Skip to main content

polyester/gen/buffa/
layout.v1.rs

1// @generated by buffa-codegen. DO NOT EDIT.
2
3/// WidgetType identifies the kind of editor widget stored in a layout.
4#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
5#[repr(i32)]
6pub enum WidgetType {
7    /// Widget type is not specified.
8    WIDGET_TYPE_UNSPECIFIED = 0i32,
9    /// Price chart widget.
10    CHART = 1i32,
11    /// Order book widget.
12    ORDERBOOK = 2i32,
13    /// Recent trades widget.
14    TRADES = 3i32,
15    /// Positions widget.
16    POSITIONS = 4i32,
17    /// Orders widget.
18    ORDERS = 5i32,
19}
20impl WidgetType {
21    ///Idiomatic alias for [`Self::WIDGET_TYPE_UNSPECIFIED`]; `Debug` prints the variant name.
22    #[allow(non_upper_case_globals)]
23    pub const WidgetTypeUnspecified: Self = Self::WIDGET_TYPE_UNSPECIFIED;
24    ///Idiomatic alias for [`Self::CHART`]; `Debug` prints the variant name.
25    #[allow(non_upper_case_globals)]
26    pub const Chart: Self = Self::CHART;
27    ///Idiomatic alias for [`Self::ORDERBOOK`]; `Debug` prints the variant name.
28    #[allow(non_upper_case_globals)]
29    pub const Orderbook: Self = Self::ORDERBOOK;
30    ///Idiomatic alias for [`Self::TRADES`]; `Debug` prints the variant name.
31    #[allow(non_upper_case_globals)]
32    pub const Trades: Self = Self::TRADES;
33    ///Idiomatic alias for [`Self::POSITIONS`]; `Debug` prints the variant name.
34    #[allow(non_upper_case_globals)]
35    pub const Positions: Self = Self::POSITIONS;
36    ///Idiomatic alias for [`Self::ORDERS`]; `Debug` prints the variant name.
37    #[allow(non_upper_case_globals)]
38    pub const Orders: Self = Self::ORDERS;
39}
40impl ::core::default::Default for WidgetType {
41    fn default() -> Self {
42        Self::WIDGET_TYPE_UNSPECIFIED
43    }
44}
45impl ::serde::Serialize for WidgetType {
46    fn serialize<S: ::serde::Serializer>(
47        &self,
48        s: S,
49    ) -> ::core::result::Result<S::Ok, S::Error> {
50        s.serialize_str(::buffa::Enumeration::proto_name(self))
51    }
52}
53impl<'de> ::serde::Deserialize<'de> for WidgetType {
54    fn deserialize<D: ::serde::Deserializer<'de>>(
55        d: D,
56    ) -> ::core::result::Result<Self, D::Error> {
57        struct _V;
58        impl ::serde::de::Visitor<'_> for _V {
59            type Value = WidgetType;
60            fn expecting(
61                &self,
62                f: &mut ::core::fmt::Formatter<'_>,
63            ) -> ::core::fmt::Result {
64                f.write_str(
65                    concat!("a string, integer, or null for ", stringify!(WidgetType)),
66                )
67            }
68            fn visit_str<E: ::serde::de::Error>(
69                self,
70                v: &str,
71            ) -> ::core::result::Result<WidgetType, E> {
72                <WidgetType as ::buffa::Enumeration>::from_proto_name(v)
73                    .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
74            }
75            fn visit_i64<E: ::serde::de::Error>(
76                self,
77                v: i64,
78            ) -> ::core::result::Result<WidgetType, E> {
79                let v32 = i32::try_from(v)
80                    .map_err(|_| {
81                        ::serde::de::Error::custom(
82                            ::buffa::alloc::format!("enum value {v} out of i32 range"),
83                        )
84                    })?;
85                <WidgetType as ::buffa::Enumeration>::from_i32(v32)
86                    .ok_or_else(|| {
87                        ::serde::de::Error::custom(
88                            ::buffa::alloc::format!("unknown enum value {v32}"),
89                        )
90                    })
91            }
92            fn visit_u64<E: ::serde::de::Error>(
93                self,
94                v: u64,
95            ) -> ::core::result::Result<WidgetType, E> {
96                let v32 = i32::try_from(v)
97                    .map_err(|_| {
98                        ::serde::de::Error::custom(
99                            ::buffa::alloc::format!("enum value {v} out of i32 range"),
100                        )
101                    })?;
102                <WidgetType as ::buffa::Enumeration>::from_i32(v32)
103                    .ok_or_else(|| {
104                        ::serde::de::Error::custom(
105                            ::buffa::alloc::format!("unknown enum value {v32}"),
106                        )
107                    })
108            }
109            fn visit_unit<E: ::serde::de::Error>(
110                self,
111            ) -> ::core::result::Result<WidgetType, E> {
112                ::core::result::Result::Ok(::core::default::Default::default())
113            }
114        }
115        d.deserialize_any(_V)
116    }
117}
118impl ::buffa::json_helpers::ProtoElemJson for WidgetType {
119    fn serialize_proto_json<S: ::serde::Serializer>(
120        v: &Self,
121        s: S,
122    ) -> ::core::result::Result<S::Ok, S::Error> {
123        ::serde::Serialize::serialize(v, s)
124    }
125    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
126        d: D,
127    ) -> ::core::result::Result<Self, D::Error> {
128        <Self as ::serde::Deserialize>::deserialize(d)
129    }
130}
131impl ::buffa::Enumeration for WidgetType {
132    fn from_i32(value: i32) -> ::core::option::Option<Self> {
133        match value {
134            0i32 => ::core::option::Option::Some(Self::WIDGET_TYPE_UNSPECIFIED),
135            1i32 => ::core::option::Option::Some(Self::CHART),
136            2i32 => ::core::option::Option::Some(Self::ORDERBOOK),
137            3i32 => ::core::option::Option::Some(Self::TRADES),
138            4i32 => ::core::option::Option::Some(Self::POSITIONS),
139            5i32 => ::core::option::Option::Some(Self::ORDERS),
140            _ => ::core::option::Option::None,
141        }
142    }
143    fn to_i32(&self) -> i32 {
144        *self as i32
145    }
146    fn proto_name(&self) -> &'static str {
147        match self {
148            Self::WIDGET_TYPE_UNSPECIFIED => "WIDGET_TYPE_UNSPECIFIED",
149            Self::CHART => "CHART",
150            Self::ORDERBOOK => "ORDERBOOK",
151            Self::TRADES => "TRADES",
152            Self::POSITIONS => "POSITIONS",
153            Self::ORDERS => "ORDERS",
154        }
155    }
156    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
157        match name {
158            "WIDGET_TYPE_UNSPECIFIED" => {
159                ::core::option::Option::Some(Self::WIDGET_TYPE_UNSPECIFIED)
160            }
161            "CHART" => ::core::option::Option::Some(Self::CHART),
162            "ORDERBOOK" => ::core::option::Option::Some(Self::ORDERBOOK),
163            "TRADES" => ::core::option::Option::Some(Self::TRADES),
164            "POSITIONS" => ::core::option::Option::Some(Self::POSITIONS),
165            "ORDERS" => ::core::option::Option::Some(Self::ORDERS),
166            _ => ::core::option::Option::None,
167        }
168    }
169    fn values() -> &'static [Self] {
170        &[
171            Self::WIDGET_TYPE_UNSPECIFIED,
172            Self::CHART,
173            Self::ORDERBOOK,
174            Self::TRADES,
175            Self::POSITIONS,
176            Self::ORDERS,
177        ]
178    }
179}
180/// LayoutWidget stores one widget instance and its widget-specific configuration.
181#[derive(Clone, PartialEq, Default)]
182#[derive(::serde::Serialize, ::serde::Deserialize)]
183#[serde(default)]
184pub struct LayoutWidget {
185    /// Stable widget identifier within the layout, such as "chart-1".
186    ///
187    /// Field 1: `widget_id`
188    #[serde(
189        rename = "widgetId",
190        alias = "widget_id",
191        with = "::buffa::json_helpers::proto_string",
192        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
193    )]
194    pub widget_id: ::buffa::alloc::string::String,
195    /// Widget kind that determines how widget_config is decoded.
196    ///
197    /// Field 2: `widget_type`
198    #[serde(
199        rename = "widgetType",
200        alias = "widget_type",
201        with = "::buffa::json_helpers::proto_enum",
202        skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
203    )]
204    pub widget_type: ::buffa::EnumValue<WidgetType>,
205    /// Serialized widget configuration bytes for the selected widget_type.
206    ///
207    /// Field 3: `widget_config`
208    #[serde(
209        rename = "widgetConfig",
210        alias = "widget_config",
211        with = "::buffa::json_helpers::bytes",
212        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
213    )]
214    pub widget_config: ::buffa::alloc::vec::Vec<u8>,
215    #[serde(skip)]
216    #[doc(hidden)]
217    pub __buffa_unknown_fields: ::buffa::UnknownFields,
218}
219impl ::core::fmt::Debug for LayoutWidget {
220    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
221        f.debug_struct("LayoutWidget")
222            .field("widget_id", &self.widget_id)
223            .field("widget_type", &self.widget_type)
224            .field("widget_config", &self.widget_config)
225            .finish()
226    }
227}
228impl LayoutWidget {
229    /// Protobuf type URL for this message, for use with `Any::pack` and
230    /// `Any::unpack_if`.
231    ///
232    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
233    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutWidget";
234}
235::buffa::impl_default_instance!(LayoutWidget);
236impl ::buffa::MessageName for LayoutWidget {
237    const PACKAGE: &'static str = "layout.v1";
238    const NAME: &'static str = "LayoutWidget";
239    const FULL_NAME: &'static str = "layout.v1.LayoutWidget";
240    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutWidget";
241}
242impl ::buffa::Message for LayoutWidget {
243    /// Returns the total encoded size in bytes.
244    ///
245    /// The result is a `u32`; the protobuf specification requires all
246    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
247    /// compliant message will never overflow this type.
248    #[allow(clippy::let_and_return)]
249    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
250        #[allow(unused_imports)]
251        use ::buffa::Enumeration as _;
252        let mut size = 0u32;
253        if !self.widget_id.is_empty() {
254            size += 1u32 + ::buffa::types::string_encoded_len(&self.widget_id) as u32;
255        }
256        {
257            let val = self.widget_type.to_i32();
258            if val != 0 {
259                size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
260            }
261        }
262        if !self.widget_config.is_empty() {
263            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.widget_config) as u32;
264        }
265        size += self.__buffa_unknown_fields.encoded_len() as u32;
266        size
267    }
268    fn write_to(
269        &self,
270        _cache: &mut ::buffa::SizeCache,
271        buf: &mut impl ::buffa::bytes::BufMut,
272    ) {
273        #[allow(unused_imports)]
274        use ::buffa::Enumeration as _;
275        if !self.widget_id.is_empty() {
276            ::buffa::types::put_string_field(1u32, &self.widget_id, buf);
277        }
278        {
279            let val = self.widget_type.to_i32();
280            if val != 0 {
281                ::buffa::types::put_int32_field(2u32, val, buf);
282            }
283        }
284        if !self.widget_config.is_empty() {
285            ::buffa::types::put_bytes_field(3u32, &self.widget_config, buf);
286        }
287        self.__buffa_unknown_fields.write_to(buf);
288    }
289    fn merge_field(
290        &mut self,
291        tag: ::buffa::encoding::Tag,
292        buf: &mut impl ::buffa::bytes::Buf,
293        ctx: ::buffa::DecodeContext<'_>,
294    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
295        #[allow(unused_imports)]
296        use ::buffa::bytes::Buf as _;
297        #[allow(unused_imports)]
298        use ::buffa::Enumeration as _;
299        match tag.field_number() {
300            1u32 => {
301                ::buffa::encoding::check_wire_type(
302                    tag,
303                    ::buffa::encoding::WireType::LengthDelimited,
304                )?;
305                ::buffa::types::merge_string(&mut self.widget_id, buf)?;
306            }
307            2u32 => {
308                ::buffa::encoding::check_wire_type(
309                    tag,
310                    ::buffa::encoding::WireType::Varint,
311                )?;
312                self.widget_type = ::buffa::EnumValue::from(
313                    ::buffa::types::decode_int32(buf)?,
314                );
315            }
316            3u32 => {
317                ::buffa::encoding::check_wire_type(
318                    tag,
319                    ::buffa::encoding::WireType::LengthDelimited,
320                )?;
321                ::buffa::types::merge_bytes(&mut self.widget_config, buf)?;
322            }
323            _ => {
324                self.__buffa_unknown_fields
325                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
326            }
327        }
328        ::core::result::Result::Ok(())
329    }
330    fn clear(&mut self) {
331        self.widget_id.clear();
332        self.widget_type = ::buffa::EnumValue::from(0);
333        self.widget_config.clear();
334        self.__buffa_unknown_fields.clear();
335    }
336}
337impl ::buffa::ExtensionSet for LayoutWidget {
338    const PROTO_FQN: &'static str = "layout.v1.LayoutWidget";
339    fn unknown_fields(&self) -> &::buffa::UnknownFields {
340        &self.__buffa_unknown_fields
341    }
342    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
343        &mut self.__buffa_unknown_fields
344    }
345}
346impl ::buffa::json_helpers::ProtoElemJson for LayoutWidget {
347    fn serialize_proto_json<S: ::serde::Serializer>(
348        v: &Self,
349        s: S,
350    ) -> ::core::result::Result<S::Ok, S::Error> {
351        ::serde::Serialize::serialize(v, s)
352    }
353    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
354        d: D,
355    ) -> ::core::result::Result<Self, D::Error> {
356        <Self as ::serde::Deserialize>::deserialize(d)
357    }
358}
359#[doc(hidden)]
360pub const __LAYOUT_WIDGET_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
361    type_url: "type.googleapis.com/layout.v1.LayoutWidget",
362    to_json: ::buffa::type_registry::any_to_json::<LayoutWidget>,
363    from_json: ::buffa::type_registry::any_from_json::<LayoutWidget>,
364    is_wkt: false,
365};
366/// Layout is a saved editor workspace owned by one viewer.
367#[derive(Clone, PartialEq, Default)]
368#[derive(::serde::Serialize, ::serde::Deserialize)]
369#[serde(default)]
370pub struct Layout {
371    /// Viewer that owns the saved layout.
372    ///
373    /// Field 1: `viewer_id`
374    #[serde(
375        rename = "viewerId",
376        alias = "viewer_id",
377        with = "::buffa::json_helpers::uint64",
378        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
379    )]
380    pub viewer_id: u64,
381    /// Layout identifier unique within the viewer's saved layouts.
382    ///
383    /// Field 2: `layout_id`
384    #[serde(
385        rename = "layoutId",
386        alias = "layout_id",
387        with = "::buffa::json_helpers::uint64",
388        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
389    )]
390    pub layout_id: u64,
391    /// Human-readable layout name.
392    ///
393    /// Field 3: `name`
394    #[serde(
395        rename = "name",
396        with = "::buffa::json_helpers::proto_string",
397        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
398    )]
399    pub name: ::buffa::alloc::string::String,
400    /// True when this is the viewer's default layout.
401    ///
402    /// Field 4: `is_default`
403    #[serde(
404        rename = "isDefault",
405        alias = "is_default",
406        with = "::buffa::json_helpers::proto_bool",
407        skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
408    )]
409    pub is_default: bool,
410    /// Serialized editor panel arrangement snapshot.
411    ///
412    /// Field 5: `dockview_state`
413    #[serde(
414        rename = "dockviewState",
415        alias = "dockview_state",
416        with = "::buffa::json_helpers::bytes",
417        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
418    )]
419    pub dockview_state: ::buffa::alloc::vec::Vec<u8>,
420    /// Widgets contained in the layout.
421    ///
422    /// Field 6: `widgets`
423    #[serde(
424        rename = "widgets",
425        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
426        deserialize_with = "::buffa::json_helpers::null_as_default"
427    )]
428    pub widgets: ::buffa::alloc::vec::Vec<LayoutWidget>,
429    /// Last update time in milliseconds since epoch (UTC).
430    ///
431    /// Field 7: `updated_at_ms`
432    #[serde(
433        rename = "updatedAtMs",
434        alias = "updated_at_ms",
435        with = "::buffa::json_helpers::uint64",
436        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
437    )]
438    pub updated_at_ms: u64,
439    #[serde(skip)]
440    #[doc(hidden)]
441    pub __buffa_unknown_fields: ::buffa::UnknownFields,
442}
443impl ::core::fmt::Debug for Layout {
444    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
445        f.debug_struct("Layout")
446            .field("viewer_id", &self.viewer_id)
447            .field("layout_id", &self.layout_id)
448            .field("name", &self.name)
449            .field("is_default", &self.is_default)
450            .field("dockview_state", &self.dockview_state)
451            .field("widgets", &self.widgets)
452            .field("updated_at_ms", &self.updated_at_ms)
453            .finish()
454    }
455}
456impl Layout {
457    /// Protobuf type URL for this message, for use with `Any::pack` and
458    /// `Any::unpack_if`.
459    ///
460    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
461    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.Layout";
462}
463::buffa::impl_default_instance!(Layout);
464impl ::buffa::MessageName for Layout {
465    const PACKAGE: &'static str = "layout.v1";
466    const NAME: &'static str = "Layout";
467    const FULL_NAME: &'static str = "layout.v1.Layout";
468    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.Layout";
469}
470impl ::buffa::Message for Layout {
471    /// Returns the total encoded size in bytes.
472    ///
473    /// The result is a `u32`; the protobuf specification requires all
474    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
475    /// compliant message will never overflow this type.
476    #[allow(clippy::let_and_return)]
477    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
478        #[allow(unused_imports)]
479        use ::buffa::Enumeration as _;
480        let mut size = 0u32;
481        if self.viewer_id != 0u64 {
482            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
483        }
484        if self.layout_id != 0u64 {
485            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
486        }
487        if !self.name.is_empty() {
488            size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
489        }
490        if self.is_default {
491            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
492        }
493        if !self.dockview_state.is_empty() {
494            size
495                += 1u32 + ::buffa::types::bytes_encoded_len(&self.dockview_state) as u32;
496        }
497        for v in &self.widgets {
498            let __slot = __cache.reserve();
499            let inner_size = v.compute_size(__cache);
500            __cache.set(__slot, inner_size);
501            size
502                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
503                    + inner_size;
504        }
505        if self.updated_at_ms != 0u64 {
506            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
507        }
508        size += self.__buffa_unknown_fields.encoded_len() as u32;
509        size
510    }
511    fn write_to(
512        &self,
513        __cache: &mut ::buffa::SizeCache,
514        buf: &mut impl ::buffa::bytes::BufMut,
515    ) {
516        #[allow(unused_imports)]
517        use ::buffa::Enumeration as _;
518        if self.viewer_id != 0u64 {
519            ::buffa::types::put_fixed64_field(1u32, self.viewer_id, buf);
520        }
521        if self.layout_id != 0u64 {
522            ::buffa::types::put_fixed64_field(2u32, self.layout_id, buf);
523        }
524        if !self.name.is_empty() {
525            ::buffa::types::put_string_field(3u32, &self.name, buf);
526        }
527        if self.is_default {
528            ::buffa::types::put_bool_field(4u32, self.is_default, buf);
529        }
530        if !self.dockview_state.is_empty() {
531            ::buffa::types::put_bytes_field(5u32, &self.dockview_state, buf);
532        }
533        for v in &self.widgets {
534            ::buffa::types::put_len_delimited_header(6u32, __cache.consume_next(), buf);
535            v.write_to(__cache, buf);
536        }
537        if self.updated_at_ms != 0u64 {
538            ::buffa::types::put_fixed64_field(7u32, self.updated_at_ms, buf);
539        }
540        self.__buffa_unknown_fields.write_to(buf);
541    }
542    fn merge_field(
543        &mut self,
544        tag: ::buffa::encoding::Tag,
545        buf: &mut impl ::buffa::bytes::Buf,
546        ctx: ::buffa::DecodeContext<'_>,
547    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
548        #[allow(unused_imports)]
549        use ::buffa::bytes::Buf as _;
550        #[allow(unused_imports)]
551        use ::buffa::Enumeration as _;
552        match tag.field_number() {
553            1u32 => {
554                ::buffa::encoding::check_wire_type(
555                    tag,
556                    ::buffa::encoding::WireType::Fixed64,
557                )?;
558                self.viewer_id = ::buffa::types::decode_fixed64(buf)?;
559            }
560            2u32 => {
561                ::buffa::encoding::check_wire_type(
562                    tag,
563                    ::buffa::encoding::WireType::Fixed64,
564                )?;
565                self.layout_id = ::buffa::types::decode_fixed64(buf)?;
566            }
567            3u32 => {
568                ::buffa::encoding::check_wire_type(
569                    tag,
570                    ::buffa::encoding::WireType::LengthDelimited,
571                )?;
572                ::buffa::types::merge_string(&mut self.name, buf)?;
573            }
574            4u32 => {
575                ::buffa::encoding::check_wire_type(
576                    tag,
577                    ::buffa::encoding::WireType::Varint,
578                )?;
579                self.is_default = ::buffa::types::decode_bool(buf)?;
580            }
581            5u32 => {
582                ::buffa::encoding::check_wire_type(
583                    tag,
584                    ::buffa::encoding::WireType::LengthDelimited,
585                )?;
586                ::buffa::types::merge_bytes(&mut self.dockview_state, buf)?;
587            }
588            6u32 => {
589                ::buffa::encoding::check_wire_type(
590                    tag,
591                    ::buffa::encoding::WireType::LengthDelimited,
592                )?;
593                let mut elem = ::core::default::Default::default();
594                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
595                self.widgets.push(elem);
596            }
597            7u32 => {
598                ::buffa::encoding::check_wire_type(
599                    tag,
600                    ::buffa::encoding::WireType::Fixed64,
601                )?;
602                self.updated_at_ms = ::buffa::types::decode_fixed64(buf)?;
603            }
604            _ => {
605                self.__buffa_unknown_fields
606                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
607            }
608        }
609        ::core::result::Result::Ok(())
610    }
611    fn clear(&mut self) {
612        self.viewer_id = 0u64;
613        self.layout_id = 0u64;
614        self.name.clear();
615        self.is_default = false;
616        self.dockview_state.clear();
617        self.widgets.clear();
618        self.updated_at_ms = 0u64;
619        self.__buffa_unknown_fields.clear();
620    }
621}
622impl ::buffa::ExtensionSet for Layout {
623    const PROTO_FQN: &'static str = "layout.v1.Layout";
624    fn unknown_fields(&self) -> &::buffa::UnknownFields {
625        &self.__buffa_unknown_fields
626    }
627    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
628        &mut self.__buffa_unknown_fields
629    }
630}
631impl ::buffa::json_helpers::ProtoElemJson for Layout {
632    fn serialize_proto_json<S: ::serde::Serializer>(
633        v: &Self,
634        s: S,
635    ) -> ::core::result::Result<S::Ok, S::Error> {
636        ::serde::Serialize::serialize(v, s)
637    }
638    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
639        d: D,
640    ) -> ::core::result::Result<Self, D::Error> {
641        <Self as ::serde::Deserialize>::deserialize(d)
642    }
643}
644#[doc(hidden)]
645pub const __LAYOUT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
646    type_url: "type.googleapis.com/layout.v1.Layout",
647    to_json: ::buffa::type_registry::any_to_json::<Layout>,
648    from_json: ::buffa::type_registry::any_from_json::<Layout>,
649    is_wkt: false,
650};
651/// -----------------------------------------------------------------------------
652/// Widget configs
653/// -----------------------------------------------------------------------------
654///
655/// Chart widget config (stored in LayoutWidget.widget_config when widget_type == CHART).
656#[derive(Clone, PartialEq, Default)]
657#[derive(::serde::Serialize, ::serde::Deserialize)]
658#[serde(default)]
659pub struct ChartWidgetConfig {
660    /// Engine symbol identifier for the chart market.
661    ///
662    /// Field 1: `engine_symbol_id`
663    #[serde(
664        rename = "engineSymbolId",
665        alias = "engine_symbol_id",
666        with = "::buffa::json_helpers::uint32",
667        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
668    )]
669    pub engine_symbol_id: u32,
670    /// Candle timeframe, such as "1m", "5m", "1h", or "1d".
671    ///
672    /// Field 2: `timeframe`
673    #[serde(
674        rename = "timeframe",
675        with = "::buffa::json_helpers::proto_string",
676        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
677    )]
678    pub timeframe: ::buffa::alloc::string::String,
679    /// Indicators configured for this chart.
680    ///
681    /// Field 3: `indicators`
682    #[serde(
683        rename = "indicators",
684        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
685        deserialize_with = "::buffa::json_helpers::null_as_default"
686    )]
687    pub indicators: ::buffa::alloc::vec::Vec<ChartIndicator>,
688    /// Visual style options for this chart.
689    ///
690    /// Field 4: `style`
691    #[serde(
692        rename = "style",
693        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
694    )]
695    pub style: ::buffa::MessageField<ChartStyle>,
696    /// Optional: per-widget layer visibility overrides.
697    /// If empty, use layer subscriptions defaults for this market.
698    ///
699    /// Field 5: `layer_overrides`
700    #[serde(
701        rename = "layerOverrides",
702        alias = "layer_overrides",
703        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
704        deserialize_with = "::buffa::json_helpers::null_as_default"
705    )]
706    pub layer_overrides: ::buffa::alloc::vec::Vec<LayerVisibilityOverride>,
707    /// When true, chart follows the latest candle/price (UI behavior).
708    ///
709    /// Field 6: `follow_latest`
710    #[serde(
711        rename = "followLatest",
712        alias = "follow_latest",
713        with = "::buffa::json_helpers::proto_bool",
714        skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
715    )]
716    pub follow_latest: bool,
717    #[serde(skip)]
718    #[doc(hidden)]
719    pub __buffa_unknown_fields: ::buffa::UnknownFields,
720}
721impl ::core::fmt::Debug for ChartWidgetConfig {
722    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
723        f.debug_struct("ChartWidgetConfig")
724            .field("engine_symbol_id", &self.engine_symbol_id)
725            .field("timeframe", &self.timeframe)
726            .field("indicators", &self.indicators)
727            .field("style", &self.style)
728            .field("layer_overrides", &self.layer_overrides)
729            .field("follow_latest", &self.follow_latest)
730            .finish()
731    }
732}
733impl ChartWidgetConfig {
734    /// Protobuf type URL for this message, for use with `Any::pack` and
735    /// `Any::unpack_if`.
736    ///
737    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
738    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ChartWidgetConfig";
739}
740::buffa::impl_default_instance!(ChartWidgetConfig);
741impl ::buffa::MessageName for ChartWidgetConfig {
742    const PACKAGE: &'static str = "layout.v1";
743    const NAME: &'static str = "ChartWidgetConfig";
744    const FULL_NAME: &'static str = "layout.v1.ChartWidgetConfig";
745    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ChartWidgetConfig";
746}
747impl ::buffa::Message for ChartWidgetConfig {
748    /// Returns the total encoded size in bytes.
749    ///
750    /// The result is a `u32`; the protobuf specification requires all
751    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
752    /// compliant message will never overflow this type.
753    #[allow(clippy::let_and_return)]
754    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
755        #[allow(unused_imports)]
756        use ::buffa::Enumeration as _;
757        let mut size = 0u32;
758        if self.engine_symbol_id != 0u32 {
759            size
760                += 1u32
761                    + ::buffa::types::uint32_encoded_len(self.engine_symbol_id) as u32;
762        }
763        if !self.timeframe.is_empty() {
764            size += 1u32 + ::buffa::types::string_encoded_len(&self.timeframe) as u32;
765        }
766        for v in &self.indicators {
767            let __slot = __cache.reserve();
768            let inner_size = v.compute_size(__cache);
769            __cache.set(__slot, inner_size);
770            size
771                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
772                    + inner_size;
773        }
774        if self.style.is_set() {
775            let __slot = __cache.reserve();
776            let inner_size = self.style.compute_size(__cache);
777            __cache.set(__slot, inner_size);
778            size
779                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
780                    + inner_size;
781        }
782        for v in &self.layer_overrides {
783            let __slot = __cache.reserve();
784            let inner_size = v.compute_size(__cache);
785            __cache.set(__slot, inner_size);
786            size
787                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
788                    + inner_size;
789        }
790        if self.follow_latest {
791            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
792        }
793        size += self.__buffa_unknown_fields.encoded_len() as u32;
794        size
795    }
796    fn write_to(
797        &self,
798        __cache: &mut ::buffa::SizeCache,
799        buf: &mut impl ::buffa::bytes::BufMut,
800    ) {
801        #[allow(unused_imports)]
802        use ::buffa::Enumeration as _;
803        if self.engine_symbol_id != 0u32 {
804            ::buffa::types::put_uint32_field(1u32, self.engine_symbol_id, buf);
805        }
806        if !self.timeframe.is_empty() {
807            ::buffa::types::put_string_field(2u32, &self.timeframe, buf);
808        }
809        for v in &self.indicators {
810            ::buffa::types::put_len_delimited_header(3u32, __cache.consume_next(), buf);
811            v.write_to(__cache, buf);
812        }
813        if self.style.is_set() {
814            ::buffa::types::put_len_delimited_header(4u32, __cache.consume_next(), buf);
815            self.style.write_to(__cache, buf);
816        }
817        for v in &self.layer_overrides {
818            ::buffa::types::put_len_delimited_header(5u32, __cache.consume_next(), buf);
819            v.write_to(__cache, buf);
820        }
821        if self.follow_latest {
822            ::buffa::types::put_bool_field(6u32, self.follow_latest, buf);
823        }
824        self.__buffa_unknown_fields.write_to(buf);
825    }
826    fn merge_field(
827        &mut self,
828        tag: ::buffa::encoding::Tag,
829        buf: &mut impl ::buffa::bytes::Buf,
830        ctx: ::buffa::DecodeContext<'_>,
831    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
832        #[allow(unused_imports)]
833        use ::buffa::bytes::Buf as _;
834        #[allow(unused_imports)]
835        use ::buffa::Enumeration as _;
836        match tag.field_number() {
837            1u32 => {
838                ::buffa::encoding::check_wire_type(
839                    tag,
840                    ::buffa::encoding::WireType::Varint,
841                )?;
842                self.engine_symbol_id = ::buffa::types::decode_uint32(buf)?;
843            }
844            2u32 => {
845                ::buffa::encoding::check_wire_type(
846                    tag,
847                    ::buffa::encoding::WireType::LengthDelimited,
848                )?;
849                ::buffa::types::merge_string(&mut self.timeframe, buf)?;
850            }
851            3u32 => {
852                ::buffa::encoding::check_wire_type(
853                    tag,
854                    ::buffa::encoding::WireType::LengthDelimited,
855                )?;
856                let mut elem = ::core::default::Default::default();
857                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
858                self.indicators.push(elem);
859            }
860            4u32 => {
861                ::buffa::encoding::check_wire_type(
862                    tag,
863                    ::buffa::encoding::WireType::LengthDelimited,
864                )?;
865                ::buffa::Message::merge_length_delimited(
866                    self.style.get_or_insert_default(),
867                    buf,
868                    ctx,
869                )?;
870            }
871            5u32 => {
872                ::buffa::encoding::check_wire_type(
873                    tag,
874                    ::buffa::encoding::WireType::LengthDelimited,
875                )?;
876                let mut elem = ::core::default::Default::default();
877                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
878                self.layer_overrides.push(elem);
879            }
880            6u32 => {
881                ::buffa::encoding::check_wire_type(
882                    tag,
883                    ::buffa::encoding::WireType::Varint,
884                )?;
885                self.follow_latest = ::buffa::types::decode_bool(buf)?;
886            }
887            _ => {
888                self.__buffa_unknown_fields
889                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
890            }
891        }
892        ::core::result::Result::Ok(())
893    }
894    fn clear(&mut self) {
895        self.engine_symbol_id = 0u32;
896        self.timeframe.clear();
897        self.indicators.clear();
898        self.style = ::buffa::MessageField::none();
899        self.layer_overrides.clear();
900        self.follow_latest = false;
901        self.__buffa_unknown_fields.clear();
902    }
903}
904impl ::buffa::ExtensionSet for ChartWidgetConfig {
905    const PROTO_FQN: &'static str = "layout.v1.ChartWidgetConfig";
906    fn unknown_fields(&self) -> &::buffa::UnknownFields {
907        &self.__buffa_unknown_fields
908    }
909    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
910        &mut self.__buffa_unknown_fields
911    }
912}
913impl ::buffa::json_helpers::ProtoElemJson for ChartWidgetConfig {
914    fn serialize_proto_json<S: ::serde::Serializer>(
915        v: &Self,
916        s: S,
917    ) -> ::core::result::Result<S::Ok, S::Error> {
918        ::serde::Serialize::serialize(v, s)
919    }
920    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
921        d: D,
922    ) -> ::core::result::Result<Self, D::Error> {
923        <Self as ::serde::Deserialize>::deserialize(d)
924    }
925}
926#[doc(hidden)]
927pub const __CHART_WIDGET_CONFIG_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
928    type_url: "type.googleapis.com/layout.v1.ChartWidgetConfig",
929    to_json: ::buffa::type_registry::any_to_json::<ChartWidgetConfig>,
930    from_json: ::buffa::type_registry::any_from_json::<ChartWidgetConfig>,
931    is_wkt: false,
932};
933/// ChartIndicator stores one configured technical indicator.
934#[derive(Clone, PartialEq, Default)]
935#[derive(::serde::Serialize, ::serde::Deserialize)]
936#[serde(default)]
937pub struct ChartIndicator {
938    /// Indicator type, such as "RSI", "MACD", or "BB".
939    ///
940    /// Field 1: `indicator_type`
941    #[serde(
942        rename = "indicatorType",
943        alias = "indicator_type",
944        with = "::buffa::json_helpers::proto_string",
945        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
946    )]
947    pub indicator_type: ::buffa::alloc::string::String,
948    /// Serialized indicator parameters understood by the chart client.
949    ///
950    /// Field 2: `params`
951    #[serde(
952        rename = "params",
953        with = "::buffa::json_helpers::bytes",
954        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
955    )]
956    pub params: ::buffa::alloc::vec::Vec<u8>,
957    #[serde(skip)]
958    #[doc(hidden)]
959    pub __buffa_unknown_fields: ::buffa::UnknownFields,
960}
961impl ::core::fmt::Debug for ChartIndicator {
962    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
963        f.debug_struct("ChartIndicator")
964            .field("indicator_type", &self.indicator_type)
965            .field("params", &self.params)
966            .finish()
967    }
968}
969impl ChartIndicator {
970    /// Protobuf type URL for this message, for use with `Any::pack` and
971    /// `Any::unpack_if`.
972    ///
973    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
974    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ChartIndicator";
975}
976::buffa::impl_default_instance!(ChartIndicator);
977impl ::buffa::MessageName for ChartIndicator {
978    const PACKAGE: &'static str = "layout.v1";
979    const NAME: &'static str = "ChartIndicator";
980    const FULL_NAME: &'static str = "layout.v1.ChartIndicator";
981    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ChartIndicator";
982}
983impl ::buffa::Message for ChartIndicator {
984    /// Returns the total encoded size in bytes.
985    ///
986    /// The result is a `u32`; the protobuf specification requires all
987    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
988    /// compliant message will never overflow this type.
989    #[allow(clippy::let_and_return)]
990    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
991        #[allow(unused_imports)]
992        use ::buffa::Enumeration as _;
993        let mut size = 0u32;
994        if !self.indicator_type.is_empty() {
995            size
996                += 1u32
997                    + ::buffa::types::string_encoded_len(&self.indicator_type) as u32;
998        }
999        if !self.params.is_empty() {
1000            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.params) as u32;
1001        }
1002        size += self.__buffa_unknown_fields.encoded_len() as u32;
1003        size
1004    }
1005    fn write_to(
1006        &self,
1007        _cache: &mut ::buffa::SizeCache,
1008        buf: &mut impl ::buffa::bytes::BufMut,
1009    ) {
1010        #[allow(unused_imports)]
1011        use ::buffa::Enumeration as _;
1012        if !self.indicator_type.is_empty() {
1013            ::buffa::types::put_string_field(1u32, &self.indicator_type, buf);
1014        }
1015        if !self.params.is_empty() {
1016            ::buffa::types::put_bytes_field(2u32, &self.params, buf);
1017        }
1018        self.__buffa_unknown_fields.write_to(buf);
1019    }
1020    fn merge_field(
1021        &mut self,
1022        tag: ::buffa::encoding::Tag,
1023        buf: &mut impl ::buffa::bytes::Buf,
1024        ctx: ::buffa::DecodeContext<'_>,
1025    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1026        #[allow(unused_imports)]
1027        use ::buffa::bytes::Buf as _;
1028        #[allow(unused_imports)]
1029        use ::buffa::Enumeration as _;
1030        match tag.field_number() {
1031            1u32 => {
1032                ::buffa::encoding::check_wire_type(
1033                    tag,
1034                    ::buffa::encoding::WireType::LengthDelimited,
1035                )?;
1036                ::buffa::types::merge_string(&mut self.indicator_type, buf)?;
1037            }
1038            2u32 => {
1039                ::buffa::encoding::check_wire_type(
1040                    tag,
1041                    ::buffa::encoding::WireType::LengthDelimited,
1042                )?;
1043                ::buffa::types::merge_bytes(&mut self.params, buf)?;
1044            }
1045            _ => {
1046                self.__buffa_unknown_fields
1047                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1048            }
1049        }
1050        ::core::result::Result::Ok(())
1051    }
1052    fn clear(&mut self) {
1053        self.indicator_type.clear();
1054        self.params.clear();
1055        self.__buffa_unknown_fields.clear();
1056    }
1057}
1058impl ::buffa::ExtensionSet for ChartIndicator {
1059    const PROTO_FQN: &'static str = "layout.v1.ChartIndicator";
1060    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1061        &self.__buffa_unknown_fields
1062    }
1063    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1064        &mut self.__buffa_unknown_fields
1065    }
1066}
1067impl ::buffa::json_helpers::ProtoElemJson for ChartIndicator {
1068    fn serialize_proto_json<S: ::serde::Serializer>(
1069        v: &Self,
1070        s: S,
1071    ) -> ::core::result::Result<S::Ok, S::Error> {
1072        ::serde::Serialize::serialize(v, s)
1073    }
1074    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1075        d: D,
1076    ) -> ::core::result::Result<Self, D::Error> {
1077        <Self as ::serde::Deserialize>::deserialize(d)
1078    }
1079}
1080#[doc(hidden)]
1081pub const __CHART_INDICATOR_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1082    type_url: "type.googleapis.com/layout.v1.ChartIndicator",
1083    to_json: ::buffa::type_registry::any_to_json::<ChartIndicator>,
1084    from_json: ::buffa::type_registry::any_from_json::<ChartIndicator>,
1085    is_wkt: false,
1086};
1087/// ChartStyle stores visual chart style settings.
1088#[derive(Clone, PartialEq, Default)]
1089#[derive(::serde::Serialize, ::serde::Deserialize)]
1090#[serde(default)]
1091pub struct ChartStyle {
1092    /// Serialized style settings understood by the chart client.
1093    ///
1094    /// Field 1: `style_bytes`
1095    #[serde(
1096        rename = "styleBytes",
1097        alias = "style_bytes",
1098        with = "::buffa::json_helpers::bytes",
1099        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
1100    )]
1101    pub style_bytes: ::buffa::alloc::vec::Vec<u8>,
1102    #[serde(skip)]
1103    #[doc(hidden)]
1104    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1105}
1106impl ::core::fmt::Debug for ChartStyle {
1107    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1108        f.debug_struct("ChartStyle").field("style_bytes", &self.style_bytes).finish()
1109    }
1110}
1111impl ChartStyle {
1112    /// Protobuf type URL for this message, for use with `Any::pack` and
1113    /// `Any::unpack_if`.
1114    ///
1115    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1116    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ChartStyle";
1117}
1118::buffa::impl_default_instance!(ChartStyle);
1119impl ::buffa::MessageName for ChartStyle {
1120    const PACKAGE: &'static str = "layout.v1";
1121    const NAME: &'static str = "ChartStyle";
1122    const FULL_NAME: &'static str = "layout.v1.ChartStyle";
1123    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ChartStyle";
1124}
1125impl ::buffa::Message for ChartStyle {
1126    /// Returns the total encoded size in bytes.
1127    ///
1128    /// The result is a `u32`; the protobuf specification requires all
1129    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1130    /// compliant message will never overflow this type.
1131    #[allow(clippy::let_and_return)]
1132    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1133        #[allow(unused_imports)]
1134        use ::buffa::Enumeration as _;
1135        let mut size = 0u32;
1136        if !self.style_bytes.is_empty() {
1137            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.style_bytes) as u32;
1138        }
1139        size += self.__buffa_unknown_fields.encoded_len() as u32;
1140        size
1141    }
1142    fn write_to(
1143        &self,
1144        _cache: &mut ::buffa::SizeCache,
1145        buf: &mut impl ::buffa::bytes::BufMut,
1146    ) {
1147        #[allow(unused_imports)]
1148        use ::buffa::Enumeration as _;
1149        if !self.style_bytes.is_empty() {
1150            ::buffa::types::put_bytes_field(1u32, &self.style_bytes, buf);
1151        }
1152        self.__buffa_unknown_fields.write_to(buf);
1153    }
1154    fn merge_field(
1155        &mut self,
1156        tag: ::buffa::encoding::Tag,
1157        buf: &mut impl ::buffa::bytes::Buf,
1158        ctx: ::buffa::DecodeContext<'_>,
1159    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1160        #[allow(unused_imports)]
1161        use ::buffa::bytes::Buf as _;
1162        #[allow(unused_imports)]
1163        use ::buffa::Enumeration as _;
1164        match tag.field_number() {
1165            1u32 => {
1166                ::buffa::encoding::check_wire_type(
1167                    tag,
1168                    ::buffa::encoding::WireType::LengthDelimited,
1169                )?;
1170                ::buffa::types::merge_bytes(&mut self.style_bytes, buf)?;
1171            }
1172            _ => {
1173                self.__buffa_unknown_fields
1174                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1175            }
1176        }
1177        ::core::result::Result::Ok(())
1178    }
1179    fn clear(&mut self) {
1180        self.style_bytes.clear();
1181        self.__buffa_unknown_fields.clear();
1182    }
1183}
1184impl ::buffa::ExtensionSet for ChartStyle {
1185    const PROTO_FQN: &'static str = "layout.v1.ChartStyle";
1186    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1187        &self.__buffa_unknown_fields
1188    }
1189    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1190        &mut self.__buffa_unknown_fields
1191    }
1192}
1193impl ::buffa::json_helpers::ProtoElemJson for ChartStyle {
1194    fn serialize_proto_json<S: ::serde::Serializer>(
1195        v: &Self,
1196        s: S,
1197    ) -> ::core::result::Result<S::Ok, S::Error> {
1198        ::serde::Serialize::serialize(v, s)
1199    }
1200    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1201        d: D,
1202    ) -> ::core::result::Result<Self, D::Error> {
1203        <Self as ::serde::Deserialize>::deserialize(d)
1204    }
1205}
1206#[doc(hidden)]
1207pub const __CHART_STYLE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1208    type_url: "type.googleapis.com/layout.v1.ChartStyle",
1209    to_json: ::buffa::type_registry::any_to_json::<ChartStyle>,
1210    from_json: ::buffa::type_registry::any_from_json::<ChartStyle>,
1211    is_wkt: false,
1212};
1213/// LayerVisibilityOverride sets per-chart visibility for one chart layer.
1214#[derive(Clone, PartialEq, Default)]
1215#[derive(::serde::Serialize, ::serde::Deserialize)]
1216#[serde(default)]
1217pub struct LayerVisibilityOverride {
1218    /// Chart layer whose visibility is overridden.
1219    ///
1220    /// Field 1: `layer`
1221    #[serde(
1222        rename = "layer",
1223        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
1224    )]
1225    pub layer: ::buffa::MessageField<super::super::polychart::v1::LayerRef>,
1226    /// True when the layer should be visible in this chart.
1227    ///
1228    /// Field 2: `visible`
1229    #[serde(
1230        rename = "visible",
1231        with = "::buffa::json_helpers::proto_bool",
1232        skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
1233    )]
1234    pub visible: bool,
1235    #[serde(skip)]
1236    #[doc(hidden)]
1237    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1238}
1239impl ::core::fmt::Debug for LayerVisibilityOverride {
1240    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1241        f.debug_struct("LayerVisibilityOverride")
1242            .field("layer", &self.layer)
1243            .field("visible", &self.visible)
1244            .finish()
1245    }
1246}
1247impl LayerVisibilityOverride {
1248    /// Protobuf type URL for this message, for use with `Any::pack` and
1249    /// `Any::unpack_if`.
1250    ///
1251    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1252    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayerVisibilityOverride";
1253}
1254::buffa::impl_default_instance!(LayerVisibilityOverride);
1255impl ::buffa::MessageName for LayerVisibilityOverride {
1256    const PACKAGE: &'static str = "layout.v1";
1257    const NAME: &'static str = "LayerVisibilityOverride";
1258    const FULL_NAME: &'static str = "layout.v1.LayerVisibilityOverride";
1259    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayerVisibilityOverride";
1260}
1261impl ::buffa::Message for LayerVisibilityOverride {
1262    /// Returns the total encoded size in bytes.
1263    ///
1264    /// The result is a `u32`; the protobuf specification requires all
1265    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1266    /// compliant message will never overflow this type.
1267    #[allow(clippy::let_and_return)]
1268    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1269        #[allow(unused_imports)]
1270        use ::buffa::Enumeration as _;
1271        let mut size = 0u32;
1272        if self.layer.is_set() {
1273            let __slot = __cache.reserve();
1274            let inner_size = self.layer.compute_size(__cache);
1275            __cache.set(__slot, inner_size);
1276            size
1277                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1278                    + inner_size;
1279        }
1280        if self.visible {
1281            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1282        }
1283        size += self.__buffa_unknown_fields.encoded_len() as u32;
1284        size
1285    }
1286    fn write_to(
1287        &self,
1288        __cache: &mut ::buffa::SizeCache,
1289        buf: &mut impl ::buffa::bytes::BufMut,
1290    ) {
1291        #[allow(unused_imports)]
1292        use ::buffa::Enumeration as _;
1293        if self.layer.is_set() {
1294            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
1295            self.layer.write_to(__cache, buf);
1296        }
1297        if self.visible {
1298            ::buffa::types::put_bool_field(2u32, self.visible, buf);
1299        }
1300        self.__buffa_unknown_fields.write_to(buf);
1301    }
1302    fn merge_field(
1303        &mut self,
1304        tag: ::buffa::encoding::Tag,
1305        buf: &mut impl ::buffa::bytes::Buf,
1306        ctx: ::buffa::DecodeContext<'_>,
1307    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1308        #[allow(unused_imports)]
1309        use ::buffa::bytes::Buf as _;
1310        #[allow(unused_imports)]
1311        use ::buffa::Enumeration as _;
1312        match tag.field_number() {
1313            1u32 => {
1314                ::buffa::encoding::check_wire_type(
1315                    tag,
1316                    ::buffa::encoding::WireType::LengthDelimited,
1317                )?;
1318                ::buffa::Message::merge_length_delimited(
1319                    self.layer.get_or_insert_default(),
1320                    buf,
1321                    ctx,
1322                )?;
1323            }
1324            2u32 => {
1325                ::buffa::encoding::check_wire_type(
1326                    tag,
1327                    ::buffa::encoding::WireType::Varint,
1328                )?;
1329                self.visible = ::buffa::types::decode_bool(buf)?;
1330            }
1331            _ => {
1332                self.__buffa_unknown_fields
1333                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1334            }
1335        }
1336        ::core::result::Result::Ok(())
1337    }
1338    fn clear(&mut self) {
1339        self.layer = ::buffa::MessageField::none();
1340        self.visible = false;
1341        self.__buffa_unknown_fields.clear();
1342    }
1343}
1344impl ::buffa::ExtensionSet for LayerVisibilityOverride {
1345    const PROTO_FQN: &'static str = "layout.v1.LayerVisibilityOverride";
1346    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1347        &self.__buffa_unknown_fields
1348    }
1349    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1350        &mut self.__buffa_unknown_fields
1351    }
1352}
1353impl ::buffa::json_helpers::ProtoElemJson for LayerVisibilityOverride {
1354    fn serialize_proto_json<S: ::serde::Serializer>(
1355        v: &Self,
1356        s: S,
1357    ) -> ::core::result::Result<S::Ok, S::Error> {
1358        ::serde::Serialize::serialize(v, s)
1359    }
1360    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1361        d: D,
1362    ) -> ::core::result::Result<Self, D::Error> {
1363        <Self as ::serde::Deserialize>::deserialize(d)
1364    }
1365}
1366#[doc(hidden)]
1367pub const __LAYER_VISIBILITY_OVERRIDE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1368    type_url: "type.googleapis.com/layout.v1.LayerVisibilityOverride",
1369    to_json: ::buffa::type_registry::any_to_json::<LayerVisibilityOverride>,
1370    from_json: ::buffa::type_registry::any_from_json::<LayerVisibilityOverride>,
1371    is_wkt: false,
1372};
1373/// =============================================================================
1374/// Snapshots
1375/// =============================================================================
1376///
1377/// GetLayoutsRequest lists saved layouts for the authenticated caller.
1378#[derive(Clone, PartialEq, Default)]
1379#[derive(::serde::Serialize, ::serde::Deserialize)]
1380#[serde(default)]
1381pub struct GetLayoutsRequest {
1382    /// Maximum number of layouts to return. Defaults to 100 when omitted; maximum
1383    /// is 500.
1384    ///
1385    /// Field 1: `limit`
1386    #[serde(
1387        rename = "limit",
1388        with = "::buffa::json_helpers::uint32",
1389        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1390    )]
1391    pub limit: u32,
1392    /// Opaque keyset cursor from a previous response. The cursor is exclusive and
1393    /// bound to the authenticated caller and newest-updated sort order.
1394    ///
1395    /// Field 2: `page_token`
1396    #[serde(
1397        rename = "pageToken",
1398        alias = "page_token",
1399        with = "::buffa::json_helpers::proto_string",
1400        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1401    )]
1402    pub page_token: ::buffa::alloc::string::String,
1403    #[serde(skip)]
1404    #[doc(hidden)]
1405    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1406}
1407impl ::core::fmt::Debug for GetLayoutsRequest {
1408    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1409        f.debug_struct("GetLayoutsRequest")
1410            .field("limit", &self.limit)
1411            .field("page_token", &self.page_token)
1412            .finish()
1413    }
1414}
1415impl GetLayoutsRequest {
1416    /// Protobuf type URL for this message, for use with `Any::pack` and
1417    /// `Any::unpack_if`.
1418    ///
1419    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1420    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutsRequest";
1421}
1422::buffa::impl_default_instance!(GetLayoutsRequest);
1423impl ::buffa::MessageName for GetLayoutsRequest {
1424    const PACKAGE: &'static str = "layout.v1";
1425    const NAME: &'static str = "GetLayoutsRequest";
1426    const FULL_NAME: &'static str = "layout.v1.GetLayoutsRequest";
1427    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutsRequest";
1428}
1429impl ::buffa::Message for GetLayoutsRequest {
1430    /// Returns the total encoded size in bytes.
1431    ///
1432    /// The result is a `u32`; the protobuf specification requires all
1433    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1434    /// compliant message will never overflow this type.
1435    #[allow(clippy::let_and_return)]
1436    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1437        #[allow(unused_imports)]
1438        use ::buffa::Enumeration as _;
1439        let mut size = 0u32;
1440        if self.limit != 0u32 {
1441            size += 1u32 + ::buffa::types::uint32_encoded_len(self.limit) as u32;
1442        }
1443        if !self.page_token.is_empty() {
1444            size += 1u32 + ::buffa::types::string_encoded_len(&self.page_token) as u32;
1445        }
1446        size += self.__buffa_unknown_fields.encoded_len() as u32;
1447        size
1448    }
1449    fn write_to(
1450        &self,
1451        _cache: &mut ::buffa::SizeCache,
1452        buf: &mut impl ::buffa::bytes::BufMut,
1453    ) {
1454        #[allow(unused_imports)]
1455        use ::buffa::Enumeration as _;
1456        if self.limit != 0u32 {
1457            ::buffa::types::put_uint32_field(1u32, self.limit, buf);
1458        }
1459        if !self.page_token.is_empty() {
1460            ::buffa::types::put_string_field(2u32, &self.page_token, buf);
1461        }
1462        self.__buffa_unknown_fields.write_to(buf);
1463    }
1464    fn merge_field(
1465        &mut self,
1466        tag: ::buffa::encoding::Tag,
1467        buf: &mut impl ::buffa::bytes::Buf,
1468        ctx: ::buffa::DecodeContext<'_>,
1469    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1470        #[allow(unused_imports)]
1471        use ::buffa::bytes::Buf as _;
1472        #[allow(unused_imports)]
1473        use ::buffa::Enumeration as _;
1474        match tag.field_number() {
1475            1u32 => {
1476                ::buffa::encoding::check_wire_type(
1477                    tag,
1478                    ::buffa::encoding::WireType::Varint,
1479                )?;
1480                self.limit = ::buffa::types::decode_uint32(buf)?;
1481            }
1482            2u32 => {
1483                ::buffa::encoding::check_wire_type(
1484                    tag,
1485                    ::buffa::encoding::WireType::LengthDelimited,
1486                )?;
1487                ::buffa::types::merge_string(&mut self.page_token, buf)?;
1488            }
1489            _ => {
1490                self.__buffa_unknown_fields
1491                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1492            }
1493        }
1494        ::core::result::Result::Ok(())
1495    }
1496    fn clear(&mut self) {
1497        self.limit = 0u32;
1498        self.page_token.clear();
1499        self.__buffa_unknown_fields.clear();
1500    }
1501}
1502impl ::buffa::ExtensionSet for GetLayoutsRequest {
1503    const PROTO_FQN: &'static str = "layout.v1.GetLayoutsRequest";
1504    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1505        &self.__buffa_unknown_fields
1506    }
1507    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1508        &mut self.__buffa_unknown_fields
1509    }
1510}
1511impl ::buffa::json_helpers::ProtoElemJson for GetLayoutsRequest {
1512    fn serialize_proto_json<S: ::serde::Serializer>(
1513        v: &Self,
1514        s: S,
1515    ) -> ::core::result::Result<S::Ok, S::Error> {
1516        ::serde::Serialize::serialize(v, s)
1517    }
1518    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1519        d: D,
1520    ) -> ::core::result::Result<Self, D::Error> {
1521        <Self as ::serde::Deserialize>::deserialize(d)
1522    }
1523}
1524#[doc(hidden)]
1525pub const __GET_LAYOUTS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1526    type_url: "type.googleapis.com/layout.v1.GetLayoutsRequest",
1527    to_json: ::buffa::type_registry::any_to_json::<GetLayoutsRequest>,
1528    from_json: ::buffa::type_registry::any_from_json::<GetLayoutsRequest>,
1529    is_wkt: false,
1530};
1531/// GetLayoutsResponse contains the caller's saved layouts.
1532#[derive(Clone, PartialEq, Default)]
1533#[derive(::serde::Serialize, ::serde::Deserialize)]
1534#[serde(default)]
1535pub struct GetLayoutsResponse {
1536    /// Saved layouts for the caller, returned newest-updated first.
1537    ///
1538    /// Field 1: `layouts`
1539    #[serde(
1540        rename = "layouts",
1541        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1542        deserialize_with = "::buffa::json_helpers::null_as_default"
1543    )]
1544    pub layouts: ::buffa::alloc::vec::Vec<Layout>,
1545    /// Opaque cursor for the next page. Empty when no more results exist.
1546    ///
1547    /// Field 2: `next_page_token`
1548    #[serde(
1549        rename = "nextPageToken",
1550        alias = "next_page_token",
1551        with = "::buffa::json_helpers::proto_string",
1552        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1553    )]
1554    pub next_page_token: ::buffa::alloc::string::String,
1555    #[serde(skip)]
1556    #[doc(hidden)]
1557    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1558}
1559impl ::core::fmt::Debug for GetLayoutsResponse {
1560    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1561        f.debug_struct("GetLayoutsResponse")
1562            .field("layouts", &self.layouts)
1563            .field("next_page_token", &self.next_page_token)
1564            .finish()
1565    }
1566}
1567impl GetLayoutsResponse {
1568    /// Protobuf type URL for this message, for use with `Any::pack` and
1569    /// `Any::unpack_if`.
1570    ///
1571    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1572    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutsResponse";
1573}
1574::buffa::impl_default_instance!(GetLayoutsResponse);
1575impl ::buffa::MessageName for GetLayoutsResponse {
1576    const PACKAGE: &'static str = "layout.v1";
1577    const NAME: &'static str = "GetLayoutsResponse";
1578    const FULL_NAME: &'static str = "layout.v1.GetLayoutsResponse";
1579    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutsResponse";
1580}
1581impl ::buffa::Message for GetLayoutsResponse {
1582    /// Returns the total encoded size in bytes.
1583    ///
1584    /// The result is a `u32`; the protobuf specification requires all
1585    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1586    /// compliant message will never overflow this type.
1587    #[allow(clippy::let_and_return)]
1588    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1589        #[allow(unused_imports)]
1590        use ::buffa::Enumeration as _;
1591        let mut size = 0u32;
1592        for v in &self.layouts {
1593            let __slot = __cache.reserve();
1594            let inner_size = v.compute_size(__cache);
1595            __cache.set(__slot, inner_size);
1596            size
1597                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1598                    + inner_size;
1599        }
1600        if !self.next_page_token.is_empty() {
1601            size
1602                += 1u32
1603                    + ::buffa::types::string_encoded_len(&self.next_page_token) as u32;
1604        }
1605        size += self.__buffa_unknown_fields.encoded_len() as u32;
1606        size
1607    }
1608    fn write_to(
1609        &self,
1610        __cache: &mut ::buffa::SizeCache,
1611        buf: &mut impl ::buffa::bytes::BufMut,
1612    ) {
1613        #[allow(unused_imports)]
1614        use ::buffa::Enumeration as _;
1615        for v in &self.layouts {
1616            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
1617            v.write_to(__cache, buf);
1618        }
1619        if !self.next_page_token.is_empty() {
1620            ::buffa::types::put_string_field(2u32, &self.next_page_token, buf);
1621        }
1622        self.__buffa_unknown_fields.write_to(buf);
1623    }
1624    fn merge_field(
1625        &mut self,
1626        tag: ::buffa::encoding::Tag,
1627        buf: &mut impl ::buffa::bytes::Buf,
1628        ctx: ::buffa::DecodeContext<'_>,
1629    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1630        #[allow(unused_imports)]
1631        use ::buffa::bytes::Buf as _;
1632        #[allow(unused_imports)]
1633        use ::buffa::Enumeration as _;
1634        match tag.field_number() {
1635            1u32 => {
1636                ::buffa::encoding::check_wire_type(
1637                    tag,
1638                    ::buffa::encoding::WireType::LengthDelimited,
1639                )?;
1640                let mut elem = ::core::default::Default::default();
1641                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1642                self.layouts.push(elem);
1643            }
1644            2u32 => {
1645                ::buffa::encoding::check_wire_type(
1646                    tag,
1647                    ::buffa::encoding::WireType::LengthDelimited,
1648                )?;
1649                ::buffa::types::merge_string(&mut self.next_page_token, buf)?;
1650            }
1651            _ => {
1652                self.__buffa_unknown_fields
1653                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1654            }
1655        }
1656        ::core::result::Result::Ok(())
1657    }
1658    fn clear(&mut self) {
1659        self.layouts.clear();
1660        self.next_page_token.clear();
1661        self.__buffa_unknown_fields.clear();
1662    }
1663}
1664impl ::buffa::ExtensionSet for GetLayoutsResponse {
1665    const PROTO_FQN: &'static str = "layout.v1.GetLayoutsResponse";
1666    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1667        &self.__buffa_unknown_fields
1668    }
1669    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1670        &mut self.__buffa_unknown_fields
1671    }
1672}
1673impl ::buffa::json_helpers::ProtoElemJson for GetLayoutsResponse {
1674    fn serialize_proto_json<S: ::serde::Serializer>(
1675        v: &Self,
1676        s: S,
1677    ) -> ::core::result::Result<S::Ok, S::Error> {
1678        ::serde::Serialize::serialize(v, s)
1679    }
1680    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1681        d: D,
1682    ) -> ::core::result::Result<Self, D::Error> {
1683        <Self as ::serde::Deserialize>::deserialize(d)
1684    }
1685}
1686#[doc(hidden)]
1687pub const __GET_LAYOUTS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1688    type_url: "type.googleapis.com/layout.v1.GetLayoutsResponse",
1689    to_json: ::buffa::type_registry::any_to_json::<GetLayoutsResponse>,
1690    from_json: ::buffa::type_registry::any_from_json::<GetLayoutsResponse>,
1691    is_wkt: false,
1692};
1693/// GetLayoutRequest fetches one saved layout by ID.
1694#[derive(Clone, PartialEq, Default)]
1695#[derive(::serde::Serialize, ::serde::Deserialize)]
1696#[serde(default)]
1697pub struct GetLayoutRequest {
1698    /// Layout identifier to fetch.
1699    ///
1700    /// Field 1: `layout_id`
1701    #[serde(
1702        rename = "layoutId",
1703        alias = "layout_id",
1704        with = "::buffa::json_helpers::uint64",
1705        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
1706    )]
1707    pub layout_id: u64,
1708    #[serde(skip)]
1709    #[doc(hidden)]
1710    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1711}
1712impl ::core::fmt::Debug for GetLayoutRequest {
1713    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1714        f.debug_struct("GetLayoutRequest").field("layout_id", &self.layout_id).finish()
1715    }
1716}
1717impl GetLayoutRequest {
1718    /// Protobuf type URL for this message, for use with `Any::pack` and
1719    /// `Any::unpack_if`.
1720    ///
1721    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1722    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutRequest";
1723}
1724::buffa::impl_default_instance!(GetLayoutRequest);
1725impl ::buffa::MessageName for GetLayoutRequest {
1726    const PACKAGE: &'static str = "layout.v1";
1727    const NAME: &'static str = "GetLayoutRequest";
1728    const FULL_NAME: &'static str = "layout.v1.GetLayoutRequest";
1729    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutRequest";
1730}
1731impl ::buffa::Message for GetLayoutRequest {
1732    /// Returns the total encoded size in bytes.
1733    ///
1734    /// The result is a `u32`; the protobuf specification requires all
1735    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1736    /// compliant message will never overflow this type.
1737    #[allow(clippy::let_and_return)]
1738    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1739        #[allow(unused_imports)]
1740        use ::buffa::Enumeration as _;
1741        let mut size = 0u32;
1742        if self.layout_id != 0u64 {
1743            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
1744        }
1745        size += self.__buffa_unknown_fields.encoded_len() as u32;
1746        size
1747    }
1748    fn write_to(
1749        &self,
1750        _cache: &mut ::buffa::SizeCache,
1751        buf: &mut impl ::buffa::bytes::BufMut,
1752    ) {
1753        #[allow(unused_imports)]
1754        use ::buffa::Enumeration as _;
1755        if self.layout_id != 0u64 {
1756            ::buffa::types::put_fixed64_field(1u32, self.layout_id, buf);
1757        }
1758        self.__buffa_unknown_fields.write_to(buf);
1759    }
1760    fn merge_field(
1761        &mut self,
1762        tag: ::buffa::encoding::Tag,
1763        buf: &mut impl ::buffa::bytes::Buf,
1764        ctx: ::buffa::DecodeContext<'_>,
1765    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1766        #[allow(unused_imports)]
1767        use ::buffa::bytes::Buf as _;
1768        #[allow(unused_imports)]
1769        use ::buffa::Enumeration as _;
1770        match tag.field_number() {
1771            1u32 => {
1772                ::buffa::encoding::check_wire_type(
1773                    tag,
1774                    ::buffa::encoding::WireType::Fixed64,
1775                )?;
1776                self.layout_id = ::buffa::types::decode_fixed64(buf)?;
1777            }
1778            _ => {
1779                self.__buffa_unknown_fields
1780                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1781            }
1782        }
1783        ::core::result::Result::Ok(())
1784    }
1785    fn clear(&mut self) {
1786        self.layout_id = 0u64;
1787        self.__buffa_unknown_fields.clear();
1788    }
1789}
1790impl ::buffa::ExtensionSet for GetLayoutRequest {
1791    const PROTO_FQN: &'static str = "layout.v1.GetLayoutRequest";
1792    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1793        &self.__buffa_unknown_fields
1794    }
1795    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1796        &mut self.__buffa_unknown_fields
1797    }
1798}
1799impl ::buffa::json_helpers::ProtoElemJson for GetLayoutRequest {
1800    fn serialize_proto_json<S: ::serde::Serializer>(
1801        v: &Self,
1802        s: S,
1803    ) -> ::core::result::Result<S::Ok, S::Error> {
1804        ::serde::Serialize::serialize(v, s)
1805    }
1806    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1807        d: D,
1808    ) -> ::core::result::Result<Self, D::Error> {
1809        <Self as ::serde::Deserialize>::deserialize(d)
1810    }
1811}
1812#[doc(hidden)]
1813pub const __GET_LAYOUT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1814    type_url: "type.googleapis.com/layout.v1.GetLayoutRequest",
1815    to_json: ::buffa::type_registry::any_to_json::<GetLayoutRequest>,
1816    from_json: ::buffa::type_registry::any_from_json::<GetLayoutRequest>,
1817    is_wkt: false,
1818};
1819/// GetLayoutResponse contains one saved layout.
1820#[derive(Clone, PartialEq, Default)]
1821#[derive(::serde::Serialize, ::serde::Deserialize)]
1822#[serde(default)]
1823pub struct GetLayoutResponse {
1824    /// Saved layout matching the requested id.
1825    ///
1826    /// Field 1: `layout`
1827    #[serde(
1828        rename = "layout",
1829        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
1830    )]
1831    pub layout: ::buffa::MessageField<Layout>,
1832    #[serde(skip)]
1833    #[doc(hidden)]
1834    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1835}
1836impl ::core::fmt::Debug for GetLayoutResponse {
1837    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1838        f.debug_struct("GetLayoutResponse").field("layout", &self.layout).finish()
1839    }
1840}
1841impl GetLayoutResponse {
1842    /// Protobuf type URL for this message, for use with `Any::pack` and
1843    /// `Any::unpack_if`.
1844    ///
1845    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1846    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutResponse";
1847}
1848::buffa::impl_default_instance!(GetLayoutResponse);
1849impl ::buffa::MessageName for GetLayoutResponse {
1850    const PACKAGE: &'static str = "layout.v1";
1851    const NAME: &'static str = "GetLayoutResponse";
1852    const FULL_NAME: &'static str = "layout.v1.GetLayoutResponse";
1853    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutResponse";
1854}
1855impl ::buffa::Message for GetLayoutResponse {
1856    /// Returns the total encoded size in bytes.
1857    ///
1858    /// The result is a `u32`; the protobuf specification requires all
1859    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1860    /// compliant message will never overflow this type.
1861    #[allow(clippy::let_and_return)]
1862    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1863        #[allow(unused_imports)]
1864        use ::buffa::Enumeration as _;
1865        let mut size = 0u32;
1866        if self.layout.is_set() {
1867            let __slot = __cache.reserve();
1868            let inner_size = self.layout.compute_size(__cache);
1869            __cache.set(__slot, inner_size);
1870            size
1871                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1872                    + inner_size;
1873        }
1874        size += self.__buffa_unknown_fields.encoded_len() as u32;
1875        size
1876    }
1877    fn write_to(
1878        &self,
1879        __cache: &mut ::buffa::SizeCache,
1880        buf: &mut impl ::buffa::bytes::BufMut,
1881    ) {
1882        #[allow(unused_imports)]
1883        use ::buffa::Enumeration as _;
1884        if self.layout.is_set() {
1885            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
1886            self.layout.write_to(__cache, buf);
1887        }
1888        self.__buffa_unknown_fields.write_to(buf);
1889    }
1890    fn merge_field(
1891        &mut self,
1892        tag: ::buffa::encoding::Tag,
1893        buf: &mut impl ::buffa::bytes::Buf,
1894        ctx: ::buffa::DecodeContext<'_>,
1895    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1896        #[allow(unused_imports)]
1897        use ::buffa::bytes::Buf as _;
1898        #[allow(unused_imports)]
1899        use ::buffa::Enumeration as _;
1900        match tag.field_number() {
1901            1u32 => {
1902                ::buffa::encoding::check_wire_type(
1903                    tag,
1904                    ::buffa::encoding::WireType::LengthDelimited,
1905                )?;
1906                ::buffa::Message::merge_length_delimited(
1907                    self.layout.get_or_insert_default(),
1908                    buf,
1909                    ctx,
1910                )?;
1911            }
1912            _ => {
1913                self.__buffa_unknown_fields
1914                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1915            }
1916        }
1917        ::core::result::Result::Ok(())
1918    }
1919    fn clear(&mut self) {
1920        self.layout = ::buffa::MessageField::none();
1921        self.__buffa_unknown_fields.clear();
1922    }
1923}
1924impl ::buffa::ExtensionSet for GetLayoutResponse {
1925    const PROTO_FQN: &'static str = "layout.v1.GetLayoutResponse";
1926    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1927        &self.__buffa_unknown_fields
1928    }
1929    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1930        &mut self.__buffa_unknown_fields
1931    }
1932}
1933impl ::buffa::json_helpers::ProtoElemJson for GetLayoutResponse {
1934    fn serialize_proto_json<S: ::serde::Serializer>(
1935        v: &Self,
1936        s: S,
1937    ) -> ::core::result::Result<S::Ok, S::Error> {
1938        ::serde::Serialize::serialize(v, s)
1939    }
1940    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1941        d: D,
1942    ) -> ::core::result::Result<Self, D::Error> {
1943        <Self as ::serde::Deserialize>::deserialize(d)
1944    }
1945}
1946#[doc(hidden)]
1947pub const __GET_LAYOUT_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1948    type_url: "type.googleapis.com/layout.v1.GetLayoutResponse",
1949    to_json: ::buffa::type_registry::any_to_json::<GetLayoutResponse>,
1950    from_json: ::buffa::type_registry::any_from_json::<GetLayoutResponse>,
1951    is_wkt: false,
1952};
1953/// =============================================================================
1954/// Share links (create/revoke) and share token resolution (no auth)
1955/// =============================================================================
1956///
1957/// Resolve a share token to a layout snapshot (template). No auth required.
1958#[derive(Clone, PartialEq, Default)]
1959#[derive(::serde::Serialize, ::serde::Deserialize)]
1960#[serde(default)]
1961pub struct ResolveLayoutShareTokenRequest {
1962    /// Opaque share token from a layout share link.
1963    ///
1964    /// Field 1: `token`
1965    #[serde(
1966        rename = "token",
1967        with = "::buffa::json_helpers::proto_string",
1968        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1969    )]
1970    pub token: ::buffa::alloc::string::String,
1971    #[serde(skip)]
1972    #[doc(hidden)]
1973    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1974}
1975impl ::core::fmt::Debug for ResolveLayoutShareTokenRequest {
1976    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1977        f.debug_struct("ResolveLayoutShareTokenRequest")
1978            .field("token", &self.token)
1979            .finish()
1980    }
1981}
1982impl ResolveLayoutShareTokenRequest {
1983    /// Protobuf type URL for this message, for use with `Any::pack` and
1984    /// `Any::unpack_if`.
1985    ///
1986    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1987    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ResolveLayoutShareTokenRequest";
1988}
1989::buffa::impl_default_instance!(ResolveLayoutShareTokenRequest);
1990impl ::buffa::MessageName for ResolveLayoutShareTokenRequest {
1991    const PACKAGE: &'static str = "layout.v1";
1992    const NAME: &'static str = "ResolveLayoutShareTokenRequest";
1993    const FULL_NAME: &'static str = "layout.v1.ResolveLayoutShareTokenRequest";
1994    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ResolveLayoutShareTokenRequest";
1995}
1996impl ::buffa::Message for ResolveLayoutShareTokenRequest {
1997    /// Returns the total encoded size in bytes.
1998    ///
1999    /// The result is a `u32`; the protobuf specification requires all
2000    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2001    /// compliant message will never overflow this type.
2002    #[allow(clippy::let_and_return)]
2003    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2004        #[allow(unused_imports)]
2005        use ::buffa::Enumeration as _;
2006        let mut size = 0u32;
2007        if !self.token.is_empty() {
2008            size += 1u32 + ::buffa::types::string_encoded_len(&self.token) as u32;
2009        }
2010        size += self.__buffa_unknown_fields.encoded_len() as u32;
2011        size
2012    }
2013    fn write_to(
2014        &self,
2015        _cache: &mut ::buffa::SizeCache,
2016        buf: &mut impl ::buffa::bytes::BufMut,
2017    ) {
2018        #[allow(unused_imports)]
2019        use ::buffa::Enumeration as _;
2020        if !self.token.is_empty() {
2021            ::buffa::types::put_string_field(1u32, &self.token, buf);
2022        }
2023        self.__buffa_unknown_fields.write_to(buf);
2024    }
2025    fn merge_field(
2026        &mut self,
2027        tag: ::buffa::encoding::Tag,
2028        buf: &mut impl ::buffa::bytes::Buf,
2029        ctx: ::buffa::DecodeContext<'_>,
2030    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2031        #[allow(unused_imports)]
2032        use ::buffa::bytes::Buf as _;
2033        #[allow(unused_imports)]
2034        use ::buffa::Enumeration as _;
2035        match tag.field_number() {
2036            1u32 => {
2037                ::buffa::encoding::check_wire_type(
2038                    tag,
2039                    ::buffa::encoding::WireType::LengthDelimited,
2040                )?;
2041                ::buffa::types::merge_string(&mut self.token, buf)?;
2042            }
2043            _ => {
2044                self.__buffa_unknown_fields
2045                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2046            }
2047        }
2048        ::core::result::Result::Ok(())
2049    }
2050    fn clear(&mut self) {
2051        self.token.clear();
2052        self.__buffa_unknown_fields.clear();
2053    }
2054}
2055impl ::buffa::ExtensionSet for ResolveLayoutShareTokenRequest {
2056    const PROTO_FQN: &'static str = "layout.v1.ResolveLayoutShareTokenRequest";
2057    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2058        &self.__buffa_unknown_fields
2059    }
2060    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2061        &mut self.__buffa_unknown_fields
2062    }
2063}
2064impl ::buffa::json_helpers::ProtoElemJson for ResolveLayoutShareTokenRequest {
2065    fn serialize_proto_json<S: ::serde::Serializer>(
2066        v: &Self,
2067        s: S,
2068    ) -> ::core::result::Result<S::Ok, S::Error> {
2069        ::serde::Serialize::serialize(v, s)
2070    }
2071    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2072        d: D,
2073    ) -> ::core::result::Result<Self, D::Error> {
2074        <Self as ::serde::Deserialize>::deserialize(d)
2075    }
2076}
2077#[doc(hidden)]
2078pub const __RESOLVE_LAYOUT_SHARE_TOKEN_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2079    type_url: "type.googleapis.com/layout.v1.ResolveLayoutShareTokenRequest",
2080    to_json: ::buffa::type_registry::any_to_json::<ResolveLayoutShareTokenRequest>,
2081    from_json: ::buffa::type_registry::any_from_json::<ResolveLayoutShareTokenRequest>,
2082    is_wkt: false,
2083};
2084/// ResolveLayoutShareTokenResponse returns the immutable layout snapshot for a share token.
2085#[derive(Clone, PartialEq, Default)]
2086#[derive(::serde::Serialize, ::serde::Deserialize)]
2087#[serde(default)]
2088pub struct ResolveLayoutShareTokenResponse {
2089    /// Shared layout snapshot.
2090    ///
2091    /// Field 1: `layout`
2092    #[serde(
2093        rename = "layout",
2094        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
2095    )]
2096    pub layout: ::buffa::MessageField<Layout>,
2097    /// Viewer that owns the shared template.
2098    ///
2099    /// Field 2: `owner_id`
2100    #[serde(
2101        rename = "ownerId",
2102        alias = "owner_id",
2103        with = "::buffa::json_helpers::uint64",
2104        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
2105    )]
2106    pub owner_id: u64,
2107    /// Template identifier referenced by the share token.
2108    ///
2109    /// Field 3: `template_id`
2110    #[serde(
2111        rename = "templateId",
2112        alias = "template_id",
2113        with = "::buffa::json_helpers::uint64",
2114        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
2115    )]
2116    pub template_id: u64,
2117    /// Immutable template version referenced by the share token.
2118    ///
2119    /// Field 4: `version`
2120    #[serde(
2121        rename = "version",
2122        with = "::buffa::json_helpers::uint32",
2123        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
2124    )]
2125    pub version: u32,
2126    #[serde(skip)]
2127    #[doc(hidden)]
2128    pub __buffa_unknown_fields: ::buffa::UnknownFields,
2129}
2130impl ::core::fmt::Debug for ResolveLayoutShareTokenResponse {
2131    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2132        f.debug_struct("ResolveLayoutShareTokenResponse")
2133            .field("layout", &self.layout)
2134            .field("owner_id", &self.owner_id)
2135            .field("template_id", &self.template_id)
2136            .field("version", &self.version)
2137            .finish()
2138    }
2139}
2140impl ResolveLayoutShareTokenResponse {
2141    /// Protobuf type URL for this message, for use with `Any::pack` and
2142    /// `Any::unpack_if`.
2143    ///
2144    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2145    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ResolveLayoutShareTokenResponse";
2146}
2147::buffa::impl_default_instance!(ResolveLayoutShareTokenResponse);
2148impl ::buffa::MessageName for ResolveLayoutShareTokenResponse {
2149    const PACKAGE: &'static str = "layout.v1";
2150    const NAME: &'static str = "ResolveLayoutShareTokenResponse";
2151    const FULL_NAME: &'static str = "layout.v1.ResolveLayoutShareTokenResponse";
2152    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ResolveLayoutShareTokenResponse";
2153}
2154impl ::buffa::Message for ResolveLayoutShareTokenResponse {
2155    /// Returns the total encoded size in bytes.
2156    ///
2157    /// The result is a `u32`; the protobuf specification requires all
2158    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2159    /// compliant message will never overflow this type.
2160    #[allow(clippy::let_and_return)]
2161    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2162        #[allow(unused_imports)]
2163        use ::buffa::Enumeration as _;
2164        let mut size = 0u32;
2165        if self.layout.is_set() {
2166            let __slot = __cache.reserve();
2167            let inner_size = self.layout.compute_size(__cache);
2168            __cache.set(__slot, inner_size);
2169            size
2170                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2171                    + inner_size;
2172        }
2173        if self.owner_id != 0u64 {
2174            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
2175        }
2176        if self.template_id != 0u64 {
2177            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
2178        }
2179        if self.version != 0u32 {
2180            size += 1u32 + ::buffa::types::uint32_encoded_len(self.version) as u32;
2181        }
2182        size += self.__buffa_unknown_fields.encoded_len() as u32;
2183        size
2184    }
2185    fn write_to(
2186        &self,
2187        __cache: &mut ::buffa::SizeCache,
2188        buf: &mut impl ::buffa::bytes::BufMut,
2189    ) {
2190        #[allow(unused_imports)]
2191        use ::buffa::Enumeration as _;
2192        if self.layout.is_set() {
2193            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
2194            self.layout.write_to(__cache, buf);
2195        }
2196        if self.owner_id != 0u64 {
2197            ::buffa::types::put_fixed64_field(2u32, self.owner_id, buf);
2198        }
2199        if self.template_id != 0u64 {
2200            ::buffa::types::put_fixed64_field(3u32, self.template_id, buf);
2201        }
2202        if self.version != 0u32 {
2203            ::buffa::types::put_uint32_field(4u32, self.version, buf);
2204        }
2205        self.__buffa_unknown_fields.write_to(buf);
2206    }
2207    fn merge_field(
2208        &mut self,
2209        tag: ::buffa::encoding::Tag,
2210        buf: &mut impl ::buffa::bytes::Buf,
2211        ctx: ::buffa::DecodeContext<'_>,
2212    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2213        #[allow(unused_imports)]
2214        use ::buffa::bytes::Buf as _;
2215        #[allow(unused_imports)]
2216        use ::buffa::Enumeration as _;
2217        match tag.field_number() {
2218            1u32 => {
2219                ::buffa::encoding::check_wire_type(
2220                    tag,
2221                    ::buffa::encoding::WireType::LengthDelimited,
2222                )?;
2223                ::buffa::Message::merge_length_delimited(
2224                    self.layout.get_or_insert_default(),
2225                    buf,
2226                    ctx,
2227                )?;
2228            }
2229            2u32 => {
2230                ::buffa::encoding::check_wire_type(
2231                    tag,
2232                    ::buffa::encoding::WireType::Fixed64,
2233                )?;
2234                self.owner_id = ::buffa::types::decode_fixed64(buf)?;
2235            }
2236            3u32 => {
2237                ::buffa::encoding::check_wire_type(
2238                    tag,
2239                    ::buffa::encoding::WireType::Fixed64,
2240                )?;
2241                self.template_id = ::buffa::types::decode_fixed64(buf)?;
2242            }
2243            4u32 => {
2244                ::buffa::encoding::check_wire_type(
2245                    tag,
2246                    ::buffa::encoding::WireType::Varint,
2247                )?;
2248                self.version = ::buffa::types::decode_uint32(buf)?;
2249            }
2250            _ => {
2251                self.__buffa_unknown_fields
2252                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2253            }
2254        }
2255        ::core::result::Result::Ok(())
2256    }
2257    fn clear(&mut self) {
2258        self.layout = ::buffa::MessageField::none();
2259        self.owner_id = 0u64;
2260        self.template_id = 0u64;
2261        self.version = 0u32;
2262        self.__buffa_unknown_fields.clear();
2263    }
2264}
2265impl ::buffa::ExtensionSet for ResolveLayoutShareTokenResponse {
2266    const PROTO_FQN: &'static str = "layout.v1.ResolveLayoutShareTokenResponse";
2267    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2268        &self.__buffa_unknown_fields
2269    }
2270    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2271        &mut self.__buffa_unknown_fields
2272    }
2273}
2274impl ::buffa::json_helpers::ProtoElemJson for ResolveLayoutShareTokenResponse {
2275    fn serialize_proto_json<S: ::serde::Serializer>(
2276        v: &Self,
2277        s: S,
2278    ) -> ::core::result::Result<S::Ok, S::Error> {
2279        ::serde::Serialize::serialize(v, s)
2280    }
2281    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2282        d: D,
2283    ) -> ::core::result::Result<Self, D::Error> {
2284        <Self as ::serde::Deserialize>::deserialize(d)
2285    }
2286}
2287#[doc(hidden)]
2288pub const __RESOLVE_LAYOUT_SHARE_TOKEN_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2289    type_url: "type.googleapis.com/layout.v1.ResolveLayoutShareTokenResponse",
2290    to_json: ::buffa::type_registry::any_to_json::<ResolveLayoutShareTokenResponse>,
2291    from_json: ::buffa::type_registry::any_from_json::<ResolveLayoutShareTokenResponse>,
2292    is_wkt: false,
2293};
2294/// CreateLayoutShareLinkRequest creates a share token for one saved layout.
2295#[derive(Clone, PartialEq, Default)]
2296#[derive(::serde::Serialize, ::serde::Deserialize)]
2297#[serde(default)]
2298pub struct CreateLayoutShareLinkRequest {
2299    /// Saved layout identifier to share.
2300    ///
2301    /// Field 1: `layout_id`
2302    #[serde(
2303        rename = "layoutId",
2304        alias = "layout_id",
2305        with = "::buffa::json_helpers::uint64",
2306        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
2307    )]
2308    pub layout_id: u64,
2309    /// Expiration time in milliseconds since epoch (UTC); 0 means the link does not expire.
2310    ///
2311    /// Field 2: `expires_at_ms`
2312    #[serde(
2313        rename = "expiresAtMs",
2314        alias = "expires_at_ms",
2315        with = "::buffa::json_helpers::uint64",
2316        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
2317    )]
2318    pub expires_at_ms: u64,
2319    #[serde(skip)]
2320    #[doc(hidden)]
2321    pub __buffa_unknown_fields: ::buffa::UnknownFields,
2322}
2323impl ::core::fmt::Debug for CreateLayoutShareLinkRequest {
2324    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2325        f.debug_struct("CreateLayoutShareLinkRequest")
2326            .field("layout_id", &self.layout_id)
2327            .field("expires_at_ms", &self.expires_at_ms)
2328            .finish()
2329    }
2330}
2331impl CreateLayoutShareLinkRequest {
2332    /// Protobuf type URL for this message, for use with `Any::pack` and
2333    /// `Any::unpack_if`.
2334    ///
2335    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2336    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.CreateLayoutShareLinkRequest";
2337}
2338::buffa::impl_default_instance!(CreateLayoutShareLinkRequest);
2339impl ::buffa::MessageName for CreateLayoutShareLinkRequest {
2340    const PACKAGE: &'static str = "layout.v1";
2341    const NAME: &'static str = "CreateLayoutShareLinkRequest";
2342    const FULL_NAME: &'static str = "layout.v1.CreateLayoutShareLinkRequest";
2343    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.CreateLayoutShareLinkRequest";
2344}
2345impl ::buffa::Message for CreateLayoutShareLinkRequest {
2346    /// Returns the total encoded size in bytes.
2347    ///
2348    /// The result is a `u32`; the protobuf specification requires all
2349    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2350    /// compliant message will never overflow this type.
2351    #[allow(clippy::let_and_return)]
2352    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2353        #[allow(unused_imports)]
2354        use ::buffa::Enumeration as _;
2355        let mut size = 0u32;
2356        if self.layout_id != 0u64 {
2357            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
2358        }
2359        if self.expires_at_ms != 0u64 {
2360            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
2361        }
2362        size += self.__buffa_unknown_fields.encoded_len() as u32;
2363        size
2364    }
2365    fn write_to(
2366        &self,
2367        _cache: &mut ::buffa::SizeCache,
2368        buf: &mut impl ::buffa::bytes::BufMut,
2369    ) {
2370        #[allow(unused_imports)]
2371        use ::buffa::Enumeration as _;
2372        if self.layout_id != 0u64 {
2373            ::buffa::types::put_fixed64_field(1u32, self.layout_id, buf);
2374        }
2375        if self.expires_at_ms != 0u64 {
2376            ::buffa::types::put_fixed64_field(2u32, self.expires_at_ms, buf);
2377        }
2378        self.__buffa_unknown_fields.write_to(buf);
2379    }
2380    fn merge_field(
2381        &mut self,
2382        tag: ::buffa::encoding::Tag,
2383        buf: &mut impl ::buffa::bytes::Buf,
2384        ctx: ::buffa::DecodeContext<'_>,
2385    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2386        #[allow(unused_imports)]
2387        use ::buffa::bytes::Buf as _;
2388        #[allow(unused_imports)]
2389        use ::buffa::Enumeration as _;
2390        match tag.field_number() {
2391            1u32 => {
2392                ::buffa::encoding::check_wire_type(
2393                    tag,
2394                    ::buffa::encoding::WireType::Fixed64,
2395                )?;
2396                self.layout_id = ::buffa::types::decode_fixed64(buf)?;
2397            }
2398            2u32 => {
2399                ::buffa::encoding::check_wire_type(
2400                    tag,
2401                    ::buffa::encoding::WireType::Fixed64,
2402                )?;
2403                self.expires_at_ms = ::buffa::types::decode_fixed64(buf)?;
2404            }
2405            _ => {
2406                self.__buffa_unknown_fields
2407                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2408            }
2409        }
2410        ::core::result::Result::Ok(())
2411    }
2412    fn clear(&mut self) {
2413        self.layout_id = 0u64;
2414        self.expires_at_ms = 0u64;
2415        self.__buffa_unknown_fields.clear();
2416    }
2417}
2418impl ::buffa::ExtensionSet for CreateLayoutShareLinkRequest {
2419    const PROTO_FQN: &'static str = "layout.v1.CreateLayoutShareLinkRequest";
2420    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2421        &self.__buffa_unknown_fields
2422    }
2423    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2424        &mut self.__buffa_unknown_fields
2425    }
2426}
2427impl ::buffa::json_helpers::ProtoElemJson for CreateLayoutShareLinkRequest {
2428    fn serialize_proto_json<S: ::serde::Serializer>(
2429        v: &Self,
2430        s: S,
2431    ) -> ::core::result::Result<S::Ok, S::Error> {
2432        ::serde::Serialize::serialize(v, s)
2433    }
2434    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2435        d: D,
2436    ) -> ::core::result::Result<Self, D::Error> {
2437        <Self as ::serde::Deserialize>::deserialize(d)
2438    }
2439}
2440#[doc(hidden)]
2441pub const __CREATE_LAYOUT_SHARE_LINK_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2442    type_url: "type.googleapis.com/layout.v1.CreateLayoutShareLinkRequest",
2443    to_json: ::buffa::type_registry::any_to_json::<CreateLayoutShareLinkRequest>,
2444    from_json: ::buffa::type_registry::any_from_json::<CreateLayoutShareLinkRequest>,
2445    is_wkt: false,
2446};
2447/// CreateLayoutShareLinkResponse returns the minted share token and target snapshot.
2448#[derive(Clone, PartialEq, Default)]
2449#[derive(::serde::Serialize, ::serde::Deserialize)]
2450#[serde(default)]
2451pub struct CreateLayoutShareLinkResponse {
2452    /// Opaque share token that can resolve the layout snapshot.
2453    ///
2454    /// Field 1: `token`
2455    #[serde(
2456        rename = "token",
2457        with = "::buffa::json_helpers::proto_string",
2458        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2459    )]
2460    pub token: ::buffa::alloc::string::String,
2461    /// Viewer that owns the shared template.
2462    ///
2463    /// Field 2: `owner_id`
2464    #[serde(
2465        rename = "ownerId",
2466        alias = "owner_id",
2467        with = "::buffa::json_helpers::uint64",
2468        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
2469    )]
2470    pub owner_id: u64,
2471    /// Template identifier created or reused for this layout.
2472    ///
2473    /// Field 3: `template_id`
2474    #[serde(
2475        rename = "templateId",
2476        alias = "template_id",
2477        with = "::buffa::json_helpers::uint64",
2478        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
2479    )]
2480    pub template_id: u64,
2481    /// Immutable template version captured by this share link.
2482    ///
2483    /// Field 4: `version`
2484    #[serde(
2485        rename = "version",
2486        with = "::buffa::json_helpers::uint32",
2487        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
2488    )]
2489    pub version: u32,
2490    #[serde(skip)]
2491    #[doc(hidden)]
2492    pub __buffa_unknown_fields: ::buffa::UnknownFields,
2493}
2494impl ::core::fmt::Debug for CreateLayoutShareLinkResponse {
2495    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2496        f.debug_struct("CreateLayoutShareLinkResponse")
2497            .field("token", &self.token)
2498            .field("owner_id", &self.owner_id)
2499            .field("template_id", &self.template_id)
2500            .field("version", &self.version)
2501            .finish()
2502    }
2503}
2504impl CreateLayoutShareLinkResponse {
2505    /// Protobuf type URL for this message, for use with `Any::pack` and
2506    /// `Any::unpack_if`.
2507    ///
2508    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2509    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.CreateLayoutShareLinkResponse";
2510}
2511::buffa::impl_default_instance!(CreateLayoutShareLinkResponse);
2512impl ::buffa::MessageName for CreateLayoutShareLinkResponse {
2513    const PACKAGE: &'static str = "layout.v1";
2514    const NAME: &'static str = "CreateLayoutShareLinkResponse";
2515    const FULL_NAME: &'static str = "layout.v1.CreateLayoutShareLinkResponse";
2516    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.CreateLayoutShareLinkResponse";
2517}
2518impl ::buffa::Message for CreateLayoutShareLinkResponse {
2519    /// Returns the total encoded size in bytes.
2520    ///
2521    /// The result is a `u32`; the protobuf specification requires all
2522    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2523    /// compliant message will never overflow this type.
2524    #[allow(clippy::let_and_return)]
2525    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2526        #[allow(unused_imports)]
2527        use ::buffa::Enumeration as _;
2528        let mut size = 0u32;
2529        if !self.token.is_empty() {
2530            size += 1u32 + ::buffa::types::string_encoded_len(&self.token) as u32;
2531        }
2532        if self.owner_id != 0u64 {
2533            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
2534        }
2535        if self.template_id != 0u64 {
2536            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
2537        }
2538        if self.version != 0u32 {
2539            size += 1u32 + ::buffa::types::uint32_encoded_len(self.version) as u32;
2540        }
2541        size += self.__buffa_unknown_fields.encoded_len() as u32;
2542        size
2543    }
2544    fn write_to(
2545        &self,
2546        _cache: &mut ::buffa::SizeCache,
2547        buf: &mut impl ::buffa::bytes::BufMut,
2548    ) {
2549        #[allow(unused_imports)]
2550        use ::buffa::Enumeration as _;
2551        if !self.token.is_empty() {
2552            ::buffa::types::put_string_field(1u32, &self.token, buf);
2553        }
2554        if self.owner_id != 0u64 {
2555            ::buffa::types::put_fixed64_field(2u32, self.owner_id, buf);
2556        }
2557        if self.template_id != 0u64 {
2558            ::buffa::types::put_fixed64_field(3u32, self.template_id, buf);
2559        }
2560        if self.version != 0u32 {
2561            ::buffa::types::put_uint32_field(4u32, self.version, buf);
2562        }
2563        self.__buffa_unknown_fields.write_to(buf);
2564    }
2565    fn merge_field(
2566        &mut self,
2567        tag: ::buffa::encoding::Tag,
2568        buf: &mut impl ::buffa::bytes::Buf,
2569        ctx: ::buffa::DecodeContext<'_>,
2570    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2571        #[allow(unused_imports)]
2572        use ::buffa::bytes::Buf as _;
2573        #[allow(unused_imports)]
2574        use ::buffa::Enumeration as _;
2575        match tag.field_number() {
2576            1u32 => {
2577                ::buffa::encoding::check_wire_type(
2578                    tag,
2579                    ::buffa::encoding::WireType::LengthDelimited,
2580                )?;
2581                ::buffa::types::merge_string(&mut self.token, buf)?;
2582            }
2583            2u32 => {
2584                ::buffa::encoding::check_wire_type(
2585                    tag,
2586                    ::buffa::encoding::WireType::Fixed64,
2587                )?;
2588                self.owner_id = ::buffa::types::decode_fixed64(buf)?;
2589            }
2590            3u32 => {
2591                ::buffa::encoding::check_wire_type(
2592                    tag,
2593                    ::buffa::encoding::WireType::Fixed64,
2594                )?;
2595                self.template_id = ::buffa::types::decode_fixed64(buf)?;
2596            }
2597            4u32 => {
2598                ::buffa::encoding::check_wire_type(
2599                    tag,
2600                    ::buffa::encoding::WireType::Varint,
2601                )?;
2602                self.version = ::buffa::types::decode_uint32(buf)?;
2603            }
2604            _ => {
2605                self.__buffa_unknown_fields
2606                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2607            }
2608        }
2609        ::core::result::Result::Ok(())
2610    }
2611    fn clear(&mut self) {
2612        self.token.clear();
2613        self.owner_id = 0u64;
2614        self.template_id = 0u64;
2615        self.version = 0u32;
2616        self.__buffa_unknown_fields.clear();
2617    }
2618}
2619impl ::buffa::ExtensionSet for CreateLayoutShareLinkResponse {
2620    const PROTO_FQN: &'static str = "layout.v1.CreateLayoutShareLinkResponse";
2621    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2622        &self.__buffa_unknown_fields
2623    }
2624    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2625        &mut self.__buffa_unknown_fields
2626    }
2627}
2628impl ::buffa::json_helpers::ProtoElemJson for CreateLayoutShareLinkResponse {
2629    fn serialize_proto_json<S: ::serde::Serializer>(
2630        v: &Self,
2631        s: S,
2632    ) -> ::core::result::Result<S::Ok, S::Error> {
2633        ::serde::Serialize::serialize(v, s)
2634    }
2635    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2636        d: D,
2637    ) -> ::core::result::Result<Self, D::Error> {
2638        <Self as ::serde::Deserialize>::deserialize(d)
2639    }
2640}
2641#[doc(hidden)]
2642pub const __CREATE_LAYOUT_SHARE_LINK_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2643    type_url: "type.googleapis.com/layout.v1.CreateLayoutShareLinkResponse",
2644    to_json: ::buffa::type_registry::any_to_json::<CreateLayoutShareLinkResponse>,
2645    from_json: ::buffa::type_registry::any_from_json::<CreateLayoutShareLinkResponse>,
2646    is_wkt: false,
2647};
2648/// RevokeLayoutShareLinkRequest revokes one previously minted share token.
2649#[derive(Clone, PartialEq, Default)]
2650#[derive(::serde::Serialize, ::serde::Deserialize)]
2651#[serde(default)]
2652pub struct RevokeLayoutShareLinkRequest {
2653    /// Opaque share token to revoke.
2654    ///
2655    /// Field 1: `token`
2656    #[serde(
2657        rename = "token",
2658        with = "::buffa::json_helpers::proto_string",
2659        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2660    )]
2661    pub token: ::buffa::alloc::string::String,
2662    #[serde(skip)]
2663    #[doc(hidden)]
2664    pub __buffa_unknown_fields: ::buffa::UnknownFields,
2665}
2666impl ::core::fmt::Debug for RevokeLayoutShareLinkRequest {
2667    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2668        f.debug_struct("RevokeLayoutShareLinkRequest")
2669            .field("token", &self.token)
2670            .finish()
2671    }
2672}
2673impl RevokeLayoutShareLinkRequest {
2674    /// Protobuf type URL for this message, for use with `Any::pack` and
2675    /// `Any::unpack_if`.
2676    ///
2677    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2678    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.RevokeLayoutShareLinkRequest";
2679}
2680::buffa::impl_default_instance!(RevokeLayoutShareLinkRequest);
2681impl ::buffa::MessageName for RevokeLayoutShareLinkRequest {
2682    const PACKAGE: &'static str = "layout.v1";
2683    const NAME: &'static str = "RevokeLayoutShareLinkRequest";
2684    const FULL_NAME: &'static str = "layout.v1.RevokeLayoutShareLinkRequest";
2685    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.RevokeLayoutShareLinkRequest";
2686}
2687impl ::buffa::Message for RevokeLayoutShareLinkRequest {
2688    /// Returns the total encoded size in bytes.
2689    ///
2690    /// The result is a `u32`; the protobuf specification requires all
2691    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2692    /// compliant message will never overflow this type.
2693    #[allow(clippy::let_and_return)]
2694    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2695        #[allow(unused_imports)]
2696        use ::buffa::Enumeration as _;
2697        let mut size = 0u32;
2698        if !self.token.is_empty() {
2699            size += 1u32 + ::buffa::types::string_encoded_len(&self.token) as u32;
2700        }
2701        size += self.__buffa_unknown_fields.encoded_len() as u32;
2702        size
2703    }
2704    fn write_to(
2705        &self,
2706        _cache: &mut ::buffa::SizeCache,
2707        buf: &mut impl ::buffa::bytes::BufMut,
2708    ) {
2709        #[allow(unused_imports)]
2710        use ::buffa::Enumeration as _;
2711        if !self.token.is_empty() {
2712            ::buffa::types::put_string_field(1u32, &self.token, buf);
2713        }
2714        self.__buffa_unknown_fields.write_to(buf);
2715    }
2716    fn merge_field(
2717        &mut self,
2718        tag: ::buffa::encoding::Tag,
2719        buf: &mut impl ::buffa::bytes::Buf,
2720        ctx: ::buffa::DecodeContext<'_>,
2721    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2722        #[allow(unused_imports)]
2723        use ::buffa::bytes::Buf as _;
2724        #[allow(unused_imports)]
2725        use ::buffa::Enumeration as _;
2726        match tag.field_number() {
2727            1u32 => {
2728                ::buffa::encoding::check_wire_type(
2729                    tag,
2730                    ::buffa::encoding::WireType::LengthDelimited,
2731                )?;
2732                ::buffa::types::merge_string(&mut self.token, buf)?;
2733            }
2734            _ => {
2735                self.__buffa_unknown_fields
2736                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2737            }
2738        }
2739        ::core::result::Result::Ok(())
2740    }
2741    fn clear(&mut self) {
2742        self.token.clear();
2743        self.__buffa_unknown_fields.clear();
2744    }
2745}
2746impl ::buffa::ExtensionSet for RevokeLayoutShareLinkRequest {
2747    const PROTO_FQN: &'static str = "layout.v1.RevokeLayoutShareLinkRequest";
2748    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2749        &self.__buffa_unknown_fields
2750    }
2751    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2752        &mut self.__buffa_unknown_fields
2753    }
2754}
2755impl ::buffa::json_helpers::ProtoElemJson for RevokeLayoutShareLinkRequest {
2756    fn serialize_proto_json<S: ::serde::Serializer>(
2757        v: &Self,
2758        s: S,
2759    ) -> ::core::result::Result<S::Ok, S::Error> {
2760        ::serde::Serialize::serialize(v, s)
2761    }
2762    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2763        d: D,
2764    ) -> ::core::result::Result<Self, D::Error> {
2765        <Self as ::serde::Deserialize>::deserialize(d)
2766    }
2767}
2768#[doc(hidden)]
2769pub const __REVOKE_LAYOUT_SHARE_LINK_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2770    type_url: "type.googleapis.com/layout.v1.RevokeLayoutShareLinkRequest",
2771    to_json: ::buffa::type_registry::any_to_json::<RevokeLayoutShareLinkRequest>,
2772    from_json: ::buffa::type_registry::any_from_json::<RevokeLayoutShareLinkRequest>,
2773    is_wkt: false,
2774};
2775/// RevokeLayoutShareLinkResponse is empty when the token was revoked.
2776#[derive(Clone, PartialEq, Default)]
2777#[derive(::serde::Serialize, ::serde::Deserialize)]
2778#[serde(default)]
2779pub struct RevokeLayoutShareLinkResponse {
2780    #[serde(skip)]
2781    #[doc(hidden)]
2782    pub __buffa_unknown_fields: ::buffa::UnknownFields,
2783}
2784impl ::core::fmt::Debug for RevokeLayoutShareLinkResponse {
2785    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2786        f.debug_struct("RevokeLayoutShareLinkResponse").finish()
2787    }
2788}
2789impl RevokeLayoutShareLinkResponse {
2790    /// Protobuf type URL for this message, for use with `Any::pack` and
2791    /// `Any::unpack_if`.
2792    ///
2793    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2794    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.RevokeLayoutShareLinkResponse";
2795}
2796::buffa::impl_default_instance!(RevokeLayoutShareLinkResponse);
2797impl ::buffa::MessageName for RevokeLayoutShareLinkResponse {
2798    const PACKAGE: &'static str = "layout.v1";
2799    const NAME: &'static str = "RevokeLayoutShareLinkResponse";
2800    const FULL_NAME: &'static str = "layout.v1.RevokeLayoutShareLinkResponse";
2801    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.RevokeLayoutShareLinkResponse";
2802}
2803impl ::buffa::Message for RevokeLayoutShareLinkResponse {
2804    /// Returns the total encoded size in bytes.
2805    ///
2806    /// The result is a `u32`; the protobuf specification requires all
2807    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2808    /// compliant message will never overflow this type.
2809    #[allow(clippy::let_and_return)]
2810    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2811        #[allow(unused_imports)]
2812        use ::buffa::Enumeration as _;
2813        let mut size = 0u32;
2814        size += self.__buffa_unknown_fields.encoded_len() as u32;
2815        size
2816    }
2817    fn write_to(
2818        &self,
2819        _cache: &mut ::buffa::SizeCache,
2820        buf: &mut impl ::buffa::bytes::BufMut,
2821    ) {
2822        #[allow(unused_imports)]
2823        use ::buffa::Enumeration as _;
2824        self.__buffa_unknown_fields.write_to(buf);
2825    }
2826    fn merge_field(
2827        &mut self,
2828        tag: ::buffa::encoding::Tag,
2829        buf: &mut impl ::buffa::bytes::Buf,
2830        ctx: ::buffa::DecodeContext<'_>,
2831    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2832        #[allow(unused_imports)]
2833        use ::buffa::bytes::Buf as _;
2834        #[allow(unused_imports)]
2835        use ::buffa::Enumeration as _;
2836        match tag.field_number() {
2837            _ => {
2838                self.__buffa_unknown_fields
2839                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2840            }
2841        }
2842        ::core::result::Result::Ok(())
2843    }
2844    fn clear(&mut self) {
2845        self.__buffa_unknown_fields.clear();
2846    }
2847}
2848impl ::buffa::ExtensionSet for RevokeLayoutShareLinkResponse {
2849    const PROTO_FQN: &'static str = "layout.v1.RevokeLayoutShareLinkResponse";
2850    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2851        &self.__buffa_unknown_fields
2852    }
2853    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2854        &mut self.__buffa_unknown_fields
2855    }
2856}
2857impl ::buffa::json_helpers::ProtoElemJson for RevokeLayoutShareLinkResponse {
2858    fn serialize_proto_json<S: ::serde::Serializer>(
2859        v: &Self,
2860        s: S,
2861    ) -> ::core::result::Result<S::Ok, S::Error> {
2862        ::serde::Serialize::serialize(v, s)
2863    }
2864    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2865        d: D,
2866    ) -> ::core::result::Result<Self, D::Error> {
2867        <Self as ::serde::Deserialize>::deserialize(d)
2868    }
2869}
2870#[doc(hidden)]
2871pub const __REVOKE_LAYOUT_SHARE_LINK_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2872    type_url: "type.googleapis.com/layout.v1.RevokeLayoutShareLinkResponse",
2873    to_json: ::buffa::type_registry::any_to_json::<RevokeLayoutShareLinkResponse>,
2874    from_json: ::buffa::type_registry::any_from_json::<RevokeLayoutShareLinkResponse>,
2875    is_wkt: false,
2876};
2877/// =============================================================================
2878/// Templates (versioned community layouts)
2879/// =============================================================================
2880///
2881/// LayoutTemplateRef identifies a published layout template.
2882#[derive(Clone, PartialEq, Default)]
2883#[derive(::serde::Serialize, ::serde::Deserialize)]
2884#[serde(default)]
2885pub struct LayoutTemplateRef {
2886    /// Viewer that owns the template.
2887    ///
2888    /// Field 1: `owner_id`
2889    #[serde(
2890        rename = "ownerId",
2891        alias = "owner_id",
2892        with = "::buffa::json_helpers::uint64",
2893        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
2894    )]
2895    pub owner_id: u64,
2896    /// Template identifier unique within the owner.
2897    ///
2898    /// Field 2: `template_id`
2899    #[serde(
2900        rename = "templateId",
2901        alias = "template_id",
2902        with = "::buffa::json_helpers::uint64",
2903        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
2904    )]
2905    pub template_id: u64,
2906    #[serde(skip)]
2907    #[doc(hidden)]
2908    pub __buffa_unknown_fields: ::buffa::UnknownFields,
2909}
2910impl ::core::fmt::Debug for LayoutTemplateRef {
2911    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2912        f.debug_struct("LayoutTemplateRef")
2913            .field("owner_id", &self.owner_id)
2914            .field("template_id", &self.template_id)
2915            .finish()
2916    }
2917}
2918impl LayoutTemplateRef {
2919    /// Protobuf type URL for this message, for use with `Any::pack` and
2920    /// `Any::unpack_if`.
2921    ///
2922    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2923    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutTemplateRef";
2924}
2925::buffa::impl_default_instance!(LayoutTemplateRef);
2926impl ::buffa::MessageName for LayoutTemplateRef {
2927    const PACKAGE: &'static str = "layout.v1";
2928    const NAME: &'static str = "LayoutTemplateRef";
2929    const FULL_NAME: &'static str = "layout.v1.LayoutTemplateRef";
2930    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutTemplateRef";
2931}
2932impl ::buffa::Message for LayoutTemplateRef {
2933    /// Returns the total encoded size in bytes.
2934    ///
2935    /// The result is a `u32`; the protobuf specification requires all
2936    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2937    /// compliant message will never overflow this type.
2938    #[allow(clippy::let_and_return)]
2939    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2940        #[allow(unused_imports)]
2941        use ::buffa::Enumeration as _;
2942        let mut size = 0u32;
2943        if self.owner_id != 0u64 {
2944            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
2945        }
2946        if self.template_id != 0u64 {
2947            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
2948        }
2949        size += self.__buffa_unknown_fields.encoded_len() as u32;
2950        size
2951    }
2952    fn write_to(
2953        &self,
2954        _cache: &mut ::buffa::SizeCache,
2955        buf: &mut impl ::buffa::bytes::BufMut,
2956    ) {
2957        #[allow(unused_imports)]
2958        use ::buffa::Enumeration as _;
2959        if self.owner_id != 0u64 {
2960            ::buffa::types::put_fixed64_field(1u32, self.owner_id, buf);
2961        }
2962        if self.template_id != 0u64 {
2963            ::buffa::types::put_fixed64_field(2u32, self.template_id, buf);
2964        }
2965        self.__buffa_unknown_fields.write_to(buf);
2966    }
2967    fn merge_field(
2968        &mut self,
2969        tag: ::buffa::encoding::Tag,
2970        buf: &mut impl ::buffa::bytes::Buf,
2971        ctx: ::buffa::DecodeContext<'_>,
2972    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2973        #[allow(unused_imports)]
2974        use ::buffa::bytes::Buf as _;
2975        #[allow(unused_imports)]
2976        use ::buffa::Enumeration as _;
2977        match tag.field_number() {
2978            1u32 => {
2979                ::buffa::encoding::check_wire_type(
2980                    tag,
2981                    ::buffa::encoding::WireType::Fixed64,
2982                )?;
2983                self.owner_id = ::buffa::types::decode_fixed64(buf)?;
2984            }
2985            2u32 => {
2986                ::buffa::encoding::check_wire_type(
2987                    tag,
2988                    ::buffa::encoding::WireType::Fixed64,
2989                )?;
2990                self.template_id = ::buffa::types::decode_fixed64(buf)?;
2991            }
2992            _ => {
2993                self.__buffa_unknown_fields
2994                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2995            }
2996        }
2997        ::core::result::Result::Ok(())
2998    }
2999    fn clear(&mut self) {
3000        self.owner_id = 0u64;
3001        self.template_id = 0u64;
3002        self.__buffa_unknown_fields.clear();
3003    }
3004}
3005impl ::buffa::ExtensionSet for LayoutTemplateRef {
3006    const PROTO_FQN: &'static str = "layout.v1.LayoutTemplateRef";
3007    fn unknown_fields(&self) -> &::buffa::UnknownFields {
3008        &self.__buffa_unknown_fields
3009    }
3010    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3011        &mut self.__buffa_unknown_fields
3012    }
3013}
3014impl ::buffa::json_helpers::ProtoElemJson for LayoutTemplateRef {
3015    fn serialize_proto_json<S: ::serde::Serializer>(
3016        v: &Self,
3017        s: S,
3018    ) -> ::core::result::Result<S::Ok, S::Error> {
3019        ::serde::Serialize::serialize(v, s)
3020    }
3021    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3022        d: D,
3023    ) -> ::core::result::Result<Self, D::Error> {
3024        <Self as ::serde::Deserialize>::deserialize(d)
3025    }
3026}
3027#[doc(hidden)]
3028pub const __LAYOUT_TEMPLATE_REF_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3029    type_url: "type.googleapis.com/layout.v1.LayoutTemplateRef",
3030    to_json: ::buffa::type_registry::any_to_json::<LayoutTemplateRef>,
3031    from_json: ::buffa::type_registry::any_from_json::<LayoutTemplateRef>,
3032    is_wkt: false,
3033};
3034/// LayoutTemplate contains discovery metadata for a versioned layout template.
3035#[derive(Clone, PartialEq, Default)]
3036#[derive(::serde::Serialize, ::serde::Deserialize)]
3037#[serde(default)]
3038pub struct LayoutTemplate {
3039    /// Template identifier.
3040    ///
3041    /// Field 1: `template`
3042    #[serde(
3043        rename = "template",
3044        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
3045    )]
3046    pub template: ::buffa::MessageField<LayoutTemplateRef>,
3047    /// Public display title.
3048    ///
3049    /// Field 2: `title`
3050    #[serde(
3051        rename = "title",
3052        with = "::buffa::json_helpers::proto_string",
3053        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
3054    )]
3055    pub title: ::buffa::alloc::string::String,
3056    /// Public description shown with the template.
3057    ///
3058    /// Field 3: `description`
3059    #[serde(
3060        rename = "description",
3061        with = "::buffa::json_helpers::proto_string",
3062        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
3063    )]
3064    pub description: ::buffa::alloc::string::String,
3065    /// Public tags used for grouping or filtering.
3066    ///
3067    /// Field 4: `tags`
3068    #[serde(
3069        rename = "tags",
3070        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
3071        deserialize_with = "::buffa::json_helpers::null_as_default"
3072    )]
3073    pub tags: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
3074    /// True when the template appears in discovery listings.
3075    ///
3076    /// Field 5: `is_listed`
3077    #[serde(
3078        rename = "isListed",
3079        alias = "is_listed",
3080        with = "::buffa::json_helpers::proto_bool",
3081        skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
3082    )]
3083    pub is_listed: bool,
3084    /// Latest immutable version number for this template.
3085    ///
3086    /// Field 6: `latest_version`
3087    #[serde(
3088        rename = "latestVersion",
3089        alias = "latest_version",
3090        with = "::buffa::json_helpers::uint32",
3091        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
3092    )]
3093    pub latest_version: u32,
3094    /// Initial publication time in milliseconds since epoch (UTC).
3095    ///
3096    /// Field 7: `published_at_ms`
3097    #[serde(
3098        rename = "publishedAtMs",
3099        alias = "published_at_ms",
3100        with = "::buffa::json_helpers::uint64",
3101        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
3102    )]
3103    pub published_at_ms: u64,
3104    /// Last metadata update time in milliseconds since epoch (UTC).
3105    ///
3106    /// Field 8: `updated_at_ms`
3107    #[serde(
3108        rename = "updatedAtMs",
3109        alias = "updated_at_ms",
3110        with = "::buffa::json_helpers::uint64",
3111        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
3112    )]
3113    pub updated_at_ms: u64,
3114    #[serde(skip)]
3115    #[doc(hidden)]
3116    pub __buffa_unknown_fields: ::buffa::UnknownFields,
3117}
3118impl ::core::fmt::Debug for LayoutTemplate {
3119    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3120        f.debug_struct("LayoutTemplate")
3121            .field("template", &self.template)
3122            .field("title", &self.title)
3123            .field("description", &self.description)
3124            .field("tags", &self.tags)
3125            .field("is_listed", &self.is_listed)
3126            .field("latest_version", &self.latest_version)
3127            .field("published_at_ms", &self.published_at_ms)
3128            .field("updated_at_ms", &self.updated_at_ms)
3129            .finish()
3130    }
3131}
3132impl LayoutTemplate {
3133    /// Protobuf type URL for this message, for use with `Any::pack` and
3134    /// `Any::unpack_if`.
3135    ///
3136    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
3137    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutTemplate";
3138}
3139::buffa::impl_default_instance!(LayoutTemplate);
3140impl ::buffa::MessageName for LayoutTemplate {
3141    const PACKAGE: &'static str = "layout.v1";
3142    const NAME: &'static str = "LayoutTemplate";
3143    const FULL_NAME: &'static str = "layout.v1.LayoutTemplate";
3144    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutTemplate";
3145}
3146impl ::buffa::Message for LayoutTemplate {
3147    /// Returns the total encoded size in bytes.
3148    ///
3149    /// The result is a `u32`; the protobuf specification requires all
3150    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
3151    /// compliant message will never overflow this type.
3152    #[allow(clippy::let_and_return)]
3153    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
3154        #[allow(unused_imports)]
3155        use ::buffa::Enumeration as _;
3156        let mut size = 0u32;
3157        if self.template.is_set() {
3158            let __slot = __cache.reserve();
3159            let inner_size = self.template.compute_size(__cache);
3160            __cache.set(__slot, inner_size);
3161            size
3162                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
3163                    + inner_size;
3164        }
3165        if !self.title.is_empty() {
3166            size += 1u32 + ::buffa::types::string_encoded_len(&self.title) as u32;
3167        }
3168        if !self.description.is_empty() {
3169            size += 1u32 + ::buffa::types::string_encoded_len(&self.description) as u32;
3170        }
3171        for v in &self.tags {
3172            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3173        }
3174        if self.is_listed {
3175            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
3176        }
3177        if self.latest_version != 0u32 {
3178            size
3179                += 1u32 + ::buffa::types::uint32_encoded_len(self.latest_version) as u32;
3180        }
3181        if self.published_at_ms != 0u64 {
3182            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
3183        }
3184        if self.updated_at_ms != 0u64 {
3185            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
3186        }
3187        size += self.__buffa_unknown_fields.encoded_len() as u32;
3188        size
3189    }
3190    fn write_to(
3191        &self,
3192        __cache: &mut ::buffa::SizeCache,
3193        buf: &mut impl ::buffa::bytes::BufMut,
3194    ) {
3195        #[allow(unused_imports)]
3196        use ::buffa::Enumeration as _;
3197        if self.template.is_set() {
3198            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
3199            self.template.write_to(__cache, buf);
3200        }
3201        if !self.title.is_empty() {
3202            ::buffa::types::put_string_field(2u32, &self.title, buf);
3203        }
3204        if !self.description.is_empty() {
3205            ::buffa::types::put_string_field(3u32, &self.description, buf);
3206        }
3207        for v in &self.tags {
3208            ::buffa::types::put_string_field(4u32, v, buf);
3209        }
3210        if self.is_listed {
3211            ::buffa::types::put_bool_field(5u32, self.is_listed, buf);
3212        }
3213        if self.latest_version != 0u32 {
3214            ::buffa::types::put_uint32_field(6u32, self.latest_version, buf);
3215        }
3216        if self.published_at_ms != 0u64 {
3217            ::buffa::types::put_fixed64_field(7u32, self.published_at_ms, buf);
3218        }
3219        if self.updated_at_ms != 0u64 {
3220            ::buffa::types::put_fixed64_field(8u32, self.updated_at_ms, buf);
3221        }
3222        self.__buffa_unknown_fields.write_to(buf);
3223    }
3224    fn merge_field(
3225        &mut self,
3226        tag: ::buffa::encoding::Tag,
3227        buf: &mut impl ::buffa::bytes::Buf,
3228        ctx: ::buffa::DecodeContext<'_>,
3229    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3230        #[allow(unused_imports)]
3231        use ::buffa::bytes::Buf as _;
3232        #[allow(unused_imports)]
3233        use ::buffa::Enumeration as _;
3234        match tag.field_number() {
3235            1u32 => {
3236                ::buffa::encoding::check_wire_type(
3237                    tag,
3238                    ::buffa::encoding::WireType::LengthDelimited,
3239                )?;
3240                ::buffa::Message::merge_length_delimited(
3241                    self.template.get_or_insert_default(),
3242                    buf,
3243                    ctx,
3244                )?;
3245            }
3246            2u32 => {
3247                ::buffa::encoding::check_wire_type(
3248                    tag,
3249                    ::buffa::encoding::WireType::LengthDelimited,
3250                )?;
3251                ::buffa::types::merge_string(&mut self.title, buf)?;
3252            }
3253            3u32 => {
3254                ::buffa::encoding::check_wire_type(
3255                    tag,
3256                    ::buffa::encoding::WireType::LengthDelimited,
3257                )?;
3258                ::buffa::types::merge_string(&mut self.description, buf)?;
3259            }
3260            4u32 => {
3261                ::buffa::encoding::check_wire_type(
3262                    tag,
3263                    ::buffa::encoding::WireType::LengthDelimited,
3264                )?;
3265                self.tags.push(::buffa::types::decode_string(buf)?);
3266            }
3267            5u32 => {
3268                ::buffa::encoding::check_wire_type(
3269                    tag,
3270                    ::buffa::encoding::WireType::Varint,
3271                )?;
3272                self.is_listed = ::buffa::types::decode_bool(buf)?;
3273            }
3274            6u32 => {
3275                ::buffa::encoding::check_wire_type(
3276                    tag,
3277                    ::buffa::encoding::WireType::Varint,
3278                )?;
3279                self.latest_version = ::buffa::types::decode_uint32(buf)?;
3280            }
3281            7u32 => {
3282                ::buffa::encoding::check_wire_type(
3283                    tag,
3284                    ::buffa::encoding::WireType::Fixed64,
3285                )?;
3286                self.published_at_ms = ::buffa::types::decode_fixed64(buf)?;
3287            }
3288            8u32 => {
3289                ::buffa::encoding::check_wire_type(
3290                    tag,
3291                    ::buffa::encoding::WireType::Fixed64,
3292                )?;
3293                self.updated_at_ms = ::buffa::types::decode_fixed64(buf)?;
3294            }
3295            _ => {
3296                self.__buffa_unknown_fields
3297                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
3298            }
3299        }
3300        ::core::result::Result::Ok(())
3301    }
3302    fn clear(&mut self) {
3303        self.template = ::buffa::MessageField::none();
3304        self.title.clear();
3305        self.description.clear();
3306        self.tags.clear();
3307        self.is_listed = false;
3308        self.latest_version = 0u32;
3309        self.published_at_ms = 0u64;
3310        self.updated_at_ms = 0u64;
3311        self.__buffa_unknown_fields.clear();
3312    }
3313}
3314impl ::buffa::ExtensionSet for LayoutTemplate {
3315    const PROTO_FQN: &'static str = "layout.v1.LayoutTemplate";
3316    fn unknown_fields(&self) -> &::buffa::UnknownFields {
3317        &self.__buffa_unknown_fields
3318    }
3319    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3320        &mut self.__buffa_unknown_fields
3321    }
3322}
3323impl ::buffa::json_helpers::ProtoElemJson for LayoutTemplate {
3324    fn serialize_proto_json<S: ::serde::Serializer>(
3325        v: &Self,
3326        s: S,
3327    ) -> ::core::result::Result<S::Ok, S::Error> {
3328        ::serde::Serialize::serialize(v, s)
3329    }
3330    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3331        d: D,
3332    ) -> ::core::result::Result<Self, D::Error> {
3333        <Self as ::serde::Deserialize>::deserialize(d)
3334    }
3335}
3336#[doc(hidden)]
3337pub const __LAYOUT_TEMPLATE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3338    type_url: "type.googleapis.com/layout.v1.LayoutTemplate",
3339    to_json: ::buffa::type_registry::any_to_json::<LayoutTemplate>,
3340    from_json: ::buffa::type_registry::any_from_json::<LayoutTemplate>,
3341    is_wkt: false,
3342};
3343/// LayoutTemplateVersionInfo contains metadata for one immutable template version.
3344#[derive(Clone, PartialEq, Default)]
3345#[derive(::serde::Serialize, ::serde::Deserialize)]
3346#[serde(default)]
3347pub struct LayoutTemplateVersionInfo {
3348    /// Immutable template version number.
3349    ///
3350    /// Field 1: `version`
3351    #[serde(
3352        rename = "version",
3353        with = "::buffa::json_helpers::uint32",
3354        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
3355    )]
3356    pub version: u32,
3357    /// Optional release notes for this version.
3358    ///
3359    /// Field 2: `changelog`
3360    #[serde(
3361        rename = "changelog",
3362        with = "::buffa::json_helpers::proto_string",
3363        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
3364    )]
3365    pub changelog: ::buffa::alloc::string::String,
3366    /// Version creation time in milliseconds since epoch (UTC).
3367    ///
3368    /// Field 3: `created_at_ms`
3369    #[serde(
3370        rename = "createdAtMs",
3371        alias = "created_at_ms",
3372        with = "::buffa::json_helpers::uint64",
3373        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
3374    )]
3375    pub created_at_ms: u64,
3376    #[serde(skip)]
3377    #[doc(hidden)]
3378    pub __buffa_unknown_fields: ::buffa::UnknownFields,
3379}
3380impl ::core::fmt::Debug for LayoutTemplateVersionInfo {
3381    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3382        f.debug_struct("LayoutTemplateVersionInfo")
3383            .field("version", &self.version)
3384            .field("changelog", &self.changelog)
3385            .field("created_at_ms", &self.created_at_ms)
3386            .finish()
3387    }
3388}
3389impl LayoutTemplateVersionInfo {
3390    /// Protobuf type URL for this message, for use with `Any::pack` and
3391    /// `Any::unpack_if`.
3392    ///
3393    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
3394    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutTemplateVersionInfo";
3395}
3396::buffa::impl_default_instance!(LayoutTemplateVersionInfo);
3397impl ::buffa::MessageName for LayoutTemplateVersionInfo {
3398    const PACKAGE: &'static str = "layout.v1";
3399    const NAME: &'static str = "LayoutTemplateVersionInfo";
3400    const FULL_NAME: &'static str = "layout.v1.LayoutTemplateVersionInfo";
3401    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutTemplateVersionInfo";
3402}
3403impl ::buffa::Message for LayoutTemplateVersionInfo {
3404    /// Returns the total encoded size in bytes.
3405    ///
3406    /// The result is a `u32`; the protobuf specification requires all
3407    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
3408    /// compliant message will never overflow this type.
3409    #[allow(clippy::let_and_return)]
3410    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3411        #[allow(unused_imports)]
3412        use ::buffa::Enumeration as _;
3413        let mut size = 0u32;
3414        if self.version != 0u32 {
3415            size += 1u32 + ::buffa::types::uint32_encoded_len(self.version) as u32;
3416        }
3417        if !self.changelog.is_empty() {
3418            size += 1u32 + ::buffa::types::string_encoded_len(&self.changelog) as u32;
3419        }
3420        if self.created_at_ms != 0u64 {
3421            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
3422        }
3423        size += self.__buffa_unknown_fields.encoded_len() as u32;
3424        size
3425    }
3426    fn write_to(
3427        &self,
3428        _cache: &mut ::buffa::SizeCache,
3429        buf: &mut impl ::buffa::bytes::BufMut,
3430    ) {
3431        #[allow(unused_imports)]
3432        use ::buffa::Enumeration as _;
3433        if self.version != 0u32 {
3434            ::buffa::types::put_uint32_field(1u32, self.version, buf);
3435        }
3436        if !self.changelog.is_empty() {
3437            ::buffa::types::put_string_field(2u32, &self.changelog, buf);
3438        }
3439        if self.created_at_ms != 0u64 {
3440            ::buffa::types::put_fixed64_field(3u32, self.created_at_ms, buf);
3441        }
3442        self.__buffa_unknown_fields.write_to(buf);
3443    }
3444    fn merge_field(
3445        &mut self,
3446        tag: ::buffa::encoding::Tag,
3447        buf: &mut impl ::buffa::bytes::Buf,
3448        ctx: ::buffa::DecodeContext<'_>,
3449    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3450        #[allow(unused_imports)]
3451        use ::buffa::bytes::Buf as _;
3452        #[allow(unused_imports)]
3453        use ::buffa::Enumeration as _;
3454        match tag.field_number() {
3455            1u32 => {
3456                ::buffa::encoding::check_wire_type(
3457                    tag,
3458                    ::buffa::encoding::WireType::Varint,
3459                )?;
3460                self.version = ::buffa::types::decode_uint32(buf)?;
3461            }
3462            2u32 => {
3463                ::buffa::encoding::check_wire_type(
3464                    tag,
3465                    ::buffa::encoding::WireType::LengthDelimited,
3466                )?;
3467                ::buffa::types::merge_string(&mut self.changelog, buf)?;
3468            }
3469            3u32 => {
3470                ::buffa::encoding::check_wire_type(
3471                    tag,
3472                    ::buffa::encoding::WireType::Fixed64,
3473                )?;
3474                self.created_at_ms = ::buffa::types::decode_fixed64(buf)?;
3475            }
3476            _ => {
3477                self.__buffa_unknown_fields
3478                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
3479            }
3480        }
3481        ::core::result::Result::Ok(())
3482    }
3483    fn clear(&mut self) {
3484        self.version = 0u32;
3485        self.changelog.clear();
3486        self.created_at_ms = 0u64;
3487        self.__buffa_unknown_fields.clear();
3488    }
3489}
3490impl ::buffa::ExtensionSet for LayoutTemplateVersionInfo {
3491    const PROTO_FQN: &'static str = "layout.v1.LayoutTemplateVersionInfo";
3492    fn unknown_fields(&self) -> &::buffa::UnknownFields {
3493        &self.__buffa_unknown_fields
3494    }
3495    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3496        &mut self.__buffa_unknown_fields
3497    }
3498}
3499impl ::buffa::json_helpers::ProtoElemJson for LayoutTemplateVersionInfo {
3500    fn serialize_proto_json<S: ::serde::Serializer>(
3501        v: &Self,
3502        s: S,
3503    ) -> ::core::result::Result<S::Ok, S::Error> {
3504        ::serde::Serialize::serialize(v, s)
3505    }
3506    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3507        d: D,
3508    ) -> ::core::result::Result<Self, D::Error> {
3509        <Self as ::serde::Deserialize>::deserialize(d)
3510    }
3511}
3512#[doc(hidden)]
3513pub const __LAYOUT_TEMPLATE_VERSION_INFO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3514    type_url: "type.googleapis.com/layout.v1.LayoutTemplateVersionInfo",
3515    to_json: ::buffa::type_registry::any_to_json::<LayoutTemplateVersionInfo>,
3516    from_json: ::buffa::type_registry::any_from_json::<LayoutTemplateVersionInfo>,
3517    is_wkt: false,
3518};
3519/// ListOwnerPublishedLayoutsRequest lists published templates owned by one viewer.
3520#[derive(Clone, PartialEq, Default)]
3521#[derive(::serde::Serialize, ::serde::Deserialize)]
3522#[serde(default)]
3523pub struct ListOwnerPublishedLayoutsRequest {
3524    /// Owner whose published layouts should be listed.
3525    ///
3526    /// Field 1: `owner_id`
3527    #[serde(
3528        rename = "ownerId",
3529        alias = "owner_id",
3530        with = "::buffa::json_helpers::uint64",
3531        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
3532    )]
3533    pub owner_id: u64,
3534    /// Maximum number of templates to return. Defaults to 100 when omitted;
3535    /// maximum is 500.
3536    ///
3537    /// Field 2: `limit`
3538    #[serde(
3539        rename = "limit",
3540        with = "::buffa::json_helpers::uint32",
3541        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
3542    )]
3543    pub limit: u32,
3544    /// Opaque keyset cursor from a previous response. The cursor is exclusive and
3545    /// bound to owner and newest-published sort order.
3546    ///
3547    /// Field 3: `page_token`
3548    #[serde(
3549        rename = "pageToken",
3550        alias = "page_token",
3551        with = "::buffa::json_helpers::proto_string",
3552        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
3553    )]
3554    pub page_token: ::buffa::alloc::string::String,
3555    #[serde(skip)]
3556    #[doc(hidden)]
3557    pub __buffa_unknown_fields: ::buffa::UnknownFields,
3558}
3559impl ::core::fmt::Debug for ListOwnerPublishedLayoutsRequest {
3560    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3561        f.debug_struct("ListOwnerPublishedLayoutsRequest")
3562            .field("owner_id", &self.owner_id)
3563            .field("limit", &self.limit)
3564            .field("page_token", &self.page_token)
3565            .finish()
3566    }
3567}
3568impl ListOwnerPublishedLayoutsRequest {
3569    /// Protobuf type URL for this message, for use with `Any::pack` and
3570    /// `Any::unpack_if`.
3571    ///
3572    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
3573    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListOwnerPublishedLayoutsRequest";
3574}
3575::buffa::impl_default_instance!(ListOwnerPublishedLayoutsRequest);
3576impl ::buffa::MessageName for ListOwnerPublishedLayoutsRequest {
3577    const PACKAGE: &'static str = "layout.v1";
3578    const NAME: &'static str = "ListOwnerPublishedLayoutsRequest";
3579    const FULL_NAME: &'static str = "layout.v1.ListOwnerPublishedLayoutsRequest";
3580    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListOwnerPublishedLayoutsRequest";
3581}
3582impl ::buffa::Message for ListOwnerPublishedLayoutsRequest {
3583    /// Returns the total encoded size in bytes.
3584    ///
3585    /// The result is a `u32`; the protobuf specification requires all
3586    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
3587    /// compliant message will never overflow this type.
3588    #[allow(clippy::let_and_return)]
3589    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3590        #[allow(unused_imports)]
3591        use ::buffa::Enumeration as _;
3592        let mut size = 0u32;
3593        if self.owner_id != 0u64 {
3594            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
3595        }
3596        if self.limit != 0u32 {
3597            size += 1u32 + ::buffa::types::uint32_encoded_len(self.limit) as u32;
3598        }
3599        if !self.page_token.is_empty() {
3600            size += 1u32 + ::buffa::types::string_encoded_len(&self.page_token) as u32;
3601        }
3602        size += self.__buffa_unknown_fields.encoded_len() as u32;
3603        size
3604    }
3605    fn write_to(
3606        &self,
3607        _cache: &mut ::buffa::SizeCache,
3608        buf: &mut impl ::buffa::bytes::BufMut,
3609    ) {
3610        #[allow(unused_imports)]
3611        use ::buffa::Enumeration as _;
3612        if self.owner_id != 0u64 {
3613            ::buffa::types::put_fixed64_field(1u32, self.owner_id, buf);
3614        }
3615        if self.limit != 0u32 {
3616            ::buffa::types::put_uint32_field(2u32, self.limit, buf);
3617        }
3618        if !self.page_token.is_empty() {
3619            ::buffa::types::put_string_field(3u32, &self.page_token, buf);
3620        }
3621        self.__buffa_unknown_fields.write_to(buf);
3622    }
3623    fn merge_field(
3624        &mut self,
3625        tag: ::buffa::encoding::Tag,
3626        buf: &mut impl ::buffa::bytes::Buf,
3627        ctx: ::buffa::DecodeContext<'_>,
3628    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3629        #[allow(unused_imports)]
3630        use ::buffa::bytes::Buf as _;
3631        #[allow(unused_imports)]
3632        use ::buffa::Enumeration as _;
3633        match tag.field_number() {
3634            1u32 => {
3635                ::buffa::encoding::check_wire_type(
3636                    tag,
3637                    ::buffa::encoding::WireType::Fixed64,
3638                )?;
3639                self.owner_id = ::buffa::types::decode_fixed64(buf)?;
3640            }
3641            2u32 => {
3642                ::buffa::encoding::check_wire_type(
3643                    tag,
3644                    ::buffa::encoding::WireType::Varint,
3645                )?;
3646                self.limit = ::buffa::types::decode_uint32(buf)?;
3647            }
3648            3u32 => {
3649                ::buffa::encoding::check_wire_type(
3650                    tag,
3651                    ::buffa::encoding::WireType::LengthDelimited,
3652                )?;
3653                ::buffa::types::merge_string(&mut self.page_token, buf)?;
3654            }
3655            _ => {
3656                self.__buffa_unknown_fields
3657                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
3658            }
3659        }
3660        ::core::result::Result::Ok(())
3661    }
3662    fn clear(&mut self) {
3663        self.owner_id = 0u64;
3664        self.limit = 0u32;
3665        self.page_token.clear();
3666        self.__buffa_unknown_fields.clear();
3667    }
3668}
3669impl ::buffa::ExtensionSet for ListOwnerPublishedLayoutsRequest {
3670    const PROTO_FQN: &'static str = "layout.v1.ListOwnerPublishedLayoutsRequest";
3671    fn unknown_fields(&self) -> &::buffa::UnknownFields {
3672        &self.__buffa_unknown_fields
3673    }
3674    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3675        &mut self.__buffa_unknown_fields
3676    }
3677}
3678impl ::buffa::json_helpers::ProtoElemJson for ListOwnerPublishedLayoutsRequest {
3679    fn serialize_proto_json<S: ::serde::Serializer>(
3680        v: &Self,
3681        s: S,
3682    ) -> ::core::result::Result<S::Ok, S::Error> {
3683        ::serde::Serialize::serialize(v, s)
3684    }
3685    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3686        d: D,
3687    ) -> ::core::result::Result<Self, D::Error> {
3688        <Self as ::serde::Deserialize>::deserialize(d)
3689    }
3690}
3691#[doc(hidden)]
3692pub const __LIST_OWNER_PUBLISHED_LAYOUTS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3693    type_url: "type.googleapis.com/layout.v1.ListOwnerPublishedLayoutsRequest",
3694    to_json: ::buffa::type_registry::any_to_json::<ListOwnerPublishedLayoutsRequest>,
3695    from_json: ::buffa::type_registry::any_from_json::<ListOwnerPublishedLayoutsRequest>,
3696    is_wkt: false,
3697};
3698/// ListOwnerPublishedLayoutsResponse contains one page of published templates.
3699#[derive(Clone, PartialEq, Default)]
3700#[derive(::serde::Serialize, ::serde::Deserialize)]
3701#[serde(default)]
3702pub struct ListOwnerPublishedLayoutsResponse {
3703    /// Published templates for the owner, returned newest-published first.
3704    ///
3705    /// Field 1: `templates`
3706    #[serde(
3707        rename = "templates",
3708        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
3709        deserialize_with = "::buffa::json_helpers::null_as_default"
3710    )]
3711    pub templates: ::buffa::alloc::vec::Vec<LayoutTemplate>,
3712    /// Opaque cursor for the next page. Empty when no more results exist.
3713    ///
3714    /// Field 2: `next_page_token`
3715    #[serde(
3716        rename = "nextPageToken",
3717        alias = "next_page_token",
3718        with = "::buffa::json_helpers::proto_string",
3719        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
3720    )]
3721    pub next_page_token: ::buffa::alloc::string::String,
3722    #[serde(skip)]
3723    #[doc(hidden)]
3724    pub __buffa_unknown_fields: ::buffa::UnknownFields,
3725}
3726impl ::core::fmt::Debug for ListOwnerPublishedLayoutsResponse {
3727    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3728        f.debug_struct("ListOwnerPublishedLayoutsResponse")
3729            .field("templates", &self.templates)
3730            .field("next_page_token", &self.next_page_token)
3731            .finish()
3732    }
3733}
3734impl ListOwnerPublishedLayoutsResponse {
3735    /// Protobuf type URL for this message, for use with `Any::pack` and
3736    /// `Any::unpack_if`.
3737    ///
3738    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
3739    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListOwnerPublishedLayoutsResponse";
3740}
3741::buffa::impl_default_instance!(ListOwnerPublishedLayoutsResponse);
3742impl ::buffa::MessageName for ListOwnerPublishedLayoutsResponse {
3743    const PACKAGE: &'static str = "layout.v1";
3744    const NAME: &'static str = "ListOwnerPublishedLayoutsResponse";
3745    const FULL_NAME: &'static str = "layout.v1.ListOwnerPublishedLayoutsResponse";
3746    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListOwnerPublishedLayoutsResponse";
3747}
3748impl ::buffa::Message for ListOwnerPublishedLayoutsResponse {
3749    /// Returns the total encoded size in bytes.
3750    ///
3751    /// The result is a `u32`; the protobuf specification requires all
3752    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
3753    /// compliant message will never overflow this type.
3754    #[allow(clippy::let_and_return)]
3755    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
3756        #[allow(unused_imports)]
3757        use ::buffa::Enumeration as _;
3758        let mut size = 0u32;
3759        for v in &self.templates {
3760            let __slot = __cache.reserve();
3761            let inner_size = v.compute_size(__cache);
3762            __cache.set(__slot, inner_size);
3763            size
3764                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
3765                    + inner_size;
3766        }
3767        if !self.next_page_token.is_empty() {
3768            size
3769                += 1u32
3770                    + ::buffa::types::string_encoded_len(&self.next_page_token) as u32;
3771        }
3772        size += self.__buffa_unknown_fields.encoded_len() as u32;
3773        size
3774    }
3775    fn write_to(
3776        &self,
3777        __cache: &mut ::buffa::SizeCache,
3778        buf: &mut impl ::buffa::bytes::BufMut,
3779    ) {
3780        #[allow(unused_imports)]
3781        use ::buffa::Enumeration as _;
3782        for v in &self.templates {
3783            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
3784            v.write_to(__cache, buf);
3785        }
3786        if !self.next_page_token.is_empty() {
3787            ::buffa::types::put_string_field(2u32, &self.next_page_token, buf);
3788        }
3789        self.__buffa_unknown_fields.write_to(buf);
3790    }
3791    fn merge_field(
3792        &mut self,
3793        tag: ::buffa::encoding::Tag,
3794        buf: &mut impl ::buffa::bytes::Buf,
3795        ctx: ::buffa::DecodeContext<'_>,
3796    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3797        #[allow(unused_imports)]
3798        use ::buffa::bytes::Buf as _;
3799        #[allow(unused_imports)]
3800        use ::buffa::Enumeration as _;
3801        match tag.field_number() {
3802            1u32 => {
3803                ::buffa::encoding::check_wire_type(
3804                    tag,
3805                    ::buffa::encoding::WireType::LengthDelimited,
3806                )?;
3807                let mut elem = ::core::default::Default::default();
3808                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
3809                self.templates.push(elem);
3810            }
3811            2u32 => {
3812                ::buffa::encoding::check_wire_type(
3813                    tag,
3814                    ::buffa::encoding::WireType::LengthDelimited,
3815                )?;
3816                ::buffa::types::merge_string(&mut self.next_page_token, buf)?;
3817            }
3818            _ => {
3819                self.__buffa_unknown_fields
3820                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
3821            }
3822        }
3823        ::core::result::Result::Ok(())
3824    }
3825    fn clear(&mut self) {
3826        self.templates.clear();
3827        self.next_page_token.clear();
3828        self.__buffa_unknown_fields.clear();
3829    }
3830}
3831impl ::buffa::ExtensionSet for ListOwnerPublishedLayoutsResponse {
3832    const PROTO_FQN: &'static str = "layout.v1.ListOwnerPublishedLayoutsResponse";
3833    fn unknown_fields(&self) -> &::buffa::UnknownFields {
3834        &self.__buffa_unknown_fields
3835    }
3836    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3837        &mut self.__buffa_unknown_fields
3838    }
3839}
3840impl ::buffa::json_helpers::ProtoElemJson for ListOwnerPublishedLayoutsResponse {
3841    fn serialize_proto_json<S: ::serde::Serializer>(
3842        v: &Self,
3843        s: S,
3844    ) -> ::core::result::Result<S::Ok, S::Error> {
3845        ::serde::Serialize::serialize(v, s)
3846    }
3847    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3848        d: D,
3849    ) -> ::core::result::Result<Self, D::Error> {
3850        <Self as ::serde::Deserialize>::deserialize(d)
3851    }
3852}
3853#[doc(hidden)]
3854pub const __LIST_OWNER_PUBLISHED_LAYOUTS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3855    type_url: "type.googleapis.com/layout.v1.ListOwnerPublishedLayoutsResponse",
3856    to_json: ::buffa::type_registry::any_to_json::<ListOwnerPublishedLayoutsResponse>,
3857    from_json: ::buffa::type_registry::any_from_json::<
3858        ListOwnerPublishedLayoutsResponse,
3859    >,
3860    is_wkt: false,
3861};
3862/// ListLayoutTemplateVersionsRequest lists immutable versions for one template.
3863#[derive(Clone, PartialEq, Default)]
3864#[derive(::serde::Serialize, ::serde::Deserialize)]
3865#[serde(default)]
3866pub struct ListLayoutTemplateVersionsRequest {
3867    /// Viewer that owns the template.
3868    ///
3869    /// Field 1: `owner_id`
3870    #[serde(
3871        rename = "ownerId",
3872        alias = "owner_id",
3873        with = "::buffa::json_helpers::uint64",
3874        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
3875    )]
3876    pub owner_id: u64,
3877    /// Template identifier.
3878    ///
3879    /// Field 2: `template_id`
3880    #[serde(
3881        rename = "templateId",
3882        alias = "template_id",
3883        with = "::buffa::json_helpers::uint64",
3884        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
3885    )]
3886    pub template_id: u64,
3887    /// Maximum number of versions to return. Defaults to 100 when omitted; maximum
3888    /// is 500.
3889    ///
3890    /// Field 3: `limit`
3891    #[serde(
3892        rename = "limit",
3893        with = "::buffa::json_helpers::uint32",
3894        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
3895    )]
3896    pub limit: u32,
3897    /// Opaque keyset cursor from a previous response. The cursor is exclusive and
3898    /// bound to owner, template, and newest-version sort order.
3899    ///
3900    /// Field 4: `page_token`
3901    #[serde(
3902        rename = "pageToken",
3903        alias = "page_token",
3904        with = "::buffa::json_helpers::proto_string",
3905        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
3906    )]
3907    pub page_token: ::buffa::alloc::string::String,
3908    #[serde(skip)]
3909    #[doc(hidden)]
3910    pub __buffa_unknown_fields: ::buffa::UnknownFields,
3911}
3912impl ::core::fmt::Debug for ListLayoutTemplateVersionsRequest {
3913    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3914        f.debug_struct("ListLayoutTemplateVersionsRequest")
3915            .field("owner_id", &self.owner_id)
3916            .field("template_id", &self.template_id)
3917            .field("limit", &self.limit)
3918            .field("page_token", &self.page_token)
3919            .finish()
3920    }
3921}
3922impl ListLayoutTemplateVersionsRequest {
3923    /// Protobuf type URL for this message, for use with `Any::pack` and
3924    /// `Any::unpack_if`.
3925    ///
3926    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
3927    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListLayoutTemplateVersionsRequest";
3928}
3929::buffa::impl_default_instance!(ListLayoutTemplateVersionsRequest);
3930impl ::buffa::MessageName for ListLayoutTemplateVersionsRequest {
3931    const PACKAGE: &'static str = "layout.v1";
3932    const NAME: &'static str = "ListLayoutTemplateVersionsRequest";
3933    const FULL_NAME: &'static str = "layout.v1.ListLayoutTemplateVersionsRequest";
3934    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListLayoutTemplateVersionsRequest";
3935}
3936impl ::buffa::Message for ListLayoutTemplateVersionsRequest {
3937    /// Returns the total encoded size in bytes.
3938    ///
3939    /// The result is a `u32`; the protobuf specification requires all
3940    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
3941    /// compliant message will never overflow this type.
3942    #[allow(clippy::let_and_return)]
3943    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3944        #[allow(unused_imports)]
3945        use ::buffa::Enumeration as _;
3946        let mut size = 0u32;
3947        if self.owner_id != 0u64 {
3948            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
3949        }
3950        if self.template_id != 0u64 {
3951            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
3952        }
3953        if self.limit != 0u32 {
3954            size += 1u32 + ::buffa::types::uint32_encoded_len(self.limit) as u32;
3955        }
3956        if !self.page_token.is_empty() {
3957            size += 1u32 + ::buffa::types::string_encoded_len(&self.page_token) as u32;
3958        }
3959        size += self.__buffa_unknown_fields.encoded_len() as u32;
3960        size
3961    }
3962    fn write_to(
3963        &self,
3964        _cache: &mut ::buffa::SizeCache,
3965        buf: &mut impl ::buffa::bytes::BufMut,
3966    ) {
3967        #[allow(unused_imports)]
3968        use ::buffa::Enumeration as _;
3969        if self.owner_id != 0u64 {
3970            ::buffa::types::put_fixed64_field(1u32, self.owner_id, buf);
3971        }
3972        if self.template_id != 0u64 {
3973            ::buffa::types::put_fixed64_field(2u32, self.template_id, buf);
3974        }
3975        if self.limit != 0u32 {
3976            ::buffa::types::put_uint32_field(3u32, self.limit, buf);
3977        }
3978        if !self.page_token.is_empty() {
3979            ::buffa::types::put_string_field(4u32, &self.page_token, buf);
3980        }
3981        self.__buffa_unknown_fields.write_to(buf);
3982    }
3983    fn merge_field(
3984        &mut self,
3985        tag: ::buffa::encoding::Tag,
3986        buf: &mut impl ::buffa::bytes::Buf,
3987        ctx: ::buffa::DecodeContext<'_>,
3988    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3989        #[allow(unused_imports)]
3990        use ::buffa::bytes::Buf as _;
3991        #[allow(unused_imports)]
3992        use ::buffa::Enumeration as _;
3993        match tag.field_number() {
3994            1u32 => {
3995                ::buffa::encoding::check_wire_type(
3996                    tag,
3997                    ::buffa::encoding::WireType::Fixed64,
3998                )?;
3999                self.owner_id = ::buffa::types::decode_fixed64(buf)?;
4000            }
4001            2u32 => {
4002                ::buffa::encoding::check_wire_type(
4003                    tag,
4004                    ::buffa::encoding::WireType::Fixed64,
4005                )?;
4006                self.template_id = ::buffa::types::decode_fixed64(buf)?;
4007            }
4008            3u32 => {
4009                ::buffa::encoding::check_wire_type(
4010                    tag,
4011                    ::buffa::encoding::WireType::Varint,
4012                )?;
4013                self.limit = ::buffa::types::decode_uint32(buf)?;
4014            }
4015            4u32 => {
4016                ::buffa::encoding::check_wire_type(
4017                    tag,
4018                    ::buffa::encoding::WireType::LengthDelimited,
4019                )?;
4020                ::buffa::types::merge_string(&mut self.page_token, buf)?;
4021            }
4022            _ => {
4023                self.__buffa_unknown_fields
4024                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
4025            }
4026        }
4027        ::core::result::Result::Ok(())
4028    }
4029    fn clear(&mut self) {
4030        self.owner_id = 0u64;
4031        self.template_id = 0u64;
4032        self.limit = 0u32;
4033        self.page_token.clear();
4034        self.__buffa_unknown_fields.clear();
4035    }
4036}
4037impl ::buffa::ExtensionSet for ListLayoutTemplateVersionsRequest {
4038    const PROTO_FQN: &'static str = "layout.v1.ListLayoutTemplateVersionsRequest";
4039    fn unknown_fields(&self) -> &::buffa::UnknownFields {
4040        &self.__buffa_unknown_fields
4041    }
4042    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
4043        &mut self.__buffa_unknown_fields
4044    }
4045}
4046impl ::buffa::json_helpers::ProtoElemJson for ListLayoutTemplateVersionsRequest {
4047    fn serialize_proto_json<S: ::serde::Serializer>(
4048        v: &Self,
4049        s: S,
4050    ) -> ::core::result::Result<S::Ok, S::Error> {
4051        ::serde::Serialize::serialize(v, s)
4052    }
4053    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4054        d: D,
4055    ) -> ::core::result::Result<Self, D::Error> {
4056        <Self as ::serde::Deserialize>::deserialize(d)
4057    }
4058}
4059#[doc(hidden)]
4060pub const __LIST_LAYOUT_TEMPLATE_VERSIONS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
4061    type_url: "type.googleapis.com/layout.v1.ListLayoutTemplateVersionsRequest",
4062    to_json: ::buffa::type_registry::any_to_json::<ListLayoutTemplateVersionsRequest>,
4063    from_json: ::buffa::type_registry::any_from_json::<
4064        ListLayoutTemplateVersionsRequest,
4065    >,
4066    is_wkt: false,
4067};
4068/// ListLayoutTemplateVersionsResponse contains version metadata for a template.
4069#[derive(Clone, PartialEq, Default)]
4070#[derive(::serde::Serialize, ::serde::Deserialize)]
4071#[serde(default)]
4072pub struct ListLayoutTemplateVersionsResponse {
4073    /// Template versions, returned newest version first.
4074    ///
4075    /// Field 1: `versions`
4076    #[serde(
4077        rename = "versions",
4078        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
4079        deserialize_with = "::buffa::json_helpers::null_as_default"
4080    )]
4081    pub versions: ::buffa::alloc::vec::Vec<LayoutTemplateVersionInfo>,
4082    /// Opaque cursor for the next page. Empty when no more results exist.
4083    ///
4084    /// Field 2: `next_page_token`
4085    #[serde(
4086        rename = "nextPageToken",
4087        alias = "next_page_token",
4088        with = "::buffa::json_helpers::proto_string",
4089        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
4090    )]
4091    pub next_page_token: ::buffa::alloc::string::String,
4092    #[serde(skip)]
4093    #[doc(hidden)]
4094    pub __buffa_unknown_fields: ::buffa::UnknownFields,
4095}
4096impl ::core::fmt::Debug for ListLayoutTemplateVersionsResponse {
4097    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4098        f.debug_struct("ListLayoutTemplateVersionsResponse")
4099            .field("versions", &self.versions)
4100            .field("next_page_token", &self.next_page_token)
4101            .finish()
4102    }
4103}
4104impl ListLayoutTemplateVersionsResponse {
4105    /// Protobuf type URL for this message, for use with `Any::pack` and
4106    /// `Any::unpack_if`.
4107    ///
4108    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
4109    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListLayoutTemplateVersionsResponse";
4110}
4111::buffa::impl_default_instance!(ListLayoutTemplateVersionsResponse);
4112impl ::buffa::MessageName for ListLayoutTemplateVersionsResponse {
4113    const PACKAGE: &'static str = "layout.v1";
4114    const NAME: &'static str = "ListLayoutTemplateVersionsResponse";
4115    const FULL_NAME: &'static str = "layout.v1.ListLayoutTemplateVersionsResponse";
4116    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListLayoutTemplateVersionsResponse";
4117}
4118impl ::buffa::Message for ListLayoutTemplateVersionsResponse {
4119    /// Returns the total encoded size in bytes.
4120    ///
4121    /// The result is a `u32`; the protobuf specification requires all
4122    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
4123    /// compliant message will never overflow this type.
4124    #[allow(clippy::let_and_return)]
4125    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4126        #[allow(unused_imports)]
4127        use ::buffa::Enumeration as _;
4128        let mut size = 0u32;
4129        for v in &self.versions {
4130            let __slot = __cache.reserve();
4131            let inner_size = v.compute_size(__cache);
4132            __cache.set(__slot, inner_size);
4133            size
4134                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4135                    + inner_size;
4136        }
4137        if !self.next_page_token.is_empty() {
4138            size
4139                += 1u32
4140                    + ::buffa::types::string_encoded_len(&self.next_page_token) as u32;
4141        }
4142        size += self.__buffa_unknown_fields.encoded_len() as u32;
4143        size
4144    }
4145    fn write_to(
4146        &self,
4147        __cache: &mut ::buffa::SizeCache,
4148        buf: &mut impl ::buffa::bytes::BufMut,
4149    ) {
4150        #[allow(unused_imports)]
4151        use ::buffa::Enumeration as _;
4152        for v in &self.versions {
4153            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
4154            v.write_to(__cache, buf);
4155        }
4156        if !self.next_page_token.is_empty() {
4157            ::buffa::types::put_string_field(2u32, &self.next_page_token, buf);
4158        }
4159        self.__buffa_unknown_fields.write_to(buf);
4160    }
4161    fn merge_field(
4162        &mut self,
4163        tag: ::buffa::encoding::Tag,
4164        buf: &mut impl ::buffa::bytes::Buf,
4165        ctx: ::buffa::DecodeContext<'_>,
4166    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4167        #[allow(unused_imports)]
4168        use ::buffa::bytes::Buf as _;
4169        #[allow(unused_imports)]
4170        use ::buffa::Enumeration as _;
4171        match tag.field_number() {
4172            1u32 => {
4173                ::buffa::encoding::check_wire_type(
4174                    tag,
4175                    ::buffa::encoding::WireType::LengthDelimited,
4176                )?;
4177                let mut elem = ::core::default::Default::default();
4178                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
4179                self.versions.push(elem);
4180            }
4181            2u32 => {
4182                ::buffa::encoding::check_wire_type(
4183                    tag,
4184                    ::buffa::encoding::WireType::LengthDelimited,
4185                )?;
4186                ::buffa::types::merge_string(&mut self.next_page_token, buf)?;
4187            }
4188            _ => {
4189                self.__buffa_unknown_fields
4190                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
4191            }
4192        }
4193        ::core::result::Result::Ok(())
4194    }
4195    fn clear(&mut self) {
4196        self.versions.clear();
4197        self.next_page_token.clear();
4198        self.__buffa_unknown_fields.clear();
4199    }
4200}
4201impl ::buffa::ExtensionSet for ListLayoutTemplateVersionsResponse {
4202    const PROTO_FQN: &'static str = "layout.v1.ListLayoutTemplateVersionsResponse";
4203    fn unknown_fields(&self) -> &::buffa::UnknownFields {
4204        &self.__buffa_unknown_fields
4205    }
4206    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
4207        &mut self.__buffa_unknown_fields
4208    }
4209}
4210impl ::buffa::json_helpers::ProtoElemJson for ListLayoutTemplateVersionsResponse {
4211    fn serialize_proto_json<S: ::serde::Serializer>(
4212        v: &Self,
4213        s: S,
4214    ) -> ::core::result::Result<S::Ok, S::Error> {
4215        ::serde::Serialize::serialize(v, s)
4216    }
4217    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4218        d: D,
4219    ) -> ::core::result::Result<Self, D::Error> {
4220        <Self as ::serde::Deserialize>::deserialize(d)
4221    }
4222}
4223#[doc(hidden)]
4224pub const __LIST_LAYOUT_TEMPLATE_VERSIONS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
4225    type_url: "type.googleapis.com/layout.v1.ListLayoutTemplateVersionsResponse",
4226    to_json: ::buffa::type_registry::any_to_json::<ListLayoutTemplateVersionsResponse>,
4227    from_json: ::buffa::type_registry::any_from_json::<
4228        ListLayoutTemplateVersionsResponse,
4229    >,
4230    is_wkt: false,
4231};
4232/// GetLayoutTemplateVersionRequest fetches one immutable template version.
4233#[derive(Clone, PartialEq, Default)]
4234#[derive(::serde::Serialize, ::serde::Deserialize)]
4235#[serde(default)]
4236pub struct GetLayoutTemplateVersionRequest {
4237    /// Viewer that owns the template.
4238    ///
4239    /// Field 1: `owner_id`
4240    #[serde(
4241        rename = "ownerId",
4242        alias = "owner_id",
4243        with = "::buffa::json_helpers::uint64",
4244        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
4245    )]
4246    pub owner_id: u64,
4247    /// Template identifier.
4248    ///
4249    /// Field 2: `template_id`
4250    #[serde(
4251        rename = "templateId",
4252        alias = "template_id",
4253        with = "::buffa::json_helpers::uint64",
4254        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
4255    )]
4256    pub template_id: u64,
4257    /// Immutable version number to fetch.
4258    ///
4259    /// Field 3: `version`
4260    #[serde(
4261        rename = "version",
4262        with = "::buffa::json_helpers::uint32",
4263        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
4264    )]
4265    pub version: u32,
4266    #[serde(skip)]
4267    #[doc(hidden)]
4268    pub __buffa_unknown_fields: ::buffa::UnknownFields,
4269}
4270impl ::core::fmt::Debug for GetLayoutTemplateVersionRequest {
4271    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4272        f.debug_struct("GetLayoutTemplateVersionRequest")
4273            .field("owner_id", &self.owner_id)
4274            .field("template_id", &self.template_id)
4275            .field("version", &self.version)
4276            .finish()
4277    }
4278}
4279impl GetLayoutTemplateVersionRequest {
4280    /// Protobuf type URL for this message, for use with `Any::pack` and
4281    /// `Any::unpack_if`.
4282    ///
4283    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
4284    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutTemplateVersionRequest";
4285}
4286::buffa::impl_default_instance!(GetLayoutTemplateVersionRequest);
4287impl ::buffa::MessageName for GetLayoutTemplateVersionRequest {
4288    const PACKAGE: &'static str = "layout.v1";
4289    const NAME: &'static str = "GetLayoutTemplateVersionRequest";
4290    const FULL_NAME: &'static str = "layout.v1.GetLayoutTemplateVersionRequest";
4291    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutTemplateVersionRequest";
4292}
4293impl ::buffa::Message for GetLayoutTemplateVersionRequest {
4294    /// Returns the total encoded size in bytes.
4295    ///
4296    /// The result is a `u32`; the protobuf specification requires all
4297    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
4298    /// compliant message will never overflow this type.
4299    #[allow(clippy::let_and_return)]
4300    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
4301        #[allow(unused_imports)]
4302        use ::buffa::Enumeration as _;
4303        let mut size = 0u32;
4304        if self.owner_id != 0u64 {
4305            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
4306        }
4307        if self.template_id != 0u64 {
4308            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
4309        }
4310        if self.version != 0u32 {
4311            size += 1u32 + ::buffa::types::uint32_encoded_len(self.version) as u32;
4312        }
4313        size += self.__buffa_unknown_fields.encoded_len() as u32;
4314        size
4315    }
4316    fn write_to(
4317        &self,
4318        _cache: &mut ::buffa::SizeCache,
4319        buf: &mut impl ::buffa::bytes::BufMut,
4320    ) {
4321        #[allow(unused_imports)]
4322        use ::buffa::Enumeration as _;
4323        if self.owner_id != 0u64 {
4324            ::buffa::types::put_fixed64_field(1u32, self.owner_id, buf);
4325        }
4326        if self.template_id != 0u64 {
4327            ::buffa::types::put_fixed64_field(2u32, self.template_id, buf);
4328        }
4329        if self.version != 0u32 {
4330            ::buffa::types::put_uint32_field(3u32, self.version, buf);
4331        }
4332        self.__buffa_unknown_fields.write_to(buf);
4333    }
4334    fn merge_field(
4335        &mut self,
4336        tag: ::buffa::encoding::Tag,
4337        buf: &mut impl ::buffa::bytes::Buf,
4338        ctx: ::buffa::DecodeContext<'_>,
4339    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4340        #[allow(unused_imports)]
4341        use ::buffa::bytes::Buf as _;
4342        #[allow(unused_imports)]
4343        use ::buffa::Enumeration as _;
4344        match tag.field_number() {
4345            1u32 => {
4346                ::buffa::encoding::check_wire_type(
4347                    tag,
4348                    ::buffa::encoding::WireType::Fixed64,
4349                )?;
4350                self.owner_id = ::buffa::types::decode_fixed64(buf)?;
4351            }
4352            2u32 => {
4353                ::buffa::encoding::check_wire_type(
4354                    tag,
4355                    ::buffa::encoding::WireType::Fixed64,
4356                )?;
4357                self.template_id = ::buffa::types::decode_fixed64(buf)?;
4358            }
4359            3u32 => {
4360                ::buffa::encoding::check_wire_type(
4361                    tag,
4362                    ::buffa::encoding::WireType::Varint,
4363                )?;
4364                self.version = ::buffa::types::decode_uint32(buf)?;
4365            }
4366            _ => {
4367                self.__buffa_unknown_fields
4368                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
4369            }
4370        }
4371        ::core::result::Result::Ok(())
4372    }
4373    fn clear(&mut self) {
4374        self.owner_id = 0u64;
4375        self.template_id = 0u64;
4376        self.version = 0u32;
4377        self.__buffa_unknown_fields.clear();
4378    }
4379}
4380impl ::buffa::ExtensionSet for GetLayoutTemplateVersionRequest {
4381    const PROTO_FQN: &'static str = "layout.v1.GetLayoutTemplateVersionRequest";
4382    fn unknown_fields(&self) -> &::buffa::UnknownFields {
4383        &self.__buffa_unknown_fields
4384    }
4385    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
4386        &mut self.__buffa_unknown_fields
4387    }
4388}
4389impl ::buffa::json_helpers::ProtoElemJson for GetLayoutTemplateVersionRequest {
4390    fn serialize_proto_json<S: ::serde::Serializer>(
4391        v: &Self,
4392        s: S,
4393    ) -> ::core::result::Result<S::Ok, S::Error> {
4394        ::serde::Serialize::serialize(v, s)
4395    }
4396    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4397        d: D,
4398    ) -> ::core::result::Result<Self, D::Error> {
4399        <Self as ::serde::Deserialize>::deserialize(d)
4400    }
4401}
4402#[doc(hidden)]
4403pub const __GET_LAYOUT_TEMPLATE_VERSION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
4404    type_url: "type.googleapis.com/layout.v1.GetLayoutTemplateVersionRequest",
4405    to_json: ::buffa::type_registry::any_to_json::<GetLayoutTemplateVersionRequest>,
4406    from_json: ::buffa::type_registry::any_from_json::<GetLayoutTemplateVersionRequest>,
4407    is_wkt: false,
4408};
4409/// GetLayoutTemplateVersionResponse returns one immutable template snapshot.
4410#[derive(Clone, PartialEq, Default)]
4411#[derive(::serde::Serialize, ::serde::Deserialize)]
4412#[serde(default)]
4413pub struct GetLayoutTemplateVersionResponse {
4414    /// Layout snapshot captured for the requested version.
4415    ///
4416    /// Field 1: `layout`
4417    #[serde(
4418        rename = "layout",
4419        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
4420    )]
4421    pub layout: ::buffa::MessageField<Layout>,
4422    /// Viewer that owns the template.
4423    ///
4424    /// Field 2: `owner_id`
4425    #[serde(
4426        rename = "ownerId",
4427        alias = "owner_id",
4428        with = "::buffa::json_helpers::uint64",
4429        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
4430    )]
4431    pub owner_id: u64,
4432    /// Template identifier.
4433    ///
4434    /// Field 3: `template_id`
4435    #[serde(
4436        rename = "templateId",
4437        alias = "template_id",
4438        with = "::buffa::json_helpers::uint64",
4439        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
4440    )]
4441    pub template_id: u64,
4442    /// Immutable version number returned.
4443    ///
4444    /// Field 4: `version`
4445    #[serde(
4446        rename = "version",
4447        with = "::buffa::json_helpers::uint32",
4448        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
4449    )]
4450    pub version: u32,
4451    #[serde(skip)]
4452    #[doc(hidden)]
4453    pub __buffa_unknown_fields: ::buffa::UnknownFields,
4454}
4455impl ::core::fmt::Debug for GetLayoutTemplateVersionResponse {
4456    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4457        f.debug_struct("GetLayoutTemplateVersionResponse")
4458            .field("layout", &self.layout)
4459            .field("owner_id", &self.owner_id)
4460            .field("template_id", &self.template_id)
4461            .field("version", &self.version)
4462            .finish()
4463    }
4464}
4465impl GetLayoutTemplateVersionResponse {
4466    /// Protobuf type URL for this message, for use with `Any::pack` and
4467    /// `Any::unpack_if`.
4468    ///
4469    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
4470    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutTemplateVersionResponse";
4471}
4472::buffa::impl_default_instance!(GetLayoutTemplateVersionResponse);
4473impl ::buffa::MessageName for GetLayoutTemplateVersionResponse {
4474    const PACKAGE: &'static str = "layout.v1";
4475    const NAME: &'static str = "GetLayoutTemplateVersionResponse";
4476    const FULL_NAME: &'static str = "layout.v1.GetLayoutTemplateVersionResponse";
4477    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutTemplateVersionResponse";
4478}
4479impl ::buffa::Message for GetLayoutTemplateVersionResponse {
4480    /// Returns the total encoded size in bytes.
4481    ///
4482    /// The result is a `u32`; the protobuf specification requires all
4483    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
4484    /// compliant message will never overflow this type.
4485    #[allow(clippy::let_and_return)]
4486    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4487        #[allow(unused_imports)]
4488        use ::buffa::Enumeration as _;
4489        let mut size = 0u32;
4490        if self.layout.is_set() {
4491            let __slot = __cache.reserve();
4492            let inner_size = self.layout.compute_size(__cache);
4493            __cache.set(__slot, inner_size);
4494            size
4495                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4496                    + inner_size;
4497        }
4498        if self.owner_id != 0u64 {
4499            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
4500        }
4501        if self.template_id != 0u64 {
4502            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
4503        }
4504        if self.version != 0u32 {
4505            size += 1u32 + ::buffa::types::uint32_encoded_len(self.version) as u32;
4506        }
4507        size += self.__buffa_unknown_fields.encoded_len() as u32;
4508        size
4509    }
4510    fn write_to(
4511        &self,
4512        __cache: &mut ::buffa::SizeCache,
4513        buf: &mut impl ::buffa::bytes::BufMut,
4514    ) {
4515        #[allow(unused_imports)]
4516        use ::buffa::Enumeration as _;
4517        if self.layout.is_set() {
4518            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
4519            self.layout.write_to(__cache, buf);
4520        }
4521        if self.owner_id != 0u64 {
4522            ::buffa::types::put_fixed64_field(2u32, self.owner_id, buf);
4523        }
4524        if self.template_id != 0u64 {
4525            ::buffa::types::put_fixed64_field(3u32, self.template_id, buf);
4526        }
4527        if self.version != 0u32 {
4528            ::buffa::types::put_uint32_field(4u32, self.version, buf);
4529        }
4530        self.__buffa_unknown_fields.write_to(buf);
4531    }
4532    fn merge_field(
4533        &mut self,
4534        tag: ::buffa::encoding::Tag,
4535        buf: &mut impl ::buffa::bytes::Buf,
4536        ctx: ::buffa::DecodeContext<'_>,
4537    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4538        #[allow(unused_imports)]
4539        use ::buffa::bytes::Buf as _;
4540        #[allow(unused_imports)]
4541        use ::buffa::Enumeration as _;
4542        match tag.field_number() {
4543            1u32 => {
4544                ::buffa::encoding::check_wire_type(
4545                    tag,
4546                    ::buffa::encoding::WireType::LengthDelimited,
4547                )?;
4548                ::buffa::Message::merge_length_delimited(
4549                    self.layout.get_or_insert_default(),
4550                    buf,
4551                    ctx,
4552                )?;
4553            }
4554            2u32 => {
4555                ::buffa::encoding::check_wire_type(
4556                    tag,
4557                    ::buffa::encoding::WireType::Fixed64,
4558                )?;
4559                self.owner_id = ::buffa::types::decode_fixed64(buf)?;
4560            }
4561            3u32 => {
4562                ::buffa::encoding::check_wire_type(
4563                    tag,
4564                    ::buffa::encoding::WireType::Fixed64,
4565                )?;
4566                self.template_id = ::buffa::types::decode_fixed64(buf)?;
4567            }
4568            4u32 => {
4569                ::buffa::encoding::check_wire_type(
4570                    tag,
4571                    ::buffa::encoding::WireType::Varint,
4572                )?;
4573                self.version = ::buffa::types::decode_uint32(buf)?;
4574            }
4575            _ => {
4576                self.__buffa_unknown_fields
4577                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
4578            }
4579        }
4580        ::core::result::Result::Ok(())
4581    }
4582    fn clear(&mut self) {
4583        self.layout = ::buffa::MessageField::none();
4584        self.owner_id = 0u64;
4585        self.template_id = 0u64;
4586        self.version = 0u32;
4587        self.__buffa_unknown_fields.clear();
4588    }
4589}
4590impl ::buffa::ExtensionSet for GetLayoutTemplateVersionResponse {
4591    const PROTO_FQN: &'static str = "layout.v1.GetLayoutTemplateVersionResponse";
4592    fn unknown_fields(&self) -> &::buffa::UnknownFields {
4593        &self.__buffa_unknown_fields
4594    }
4595    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
4596        &mut self.__buffa_unknown_fields
4597    }
4598}
4599impl ::buffa::json_helpers::ProtoElemJson for GetLayoutTemplateVersionResponse {
4600    fn serialize_proto_json<S: ::serde::Serializer>(
4601        v: &Self,
4602        s: S,
4603    ) -> ::core::result::Result<S::Ok, S::Error> {
4604        ::serde::Serialize::serialize(v, s)
4605    }
4606    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4607        d: D,
4608    ) -> ::core::result::Result<Self, D::Error> {
4609        <Self as ::serde::Deserialize>::deserialize(d)
4610    }
4611}
4612#[doc(hidden)]
4613pub const __GET_LAYOUT_TEMPLATE_VERSION_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
4614    type_url: "type.googleapis.com/layout.v1.GetLayoutTemplateVersionResponse",
4615    to_json: ::buffa::type_registry::any_to_json::<GetLayoutTemplateVersionResponse>,
4616    from_json: ::buffa::type_registry::any_from_json::<GetLayoutTemplateVersionResponse>,
4617    is_wkt: false,
4618};
4619/// PublishLayoutRequest creates a new immutable template version from a saved layout.
4620#[derive(Clone, PartialEq, Default)]
4621#[derive(::serde::Serialize, ::serde::Deserialize)]
4622#[serde(default)]
4623pub struct PublishLayoutRequest {
4624    /// Saved layout identifier to publish.
4625    ///
4626    /// Field 1: `layout_id`
4627    #[serde(
4628        rename = "layoutId",
4629        alias = "layout_id",
4630        with = "::buffa::json_helpers::uint64",
4631        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
4632    )]
4633    pub layout_id: u64,
4634    /// Public display title.
4635    ///
4636    /// Field 2: `title`
4637    #[serde(
4638        rename = "title",
4639        with = "::buffa::json_helpers::proto_string",
4640        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
4641    )]
4642    pub title: ::buffa::alloc::string::String,
4643    /// Public description shown with the template.
4644    ///
4645    /// Field 3: `description`
4646    #[serde(
4647        rename = "description",
4648        with = "::buffa::json_helpers::proto_string",
4649        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
4650    )]
4651    pub description: ::buffa::alloc::string::String,
4652    /// Public tags used for grouping or filtering.
4653    ///
4654    /// Field 4: `tags`
4655    #[serde(
4656        rename = "tags",
4657        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
4658        deserialize_with = "::buffa::json_helpers::null_as_default"
4659    )]
4660    pub tags: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
4661    /// True when the template should appear in discovery listings.
4662    ///
4663    /// Field 5: `is_listed`
4664    #[serde(
4665        rename = "isListed",
4666        alias = "is_listed",
4667        with = "::buffa::json_helpers::proto_bool",
4668        skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
4669    )]
4670    pub is_listed: bool,
4671    /// Optional release notes for the new immutable version.
4672    ///
4673    /// Field 6: `changelog`
4674    #[serde(
4675        rename = "changelog",
4676        with = "::buffa::json_helpers::proto_string",
4677        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
4678    )]
4679    pub changelog: ::buffa::alloc::string::String,
4680    #[serde(skip)]
4681    #[doc(hidden)]
4682    pub __buffa_unknown_fields: ::buffa::UnknownFields,
4683}
4684impl ::core::fmt::Debug for PublishLayoutRequest {
4685    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4686        f.debug_struct("PublishLayoutRequest")
4687            .field("layout_id", &self.layout_id)
4688            .field("title", &self.title)
4689            .field("description", &self.description)
4690            .field("tags", &self.tags)
4691            .field("is_listed", &self.is_listed)
4692            .field("changelog", &self.changelog)
4693            .finish()
4694    }
4695}
4696impl PublishLayoutRequest {
4697    /// Protobuf type URL for this message, for use with `Any::pack` and
4698    /// `Any::unpack_if`.
4699    ///
4700    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
4701    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.PublishLayoutRequest";
4702}
4703::buffa::impl_default_instance!(PublishLayoutRequest);
4704impl ::buffa::MessageName for PublishLayoutRequest {
4705    const PACKAGE: &'static str = "layout.v1";
4706    const NAME: &'static str = "PublishLayoutRequest";
4707    const FULL_NAME: &'static str = "layout.v1.PublishLayoutRequest";
4708    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.PublishLayoutRequest";
4709}
4710impl ::buffa::Message for PublishLayoutRequest {
4711    /// Returns the total encoded size in bytes.
4712    ///
4713    /// The result is a `u32`; the protobuf specification requires all
4714    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
4715    /// compliant message will never overflow this type.
4716    #[allow(clippy::let_and_return)]
4717    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
4718        #[allow(unused_imports)]
4719        use ::buffa::Enumeration as _;
4720        let mut size = 0u32;
4721        if self.layout_id != 0u64 {
4722            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
4723        }
4724        if !self.title.is_empty() {
4725            size += 1u32 + ::buffa::types::string_encoded_len(&self.title) as u32;
4726        }
4727        if !self.description.is_empty() {
4728            size += 1u32 + ::buffa::types::string_encoded_len(&self.description) as u32;
4729        }
4730        for v in &self.tags {
4731            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4732        }
4733        if self.is_listed {
4734            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
4735        }
4736        if !self.changelog.is_empty() {
4737            size += 1u32 + ::buffa::types::string_encoded_len(&self.changelog) as u32;
4738        }
4739        size += self.__buffa_unknown_fields.encoded_len() as u32;
4740        size
4741    }
4742    fn write_to(
4743        &self,
4744        _cache: &mut ::buffa::SizeCache,
4745        buf: &mut impl ::buffa::bytes::BufMut,
4746    ) {
4747        #[allow(unused_imports)]
4748        use ::buffa::Enumeration as _;
4749        if self.layout_id != 0u64 {
4750            ::buffa::types::put_fixed64_field(1u32, self.layout_id, buf);
4751        }
4752        if !self.title.is_empty() {
4753            ::buffa::types::put_string_field(2u32, &self.title, buf);
4754        }
4755        if !self.description.is_empty() {
4756            ::buffa::types::put_string_field(3u32, &self.description, buf);
4757        }
4758        for v in &self.tags {
4759            ::buffa::types::put_string_field(4u32, v, buf);
4760        }
4761        if self.is_listed {
4762            ::buffa::types::put_bool_field(5u32, self.is_listed, buf);
4763        }
4764        if !self.changelog.is_empty() {
4765            ::buffa::types::put_string_field(6u32, &self.changelog, buf);
4766        }
4767        self.__buffa_unknown_fields.write_to(buf);
4768    }
4769    fn merge_field(
4770        &mut self,
4771        tag: ::buffa::encoding::Tag,
4772        buf: &mut impl ::buffa::bytes::Buf,
4773        ctx: ::buffa::DecodeContext<'_>,
4774    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4775        #[allow(unused_imports)]
4776        use ::buffa::bytes::Buf as _;
4777        #[allow(unused_imports)]
4778        use ::buffa::Enumeration as _;
4779        match tag.field_number() {
4780            1u32 => {
4781                ::buffa::encoding::check_wire_type(
4782                    tag,
4783                    ::buffa::encoding::WireType::Fixed64,
4784                )?;
4785                self.layout_id = ::buffa::types::decode_fixed64(buf)?;
4786            }
4787            2u32 => {
4788                ::buffa::encoding::check_wire_type(
4789                    tag,
4790                    ::buffa::encoding::WireType::LengthDelimited,
4791                )?;
4792                ::buffa::types::merge_string(&mut self.title, buf)?;
4793            }
4794            3u32 => {
4795                ::buffa::encoding::check_wire_type(
4796                    tag,
4797                    ::buffa::encoding::WireType::LengthDelimited,
4798                )?;
4799                ::buffa::types::merge_string(&mut self.description, buf)?;
4800            }
4801            4u32 => {
4802                ::buffa::encoding::check_wire_type(
4803                    tag,
4804                    ::buffa::encoding::WireType::LengthDelimited,
4805                )?;
4806                self.tags.push(::buffa::types::decode_string(buf)?);
4807            }
4808            5u32 => {
4809                ::buffa::encoding::check_wire_type(
4810                    tag,
4811                    ::buffa::encoding::WireType::Varint,
4812                )?;
4813                self.is_listed = ::buffa::types::decode_bool(buf)?;
4814            }
4815            6u32 => {
4816                ::buffa::encoding::check_wire_type(
4817                    tag,
4818                    ::buffa::encoding::WireType::LengthDelimited,
4819                )?;
4820                ::buffa::types::merge_string(&mut self.changelog, buf)?;
4821            }
4822            _ => {
4823                self.__buffa_unknown_fields
4824                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
4825            }
4826        }
4827        ::core::result::Result::Ok(())
4828    }
4829    fn clear(&mut self) {
4830        self.layout_id = 0u64;
4831        self.title.clear();
4832        self.description.clear();
4833        self.tags.clear();
4834        self.is_listed = false;
4835        self.changelog.clear();
4836        self.__buffa_unknown_fields.clear();
4837    }
4838}
4839impl ::buffa::ExtensionSet for PublishLayoutRequest {
4840    const PROTO_FQN: &'static str = "layout.v1.PublishLayoutRequest";
4841    fn unknown_fields(&self) -> &::buffa::UnknownFields {
4842        &self.__buffa_unknown_fields
4843    }
4844    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
4845        &mut self.__buffa_unknown_fields
4846    }
4847}
4848impl ::buffa::json_helpers::ProtoElemJson for PublishLayoutRequest {
4849    fn serialize_proto_json<S: ::serde::Serializer>(
4850        v: &Self,
4851        s: S,
4852    ) -> ::core::result::Result<S::Ok, S::Error> {
4853        ::serde::Serialize::serialize(v, s)
4854    }
4855    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4856        d: D,
4857    ) -> ::core::result::Result<Self, D::Error> {
4858        <Self as ::serde::Deserialize>::deserialize(d)
4859    }
4860}
4861#[doc(hidden)]
4862pub const __PUBLISH_LAYOUT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
4863    type_url: "type.googleapis.com/layout.v1.PublishLayoutRequest",
4864    to_json: ::buffa::type_registry::any_to_json::<PublishLayoutRequest>,
4865    from_json: ::buffa::type_registry::any_from_json::<PublishLayoutRequest>,
4866    is_wkt: false,
4867};
4868/// PublishLayoutResponse returns the published template and version number.
4869#[derive(Clone, PartialEq, Default)]
4870#[derive(::serde::Serialize, ::serde::Deserialize)]
4871#[serde(default)]
4872pub struct PublishLayoutResponse {
4873    /// Published template metadata after the update.
4874    ///
4875    /// Field 1: `template`
4876    #[serde(
4877        rename = "template",
4878        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
4879    )]
4880    pub template: ::buffa::MessageField<LayoutTemplate>,
4881    /// Immutable version number created by this publish operation.
4882    ///
4883    /// Field 2: `version`
4884    #[serde(
4885        rename = "version",
4886        with = "::buffa::json_helpers::uint32",
4887        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
4888    )]
4889    pub version: u32,
4890    #[serde(skip)]
4891    #[doc(hidden)]
4892    pub __buffa_unknown_fields: ::buffa::UnknownFields,
4893}
4894impl ::core::fmt::Debug for PublishLayoutResponse {
4895    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4896        f.debug_struct("PublishLayoutResponse")
4897            .field("template", &self.template)
4898            .field("version", &self.version)
4899            .finish()
4900    }
4901}
4902impl PublishLayoutResponse {
4903    /// Protobuf type URL for this message, for use with `Any::pack` and
4904    /// `Any::unpack_if`.
4905    ///
4906    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
4907    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.PublishLayoutResponse";
4908}
4909::buffa::impl_default_instance!(PublishLayoutResponse);
4910impl ::buffa::MessageName for PublishLayoutResponse {
4911    const PACKAGE: &'static str = "layout.v1";
4912    const NAME: &'static str = "PublishLayoutResponse";
4913    const FULL_NAME: &'static str = "layout.v1.PublishLayoutResponse";
4914    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.PublishLayoutResponse";
4915}
4916impl ::buffa::Message for PublishLayoutResponse {
4917    /// Returns the total encoded size in bytes.
4918    ///
4919    /// The result is a `u32`; the protobuf specification requires all
4920    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
4921    /// compliant message will never overflow this type.
4922    #[allow(clippy::let_and_return)]
4923    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4924        #[allow(unused_imports)]
4925        use ::buffa::Enumeration as _;
4926        let mut size = 0u32;
4927        if self.template.is_set() {
4928            let __slot = __cache.reserve();
4929            let inner_size = self.template.compute_size(__cache);
4930            __cache.set(__slot, inner_size);
4931            size
4932                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4933                    + inner_size;
4934        }
4935        if self.version != 0u32 {
4936            size += 1u32 + ::buffa::types::uint32_encoded_len(self.version) as u32;
4937        }
4938        size += self.__buffa_unknown_fields.encoded_len() as u32;
4939        size
4940    }
4941    fn write_to(
4942        &self,
4943        __cache: &mut ::buffa::SizeCache,
4944        buf: &mut impl ::buffa::bytes::BufMut,
4945    ) {
4946        #[allow(unused_imports)]
4947        use ::buffa::Enumeration as _;
4948        if self.template.is_set() {
4949            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
4950            self.template.write_to(__cache, buf);
4951        }
4952        if self.version != 0u32 {
4953            ::buffa::types::put_uint32_field(2u32, self.version, buf);
4954        }
4955        self.__buffa_unknown_fields.write_to(buf);
4956    }
4957    fn merge_field(
4958        &mut self,
4959        tag: ::buffa::encoding::Tag,
4960        buf: &mut impl ::buffa::bytes::Buf,
4961        ctx: ::buffa::DecodeContext<'_>,
4962    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4963        #[allow(unused_imports)]
4964        use ::buffa::bytes::Buf as _;
4965        #[allow(unused_imports)]
4966        use ::buffa::Enumeration as _;
4967        match tag.field_number() {
4968            1u32 => {
4969                ::buffa::encoding::check_wire_type(
4970                    tag,
4971                    ::buffa::encoding::WireType::LengthDelimited,
4972                )?;
4973                ::buffa::Message::merge_length_delimited(
4974                    self.template.get_or_insert_default(),
4975                    buf,
4976                    ctx,
4977                )?;
4978            }
4979            2u32 => {
4980                ::buffa::encoding::check_wire_type(
4981                    tag,
4982                    ::buffa::encoding::WireType::Varint,
4983                )?;
4984                self.version = ::buffa::types::decode_uint32(buf)?;
4985            }
4986            _ => {
4987                self.__buffa_unknown_fields
4988                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
4989            }
4990        }
4991        ::core::result::Result::Ok(())
4992    }
4993    fn clear(&mut self) {
4994        self.template = ::buffa::MessageField::none();
4995        self.version = 0u32;
4996        self.__buffa_unknown_fields.clear();
4997    }
4998}
4999impl ::buffa::ExtensionSet for PublishLayoutResponse {
5000    const PROTO_FQN: &'static str = "layout.v1.PublishLayoutResponse";
5001    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5002        &self.__buffa_unknown_fields
5003    }
5004    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5005        &mut self.__buffa_unknown_fields
5006    }
5007}
5008impl ::buffa::json_helpers::ProtoElemJson for PublishLayoutResponse {
5009    fn serialize_proto_json<S: ::serde::Serializer>(
5010        v: &Self,
5011        s: S,
5012    ) -> ::core::result::Result<S::Ok, S::Error> {
5013        ::serde::Serialize::serialize(v, s)
5014    }
5015    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5016        d: D,
5017    ) -> ::core::result::Result<Self, D::Error> {
5018        <Self as ::serde::Deserialize>::deserialize(d)
5019    }
5020}
5021#[doc(hidden)]
5022pub const __PUBLISH_LAYOUT_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5023    type_url: "type.googleapis.com/layout.v1.PublishLayoutResponse",
5024    to_json: ::buffa::type_registry::any_to_json::<PublishLayoutResponse>,
5025    from_json: ::buffa::type_registry::any_from_json::<PublishLayoutResponse>,
5026    is_wkt: false,
5027};
5028/// UnpublishLayoutRequest removes a template from discovery listings.
5029#[derive(Clone, PartialEq, Default)]
5030#[derive(::serde::Serialize, ::serde::Deserialize)]
5031#[serde(default)]
5032pub struct UnpublishLayoutRequest {
5033    /// Removes the template from discovery (unlisted). Versions and share links remain.
5034    ///
5035    /// Field 1: `template_id`
5036    #[serde(
5037        rename = "templateId",
5038        alias = "template_id",
5039        with = "::buffa::json_helpers::uint64",
5040        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
5041    )]
5042    pub template_id: u64,
5043    #[serde(skip)]
5044    #[doc(hidden)]
5045    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5046}
5047impl ::core::fmt::Debug for UnpublishLayoutRequest {
5048    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5049        f.debug_struct("UnpublishLayoutRequest")
5050            .field("template_id", &self.template_id)
5051            .finish()
5052    }
5053}
5054impl UnpublishLayoutRequest {
5055    /// Protobuf type URL for this message, for use with `Any::pack` and
5056    /// `Any::unpack_if`.
5057    ///
5058    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5059    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.UnpublishLayoutRequest";
5060}
5061::buffa::impl_default_instance!(UnpublishLayoutRequest);
5062impl ::buffa::MessageName for UnpublishLayoutRequest {
5063    const PACKAGE: &'static str = "layout.v1";
5064    const NAME: &'static str = "UnpublishLayoutRequest";
5065    const FULL_NAME: &'static str = "layout.v1.UnpublishLayoutRequest";
5066    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.UnpublishLayoutRequest";
5067}
5068impl ::buffa::Message for UnpublishLayoutRequest {
5069    /// Returns the total encoded size in bytes.
5070    ///
5071    /// The result is a `u32`; the protobuf specification requires all
5072    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5073    /// compliant message will never overflow this type.
5074    #[allow(clippy::let_and_return)]
5075    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5076        #[allow(unused_imports)]
5077        use ::buffa::Enumeration as _;
5078        let mut size = 0u32;
5079        if self.template_id != 0u64 {
5080            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
5081        }
5082        size += self.__buffa_unknown_fields.encoded_len() as u32;
5083        size
5084    }
5085    fn write_to(
5086        &self,
5087        _cache: &mut ::buffa::SizeCache,
5088        buf: &mut impl ::buffa::bytes::BufMut,
5089    ) {
5090        #[allow(unused_imports)]
5091        use ::buffa::Enumeration as _;
5092        if self.template_id != 0u64 {
5093            ::buffa::types::put_fixed64_field(1u32, self.template_id, buf);
5094        }
5095        self.__buffa_unknown_fields.write_to(buf);
5096    }
5097    fn merge_field(
5098        &mut self,
5099        tag: ::buffa::encoding::Tag,
5100        buf: &mut impl ::buffa::bytes::Buf,
5101        ctx: ::buffa::DecodeContext<'_>,
5102    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5103        #[allow(unused_imports)]
5104        use ::buffa::bytes::Buf as _;
5105        #[allow(unused_imports)]
5106        use ::buffa::Enumeration as _;
5107        match tag.field_number() {
5108            1u32 => {
5109                ::buffa::encoding::check_wire_type(
5110                    tag,
5111                    ::buffa::encoding::WireType::Fixed64,
5112                )?;
5113                self.template_id = ::buffa::types::decode_fixed64(buf)?;
5114            }
5115            _ => {
5116                self.__buffa_unknown_fields
5117                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5118            }
5119        }
5120        ::core::result::Result::Ok(())
5121    }
5122    fn clear(&mut self) {
5123        self.template_id = 0u64;
5124        self.__buffa_unknown_fields.clear();
5125    }
5126}
5127impl ::buffa::ExtensionSet for UnpublishLayoutRequest {
5128    const PROTO_FQN: &'static str = "layout.v1.UnpublishLayoutRequest";
5129    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5130        &self.__buffa_unknown_fields
5131    }
5132    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5133        &mut self.__buffa_unknown_fields
5134    }
5135}
5136impl ::buffa::json_helpers::ProtoElemJson for UnpublishLayoutRequest {
5137    fn serialize_proto_json<S: ::serde::Serializer>(
5138        v: &Self,
5139        s: S,
5140    ) -> ::core::result::Result<S::Ok, S::Error> {
5141        ::serde::Serialize::serialize(v, s)
5142    }
5143    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5144        d: D,
5145    ) -> ::core::result::Result<Self, D::Error> {
5146        <Self as ::serde::Deserialize>::deserialize(d)
5147    }
5148}
5149#[doc(hidden)]
5150pub const __UNPUBLISH_LAYOUT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5151    type_url: "type.googleapis.com/layout.v1.UnpublishLayoutRequest",
5152    to_json: ::buffa::type_registry::any_to_json::<UnpublishLayoutRequest>,
5153    from_json: ::buffa::type_registry::any_from_json::<UnpublishLayoutRequest>,
5154    is_wkt: false,
5155};
5156/// UnpublishLayoutResponse is empty when the template was removed from discovery.
5157#[derive(Clone, PartialEq, Default)]
5158#[derive(::serde::Serialize, ::serde::Deserialize)]
5159#[serde(default)]
5160pub struct UnpublishLayoutResponse {
5161    #[serde(skip)]
5162    #[doc(hidden)]
5163    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5164}
5165impl ::core::fmt::Debug for UnpublishLayoutResponse {
5166    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5167        f.debug_struct("UnpublishLayoutResponse").finish()
5168    }
5169}
5170impl UnpublishLayoutResponse {
5171    /// Protobuf type URL for this message, for use with `Any::pack` and
5172    /// `Any::unpack_if`.
5173    ///
5174    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5175    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.UnpublishLayoutResponse";
5176}
5177::buffa::impl_default_instance!(UnpublishLayoutResponse);
5178impl ::buffa::MessageName for UnpublishLayoutResponse {
5179    const PACKAGE: &'static str = "layout.v1";
5180    const NAME: &'static str = "UnpublishLayoutResponse";
5181    const FULL_NAME: &'static str = "layout.v1.UnpublishLayoutResponse";
5182    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.UnpublishLayoutResponse";
5183}
5184impl ::buffa::Message for UnpublishLayoutResponse {
5185    /// Returns the total encoded size in bytes.
5186    ///
5187    /// The result is a `u32`; the protobuf specification requires all
5188    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5189    /// compliant message will never overflow this type.
5190    #[allow(clippy::let_and_return)]
5191    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5192        #[allow(unused_imports)]
5193        use ::buffa::Enumeration as _;
5194        let mut size = 0u32;
5195        size += self.__buffa_unknown_fields.encoded_len() as u32;
5196        size
5197    }
5198    fn write_to(
5199        &self,
5200        _cache: &mut ::buffa::SizeCache,
5201        buf: &mut impl ::buffa::bytes::BufMut,
5202    ) {
5203        #[allow(unused_imports)]
5204        use ::buffa::Enumeration as _;
5205        self.__buffa_unknown_fields.write_to(buf);
5206    }
5207    fn merge_field(
5208        &mut self,
5209        tag: ::buffa::encoding::Tag,
5210        buf: &mut impl ::buffa::bytes::Buf,
5211        ctx: ::buffa::DecodeContext<'_>,
5212    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5213        #[allow(unused_imports)]
5214        use ::buffa::bytes::Buf as _;
5215        #[allow(unused_imports)]
5216        use ::buffa::Enumeration as _;
5217        match tag.field_number() {
5218            _ => {
5219                self.__buffa_unknown_fields
5220                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5221            }
5222        }
5223        ::core::result::Result::Ok(())
5224    }
5225    fn clear(&mut self) {
5226        self.__buffa_unknown_fields.clear();
5227    }
5228}
5229impl ::buffa::ExtensionSet for UnpublishLayoutResponse {
5230    const PROTO_FQN: &'static str = "layout.v1.UnpublishLayoutResponse";
5231    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5232        &self.__buffa_unknown_fields
5233    }
5234    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5235        &mut self.__buffa_unknown_fields
5236    }
5237}
5238impl ::buffa::json_helpers::ProtoElemJson for UnpublishLayoutResponse {
5239    fn serialize_proto_json<S: ::serde::Serializer>(
5240        v: &Self,
5241        s: S,
5242    ) -> ::core::result::Result<S::Ok, S::Error> {
5243        ::serde::Serialize::serialize(v, s)
5244    }
5245    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5246        d: D,
5247    ) -> ::core::result::Result<Self, D::Error> {
5248        <Self as ::serde::Deserialize>::deserialize(d)
5249    }
5250}
5251#[doc(hidden)]
5252pub const __UNPUBLISH_LAYOUT_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5253    type_url: "type.googleapis.com/layout.v1.UnpublishLayoutResponse",
5254    to_json: ::buffa::type_registry::any_to_json::<UnpublishLayoutResponse>,
5255    from_json: ::buffa::type_registry::any_from_json::<UnpublishLayoutResponse>,
5256    is_wkt: false,
5257};
5258/// SetLayoutTemplateSubscriptionRequest follows a template by tracking latest or pinning a version.
5259#[derive(Clone, PartialEq, Default)]
5260#[derive(::serde::Serialize, ::serde::Deserialize)]
5261#[serde(default)]
5262pub struct SetLayoutTemplateSubscriptionRequest {
5263    /// Viewer that owns the template.
5264    ///
5265    /// Field 1: `owner_id`
5266    #[serde(
5267        rename = "ownerId",
5268        alias = "owner_id",
5269        with = "::buffa::json_helpers::uint64",
5270        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
5271    )]
5272    pub owner_id: u64,
5273    /// Template identifier to follow.
5274    ///
5275    /// Field 2: `template_id`
5276    #[serde(
5277        rename = "templateId",
5278        alias = "template_id",
5279        with = "::buffa::json_helpers::uint64",
5280        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
5281    )]
5282    pub template_id: u64,
5283    /// True to follow the latest version automatically.
5284    ///
5285    /// Field 3: `track_latest`
5286    #[serde(
5287        rename = "trackLatest",
5288        alias = "track_latest",
5289        with = "::buffa::json_helpers::proto_bool",
5290        skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
5291    )]
5292    pub track_latest: bool,
5293    /// Version to follow when track_latest is false.
5294    ///
5295    /// Field 4: `pinned_version`
5296    #[serde(
5297        rename = "pinnedVersion",
5298        alias = "pinned_version",
5299        with = "::buffa::json_helpers::opt_uint32",
5300        skip_serializing_if = "::core::option::Option::is_none"
5301    )]
5302    pub pinned_version: ::core::option::Option<u32>,
5303    #[serde(skip)]
5304    #[doc(hidden)]
5305    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5306}
5307impl ::core::fmt::Debug for SetLayoutTemplateSubscriptionRequest {
5308    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5309        f.debug_struct("SetLayoutTemplateSubscriptionRequest")
5310            .field("owner_id", &self.owner_id)
5311            .field("template_id", &self.template_id)
5312            .field("track_latest", &self.track_latest)
5313            .field("pinned_version", &self.pinned_version)
5314            .finish()
5315    }
5316}
5317impl SetLayoutTemplateSubscriptionRequest {
5318    /// Protobuf type URL for this message, for use with `Any::pack` and
5319    /// `Any::unpack_if`.
5320    ///
5321    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5322    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.SetLayoutTemplateSubscriptionRequest";
5323}
5324impl SetLayoutTemplateSubscriptionRequest {
5325    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5326    #[inline]
5327    ///Sets [`Self::pinned_version`] to `Some(value)`, consuming and returning `self`.
5328    pub fn with_pinned_version(mut self, value: u32) -> Self {
5329        self.pinned_version = Some(value);
5330        self
5331    }
5332}
5333::buffa::impl_default_instance!(SetLayoutTemplateSubscriptionRequest);
5334impl ::buffa::MessageName for SetLayoutTemplateSubscriptionRequest {
5335    const PACKAGE: &'static str = "layout.v1";
5336    const NAME: &'static str = "SetLayoutTemplateSubscriptionRequest";
5337    const FULL_NAME: &'static str = "layout.v1.SetLayoutTemplateSubscriptionRequest";
5338    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.SetLayoutTemplateSubscriptionRequest";
5339}
5340impl ::buffa::Message for SetLayoutTemplateSubscriptionRequest {
5341    /// Returns the total encoded size in bytes.
5342    ///
5343    /// The result is a `u32`; the protobuf specification requires all
5344    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5345    /// compliant message will never overflow this type.
5346    #[allow(clippy::let_and_return)]
5347    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5348        #[allow(unused_imports)]
5349        use ::buffa::Enumeration as _;
5350        let mut size = 0u32;
5351        if self.owner_id != 0u64 {
5352            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
5353        }
5354        if self.template_id != 0u64 {
5355            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
5356        }
5357        if self.track_latest {
5358            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
5359        }
5360        if let Some(v) = self.pinned_version {
5361            size += 1u32 + ::buffa::types::uint32_encoded_len(v) as u32;
5362        }
5363        size += self.__buffa_unknown_fields.encoded_len() as u32;
5364        size
5365    }
5366    fn write_to(
5367        &self,
5368        _cache: &mut ::buffa::SizeCache,
5369        buf: &mut impl ::buffa::bytes::BufMut,
5370    ) {
5371        #[allow(unused_imports)]
5372        use ::buffa::Enumeration as _;
5373        if self.owner_id != 0u64 {
5374            ::buffa::types::put_fixed64_field(1u32, self.owner_id, buf);
5375        }
5376        if self.template_id != 0u64 {
5377            ::buffa::types::put_fixed64_field(2u32, self.template_id, buf);
5378        }
5379        if self.track_latest {
5380            ::buffa::types::put_bool_field(3u32, self.track_latest, buf);
5381        }
5382        if let Some(v) = self.pinned_version {
5383            ::buffa::types::put_uint32_field(4u32, v, buf);
5384        }
5385        self.__buffa_unknown_fields.write_to(buf);
5386    }
5387    fn merge_field(
5388        &mut self,
5389        tag: ::buffa::encoding::Tag,
5390        buf: &mut impl ::buffa::bytes::Buf,
5391        ctx: ::buffa::DecodeContext<'_>,
5392    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5393        #[allow(unused_imports)]
5394        use ::buffa::bytes::Buf as _;
5395        #[allow(unused_imports)]
5396        use ::buffa::Enumeration as _;
5397        match tag.field_number() {
5398            1u32 => {
5399                ::buffa::encoding::check_wire_type(
5400                    tag,
5401                    ::buffa::encoding::WireType::Fixed64,
5402                )?;
5403                self.owner_id = ::buffa::types::decode_fixed64(buf)?;
5404            }
5405            2u32 => {
5406                ::buffa::encoding::check_wire_type(
5407                    tag,
5408                    ::buffa::encoding::WireType::Fixed64,
5409                )?;
5410                self.template_id = ::buffa::types::decode_fixed64(buf)?;
5411            }
5412            3u32 => {
5413                ::buffa::encoding::check_wire_type(
5414                    tag,
5415                    ::buffa::encoding::WireType::Varint,
5416                )?;
5417                self.track_latest = ::buffa::types::decode_bool(buf)?;
5418            }
5419            4u32 => {
5420                ::buffa::encoding::check_wire_type(
5421                    tag,
5422                    ::buffa::encoding::WireType::Varint,
5423                )?;
5424                self.pinned_version = ::core::option::Option::Some(
5425                    ::buffa::types::decode_uint32(buf)?,
5426                );
5427            }
5428            _ => {
5429                self.__buffa_unknown_fields
5430                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5431            }
5432        }
5433        ::core::result::Result::Ok(())
5434    }
5435    fn clear(&mut self) {
5436        self.owner_id = 0u64;
5437        self.template_id = 0u64;
5438        self.track_latest = false;
5439        self.pinned_version = ::core::option::Option::None;
5440        self.__buffa_unknown_fields.clear();
5441    }
5442}
5443impl ::buffa::ExtensionSet for SetLayoutTemplateSubscriptionRequest {
5444    const PROTO_FQN: &'static str = "layout.v1.SetLayoutTemplateSubscriptionRequest";
5445    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5446        &self.__buffa_unknown_fields
5447    }
5448    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5449        &mut self.__buffa_unknown_fields
5450    }
5451}
5452impl ::buffa::json_helpers::ProtoElemJson for SetLayoutTemplateSubscriptionRequest {
5453    fn serialize_proto_json<S: ::serde::Serializer>(
5454        v: &Self,
5455        s: S,
5456    ) -> ::core::result::Result<S::Ok, S::Error> {
5457        ::serde::Serialize::serialize(v, s)
5458    }
5459    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5460        d: D,
5461    ) -> ::core::result::Result<Self, D::Error> {
5462        <Self as ::serde::Deserialize>::deserialize(d)
5463    }
5464}
5465#[doc(hidden)]
5466pub const __SET_LAYOUT_TEMPLATE_SUBSCRIPTION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5467    type_url: "type.googleapis.com/layout.v1.SetLayoutTemplateSubscriptionRequest",
5468    to_json: ::buffa::type_registry::any_to_json::<SetLayoutTemplateSubscriptionRequest>,
5469    from_json: ::buffa::type_registry::any_from_json::<
5470        SetLayoutTemplateSubscriptionRequest,
5471    >,
5472    is_wkt: false,
5473};
5474/// SetLayoutTemplateSubscriptionResponse is empty when the subscription was saved.
5475#[derive(Clone, PartialEq, Default)]
5476#[derive(::serde::Serialize, ::serde::Deserialize)]
5477#[serde(default)]
5478pub struct SetLayoutTemplateSubscriptionResponse {
5479    #[serde(skip)]
5480    #[doc(hidden)]
5481    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5482}
5483impl ::core::fmt::Debug for SetLayoutTemplateSubscriptionResponse {
5484    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5485        f.debug_struct("SetLayoutTemplateSubscriptionResponse").finish()
5486    }
5487}
5488impl SetLayoutTemplateSubscriptionResponse {
5489    /// Protobuf type URL for this message, for use with `Any::pack` and
5490    /// `Any::unpack_if`.
5491    ///
5492    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5493    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.SetLayoutTemplateSubscriptionResponse";
5494}
5495::buffa::impl_default_instance!(SetLayoutTemplateSubscriptionResponse);
5496impl ::buffa::MessageName for SetLayoutTemplateSubscriptionResponse {
5497    const PACKAGE: &'static str = "layout.v1";
5498    const NAME: &'static str = "SetLayoutTemplateSubscriptionResponse";
5499    const FULL_NAME: &'static str = "layout.v1.SetLayoutTemplateSubscriptionResponse";
5500    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.SetLayoutTemplateSubscriptionResponse";
5501}
5502impl ::buffa::Message for SetLayoutTemplateSubscriptionResponse {
5503    /// Returns the total encoded size in bytes.
5504    ///
5505    /// The result is a `u32`; the protobuf specification requires all
5506    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5507    /// compliant message will never overflow this type.
5508    #[allow(clippy::let_and_return)]
5509    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5510        #[allow(unused_imports)]
5511        use ::buffa::Enumeration as _;
5512        let mut size = 0u32;
5513        size += self.__buffa_unknown_fields.encoded_len() as u32;
5514        size
5515    }
5516    fn write_to(
5517        &self,
5518        _cache: &mut ::buffa::SizeCache,
5519        buf: &mut impl ::buffa::bytes::BufMut,
5520    ) {
5521        #[allow(unused_imports)]
5522        use ::buffa::Enumeration as _;
5523        self.__buffa_unknown_fields.write_to(buf);
5524    }
5525    fn merge_field(
5526        &mut self,
5527        tag: ::buffa::encoding::Tag,
5528        buf: &mut impl ::buffa::bytes::Buf,
5529        ctx: ::buffa::DecodeContext<'_>,
5530    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5531        #[allow(unused_imports)]
5532        use ::buffa::bytes::Buf as _;
5533        #[allow(unused_imports)]
5534        use ::buffa::Enumeration as _;
5535        match tag.field_number() {
5536            _ => {
5537                self.__buffa_unknown_fields
5538                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5539            }
5540        }
5541        ::core::result::Result::Ok(())
5542    }
5543    fn clear(&mut self) {
5544        self.__buffa_unknown_fields.clear();
5545    }
5546}
5547impl ::buffa::ExtensionSet for SetLayoutTemplateSubscriptionResponse {
5548    const PROTO_FQN: &'static str = "layout.v1.SetLayoutTemplateSubscriptionResponse";
5549    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5550        &self.__buffa_unknown_fields
5551    }
5552    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5553        &mut self.__buffa_unknown_fields
5554    }
5555}
5556impl ::buffa::json_helpers::ProtoElemJson for SetLayoutTemplateSubscriptionResponse {
5557    fn serialize_proto_json<S: ::serde::Serializer>(
5558        v: &Self,
5559        s: S,
5560    ) -> ::core::result::Result<S::Ok, S::Error> {
5561        ::serde::Serialize::serialize(v, s)
5562    }
5563    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5564        d: D,
5565    ) -> ::core::result::Result<Self, D::Error> {
5566        <Self as ::serde::Deserialize>::deserialize(d)
5567    }
5568}
5569#[doc(hidden)]
5570pub const __SET_LAYOUT_TEMPLATE_SUBSCRIPTION_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5571    type_url: "type.googleapis.com/layout.v1.SetLayoutTemplateSubscriptionResponse",
5572    to_json: ::buffa::type_registry::any_to_json::<
5573        SetLayoutTemplateSubscriptionResponse,
5574    >,
5575    from_json: ::buffa::type_registry::any_from_json::<
5576        SetLayoutTemplateSubscriptionResponse,
5577    >,
5578    is_wkt: false,
5579};
5580/// DeleteLayoutTemplateSubscriptionRequest deletes one followed template.
5581#[derive(Clone, PartialEq, Default)]
5582#[derive(::serde::Serialize, ::serde::Deserialize)]
5583#[serde(default)]
5584pub struct DeleteLayoutTemplateSubscriptionRequest {
5585    /// Viewer that owns the template.
5586    ///
5587    /// Field 1: `owner_id`
5588    #[serde(
5589        rename = "ownerId",
5590        alias = "owner_id",
5591        with = "::buffa::json_helpers::uint64",
5592        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
5593    )]
5594    pub owner_id: u64,
5595    /// Template identifier to unfollow.
5596    ///
5597    /// Field 2: `template_id`
5598    #[serde(
5599        rename = "templateId",
5600        alias = "template_id",
5601        with = "::buffa::json_helpers::uint64",
5602        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
5603    )]
5604    pub template_id: u64,
5605    #[serde(skip)]
5606    #[doc(hidden)]
5607    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5608}
5609impl ::core::fmt::Debug for DeleteLayoutTemplateSubscriptionRequest {
5610    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5611        f.debug_struct("DeleteLayoutTemplateSubscriptionRequest")
5612            .field("owner_id", &self.owner_id)
5613            .field("template_id", &self.template_id)
5614            .finish()
5615    }
5616}
5617impl DeleteLayoutTemplateSubscriptionRequest {
5618    /// Protobuf type URL for this message, for use with `Any::pack` and
5619    /// `Any::unpack_if`.
5620    ///
5621    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5622    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.DeleteLayoutTemplateSubscriptionRequest";
5623}
5624::buffa::impl_default_instance!(DeleteLayoutTemplateSubscriptionRequest);
5625impl ::buffa::MessageName for DeleteLayoutTemplateSubscriptionRequest {
5626    const PACKAGE: &'static str = "layout.v1";
5627    const NAME: &'static str = "DeleteLayoutTemplateSubscriptionRequest";
5628    const FULL_NAME: &'static str = "layout.v1.DeleteLayoutTemplateSubscriptionRequest";
5629    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.DeleteLayoutTemplateSubscriptionRequest";
5630}
5631impl ::buffa::Message for DeleteLayoutTemplateSubscriptionRequest {
5632    /// Returns the total encoded size in bytes.
5633    ///
5634    /// The result is a `u32`; the protobuf specification requires all
5635    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5636    /// compliant message will never overflow this type.
5637    #[allow(clippy::let_and_return)]
5638    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5639        #[allow(unused_imports)]
5640        use ::buffa::Enumeration as _;
5641        let mut size = 0u32;
5642        if self.owner_id != 0u64 {
5643            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
5644        }
5645        if self.template_id != 0u64 {
5646            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
5647        }
5648        size += self.__buffa_unknown_fields.encoded_len() as u32;
5649        size
5650    }
5651    fn write_to(
5652        &self,
5653        _cache: &mut ::buffa::SizeCache,
5654        buf: &mut impl ::buffa::bytes::BufMut,
5655    ) {
5656        #[allow(unused_imports)]
5657        use ::buffa::Enumeration as _;
5658        if self.owner_id != 0u64 {
5659            ::buffa::types::put_fixed64_field(1u32, self.owner_id, buf);
5660        }
5661        if self.template_id != 0u64 {
5662            ::buffa::types::put_fixed64_field(2u32, self.template_id, buf);
5663        }
5664        self.__buffa_unknown_fields.write_to(buf);
5665    }
5666    fn merge_field(
5667        &mut self,
5668        tag: ::buffa::encoding::Tag,
5669        buf: &mut impl ::buffa::bytes::Buf,
5670        ctx: ::buffa::DecodeContext<'_>,
5671    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5672        #[allow(unused_imports)]
5673        use ::buffa::bytes::Buf as _;
5674        #[allow(unused_imports)]
5675        use ::buffa::Enumeration as _;
5676        match tag.field_number() {
5677            1u32 => {
5678                ::buffa::encoding::check_wire_type(
5679                    tag,
5680                    ::buffa::encoding::WireType::Fixed64,
5681                )?;
5682                self.owner_id = ::buffa::types::decode_fixed64(buf)?;
5683            }
5684            2u32 => {
5685                ::buffa::encoding::check_wire_type(
5686                    tag,
5687                    ::buffa::encoding::WireType::Fixed64,
5688                )?;
5689                self.template_id = ::buffa::types::decode_fixed64(buf)?;
5690            }
5691            _ => {
5692                self.__buffa_unknown_fields
5693                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5694            }
5695        }
5696        ::core::result::Result::Ok(())
5697    }
5698    fn clear(&mut self) {
5699        self.owner_id = 0u64;
5700        self.template_id = 0u64;
5701        self.__buffa_unknown_fields.clear();
5702    }
5703}
5704impl ::buffa::ExtensionSet for DeleteLayoutTemplateSubscriptionRequest {
5705    const PROTO_FQN: &'static str = "layout.v1.DeleteLayoutTemplateSubscriptionRequest";
5706    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5707        &self.__buffa_unknown_fields
5708    }
5709    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5710        &mut self.__buffa_unknown_fields
5711    }
5712}
5713impl ::buffa::json_helpers::ProtoElemJson for DeleteLayoutTemplateSubscriptionRequest {
5714    fn serialize_proto_json<S: ::serde::Serializer>(
5715        v: &Self,
5716        s: S,
5717    ) -> ::core::result::Result<S::Ok, S::Error> {
5718        ::serde::Serialize::serialize(v, s)
5719    }
5720    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5721        d: D,
5722    ) -> ::core::result::Result<Self, D::Error> {
5723        <Self as ::serde::Deserialize>::deserialize(d)
5724    }
5725}
5726#[doc(hidden)]
5727pub const __DELETE_LAYOUT_TEMPLATE_SUBSCRIPTION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5728    type_url: "type.googleapis.com/layout.v1.DeleteLayoutTemplateSubscriptionRequest",
5729    to_json: ::buffa::type_registry::any_to_json::<
5730        DeleteLayoutTemplateSubscriptionRequest,
5731    >,
5732    from_json: ::buffa::type_registry::any_from_json::<
5733        DeleteLayoutTemplateSubscriptionRequest,
5734    >,
5735    is_wkt: false,
5736};
5737/// DeleteLayoutTemplateSubscriptionResponse is empty when the subscription was deleted.
5738#[derive(Clone, PartialEq, Default)]
5739#[derive(::serde::Serialize, ::serde::Deserialize)]
5740#[serde(default)]
5741pub struct DeleteLayoutTemplateSubscriptionResponse {
5742    #[serde(skip)]
5743    #[doc(hidden)]
5744    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5745}
5746impl ::core::fmt::Debug for DeleteLayoutTemplateSubscriptionResponse {
5747    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5748        f.debug_struct("DeleteLayoutTemplateSubscriptionResponse").finish()
5749    }
5750}
5751impl DeleteLayoutTemplateSubscriptionResponse {
5752    /// Protobuf type URL for this message, for use with `Any::pack` and
5753    /// `Any::unpack_if`.
5754    ///
5755    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5756    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.DeleteLayoutTemplateSubscriptionResponse";
5757}
5758::buffa::impl_default_instance!(DeleteLayoutTemplateSubscriptionResponse);
5759impl ::buffa::MessageName for DeleteLayoutTemplateSubscriptionResponse {
5760    const PACKAGE: &'static str = "layout.v1";
5761    const NAME: &'static str = "DeleteLayoutTemplateSubscriptionResponse";
5762    const FULL_NAME: &'static str = "layout.v1.DeleteLayoutTemplateSubscriptionResponse";
5763    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.DeleteLayoutTemplateSubscriptionResponse";
5764}
5765impl ::buffa::Message for DeleteLayoutTemplateSubscriptionResponse {
5766    /// Returns the total encoded size in bytes.
5767    ///
5768    /// The result is a `u32`; the protobuf specification requires all
5769    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5770    /// compliant message will never overflow this type.
5771    #[allow(clippy::let_and_return)]
5772    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5773        #[allow(unused_imports)]
5774        use ::buffa::Enumeration as _;
5775        let mut size = 0u32;
5776        size += self.__buffa_unknown_fields.encoded_len() as u32;
5777        size
5778    }
5779    fn write_to(
5780        &self,
5781        _cache: &mut ::buffa::SizeCache,
5782        buf: &mut impl ::buffa::bytes::BufMut,
5783    ) {
5784        #[allow(unused_imports)]
5785        use ::buffa::Enumeration as _;
5786        self.__buffa_unknown_fields.write_to(buf);
5787    }
5788    fn merge_field(
5789        &mut self,
5790        tag: ::buffa::encoding::Tag,
5791        buf: &mut impl ::buffa::bytes::Buf,
5792        ctx: ::buffa::DecodeContext<'_>,
5793    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5794        #[allow(unused_imports)]
5795        use ::buffa::bytes::Buf as _;
5796        #[allow(unused_imports)]
5797        use ::buffa::Enumeration as _;
5798        match tag.field_number() {
5799            _ => {
5800                self.__buffa_unknown_fields
5801                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
5802            }
5803        }
5804        ::core::result::Result::Ok(())
5805    }
5806    fn clear(&mut self) {
5807        self.__buffa_unknown_fields.clear();
5808    }
5809}
5810impl ::buffa::ExtensionSet for DeleteLayoutTemplateSubscriptionResponse {
5811    const PROTO_FQN: &'static str = "layout.v1.DeleteLayoutTemplateSubscriptionResponse";
5812    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5813        &self.__buffa_unknown_fields
5814    }
5815    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5816        &mut self.__buffa_unknown_fields
5817    }
5818}
5819impl ::buffa::json_helpers::ProtoElemJson for DeleteLayoutTemplateSubscriptionResponse {
5820    fn serialize_proto_json<S: ::serde::Serializer>(
5821        v: &Self,
5822        s: S,
5823    ) -> ::core::result::Result<S::Ok, S::Error> {
5824        ::serde::Serialize::serialize(v, s)
5825    }
5826    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5827        d: D,
5828    ) -> ::core::result::Result<Self, D::Error> {
5829        <Self as ::serde::Deserialize>::deserialize(d)
5830    }
5831}
5832#[doc(hidden)]
5833pub const __DELETE_LAYOUT_TEMPLATE_SUBSCRIPTION_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5834    type_url: "type.googleapis.com/layout.v1.DeleteLayoutTemplateSubscriptionResponse",
5835    to_json: ::buffa::type_registry::any_to_json::<
5836        DeleteLayoutTemplateSubscriptionResponse,
5837    >,
5838    from_json: ::buffa::type_registry::any_from_json::<
5839        DeleteLayoutTemplateSubscriptionResponse,
5840    >,
5841    is_wkt: false,
5842};
5843/// LayoutTemplateSubscription describes one template followed by a viewer.
5844#[derive(Clone, PartialEq, Default)]
5845#[derive(::serde::Serialize, ::serde::Deserialize)]
5846#[serde(default)]
5847pub struct LayoutTemplateSubscription {
5848    /// Viewer that follows the template.
5849    ///
5850    /// Field 1: `viewer_id`
5851    #[serde(
5852        rename = "viewerId",
5853        alias = "viewer_id",
5854        with = "::buffa::json_helpers::uint64",
5855        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
5856    )]
5857    pub viewer_id: u64,
5858    /// Viewer that owns the template.
5859    ///
5860    /// Field 2: `owner_id`
5861    #[serde(
5862        rename = "ownerId",
5863        alias = "owner_id",
5864        with = "::buffa::json_helpers::uint64",
5865        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
5866    )]
5867    pub owner_id: u64,
5868    /// Followed template identifier.
5869    ///
5870    /// Field 3: `template_id`
5871    #[serde(
5872        rename = "templateId",
5873        alias = "template_id",
5874        with = "::buffa::json_helpers::uint64",
5875        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
5876    )]
5877    pub template_id: u64,
5878    /// True when the subscription follows the latest version automatically.
5879    ///
5880    /// Field 4: `track_latest`
5881    #[serde(
5882        rename = "trackLatest",
5883        alias = "track_latest",
5884        with = "::buffa::json_helpers::proto_bool",
5885        skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
5886    )]
5887    pub track_latest: bool,
5888    /// Version followed when track_latest is false.
5889    ///
5890    /// Field 5: `pinned_version`
5891    #[serde(
5892        rename = "pinnedVersion",
5893        alias = "pinned_version",
5894        with = "::buffa::json_helpers::opt_uint32",
5895        skip_serializing_if = "::core::option::Option::is_none"
5896    )]
5897    pub pinned_version: ::core::option::Option<u32>,
5898    /// Subscription update time in milliseconds since epoch (UTC).
5899    ///
5900    /// Field 6: `updated_at_ms`
5901    #[serde(
5902        rename = "updatedAtMs",
5903        alias = "updated_at_ms",
5904        with = "::buffa::json_helpers::uint64",
5905        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
5906    )]
5907    pub updated_at_ms: u64,
5908    #[serde(skip)]
5909    #[doc(hidden)]
5910    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5911}
5912impl ::core::fmt::Debug for LayoutTemplateSubscription {
5913    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5914        f.debug_struct("LayoutTemplateSubscription")
5915            .field("viewer_id", &self.viewer_id)
5916            .field("owner_id", &self.owner_id)
5917            .field("template_id", &self.template_id)
5918            .field("track_latest", &self.track_latest)
5919            .field("pinned_version", &self.pinned_version)
5920            .field("updated_at_ms", &self.updated_at_ms)
5921            .finish()
5922    }
5923}
5924impl LayoutTemplateSubscription {
5925    /// Protobuf type URL for this message, for use with `Any::pack` and
5926    /// `Any::unpack_if`.
5927    ///
5928    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5929    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutTemplateSubscription";
5930}
5931impl LayoutTemplateSubscription {
5932    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
5933    #[inline]
5934    ///Sets [`Self::pinned_version`] to `Some(value)`, consuming and returning `self`.
5935    pub fn with_pinned_version(mut self, value: u32) -> Self {
5936        self.pinned_version = Some(value);
5937        self
5938    }
5939}
5940::buffa::impl_default_instance!(LayoutTemplateSubscription);
5941impl ::buffa::MessageName for LayoutTemplateSubscription {
5942    const PACKAGE: &'static str = "layout.v1";
5943    const NAME: &'static str = "LayoutTemplateSubscription";
5944    const FULL_NAME: &'static str = "layout.v1.LayoutTemplateSubscription";
5945    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutTemplateSubscription";
5946}
5947impl ::buffa::Message for LayoutTemplateSubscription {
5948    /// Returns the total encoded size in bytes.
5949    ///
5950    /// The result is a `u32`; the protobuf specification requires all
5951    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5952    /// compliant message will never overflow this type.
5953    #[allow(clippy::let_and_return)]
5954    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5955        #[allow(unused_imports)]
5956        use ::buffa::Enumeration as _;
5957        let mut size = 0u32;
5958        if self.viewer_id != 0u64 {
5959            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
5960        }
5961        if self.owner_id != 0u64 {
5962            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
5963        }
5964        if self.template_id != 0u64 {
5965            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
5966        }
5967        if self.track_latest {
5968            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
5969        }
5970        if let Some(v) = self.pinned_version {
5971            size += 1u32 + ::buffa::types::uint32_encoded_len(v) as u32;
5972        }
5973        if self.updated_at_ms != 0u64 {
5974            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
5975        }
5976        size += self.__buffa_unknown_fields.encoded_len() as u32;
5977        size
5978    }
5979    fn write_to(
5980        &self,
5981        _cache: &mut ::buffa::SizeCache,
5982        buf: &mut impl ::buffa::bytes::BufMut,
5983    ) {
5984        #[allow(unused_imports)]
5985        use ::buffa::Enumeration as _;
5986        if self.viewer_id != 0u64 {
5987            ::buffa::types::put_fixed64_field(1u32, self.viewer_id, buf);
5988        }
5989        if self.owner_id != 0u64 {
5990            ::buffa::types::put_fixed64_field(2u32, self.owner_id, buf);
5991        }
5992        if self.template_id != 0u64 {
5993            ::buffa::types::put_fixed64_field(3u32, self.template_id, buf);
5994        }
5995        if self.track_latest {
5996            ::buffa::types::put_bool_field(4u32, self.track_latest, buf);
5997        }
5998        if let Some(v) = self.pinned_version {
5999            ::buffa::types::put_uint32_field(5u32, v, buf);
6000        }
6001        if self.updated_at_ms != 0u64 {
6002            ::buffa::types::put_fixed64_field(6u32, self.updated_at_ms, buf);
6003        }
6004        self.__buffa_unknown_fields.write_to(buf);
6005    }
6006    fn merge_field(
6007        &mut self,
6008        tag: ::buffa::encoding::Tag,
6009        buf: &mut impl ::buffa::bytes::Buf,
6010        ctx: ::buffa::DecodeContext<'_>,
6011    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6012        #[allow(unused_imports)]
6013        use ::buffa::bytes::Buf as _;
6014        #[allow(unused_imports)]
6015        use ::buffa::Enumeration as _;
6016        match tag.field_number() {
6017            1u32 => {
6018                ::buffa::encoding::check_wire_type(
6019                    tag,
6020                    ::buffa::encoding::WireType::Fixed64,
6021                )?;
6022                self.viewer_id = ::buffa::types::decode_fixed64(buf)?;
6023            }
6024            2u32 => {
6025                ::buffa::encoding::check_wire_type(
6026                    tag,
6027                    ::buffa::encoding::WireType::Fixed64,
6028                )?;
6029                self.owner_id = ::buffa::types::decode_fixed64(buf)?;
6030            }
6031            3u32 => {
6032                ::buffa::encoding::check_wire_type(
6033                    tag,
6034                    ::buffa::encoding::WireType::Fixed64,
6035                )?;
6036                self.template_id = ::buffa::types::decode_fixed64(buf)?;
6037            }
6038            4u32 => {
6039                ::buffa::encoding::check_wire_type(
6040                    tag,
6041                    ::buffa::encoding::WireType::Varint,
6042                )?;
6043                self.track_latest = ::buffa::types::decode_bool(buf)?;
6044            }
6045            5u32 => {
6046                ::buffa::encoding::check_wire_type(
6047                    tag,
6048                    ::buffa::encoding::WireType::Varint,
6049                )?;
6050                self.pinned_version = ::core::option::Option::Some(
6051                    ::buffa::types::decode_uint32(buf)?,
6052                );
6053            }
6054            6u32 => {
6055                ::buffa::encoding::check_wire_type(
6056                    tag,
6057                    ::buffa::encoding::WireType::Fixed64,
6058                )?;
6059                self.updated_at_ms = ::buffa::types::decode_fixed64(buf)?;
6060            }
6061            _ => {
6062                self.__buffa_unknown_fields
6063                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6064            }
6065        }
6066        ::core::result::Result::Ok(())
6067    }
6068    fn clear(&mut self) {
6069        self.viewer_id = 0u64;
6070        self.owner_id = 0u64;
6071        self.template_id = 0u64;
6072        self.track_latest = false;
6073        self.pinned_version = ::core::option::Option::None;
6074        self.updated_at_ms = 0u64;
6075        self.__buffa_unknown_fields.clear();
6076    }
6077}
6078impl ::buffa::ExtensionSet for LayoutTemplateSubscription {
6079    const PROTO_FQN: &'static str = "layout.v1.LayoutTemplateSubscription";
6080    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6081        &self.__buffa_unknown_fields
6082    }
6083    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6084        &mut self.__buffa_unknown_fields
6085    }
6086}
6087impl ::buffa::json_helpers::ProtoElemJson for LayoutTemplateSubscription {
6088    fn serialize_proto_json<S: ::serde::Serializer>(
6089        v: &Self,
6090        s: S,
6091    ) -> ::core::result::Result<S::Ok, S::Error> {
6092        ::serde::Serialize::serialize(v, s)
6093    }
6094    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6095        d: D,
6096    ) -> ::core::result::Result<Self, D::Error> {
6097        <Self as ::serde::Deserialize>::deserialize(d)
6098    }
6099}
6100#[doc(hidden)]
6101pub const __LAYOUT_TEMPLATE_SUBSCRIPTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6102    type_url: "type.googleapis.com/layout.v1.LayoutTemplateSubscription",
6103    to_json: ::buffa::type_registry::any_to_json::<LayoutTemplateSubscription>,
6104    from_json: ::buffa::type_registry::any_from_json::<LayoutTemplateSubscription>,
6105    is_wkt: false,
6106};
6107/// ListMyLayoutTemplateSubscriptionsRequest lists templates followed by the authenticated caller.
6108#[derive(Clone, PartialEq, Default)]
6109#[derive(::serde::Serialize, ::serde::Deserialize)]
6110#[serde(default)]
6111pub struct ListMyLayoutTemplateSubscriptionsRequest {
6112    /// Maximum number of subscriptions to return. Defaults to 100 when omitted;
6113    /// maximum is 500.
6114    ///
6115    /// Field 1: `limit`
6116    #[serde(
6117        rename = "limit",
6118        with = "::buffa::json_helpers::uint32",
6119        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
6120    )]
6121    pub limit: u32,
6122    /// Opaque keyset cursor from a previous response. The cursor is exclusive and
6123    /// bound to the authenticated caller and newest-updated sort order.
6124    ///
6125    /// Field 2: `page_token`
6126    #[serde(
6127        rename = "pageToken",
6128        alias = "page_token",
6129        with = "::buffa::json_helpers::proto_string",
6130        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
6131    )]
6132    pub page_token: ::buffa::alloc::string::String,
6133    #[serde(skip)]
6134    #[doc(hidden)]
6135    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6136}
6137impl ::core::fmt::Debug for ListMyLayoutTemplateSubscriptionsRequest {
6138    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6139        f.debug_struct("ListMyLayoutTemplateSubscriptionsRequest")
6140            .field("limit", &self.limit)
6141            .field("page_token", &self.page_token)
6142            .finish()
6143    }
6144}
6145impl ListMyLayoutTemplateSubscriptionsRequest {
6146    /// Protobuf type URL for this message, for use with `Any::pack` and
6147    /// `Any::unpack_if`.
6148    ///
6149    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6150    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListMyLayoutTemplateSubscriptionsRequest";
6151}
6152::buffa::impl_default_instance!(ListMyLayoutTemplateSubscriptionsRequest);
6153impl ::buffa::MessageName for ListMyLayoutTemplateSubscriptionsRequest {
6154    const PACKAGE: &'static str = "layout.v1";
6155    const NAME: &'static str = "ListMyLayoutTemplateSubscriptionsRequest";
6156    const FULL_NAME: &'static str = "layout.v1.ListMyLayoutTemplateSubscriptionsRequest";
6157    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListMyLayoutTemplateSubscriptionsRequest";
6158}
6159impl ::buffa::Message for ListMyLayoutTemplateSubscriptionsRequest {
6160    /// Returns the total encoded size in bytes.
6161    ///
6162    /// The result is a `u32`; the protobuf specification requires all
6163    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
6164    /// compliant message will never overflow this type.
6165    #[allow(clippy::let_and_return)]
6166    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
6167        #[allow(unused_imports)]
6168        use ::buffa::Enumeration as _;
6169        let mut size = 0u32;
6170        if self.limit != 0u32 {
6171            size += 1u32 + ::buffa::types::uint32_encoded_len(self.limit) as u32;
6172        }
6173        if !self.page_token.is_empty() {
6174            size += 1u32 + ::buffa::types::string_encoded_len(&self.page_token) as u32;
6175        }
6176        size += self.__buffa_unknown_fields.encoded_len() as u32;
6177        size
6178    }
6179    fn write_to(
6180        &self,
6181        _cache: &mut ::buffa::SizeCache,
6182        buf: &mut impl ::buffa::bytes::BufMut,
6183    ) {
6184        #[allow(unused_imports)]
6185        use ::buffa::Enumeration as _;
6186        if self.limit != 0u32 {
6187            ::buffa::types::put_uint32_field(1u32, self.limit, buf);
6188        }
6189        if !self.page_token.is_empty() {
6190            ::buffa::types::put_string_field(2u32, &self.page_token, buf);
6191        }
6192        self.__buffa_unknown_fields.write_to(buf);
6193    }
6194    fn merge_field(
6195        &mut self,
6196        tag: ::buffa::encoding::Tag,
6197        buf: &mut impl ::buffa::bytes::Buf,
6198        ctx: ::buffa::DecodeContext<'_>,
6199    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6200        #[allow(unused_imports)]
6201        use ::buffa::bytes::Buf as _;
6202        #[allow(unused_imports)]
6203        use ::buffa::Enumeration as _;
6204        match tag.field_number() {
6205            1u32 => {
6206                ::buffa::encoding::check_wire_type(
6207                    tag,
6208                    ::buffa::encoding::WireType::Varint,
6209                )?;
6210                self.limit = ::buffa::types::decode_uint32(buf)?;
6211            }
6212            2u32 => {
6213                ::buffa::encoding::check_wire_type(
6214                    tag,
6215                    ::buffa::encoding::WireType::LengthDelimited,
6216                )?;
6217                ::buffa::types::merge_string(&mut self.page_token, buf)?;
6218            }
6219            _ => {
6220                self.__buffa_unknown_fields
6221                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6222            }
6223        }
6224        ::core::result::Result::Ok(())
6225    }
6226    fn clear(&mut self) {
6227        self.limit = 0u32;
6228        self.page_token.clear();
6229        self.__buffa_unknown_fields.clear();
6230    }
6231}
6232impl ::buffa::ExtensionSet for ListMyLayoutTemplateSubscriptionsRequest {
6233    const PROTO_FQN: &'static str = "layout.v1.ListMyLayoutTemplateSubscriptionsRequest";
6234    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6235        &self.__buffa_unknown_fields
6236    }
6237    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6238        &mut self.__buffa_unknown_fields
6239    }
6240}
6241impl ::buffa::json_helpers::ProtoElemJson for ListMyLayoutTemplateSubscriptionsRequest {
6242    fn serialize_proto_json<S: ::serde::Serializer>(
6243        v: &Self,
6244        s: S,
6245    ) -> ::core::result::Result<S::Ok, S::Error> {
6246        ::serde::Serialize::serialize(v, s)
6247    }
6248    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6249        d: D,
6250    ) -> ::core::result::Result<Self, D::Error> {
6251        <Self as ::serde::Deserialize>::deserialize(d)
6252    }
6253}
6254#[doc(hidden)]
6255pub const __LIST_MY_LAYOUT_TEMPLATE_SUBSCRIPTIONS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6256    type_url: "type.googleapis.com/layout.v1.ListMyLayoutTemplateSubscriptionsRequest",
6257    to_json: ::buffa::type_registry::any_to_json::<
6258        ListMyLayoutTemplateSubscriptionsRequest,
6259    >,
6260    from_json: ::buffa::type_registry::any_from_json::<
6261        ListMyLayoutTemplateSubscriptionsRequest,
6262    >,
6263    is_wkt: false,
6264};
6265/// ListMyLayoutTemplateSubscriptionsResponse contains the caller's followed templates.
6266#[derive(Clone, PartialEq, Default)]
6267#[derive(::serde::Serialize, ::serde::Deserialize)]
6268#[serde(default)]
6269pub struct ListMyLayoutTemplateSubscriptionsResponse {
6270    /// Followed templates for the caller, returned newest-updated first.
6271    ///
6272    /// Field 1: `subscriptions`
6273    #[serde(
6274        rename = "subscriptions",
6275        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
6276        deserialize_with = "::buffa::json_helpers::null_as_default"
6277    )]
6278    pub subscriptions: ::buffa::alloc::vec::Vec<LayoutTemplateSubscription>,
6279    /// Opaque cursor for the next page. Empty when no more results exist.
6280    ///
6281    /// Field 2: `next_page_token`
6282    #[serde(
6283        rename = "nextPageToken",
6284        alias = "next_page_token",
6285        with = "::buffa::json_helpers::proto_string",
6286        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
6287    )]
6288    pub next_page_token: ::buffa::alloc::string::String,
6289    #[serde(skip)]
6290    #[doc(hidden)]
6291    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6292}
6293impl ::core::fmt::Debug for ListMyLayoutTemplateSubscriptionsResponse {
6294    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6295        f.debug_struct("ListMyLayoutTemplateSubscriptionsResponse")
6296            .field("subscriptions", &self.subscriptions)
6297            .field("next_page_token", &self.next_page_token)
6298            .finish()
6299    }
6300}
6301impl ListMyLayoutTemplateSubscriptionsResponse {
6302    /// Protobuf type URL for this message, for use with `Any::pack` and
6303    /// `Any::unpack_if`.
6304    ///
6305    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6306    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListMyLayoutTemplateSubscriptionsResponse";
6307}
6308::buffa::impl_default_instance!(ListMyLayoutTemplateSubscriptionsResponse);
6309impl ::buffa::MessageName for ListMyLayoutTemplateSubscriptionsResponse {
6310    const PACKAGE: &'static str = "layout.v1";
6311    const NAME: &'static str = "ListMyLayoutTemplateSubscriptionsResponse";
6312    const FULL_NAME: &'static str = "layout.v1.ListMyLayoutTemplateSubscriptionsResponse";
6313    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListMyLayoutTemplateSubscriptionsResponse";
6314}
6315impl ::buffa::Message for ListMyLayoutTemplateSubscriptionsResponse {
6316    /// Returns the total encoded size in bytes.
6317    ///
6318    /// The result is a `u32`; the protobuf specification requires all
6319    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
6320    /// compliant message will never overflow this type.
6321    #[allow(clippy::let_and_return)]
6322    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6323        #[allow(unused_imports)]
6324        use ::buffa::Enumeration as _;
6325        let mut size = 0u32;
6326        for v in &self.subscriptions {
6327            let __slot = __cache.reserve();
6328            let inner_size = v.compute_size(__cache);
6329            __cache.set(__slot, inner_size);
6330            size
6331                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
6332                    + inner_size;
6333        }
6334        if !self.next_page_token.is_empty() {
6335            size
6336                += 1u32
6337                    + ::buffa::types::string_encoded_len(&self.next_page_token) as u32;
6338        }
6339        size += self.__buffa_unknown_fields.encoded_len() as u32;
6340        size
6341    }
6342    fn write_to(
6343        &self,
6344        __cache: &mut ::buffa::SizeCache,
6345        buf: &mut impl ::buffa::bytes::BufMut,
6346    ) {
6347        #[allow(unused_imports)]
6348        use ::buffa::Enumeration as _;
6349        for v in &self.subscriptions {
6350            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
6351            v.write_to(__cache, buf);
6352        }
6353        if !self.next_page_token.is_empty() {
6354            ::buffa::types::put_string_field(2u32, &self.next_page_token, buf);
6355        }
6356        self.__buffa_unknown_fields.write_to(buf);
6357    }
6358    fn merge_field(
6359        &mut self,
6360        tag: ::buffa::encoding::Tag,
6361        buf: &mut impl ::buffa::bytes::Buf,
6362        ctx: ::buffa::DecodeContext<'_>,
6363    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6364        #[allow(unused_imports)]
6365        use ::buffa::bytes::Buf as _;
6366        #[allow(unused_imports)]
6367        use ::buffa::Enumeration as _;
6368        match tag.field_number() {
6369            1u32 => {
6370                ::buffa::encoding::check_wire_type(
6371                    tag,
6372                    ::buffa::encoding::WireType::LengthDelimited,
6373                )?;
6374                let mut elem = ::core::default::Default::default();
6375                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
6376                self.subscriptions.push(elem);
6377            }
6378            2u32 => {
6379                ::buffa::encoding::check_wire_type(
6380                    tag,
6381                    ::buffa::encoding::WireType::LengthDelimited,
6382                )?;
6383                ::buffa::types::merge_string(&mut self.next_page_token, buf)?;
6384            }
6385            _ => {
6386                self.__buffa_unknown_fields
6387                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6388            }
6389        }
6390        ::core::result::Result::Ok(())
6391    }
6392    fn clear(&mut self) {
6393        self.subscriptions.clear();
6394        self.next_page_token.clear();
6395        self.__buffa_unknown_fields.clear();
6396    }
6397}
6398impl ::buffa::ExtensionSet for ListMyLayoutTemplateSubscriptionsResponse {
6399    const PROTO_FQN: &'static str = "layout.v1.ListMyLayoutTemplateSubscriptionsResponse";
6400    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6401        &self.__buffa_unknown_fields
6402    }
6403    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6404        &mut self.__buffa_unknown_fields
6405    }
6406}
6407impl ::buffa::json_helpers::ProtoElemJson for ListMyLayoutTemplateSubscriptionsResponse {
6408    fn serialize_proto_json<S: ::serde::Serializer>(
6409        v: &Self,
6410        s: S,
6411    ) -> ::core::result::Result<S::Ok, S::Error> {
6412        ::serde::Serialize::serialize(v, s)
6413    }
6414    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6415        d: D,
6416    ) -> ::core::result::Result<Self, D::Error> {
6417        <Self as ::serde::Deserialize>::deserialize(d)
6418    }
6419}
6420#[doc(hidden)]
6421pub const __LIST_MY_LAYOUT_TEMPLATE_SUBSCRIPTIONS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6422    type_url: "type.googleapis.com/layout.v1.ListMyLayoutTemplateSubscriptionsResponse",
6423    to_json: ::buffa::type_registry::any_to_json::<
6424        ListMyLayoutTemplateSubscriptionsResponse,
6425    >,
6426    from_json: ::buffa::type_registry::any_from_json::<
6427        ListMyLayoutTemplateSubscriptionsResponse,
6428    >,
6429    is_wkt: false,
6430};
6431/// =============================================================================
6432/// Mutations
6433/// =============================================================================
6434///
6435/// UpsertLayoutRequest creates or updates a saved layout for the authenticated caller.
6436#[derive(Clone, PartialEq, Default)]
6437#[derive(::serde::Serialize, ::serde::Deserialize)]
6438#[serde(default)]
6439pub struct UpsertLayoutRequest {
6440    /// Layout payload to save.
6441    ///
6442    /// Field 1: `layout`
6443    #[serde(
6444        rename = "layout",
6445        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6446    )]
6447    pub layout: ::buffa::MessageField<Layout>,
6448    #[serde(skip)]
6449    #[doc(hidden)]
6450    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6451}
6452impl ::core::fmt::Debug for UpsertLayoutRequest {
6453    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6454        f.debug_struct("UpsertLayoutRequest").field("layout", &self.layout).finish()
6455    }
6456}
6457impl UpsertLayoutRequest {
6458    /// Protobuf type URL for this message, for use with `Any::pack` and
6459    /// `Any::unpack_if`.
6460    ///
6461    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6462    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.UpsertLayoutRequest";
6463}
6464::buffa::impl_default_instance!(UpsertLayoutRequest);
6465impl ::buffa::MessageName for UpsertLayoutRequest {
6466    const PACKAGE: &'static str = "layout.v1";
6467    const NAME: &'static str = "UpsertLayoutRequest";
6468    const FULL_NAME: &'static str = "layout.v1.UpsertLayoutRequest";
6469    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.UpsertLayoutRequest";
6470}
6471impl ::buffa::Message for UpsertLayoutRequest {
6472    /// Returns the total encoded size in bytes.
6473    ///
6474    /// The result is a `u32`; the protobuf specification requires all
6475    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
6476    /// compliant message will never overflow this type.
6477    #[allow(clippy::let_and_return)]
6478    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6479        #[allow(unused_imports)]
6480        use ::buffa::Enumeration as _;
6481        let mut size = 0u32;
6482        if self.layout.is_set() {
6483            let __slot = __cache.reserve();
6484            let inner_size = self.layout.compute_size(__cache);
6485            __cache.set(__slot, inner_size);
6486            size
6487                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
6488                    + inner_size;
6489        }
6490        size += self.__buffa_unknown_fields.encoded_len() as u32;
6491        size
6492    }
6493    fn write_to(
6494        &self,
6495        __cache: &mut ::buffa::SizeCache,
6496        buf: &mut impl ::buffa::bytes::BufMut,
6497    ) {
6498        #[allow(unused_imports)]
6499        use ::buffa::Enumeration as _;
6500        if self.layout.is_set() {
6501            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
6502            self.layout.write_to(__cache, buf);
6503        }
6504        self.__buffa_unknown_fields.write_to(buf);
6505    }
6506    fn merge_field(
6507        &mut self,
6508        tag: ::buffa::encoding::Tag,
6509        buf: &mut impl ::buffa::bytes::Buf,
6510        ctx: ::buffa::DecodeContext<'_>,
6511    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6512        #[allow(unused_imports)]
6513        use ::buffa::bytes::Buf as _;
6514        #[allow(unused_imports)]
6515        use ::buffa::Enumeration as _;
6516        match tag.field_number() {
6517            1u32 => {
6518                ::buffa::encoding::check_wire_type(
6519                    tag,
6520                    ::buffa::encoding::WireType::LengthDelimited,
6521                )?;
6522                ::buffa::Message::merge_length_delimited(
6523                    self.layout.get_or_insert_default(),
6524                    buf,
6525                    ctx,
6526                )?;
6527            }
6528            _ => {
6529                self.__buffa_unknown_fields
6530                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6531            }
6532        }
6533        ::core::result::Result::Ok(())
6534    }
6535    fn clear(&mut self) {
6536        self.layout = ::buffa::MessageField::none();
6537        self.__buffa_unknown_fields.clear();
6538    }
6539}
6540impl ::buffa::ExtensionSet for UpsertLayoutRequest {
6541    const PROTO_FQN: &'static str = "layout.v1.UpsertLayoutRequest";
6542    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6543        &self.__buffa_unknown_fields
6544    }
6545    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6546        &mut self.__buffa_unknown_fields
6547    }
6548}
6549impl ::buffa::json_helpers::ProtoElemJson for UpsertLayoutRequest {
6550    fn serialize_proto_json<S: ::serde::Serializer>(
6551        v: &Self,
6552        s: S,
6553    ) -> ::core::result::Result<S::Ok, S::Error> {
6554        ::serde::Serialize::serialize(v, s)
6555    }
6556    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6557        d: D,
6558    ) -> ::core::result::Result<Self, D::Error> {
6559        <Self as ::serde::Deserialize>::deserialize(d)
6560    }
6561}
6562#[doc(hidden)]
6563pub const __UPSERT_LAYOUT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6564    type_url: "type.googleapis.com/layout.v1.UpsertLayoutRequest",
6565    to_json: ::buffa::type_registry::any_to_json::<UpsertLayoutRequest>,
6566    from_json: ::buffa::type_registry::any_from_json::<UpsertLayoutRequest>,
6567    is_wkt: false,
6568};
6569/// UpsertLayoutResponse returns the saved layout.
6570#[derive(Clone, PartialEq, Default)]
6571#[derive(::serde::Serialize, ::serde::Deserialize)]
6572#[serde(default)]
6573pub struct UpsertLayoutResponse {
6574    /// Saved layout after server-side ownership and timestamp handling.
6575    ///
6576    /// Field 1: `layout`
6577    #[serde(
6578        rename = "layout",
6579        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
6580    )]
6581    pub layout: ::buffa::MessageField<Layout>,
6582    #[serde(skip)]
6583    #[doc(hidden)]
6584    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6585}
6586impl ::core::fmt::Debug for UpsertLayoutResponse {
6587    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6588        f.debug_struct("UpsertLayoutResponse").field("layout", &self.layout).finish()
6589    }
6590}
6591impl UpsertLayoutResponse {
6592    /// Protobuf type URL for this message, for use with `Any::pack` and
6593    /// `Any::unpack_if`.
6594    ///
6595    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6596    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.UpsertLayoutResponse";
6597}
6598::buffa::impl_default_instance!(UpsertLayoutResponse);
6599impl ::buffa::MessageName for UpsertLayoutResponse {
6600    const PACKAGE: &'static str = "layout.v1";
6601    const NAME: &'static str = "UpsertLayoutResponse";
6602    const FULL_NAME: &'static str = "layout.v1.UpsertLayoutResponse";
6603    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.UpsertLayoutResponse";
6604}
6605impl ::buffa::Message for UpsertLayoutResponse {
6606    /// Returns the total encoded size in bytes.
6607    ///
6608    /// The result is a `u32`; the protobuf specification requires all
6609    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
6610    /// compliant message will never overflow this type.
6611    #[allow(clippy::let_and_return)]
6612    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6613        #[allow(unused_imports)]
6614        use ::buffa::Enumeration as _;
6615        let mut size = 0u32;
6616        if self.layout.is_set() {
6617            let __slot = __cache.reserve();
6618            let inner_size = self.layout.compute_size(__cache);
6619            __cache.set(__slot, inner_size);
6620            size
6621                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
6622                    + inner_size;
6623        }
6624        size += self.__buffa_unknown_fields.encoded_len() as u32;
6625        size
6626    }
6627    fn write_to(
6628        &self,
6629        __cache: &mut ::buffa::SizeCache,
6630        buf: &mut impl ::buffa::bytes::BufMut,
6631    ) {
6632        #[allow(unused_imports)]
6633        use ::buffa::Enumeration as _;
6634        if self.layout.is_set() {
6635            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
6636            self.layout.write_to(__cache, buf);
6637        }
6638        self.__buffa_unknown_fields.write_to(buf);
6639    }
6640    fn merge_field(
6641        &mut self,
6642        tag: ::buffa::encoding::Tag,
6643        buf: &mut impl ::buffa::bytes::Buf,
6644        ctx: ::buffa::DecodeContext<'_>,
6645    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6646        #[allow(unused_imports)]
6647        use ::buffa::bytes::Buf as _;
6648        #[allow(unused_imports)]
6649        use ::buffa::Enumeration as _;
6650        match tag.field_number() {
6651            1u32 => {
6652                ::buffa::encoding::check_wire_type(
6653                    tag,
6654                    ::buffa::encoding::WireType::LengthDelimited,
6655                )?;
6656                ::buffa::Message::merge_length_delimited(
6657                    self.layout.get_or_insert_default(),
6658                    buf,
6659                    ctx,
6660                )?;
6661            }
6662            _ => {
6663                self.__buffa_unknown_fields
6664                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6665            }
6666        }
6667        ::core::result::Result::Ok(())
6668    }
6669    fn clear(&mut self) {
6670        self.layout = ::buffa::MessageField::none();
6671        self.__buffa_unknown_fields.clear();
6672    }
6673}
6674impl ::buffa::ExtensionSet for UpsertLayoutResponse {
6675    const PROTO_FQN: &'static str = "layout.v1.UpsertLayoutResponse";
6676    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6677        &self.__buffa_unknown_fields
6678    }
6679    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6680        &mut self.__buffa_unknown_fields
6681    }
6682}
6683impl ::buffa::json_helpers::ProtoElemJson for UpsertLayoutResponse {
6684    fn serialize_proto_json<S: ::serde::Serializer>(
6685        v: &Self,
6686        s: S,
6687    ) -> ::core::result::Result<S::Ok, S::Error> {
6688        ::serde::Serialize::serialize(v, s)
6689    }
6690    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6691        d: D,
6692    ) -> ::core::result::Result<Self, D::Error> {
6693        <Self as ::serde::Deserialize>::deserialize(d)
6694    }
6695}
6696#[doc(hidden)]
6697pub const __UPSERT_LAYOUT_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6698    type_url: "type.googleapis.com/layout.v1.UpsertLayoutResponse",
6699    to_json: ::buffa::type_registry::any_to_json::<UpsertLayoutResponse>,
6700    from_json: ::buffa::type_registry::any_from_json::<UpsertLayoutResponse>,
6701    is_wkt: false,
6702};
6703/// DeleteLayoutRequest deletes one saved layout owned by the authenticated caller.
6704#[derive(Clone, PartialEq, Default)]
6705#[derive(::serde::Serialize, ::serde::Deserialize)]
6706#[serde(default)]
6707pub struct DeleteLayoutRequest {
6708    /// Layout identifier to delete.
6709    ///
6710    /// Field 1: `layout_id`
6711    #[serde(
6712        rename = "layoutId",
6713        alias = "layout_id",
6714        with = "::buffa::json_helpers::uint64",
6715        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
6716    )]
6717    pub layout_id: u64,
6718    #[serde(skip)]
6719    #[doc(hidden)]
6720    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6721}
6722impl ::core::fmt::Debug for DeleteLayoutRequest {
6723    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6724        f.debug_struct("DeleteLayoutRequest")
6725            .field("layout_id", &self.layout_id)
6726            .finish()
6727    }
6728}
6729impl DeleteLayoutRequest {
6730    /// Protobuf type URL for this message, for use with `Any::pack` and
6731    /// `Any::unpack_if`.
6732    ///
6733    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6734    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.DeleteLayoutRequest";
6735}
6736::buffa::impl_default_instance!(DeleteLayoutRequest);
6737impl ::buffa::MessageName for DeleteLayoutRequest {
6738    const PACKAGE: &'static str = "layout.v1";
6739    const NAME: &'static str = "DeleteLayoutRequest";
6740    const FULL_NAME: &'static str = "layout.v1.DeleteLayoutRequest";
6741    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.DeleteLayoutRequest";
6742}
6743impl ::buffa::Message for DeleteLayoutRequest {
6744    /// Returns the total encoded size in bytes.
6745    ///
6746    /// The result is a `u32`; the protobuf specification requires all
6747    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
6748    /// compliant message will never overflow this type.
6749    #[allow(clippy::let_and_return)]
6750    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
6751        #[allow(unused_imports)]
6752        use ::buffa::Enumeration as _;
6753        let mut size = 0u32;
6754        if self.layout_id != 0u64 {
6755            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
6756        }
6757        size += self.__buffa_unknown_fields.encoded_len() as u32;
6758        size
6759    }
6760    fn write_to(
6761        &self,
6762        _cache: &mut ::buffa::SizeCache,
6763        buf: &mut impl ::buffa::bytes::BufMut,
6764    ) {
6765        #[allow(unused_imports)]
6766        use ::buffa::Enumeration as _;
6767        if self.layout_id != 0u64 {
6768            ::buffa::types::put_fixed64_field(1u32, self.layout_id, buf);
6769        }
6770        self.__buffa_unknown_fields.write_to(buf);
6771    }
6772    fn merge_field(
6773        &mut self,
6774        tag: ::buffa::encoding::Tag,
6775        buf: &mut impl ::buffa::bytes::Buf,
6776        ctx: ::buffa::DecodeContext<'_>,
6777    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6778        #[allow(unused_imports)]
6779        use ::buffa::bytes::Buf as _;
6780        #[allow(unused_imports)]
6781        use ::buffa::Enumeration as _;
6782        match tag.field_number() {
6783            1u32 => {
6784                ::buffa::encoding::check_wire_type(
6785                    tag,
6786                    ::buffa::encoding::WireType::Fixed64,
6787                )?;
6788                self.layout_id = ::buffa::types::decode_fixed64(buf)?;
6789            }
6790            _ => {
6791                self.__buffa_unknown_fields
6792                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6793            }
6794        }
6795        ::core::result::Result::Ok(())
6796    }
6797    fn clear(&mut self) {
6798        self.layout_id = 0u64;
6799        self.__buffa_unknown_fields.clear();
6800    }
6801}
6802impl ::buffa::ExtensionSet for DeleteLayoutRequest {
6803    const PROTO_FQN: &'static str = "layout.v1.DeleteLayoutRequest";
6804    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6805        &self.__buffa_unknown_fields
6806    }
6807    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6808        &mut self.__buffa_unknown_fields
6809    }
6810}
6811impl ::buffa::json_helpers::ProtoElemJson for DeleteLayoutRequest {
6812    fn serialize_proto_json<S: ::serde::Serializer>(
6813        v: &Self,
6814        s: S,
6815    ) -> ::core::result::Result<S::Ok, S::Error> {
6816        ::serde::Serialize::serialize(v, s)
6817    }
6818    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6819        d: D,
6820    ) -> ::core::result::Result<Self, D::Error> {
6821        <Self as ::serde::Deserialize>::deserialize(d)
6822    }
6823}
6824#[doc(hidden)]
6825pub const __DELETE_LAYOUT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6826    type_url: "type.googleapis.com/layout.v1.DeleteLayoutRequest",
6827    to_json: ::buffa::type_registry::any_to_json::<DeleteLayoutRequest>,
6828    from_json: ::buffa::type_registry::any_from_json::<DeleteLayoutRequest>,
6829    is_wkt: false,
6830};
6831/// DeleteLayoutResponse is empty when the layout was deleted.
6832#[derive(Clone, PartialEq, Default)]
6833#[derive(::serde::Serialize, ::serde::Deserialize)]
6834#[serde(default)]
6835pub struct DeleteLayoutResponse {
6836    #[serde(skip)]
6837    #[doc(hidden)]
6838    pub __buffa_unknown_fields: ::buffa::UnknownFields,
6839}
6840impl ::core::fmt::Debug for DeleteLayoutResponse {
6841    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6842        f.debug_struct("DeleteLayoutResponse").finish()
6843    }
6844}
6845impl DeleteLayoutResponse {
6846    /// Protobuf type URL for this message, for use with `Any::pack` and
6847    /// `Any::unpack_if`.
6848    ///
6849    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6850    pub const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.DeleteLayoutResponse";
6851}
6852::buffa::impl_default_instance!(DeleteLayoutResponse);
6853impl ::buffa::MessageName for DeleteLayoutResponse {
6854    const PACKAGE: &'static str = "layout.v1";
6855    const NAME: &'static str = "DeleteLayoutResponse";
6856    const FULL_NAME: &'static str = "layout.v1.DeleteLayoutResponse";
6857    const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.DeleteLayoutResponse";
6858}
6859impl ::buffa::Message for DeleteLayoutResponse {
6860    /// Returns the total encoded size in bytes.
6861    ///
6862    /// The result is a `u32`; the protobuf specification requires all
6863    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
6864    /// compliant message will never overflow this type.
6865    #[allow(clippy::let_and_return)]
6866    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
6867        #[allow(unused_imports)]
6868        use ::buffa::Enumeration as _;
6869        let mut size = 0u32;
6870        size += self.__buffa_unknown_fields.encoded_len() as u32;
6871        size
6872    }
6873    fn write_to(
6874        &self,
6875        _cache: &mut ::buffa::SizeCache,
6876        buf: &mut impl ::buffa::bytes::BufMut,
6877    ) {
6878        #[allow(unused_imports)]
6879        use ::buffa::Enumeration as _;
6880        self.__buffa_unknown_fields.write_to(buf);
6881    }
6882    fn merge_field(
6883        &mut self,
6884        tag: ::buffa::encoding::Tag,
6885        buf: &mut impl ::buffa::bytes::Buf,
6886        ctx: ::buffa::DecodeContext<'_>,
6887    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6888        #[allow(unused_imports)]
6889        use ::buffa::bytes::Buf as _;
6890        #[allow(unused_imports)]
6891        use ::buffa::Enumeration as _;
6892        match tag.field_number() {
6893            _ => {
6894                self.__buffa_unknown_fields
6895                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
6896            }
6897        }
6898        ::core::result::Result::Ok(())
6899    }
6900    fn clear(&mut self) {
6901        self.__buffa_unknown_fields.clear();
6902    }
6903}
6904impl ::buffa::ExtensionSet for DeleteLayoutResponse {
6905    const PROTO_FQN: &'static str = "layout.v1.DeleteLayoutResponse";
6906    fn unknown_fields(&self) -> &::buffa::UnknownFields {
6907        &self.__buffa_unknown_fields
6908    }
6909    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6910        &mut self.__buffa_unknown_fields
6911    }
6912}
6913impl ::buffa::json_helpers::ProtoElemJson for DeleteLayoutResponse {
6914    fn serialize_proto_json<S: ::serde::Serializer>(
6915        v: &Self,
6916        s: S,
6917    ) -> ::core::result::Result<S::Ok, S::Error> {
6918        ::serde::Serialize::serialize(v, s)
6919    }
6920    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6921        d: D,
6922    ) -> ::core::result::Result<Self, D::Error> {
6923        <Self as ::serde::Deserialize>::deserialize(d)
6924    }
6925}
6926#[doc(hidden)]
6927pub const __DELETE_LAYOUT_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6928    type_url: "type.googleapis.com/layout.v1.DeleteLayoutResponse",
6929    to_json: ::buffa::type_registry::any_to_json::<DeleteLayoutResponse>,
6930    from_json: ::buffa::type_registry::any_from_json::<DeleteLayoutResponse>,
6931    is_wkt: false,
6932};
6933#[allow(
6934    non_camel_case_types,
6935    dead_code,
6936    unused_imports,
6937    unused_qualifications,
6938    clippy::derivable_impls,
6939    clippy::match_single_binding,
6940    clippy::uninlined_format_args,
6941    clippy::doc_lazy_continuation,
6942    clippy::module_inception
6943)]
6944pub mod __buffa {
6945    #[allow(unused_imports)]
6946    use super::*;
6947    pub mod view {
6948        #[allow(unused_imports)]
6949        use super::*;
6950        /// LayoutWidget stores one widget instance and its widget-specific configuration.
6951        #[derive(Clone, Debug, Default)]
6952        pub struct LayoutWidgetView<'a> {
6953            /// Stable widget identifier within the layout, such as "chart-1".
6954            ///
6955            /// Field 1: `widget_id`
6956            pub widget_id: &'a str,
6957            /// Widget kind that determines how widget_config is decoded.
6958            ///
6959            /// Field 2: `widget_type`
6960            pub widget_type: ::buffa::EnumValue<super::super::WidgetType>,
6961            /// Serialized widget configuration bytes for the selected widget_type.
6962            ///
6963            /// Field 3: `widget_config`
6964            pub widget_config: &'a [u8],
6965            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
6966        }
6967        impl<'a> ::buffa::MessageView<'a> for LayoutWidgetView<'a> {
6968            type Owned = super::super::LayoutWidget;
6969            fn decode_view(
6970                buf: &'a [u8],
6971            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6972                let __limit = ::core::cell::Cell::new(
6973                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
6974                );
6975                <Self as ::buffa::MessageView>::decode_view_ctx(
6976                    buf,
6977                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
6978                )
6979            }
6980            fn decode_view_with_ctx(
6981                buf: &'a [u8],
6982                ctx: ::buffa::DecodeContext<'_>,
6983            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6984                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
6985            }
6986            fn merge_view_field(
6987                &mut self,
6988                tag: ::buffa::encoding::Tag,
6989                cur: &'a [u8],
6990                before_tag: &'a [u8],
6991                ctx: ::buffa::DecodeContext<'_>,
6992            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
6993                let _ = ctx;
6994                #[allow(unused_variables)]
6995                let view = self;
6996                let mut cur = cur;
6997                match tag.field_number() {
6998                    1u32 => {
6999                        ::buffa::encoding::check_wire_type(
7000                            tag,
7001                            ::buffa::encoding::WireType::LengthDelimited,
7002                        )?;
7003                        view.widget_id = ::buffa::types::borrow_str(&mut cur)?;
7004                    }
7005                    2u32 => {
7006                        ::buffa::encoding::check_wire_type(
7007                            tag,
7008                            ::buffa::encoding::WireType::Varint,
7009                        )?;
7010                        view.widget_type = ::buffa::EnumValue::from(
7011                            ::buffa::types::decode_int32(&mut cur)?,
7012                        );
7013                    }
7014                    3u32 => {
7015                        ::buffa::encoding::check_wire_type(
7016                            tag,
7017                            ::buffa::encoding::WireType::LengthDelimited,
7018                        )?;
7019                        view.widget_config = ::buffa::types::borrow_bytes(&mut cur)?;
7020                    }
7021                    _ => {
7022                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
7023                        let span_len = before_tag.len() - cur.len();
7024                        view.__buffa_unknown_fields
7025                            .push_record(before_tag, span_len, ctx)?;
7026                    }
7027                }
7028                ::core::result::Result::Ok(cur)
7029            }
7030            fn to_owned_message(
7031                &self,
7032            ) -> ::core::result::Result<
7033                super::super::LayoutWidget,
7034                ::buffa::DecodeError,
7035            > {
7036                self.to_owned_from_source(None)
7037            }
7038            #[allow(clippy::useless_conversion, clippy::needless_update)]
7039            fn to_owned_from_source(
7040                &self,
7041                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
7042            ) -> ::core::result::Result<
7043                super::super::LayoutWidget,
7044                ::buffa::DecodeError,
7045            > {
7046                #[allow(unused_imports)]
7047                use ::buffa::alloc::string::ToString as _;
7048                let _ = __buffa_src;
7049                ::core::result::Result::Ok(super::super::LayoutWidget {
7050                    widget_id: self.widget_id.to_string(),
7051                    widget_type: self.widget_type,
7052                    widget_config: (self.widget_config).to_vec(),
7053                    __buffa_unknown_fields: self
7054                        .__buffa_unknown_fields
7055                        .to_owned()?
7056                        .into(),
7057                    ..::core::default::Default::default()
7058                })
7059            }
7060        }
7061        impl<'a> ::buffa::ViewEncode<'a> for LayoutWidgetView<'a> {
7062            #[allow(clippy::needless_borrow, clippy::let_and_return)]
7063            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
7064                #[allow(unused_imports)]
7065                use ::buffa::Enumeration as _;
7066                let mut size = 0u32;
7067                if !self.widget_id.is_empty() {
7068                    size
7069                        += 1u32
7070                            + ::buffa::types::string_encoded_len(&self.widget_id) as u32;
7071                }
7072                {
7073                    let val = self.widget_type.to_i32();
7074                    if val != 0 {
7075                        size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
7076                    }
7077                }
7078                if !self.widget_config.is_empty() {
7079                    size
7080                        += 1u32
7081                            + ::buffa::types::bytes_encoded_len(&self.widget_config)
7082                                as u32;
7083                }
7084                size += self.__buffa_unknown_fields.encoded_len() as u32;
7085                size
7086            }
7087            #[allow(clippy::needless_borrow)]
7088            fn write_to(
7089                &self,
7090                _cache: &mut ::buffa::SizeCache,
7091                buf: &mut impl ::buffa::bytes::BufMut,
7092            ) {
7093                #[allow(unused_imports)]
7094                use ::buffa::Enumeration as _;
7095                if !self.widget_id.is_empty() {
7096                    ::buffa::types::put_string_field(1u32, &self.widget_id, buf);
7097                }
7098                {
7099                    let val = self.widget_type.to_i32();
7100                    if val != 0 {
7101                        ::buffa::types::put_int32_field(2u32, val, buf);
7102                    }
7103                }
7104                if !self.widget_config.is_empty() {
7105                    ::buffa::types::put_bytes_field(3u32, &self.widget_config, buf);
7106                }
7107                self.__buffa_unknown_fields.write_to(buf);
7108            }
7109        }
7110        /// Serializes this view as protobuf JSON.
7111        ///
7112        /// Implicit-presence fields with default values are omitted, `required`
7113        /// fields are always emitted, explicit-presence (`optional`) fields are
7114        /// emitted only when set, bytes fields are base64-encoded, and enum
7115        /// values are their proto name strings.
7116        ///
7117        /// This impl uses `serialize_map(None)` because the number of emitted
7118        /// fields depends on default-omission rules; serializers that require
7119        /// known map lengths (e.g. `bincode`) will return a runtime error.
7120        /// Use the owned message type for those formats.
7121        impl<'__a> ::serde::Serialize for LayoutWidgetView<'__a> {
7122            fn serialize<__S: ::serde::Serializer>(
7123                &self,
7124                __s: __S,
7125            ) -> ::core::result::Result<__S::Ok, __S::Error> {
7126                use ::serde::ser::SerializeMap as _;
7127                let mut __map = __s.serialize_map(::core::option::Option::None)?;
7128                if !::buffa::json_helpers::skip_if::is_empty_str(self.widget_id) {
7129                    __map.serialize_entry("widgetId", self.widget_id)?;
7130                }
7131                if !::buffa::json_helpers::skip_if::is_default_enum_value(
7132                    &self.widget_type,
7133                ) {
7134                    __map.serialize_entry("widgetType", &self.widget_type)?;
7135                }
7136                if !::buffa::json_helpers::skip_if::is_empty_bytes(self.widget_config) {
7137                    __map
7138                        .serialize_entry(
7139                            "widgetConfig",
7140                            &::buffa::json_helpers::BytesJson(self.widget_config),
7141                        )?;
7142                }
7143                __map.end()
7144            }
7145        }
7146        impl<'a> ::buffa::MessageName for LayoutWidgetView<'a> {
7147            const PACKAGE: &'static str = "layout.v1";
7148            const NAME: &'static str = "LayoutWidget";
7149            const FULL_NAME: &'static str = "layout.v1.LayoutWidget";
7150            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutWidget";
7151        }
7152        ::buffa::impl_default_view_instance!(LayoutWidgetView);
7153        ::buffa::impl_view_reborrow!(LayoutWidgetView);
7154        /** Self-contained, `'static` owned view of a `LayoutWidget` message.
7155
7156 Wraps [`::buffa::OwnedView`]`<`[`LayoutWidgetView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
7157
7158 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`LayoutWidgetView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
7159        #[derive(Clone, Debug)]
7160        pub struct LayoutWidgetOwnedView(::buffa::OwnedView<LayoutWidgetView<'static>>);
7161        impl LayoutWidgetOwnedView {
7162            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
7163            ///
7164            /// The view borrows directly from the buffer's data; the buffer is
7165            /// retained inside the returned handle.
7166            ///
7167            /// # Errors
7168            ///
7169            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
7170            /// protobuf data.
7171            pub fn decode(
7172                bytes: ::buffa::bytes::Bytes,
7173            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7174                ::core::result::Result::Ok(
7175                    LayoutWidgetOwnedView(::buffa::OwnedView::decode(bytes)?),
7176                )
7177            }
7178            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
7179            /// max message size).
7180            ///
7181            /// # Errors
7182            ///
7183            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
7184            /// exceeds the configured limits.
7185            pub fn decode_with_options(
7186                bytes: ::buffa::bytes::Bytes,
7187                opts: &::buffa::DecodeOptions,
7188            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7189                ::core::result::Result::Ok(
7190                    LayoutWidgetOwnedView(
7191                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
7192                    ),
7193                )
7194            }
7195            /// Build from an owned message via an encode → decode round-trip.
7196            ///
7197            /// # Errors
7198            ///
7199            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
7200            /// somehow invalid (should not happen for well-formed messages).
7201            pub fn from_owned(
7202                msg: &super::super::LayoutWidget,
7203            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7204                ::core::result::Result::Ok(
7205                    LayoutWidgetOwnedView(::buffa::OwnedView::from_owned(msg)?),
7206                )
7207            }
7208            /// Borrow the full [`LayoutWidgetView`] with its lifetime tied to `&self`.
7209            #[must_use]
7210            pub fn view(&self) -> &LayoutWidgetView<'_> {
7211                self.0.reborrow()
7212            }
7213            /// Convert to the owned message type.
7214            ///
7215            /// # Errors
7216            ///
7217            /// Returns an error if re-materializing preserved unknown fields
7218            /// fails (e.g. the unknown-field limit is exceeded).
7219            pub fn to_owned_message(
7220                &self,
7221            ) -> ::core::result::Result<
7222                super::super::LayoutWidget,
7223                ::buffa::DecodeError,
7224            > {
7225                self.0.to_owned_message()
7226            }
7227            /// The underlying bytes buffer.
7228            #[must_use]
7229            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
7230                self.0.bytes()
7231            }
7232            /// Consume the handle, returning the underlying bytes buffer.
7233            #[must_use]
7234            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
7235                self.0.into_bytes()
7236            }
7237            /// Stable widget identifier within the layout, such as "chart-1".
7238            ///
7239            /// Field 1: `widget_id`
7240            #[must_use]
7241            pub fn widget_id(&self) -> &'_ str {
7242                self.0.reborrow().widget_id
7243            }
7244            /// Widget kind that determines how widget_config is decoded.
7245            ///
7246            /// Field 2: `widget_type`
7247            #[must_use]
7248            pub fn widget_type(&self) -> ::buffa::EnumValue<super::super::WidgetType> {
7249                self.0.reborrow().widget_type
7250            }
7251            /// Serialized widget configuration bytes for the selected widget_type.
7252            ///
7253            /// Field 3: `widget_config`
7254            #[must_use]
7255            pub fn widget_config(&self) -> &'_ [u8] {
7256                self.0.reborrow().widget_config
7257            }
7258        }
7259        impl ::core::convert::From<::buffa::OwnedView<LayoutWidgetView<'static>>>
7260        for LayoutWidgetOwnedView {
7261            fn from(inner: ::buffa::OwnedView<LayoutWidgetView<'static>>) -> Self {
7262                LayoutWidgetOwnedView(inner)
7263            }
7264        }
7265        impl ::core::convert::From<LayoutWidgetOwnedView>
7266        for ::buffa::OwnedView<LayoutWidgetView<'static>> {
7267            fn from(wrapper: LayoutWidgetOwnedView) -> Self {
7268                wrapper.0
7269            }
7270        }
7271        impl ::core::convert::AsRef<::buffa::OwnedView<LayoutWidgetView<'static>>>
7272        for LayoutWidgetOwnedView {
7273            fn as_ref(&self) -> &::buffa::OwnedView<LayoutWidgetView<'static>> {
7274                &self.0
7275            }
7276        }
7277        impl ::buffa::HasMessageView for super::super::LayoutWidget {
7278            type View<'a> = LayoutWidgetView<'a>;
7279            type ViewHandle = LayoutWidgetOwnedView;
7280        }
7281        impl ::serde::Serialize for LayoutWidgetOwnedView {
7282            fn serialize<__S: ::serde::Serializer>(
7283                &self,
7284                __s: __S,
7285            ) -> ::core::result::Result<__S::Ok, __S::Error> {
7286                ::serde::Serialize::serialize(&self.0, __s)
7287            }
7288        }
7289        /// Layout is a saved editor workspace owned by one viewer.
7290        #[derive(Clone, Debug, Default)]
7291        pub struct LayoutView<'a> {
7292            /// Viewer that owns the saved layout.
7293            ///
7294            /// Field 1: `viewer_id`
7295            pub viewer_id: u64,
7296            /// Layout identifier unique within the viewer's saved layouts.
7297            ///
7298            /// Field 2: `layout_id`
7299            pub layout_id: u64,
7300            /// Human-readable layout name.
7301            ///
7302            /// Field 3: `name`
7303            pub name: &'a str,
7304            /// True when this is the viewer's default layout.
7305            ///
7306            /// Field 4: `is_default`
7307            pub is_default: bool,
7308            /// Serialized editor panel arrangement snapshot.
7309            ///
7310            /// Field 5: `dockview_state`
7311            pub dockview_state: &'a [u8],
7312            /// Widgets contained in the layout.
7313            ///
7314            /// Field 6: `widgets`
7315            pub widgets: ::buffa::RepeatedView<
7316                'a,
7317                super::super::__buffa::view::LayoutWidgetView<'a>,
7318            >,
7319            /// Last update time in milliseconds since epoch (UTC).
7320            ///
7321            /// Field 7: `updated_at_ms`
7322            pub updated_at_ms: u64,
7323            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
7324        }
7325        impl<'a> ::buffa::MessageView<'a> for LayoutView<'a> {
7326            type Owned = super::super::Layout;
7327            fn decode_view(
7328                buf: &'a [u8],
7329            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7330                let __limit = ::core::cell::Cell::new(
7331                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
7332                );
7333                <Self as ::buffa::MessageView>::decode_view_ctx(
7334                    buf,
7335                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
7336                )
7337            }
7338            fn decode_view_with_ctx(
7339                buf: &'a [u8],
7340                ctx: ::buffa::DecodeContext<'_>,
7341            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7342                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
7343            }
7344            fn merge_view_field(
7345                &mut self,
7346                tag: ::buffa::encoding::Tag,
7347                cur: &'a [u8],
7348                before_tag: &'a [u8],
7349                ctx: ::buffa::DecodeContext<'_>,
7350            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
7351                let _ = ctx;
7352                #[allow(unused_variables)]
7353                let view = self;
7354                let mut cur = cur;
7355                match tag.field_number() {
7356                    1u32 => {
7357                        ::buffa::encoding::check_wire_type(
7358                            tag,
7359                            ::buffa::encoding::WireType::Fixed64,
7360                        )?;
7361                        view.viewer_id = ::buffa::types::decode_fixed64(&mut cur)?;
7362                    }
7363                    2u32 => {
7364                        ::buffa::encoding::check_wire_type(
7365                            tag,
7366                            ::buffa::encoding::WireType::Fixed64,
7367                        )?;
7368                        view.layout_id = ::buffa::types::decode_fixed64(&mut cur)?;
7369                    }
7370                    3u32 => {
7371                        ::buffa::encoding::check_wire_type(
7372                            tag,
7373                            ::buffa::encoding::WireType::LengthDelimited,
7374                        )?;
7375                        view.name = ::buffa::types::borrow_str(&mut cur)?;
7376                    }
7377                    4u32 => {
7378                        ::buffa::encoding::check_wire_type(
7379                            tag,
7380                            ::buffa::encoding::WireType::Varint,
7381                        )?;
7382                        view.is_default = ::buffa::types::decode_bool(&mut cur)?;
7383                    }
7384                    5u32 => {
7385                        ::buffa::encoding::check_wire_type(
7386                            tag,
7387                            ::buffa::encoding::WireType::LengthDelimited,
7388                        )?;
7389                        view.dockview_state = ::buffa::types::borrow_bytes(&mut cur)?;
7390                    }
7391                    7u32 => {
7392                        ::buffa::encoding::check_wire_type(
7393                            tag,
7394                            ::buffa::encoding::WireType::Fixed64,
7395                        )?;
7396                        view.updated_at_ms = ::buffa::types::decode_fixed64(&mut cur)?;
7397                    }
7398                    6u32 => {
7399                        ::buffa::encoding::check_wire_type(
7400                            tag,
7401                            ::buffa::encoding::WireType::LengthDelimited,
7402                        )?;
7403                        let __sub_ctx = ctx.descend()?;
7404                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
7405                        view.widgets
7406                            .push(
7407                                <super::super::__buffa::view::LayoutWidgetView as ::buffa::MessageView>::decode_view_ctx(
7408                                    sub,
7409                                    __sub_ctx,
7410                                )?,
7411                            );
7412                    }
7413                    _ => {
7414                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
7415                        let span_len = before_tag.len() - cur.len();
7416                        view.__buffa_unknown_fields
7417                            .push_record(before_tag, span_len, ctx)?;
7418                    }
7419                }
7420                ::core::result::Result::Ok(cur)
7421            }
7422            fn to_owned_message(
7423                &self,
7424            ) -> ::core::result::Result<super::super::Layout, ::buffa::DecodeError> {
7425                self.to_owned_from_source(None)
7426            }
7427            #[allow(clippy::useless_conversion, clippy::needless_update)]
7428            fn to_owned_from_source(
7429                &self,
7430                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
7431            ) -> ::core::result::Result<super::super::Layout, ::buffa::DecodeError> {
7432                #[allow(unused_imports)]
7433                use ::buffa::alloc::string::ToString as _;
7434                let _ = __buffa_src;
7435                ::core::result::Result::Ok(super::super::Layout {
7436                    viewer_id: self.viewer_id,
7437                    layout_id: self.layout_id,
7438                    name: self.name.to_string(),
7439                    is_default: self.is_default,
7440                    dockview_state: (self.dockview_state).to_vec(),
7441                    widgets: self
7442                        .widgets
7443                        .iter()
7444                        .map(|v| v.to_owned_from_source(__buffa_src))
7445                        .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
7446                    updated_at_ms: self.updated_at_ms,
7447                    __buffa_unknown_fields: self
7448                        .__buffa_unknown_fields
7449                        .to_owned()?
7450                        .into(),
7451                    ..::core::default::Default::default()
7452                })
7453            }
7454        }
7455        impl<'a> ::buffa::ViewEncode<'a> for LayoutView<'a> {
7456            #[allow(clippy::needless_borrow, clippy::let_and_return)]
7457            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
7458                #[allow(unused_imports)]
7459                use ::buffa::Enumeration as _;
7460                let mut size = 0u32;
7461                if self.viewer_id != 0u64 {
7462                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
7463                }
7464                if self.layout_id != 0u64 {
7465                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
7466                }
7467                if !self.name.is_empty() {
7468                    size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
7469                }
7470                if self.is_default {
7471                    size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7472                }
7473                if !self.dockview_state.is_empty() {
7474                    size
7475                        += 1u32
7476                            + ::buffa::types::bytes_encoded_len(&self.dockview_state)
7477                                as u32;
7478                }
7479                for v in &self.widgets {
7480                    let __slot = __cache.reserve();
7481                    let inner_size = v.compute_size(__cache);
7482                    __cache.set(__slot, inner_size);
7483                    size
7484                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
7485                            + inner_size;
7486                }
7487                if self.updated_at_ms != 0u64 {
7488                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
7489                }
7490                size += self.__buffa_unknown_fields.encoded_len() as u32;
7491                size
7492            }
7493            #[allow(clippy::needless_borrow)]
7494            fn write_to(
7495                &self,
7496                __cache: &mut ::buffa::SizeCache,
7497                buf: &mut impl ::buffa::bytes::BufMut,
7498            ) {
7499                #[allow(unused_imports)]
7500                use ::buffa::Enumeration as _;
7501                if self.viewer_id != 0u64 {
7502                    ::buffa::types::put_fixed64_field(1u32, self.viewer_id, buf);
7503                }
7504                if self.layout_id != 0u64 {
7505                    ::buffa::types::put_fixed64_field(2u32, self.layout_id, buf);
7506                }
7507                if !self.name.is_empty() {
7508                    ::buffa::types::put_string_field(3u32, &self.name, buf);
7509                }
7510                if self.is_default {
7511                    ::buffa::types::put_bool_field(4u32, self.is_default, buf);
7512                }
7513                if !self.dockview_state.is_empty() {
7514                    ::buffa::types::put_bytes_field(5u32, &self.dockview_state, buf);
7515                }
7516                for v in &self.widgets {
7517                    ::buffa::types::put_len_delimited_header(
7518                        6u32,
7519                        __cache.consume_next(),
7520                        buf,
7521                    );
7522                    v.write_to(__cache, buf);
7523                }
7524                if self.updated_at_ms != 0u64 {
7525                    ::buffa::types::put_fixed64_field(7u32, self.updated_at_ms, buf);
7526                }
7527                self.__buffa_unknown_fields.write_to(buf);
7528            }
7529        }
7530        /// Serializes this view as protobuf JSON.
7531        ///
7532        /// Implicit-presence fields with default values are omitted, `required`
7533        /// fields are always emitted, explicit-presence (`optional`) fields are
7534        /// emitted only when set, bytes fields are base64-encoded, and enum
7535        /// values are their proto name strings.
7536        ///
7537        /// This impl uses `serialize_map(None)` because the number of emitted
7538        /// fields depends on default-omission rules; serializers that require
7539        /// known map lengths (e.g. `bincode`) will return a runtime error.
7540        /// Use the owned message type for those formats.
7541        impl<'__a> ::serde::Serialize for LayoutView<'__a> {
7542            fn serialize<__S: ::serde::Serializer>(
7543                &self,
7544                __s: __S,
7545            ) -> ::core::result::Result<__S::Ok, __S::Error> {
7546                use ::serde::ser::SerializeMap as _;
7547                let mut __map = __s.serialize_map(::core::option::Option::None)?;
7548                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.viewer_id) {
7549                    __map
7550                        .serialize_entry(
7551                            "viewerId",
7552                            &::buffa::json_helpers::ProtoJson(&self.viewer_id),
7553                        )?;
7554                }
7555                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.layout_id) {
7556                    __map
7557                        .serialize_entry(
7558                            "layoutId",
7559                            &::buffa::json_helpers::ProtoJson(&self.layout_id),
7560                        )?;
7561                }
7562                if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
7563                    __map.serialize_entry("name", self.name)?;
7564                }
7565                if self.is_default {
7566                    __map.serialize_entry("isDefault", &self.is_default)?;
7567                }
7568                if !::buffa::json_helpers::skip_if::is_empty_bytes(self.dockview_state) {
7569                    __map
7570                        .serialize_entry(
7571                            "dockviewState",
7572                            &::buffa::json_helpers::BytesJson(self.dockview_state),
7573                        )?;
7574                }
7575                if !self.widgets.is_empty() {
7576                    __map.serialize_entry("widgets", &*self.widgets)?;
7577                }
7578                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.updated_at_ms) {
7579                    __map
7580                        .serialize_entry(
7581                            "updatedAtMs",
7582                            &::buffa::json_helpers::ProtoJson(&self.updated_at_ms),
7583                        )?;
7584                }
7585                __map.end()
7586            }
7587        }
7588        impl<'a> ::buffa::MessageName for LayoutView<'a> {
7589            const PACKAGE: &'static str = "layout.v1";
7590            const NAME: &'static str = "Layout";
7591            const FULL_NAME: &'static str = "layout.v1.Layout";
7592            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.Layout";
7593        }
7594        ::buffa::impl_default_view_instance!(LayoutView);
7595        ::buffa::impl_view_reborrow!(LayoutView);
7596        /** Self-contained, `'static` owned view of a `Layout` message.
7597
7598 Wraps [`::buffa::OwnedView`]`<`[`LayoutView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
7599
7600 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`LayoutView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
7601        #[derive(Clone, Debug)]
7602        pub struct LayoutOwnedView(::buffa::OwnedView<LayoutView<'static>>);
7603        impl LayoutOwnedView {
7604            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
7605            ///
7606            /// The view borrows directly from the buffer's data; the buffer is
7607            /// retained inside the returned handle.
7608            ///
7609            /// # Errors
7610            ///
7611            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
7612            /// protobuf data.
7613            pub fn decode(
7614                bytes: ::buffa::bytes::Bytes,
7615            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7616                ::core::result::Result::Ok(
7617                    LayoutOwnedView(::buffa::OwnedView::decode(bytes)?),
7618                )
7619            }
7620            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
7621            /// max message size).
7622            ///
7623            /// # Errors
7624            ///
7625            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
7626            /// exceeds the configured limits.
7627            pub fn decode_with_options(
7628                bytes: ::buffa::bytes::Bytes,
7629                opts: &::buffa::DecodeOptions,
7630            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7631                ::core::result::Result::Ok(
7632                    LayoutOwnedView(
7633                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
7634                    ),
7635                )
7636            }
7637            /// Build from an owned message via an encode → decode round-trip.
7638            ///
7639            /// # Errors
7640            ///
7641            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
7642            /// somehow invalid (should not happen for well-formed messages).
7643            pub fn from_owned(
7644                msg: &super::super::Layout,
7645            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7646                ::core::result::Result::Ok(
7647                    LayoutOwnedView(::buffa::OwnedView::from_owned(msg)?),
7648                )
7649            }
7650            /// Borrow the full [`LayoutView`] with its lifetime tied to `&self`.
7651            #[must_use]
7652            pub fn view(&self) -> &LayoutView<'_> {
7653                self.0.reborrow()
7654            }
7655            /// Convert to the owned message type.
7656            ///
7657            /// # Errors
7658            ///
7659            /// Returns an error if re-materializing preserved unknown fields
7660            /// fails (e.g. the unknown-field limit is exceeded).
7661            pub fn to_owned_message(
7662                &self,
7663            ) -> ::core::result::Result<super::super::Layout, ::buffa::DecodeError> {
7664                self.0.to_owned_message()
7665            }
7666            /// The underlying bytes buffer.
7667            #[must_use]
7668            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
7669                self.0.bytes()
7670            }
7671            /// Consume the handle, returning the underlying bytes buffer.
7672            #[must_use]
7673            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
7674                self.0.into_bytes()
7675            }
7676            /// Viewer that owns the saved layout.
7677            ///
7678            /// Field 1: `viewer_id`
7679            #[must_use]
7680            pub fn viewer_id(&self) -> u64 {
7681                self.0.reborrow().viewer_id
7682            }
7683            /// Layout identifier unique within the viewer's saved layouts.
7684            ///
7685            /// Field 2: `layout_id`
7686            #[must_use]
7687            pub fn layout_id(&self) -> u64 {
7688                self.0.reborrow().layout_id
7689            }
7690            /// Human-readable layout name.
7691            ///
7692            /// Field 3: `name`
7693            #[must_use]
7694            pub fn name(&self) -> &'_ str {
7695                self.0.reborrow().name
7696            }
7697            /// True when this is the viewer's default layout.
7698            ///
7699            /// Field 4: `is_default`
7700            #[must_use]
7701            pub fn is_default(&self) -> bool {
7702                self.0.reborrow().is_default
7703            }
7704            /// Serialized editor panel arrangement snapshot.
7705            ///
7706            /// Field 5: `dockview_state`
7707            #[must_use]
7708            pub fn dockview_state(&self) -> &'_ [u8] {
7709                self.0.reborrow().dockview_state
7710            }
7711            /// Widgets contained in the layout.
7712            ///
7713            /// Field 6: `widgets`
7714            #[must_use]
7715            pub fn widgets(
7716                &self,
7717            ) -> &::buffa::RepeatedView<
7718                '_,
7719                super::super::__buffa::view::LayoutWidgetView<'_>,
7720            > {
7721                &self.0.reborrow().widgets
7722            }
7723            /// Last update time in milliseconds since epoch (UTC).
7724            ///
7725            /// Field 7: `updated_at_ms`
7726            #[must_use]
7727            pub fn updated_at_ms(&self) -> u64 {
7728                self.0.reborrow().updated_at_ms
7729            }
7730        }
7731        impl ::core::convert::From<::buffa::OwnedView<LayoutView<'static>>>
7732        for LayoutOwnedView {
7733            fn from(inner: ::buffa::OwnedView<LayoutView<'static>>) -> Self {
7734                LayoutOwnedView(inner)
7735            }
7736        }
7737        impl ::core::convert::From<LayoutOwnedView>
7738        for ::buffa::OwnedView<LayoutView<'static>> {
7739            fn from(wrapper: LayoutOwnedView) -> Self {
7740                wrapper.0
7741            }
7742        }
7743        impl ::core::convert::AsRef<::buffa::OwnedView<LayoutView<'static>>>
7744        for LayoutOwnedView {
7745            fn as_ref(&self) -> &::buffa::OwnedView<LayoutView<'static>> {
7746                &self.0
7747            }
7748        }
7749        impl ::buffa::HasMessageView for super::super::Layout {
7750            type View<'a> = LayoutView<'a>;
7751            type ViewHandle = LayoutOwnedView;
7752        }
7753        impl ::serde::Serialize for LayoutOwnedView {
7754            fn serialize<__S: ::serde::Serializer>(
7755                &self,
7756                __s: __S,
7757            ) -> ::core::result::Result<__S::Ok, __S::Error> {
7758                ::serde::Serialize::serialize(&self.0, __s)
7759            }
7760        }
7761        /// -----------------------------------------------------------------------------
7762        /// Widget configs
7763        /// -----------------------------------------------------------------------------
7764        ///
7765        /// Chart widget config (stored in LayoutWidget.widget_config when widget_type == CHART).
7766        #[derive(Clone, Debug, Default)]
7767        pub struct ChartWidgetConfigView<'a> {
7768            /// Engine symbol identifier for the chart market.
7769            ///
7770            /// Field 1: `engine_symbol_id`
7771            pub engine_symbol_id: u32,
7772            /// Candle timeframe, such as "1m", "5m", "1h", or "1d".
7773            ///
7774            /// Field 2: `timeframe`
7775            pub timeframe: &'a str,
7776            /// Indicators configured for this chart.
7777            ///
7778            /// Field 3: `indicators`
7779            pub indicators: ::buffa::RepeatedView<
7780                'a,
7781                super::super::__buffa::view::ChartIndicatorView<'a>,
7782            >,
7783            /// Visual style options for this chart.
7784            ///
7785            /// Field 4: `style`
7786            pub style: ::buffa::MessageFieldView<
7787                super::super::__buffa::view::ChartStyleView<'a>,
7788            >,
7789            /// Optional: per-widget layer visibility overrides.
7790            /// If empty, use layer subscriptions defaults for this market.
7791            ///
7792            /// Field 5: `layer_overrides`
7793            pub layer_overrides: ::buffa::RepeatedView<
7794                'a,
7795                super::super::__buffa::view::LayerVisibilityOverrideView<'a>,
7796            >,
7797            /// When true, chart follows the latest candle/price (UI behavior).
7798            ///
7799            /// Field 6: `follow_latest`
7800            pub follow_latest: bool,
7801            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
7802        }
7803        impl<'a> ::buffa::MessageView<'a> for ChartWidgetConfigView<'a> {
7804            type Owned = super::super::ChartWidgetConfig;
7805            fn decode_view(
7806                buf: &'a [u8],
7807            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7808                let __limit = ::core::cell::Cell::new(
7809                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
7810                );
7811                <Self as ::buffa::MessageView>::decode_view_ctx(
7812                    buf,
7813                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
7814                )
7815            }
7816            fn decode_view_with_ctx(
7817                buf: &'a [u8],
7818                ctx: ::buffa::DecodeContext<'_>,
7819            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7820                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
7821            }
7822            fn merge_view_field(
7823                &mut self,
7824                tag: ::buffa::encoding::Tag,
7825                cur: &'a [u8],
7826                before_tag: &'a [u8],
7827                ctx: ::buffa::DecodeContext<'_>,
7828            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
7829                let _ = ctx;
7830                #[allow(unused_variables)]
7831                let view = self;
7832                let mut cur = cur;
7833                match tag.field_number() {
7834                    1u32 => {
7835                        ::buffa::encoding::check_wire_type(
7836                            tag,
7837                            ::buffa::encoding::WireType::Varint,
7838                        )?;
7839                        view.engine_symbol_id = ::buffa::types::decode_uint32(&mut cur)?;
7840                    }
7841                    2u32 => {
7842                        ::buffa::encoding::check_wire_type(
7843                            tag,
7844                            ::buffa::encoding::WireType::LengthDelimited,
7845                        )?;
7846                        view.timeframe = ::buffa::types::borrow_str(&mut cur)?;
7847                    }
7848                    4u32 => {
7849                        ::buffa::encoding::check_wire_type(
7850                            tag,
7851                            ::buffa::encoding::WireType::LengthDelimited,
7852                        )?;
7853                        let __sub_ctx = ctx.descend()?;
7854                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
7855                        match view.style.as_mut() {
7856                            Some(existing) => {
7857                                ::buffa::MessageView::merge_into_view(
7858                                    existing,
7859                                    sub,
7860                                    __sub_ctx,
7861                                )?
7862                            }
7863                            None => {
7864                                view.style = ::buffa::MessageFieldView::set(
7865                                    <super::super::__buffa::view::ChartStyleView as ::buffa::MessageView>::decode_view_ctx(
7866                                        sub,
7867                                        __sub_ctx,
7868                                    )?,
7869                                );
7870                            }
7871                        }
7872                    }
7873                    6u32 => {
7874                        ::buffa::encoding::check_wire_type(
7875                            tag,
7876                            ::buffa::encoding::WireType::Varint,
7877                        )?;
7878                        view.follow_latest = ::buffa::types::decode_bool(&mut cur)?;
7879                    }
7880                    3u32 => {
7881                        ::buffa::encoding::check_wire_type(
7882                            tag,
7883                            ::buffa::encoding::WireType::LengthDelimited,
7884                        )?;
7885                        let __sub_ctx = ctx.descend()?;
7886                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
7887                        view.indicators
7888                            .push(
7889                                <super::super::__buffa::view::ChartIndicatorView as ::buffa::MessageView>::decode_view_ctx(
7890                                    sub,
7891                                    __sub_ctx,
7892                                )?,
7893                            );
7894                    }
7895                    5u32 => {
7896                        ::buffa::encoding::check_wire_type(
7897                            tag,
7898                            ::buffa::encoding::WireType::LengthDelimited,
7899                        )?;
7900                        let __sub_ctx = ctx.descend()?;
7901                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
7902                        view.layer_overrides
7903                            .push(
7904                                <super::super::__buffa::view::LayerVisibilityOverrideView as ::buffa::MessageView>::decode_view_ctx(
7905                                    sub,
7906                                    __sub_ctx,
7907                                )?,
7908                            );
7909                    }
7910                    _ => {
7911                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
7912                        let span_len = before_tag.len() - cur.len();
7913                        view.__buffa_unknown_fields
7914                            .push_record(before_tag, span_len, ctx)?;
7915                    }
7916                }
7917                ::core::result::Result::Ok(cur)
7918            }
7919            fn to_owned_message(
7920                &self,
7921            ) -> ::core::result::Result<
7922                super::super::ChartWidgetConfig,
7923                ::buffa::DecodeError,
7924            > {
7925                self.to_owned_from_source(None)
7926            }
7927            #[allow(clippy::useless_conversion, clippy::needless_update)]
7928            fn to_owned_from_source(
7929                &self,
7930                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
7931            ) -> ::core::result::Result<
7932                super::super::ChartWidgetConfig,
7933                ::buffa::DecodeError,
7934            > {
7935                #[allow(unused_imports)]
7936                use ::buffa::alloc::string::ToString as _;
7937                let _ = __buffa_src;
7938                ::core::result::Result::Ok(super::super::ChartWidgetConfig {
7939                    engine_symbol_id: self.engine_symbol_id,
7940                    timeframe: self.timeframe.to_string(),
7941                    indicators: self
7942                        .indicators
7943                        .iter()
7944                        .map(|v| v.to_owned_from_source(__buffa_src))
7945                        .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
7946                    style: match self.style.as_option() {
7947                        Some(v) => {
7948                            ::buffa::MessageField::<
7949                                super::super::ChartStyle,
7950                            >::some(v.to_owned_from_source(__buffa_src)?)
7951                        }
7952                        None => ::buffa::MessageField::none(),
7953                    },
7954                    layer_overrides: self
7955                        .layer_overrides
7956                        .iter()
7957                        .map(|v| v.to_owned_from_source(__buffa_src))
7958                        .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
7959                    follow_latest: self.follow_latest,
7960                    __buffa_unknown_fields: self
7961                        .__buffa_unknown_fields
7962                        .to_owned()?
7963                        .into(),
7964                    ..::core::default::Default::default()
7965                })
7966            }
7967        }
7968        impl<'a> ::buffa::ViewEncode<'a> for ChartWidgetConfigView<'a> {
7969            #[allow(clippy::needless_borrow, clippy::let_and_return)]
7970            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
7971                #[allow(unused_imports)]
7972                use ::buffa::Enumeration as _;
7973                let mut size = 0u32;
7974                if self.engine_symbol_id != 0u32 {
7975                    size
7976                        += 1u32
7977                            + ::buffa::types::uint32_encoded_len(self.engine_symbol_id)
7978                                as u32;
7979                }
7980                if !self.timeframe.is_empty() {
7981                    size
7982                        += 1u32
7983                            + ::buffa::types::string_encoded_len(&self.timeframe) as u32;
7984                }
7985                for v in &self.indicators {
7986                    let __slot = __cache.reserve();
7987                    let inner_size = v.compute_size(__cache);
7988                    __cache.set(__slot, inner_size);
7989                    size
7990                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
7991                            + inner_size;
7992                }
7993                if self.style.is_set() {
7994                    let __slot = __cache.reserve();
7995                    let inner_size = self.style.compute_size(__cache);
7996                    __cache.set(__slot, inner_size);
7997                    size
7998                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
7999                            + inner_size;
8000                }
8001                for v in &self.layer_overrides {
8002                    let __slot = __cache.reserve();
8003                    let inner_size = v.compute_size(__cache);
8004                    __cache.set(__slot, inner_size);
8005                    size
8006                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
8007                            + inner_size;
8008                }
8009                if self.follow_latest {
8010                    size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
8011                }
8012                size += self.__buffa_unknown_fields.encoded_len() as u32;
8013                size
8014            }
8015            #[allow(clippy::needless_borrow)]
8016            fn write_to(
8017                &self,
8018                __cache: &mut ::buffa::SizeCache,
8019                buf: &mut impl ::buffa::bytes::BufMut,
8020            ) {
8021                #[allow(unused_imports)]
8022                use ::buffa::Enumeration as _;
8023                if self.engine_symbol_id != 0u32 {
8024                    ::buffa::types::put_uint32_field(1u32, self.engine_symbol_id, buf);
8025                }
8026                if !self.timeframe.is_empty() {
8027                    ::buffa::types::put_string_field(2u32, &self.timeframe, buf);
8028                }
8029                for v in &self.indicators {
8030                    ::buffa::types::put_len_delimited_header(
8031                        3u32,
8032                        __cache.consume_next(),
8033                        buf,
8034                    );
8035                    v.write_to(__cache, buf);
8036                }
8037                if self.style.is_set() {
8038                    ::buffa::types::put_len_delimited_header(
8039                        4u32,
8040                        __cache.consume_next(),
8041                        buf,
8042                    );
8043                    self.style.write_to(__cache, buf);
8044                }
8045                for v in &self.layer_overrides {
8046                    ::buffa::types::put_len_delimited_header(
8047                        5u32,
8048                        __cache.consume_next(),
8049                        buf,
8050                    );
8051                    v.write_to(__cache, buf);
8052                }
8053                if self.follow_latest {
8054                    ::buffa::types::put_bool_field(6u32, self.follow_latest, buf);
8055                }
8056                self.__buffa_unknown_fields.write_to(buf);
8057            }
8058        }
8059        /// Serializes this view as protobuf JSON.
8060        ///
8061        /// Implicit-presence fields with default values are omitted, `required`
8062        /// fields are always emitted, explicit-presence (`optional`) fields are
8063        /// emitted only when set, bytes fields are base64-encoded, and enum
8064        /// values are their proto name strings.
8065        ///
8066        /// This impl uses `serialize_map(None)` because the number of emitted
8067        /// fields depends on default-omission rules; serializers that require
8068        /// known map lengths (e.g. `bincode`) will return a runtime error.
8069        /// Use the owned message type for those formats.
8070        impl<'__a> ::serde::Serialize for ChartWidgetConfigView<'__a> {
8071            fn serialize<__S: ::serde::Serializer>(
8072                &self,
8073                __s: __S,
8074            ) -> ::core::result::Result<__S::Ok, __S::Error> {
8075                use ::serde::ser::SerializeMap as _;
8076                let mut __map = __s.serialize_map(::core::option::Option::None)?;
8077                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.engine_symbol_id) {
8078                    __map
8079                        .serialize_entry(
8080                            "engineSymbolId",
8081                            &::buffa::json_helpers::ProtoJson(&self.engine_symbol_id),
8082                        )?;
8083                }
8084                if !::buffa::json_helpers::skip_if::is_empty_str(self.timeframe) {
8085                    __map.serialize_entry("timeframe", self.timeframe)?;
8086                }
8087                if !self.indicators.is_empty() {
8088                    __map.serialize_entry("indicators", &*self.indicators)?;
8089                }
8090                {
8091                    if let ::core::option::Option::Some(__v) = self.style.as_option() {
8092                        __map.serialize_entry("style", __v)?;
8093                    }
8094                }
8095                if !self.layer_overrides.is_empty() {
8096                    __map.serialize_entry("layerOverrides", &*self.layer_overrides)?;
8097                }
8098                if self.follow_latest {
8099                    __map.serialize_entry("followLatest", &self.follow_latest)?;
8100                }
8101                __map.end()
8102            }
8103        }
8104        impl<'a> ::buffa::MessageName for ChartWidgetConfigView<'a> {
8105            const PACKAGE: &'static str = "layout.v1";
8106            const NAME: &'static str = "ChartWidgetConfig";
8107            const FULL_NAME: &'static str = "layout.v1.ChartWidgetConfig";
8108            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ChartWidgetConfig";
8109        }
8110        ::buffa::impl_default_view_instance!(ChartWidgetConfigView);
8111        ::buffa::impl_view_reborrow!(ChartWidgetConfigView);
8112        /** Self-contained, `'static` owned view of a `ChartWidgetConfig` message.
8113
8114 Wraps [`::buffa::OwnedView`]`<`[`ChartWidgetConfigView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
8115
8116 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ChartWidgetConfigView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
8117        #[derive(Clone, Debug)]
8118        pub struct ChartWidgetConfigOwnedView(
8119            ::buffa::OwnedView<ChartWidgetConfigView<'static>>,
8120        );
8121        impl ChartWidgetConfigOwnedView {
8122            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
8123            ///
8124            /// The view borrows directly from the buffer's data; the buffer is
8125            /// retained inside the returned handle.
8126            ///
8127            /// # Errors
8128            ///
8129            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
8130            /// protobuf data.
8131            pub fn decode(
8132                bytes: ::buffa::bytes::Bytes,
8133            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8134                ::core::result::Result::Ok(
8135                    ChartWidgetConfigOwnedView(::buffa::OwnedView::decode(bytes)?),
8136                )
8137            }
8138            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
8139            /// max message size).
8140            ///
8141            /// # Errors
8142            ///
8143            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
8144            /// exceeds the configured limits.
8145            pub fn decode_with_options(
8146                bytes: ::buffa::bytes::Bytes,
8147                opts: &::buffa::DecodeOptions,
8148            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8149                ::core::result::Result::Ok(
8150                    ChartWidgetConfigOwnedView(
8151                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
8152                    ),
8153                )
8154            }
8155            /// Build from an owned message via an encode → decode round-trip.
8156            ///
8157            /// # Errors
8158            ///
8159            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
8160            /// somehow invalid (should not happen for well-formed messages).
8161            pub fn from_owned(
8162                msg: &super::super::ChartWidgetConfig,
8163            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8164                ::core::result::Result::Ok(
8165                    ChartWidgetConfigOwnedView(::buffa::OwnedView::from_owned(msg)?),
8166                )
8167            }
8168            /// Borrow the full [`ChartWidgetConfigView`] with its lifetime tied to `&self`.
8169            #[must_use]
8170            pub fn view(&self) -> &ChartWidgetConfigView<'_> {
8171                self.0.reborrow()
8172            }
8173            /// Convert to the owned message type.
8174            ///
8175            /// # Errors
8176            ///
8177            /// Returns an error if re-materializing preserved unknown fields
8178            /// fails (e.g. the unknown-field limit is exceeded).
8179            pub fn to_owned_message(
8180                &self,
8181            ) -> ::core::result::Result<
8182                super::super::ChartWidgetConfig,
8183                ::buffa::DecodeError,
8184            > {
8185                self.0.to_owned_message()
8186            }
8187            /// The underlying bytes buffer.
8188            #[must_use]
8189            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
8190                self.0.bytes()
8191            }
8192            /// Consume the handle, returning the underlying bytes buffer.
8193            #[must_use]
8194            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
8195                self.0.into_bytes()
8196            }
8197            /// Engine symbol identifier for the chart market.
8198            ///
8199            /// Field 1: `engine_symbol_id`
8200            #[must_use]
8201            pub fn engine_symbol_id(&self) -> u32 {
8202                self.0.reborrow().engine_symbol_id
8203            }
8204            /// Candle timeframe, such as "1m", "5m", "1h", or "1d".
8205            ///
8206            /// Field 2: `timeframe`
8207            #[must_use]
8208            pub fn timeframe(&self) -> &'_ str {
8209                self.0.reborrow().timeframe
8210            }
8211            /// Indicators configured for this chart.
8212            ///
8213            /// Field 3: `indicators`
8214            #[must_use]
8215            pub fn indicators(
8216                &self,
8217            ) -> &::buffa::RepeatedView<
8218                '_,
8219                super::super::__buffa::view::ChartIndicatorView<'_>,
8220            > {
8221                &self.0.reborrow().indicators
8222            }
8223            /// Visual style options for this chart.
8224            ///
8225            /// Field 4: `style`
8226            #[must_use]
8227            pub fn style(
8228                &self,
8229            ) -> &::buffa::MessageFieldView<
8230                super::super::__buffa::view::ChartStyleView<'_>,
8231            > {
8232                &self.0.reborrow().style
8233            }
8234            /// Optional: per-widget layer visibility overrides.
8235            /// If empty, use layer subscriptions defaults for this market.
8236            ///
8237            /// Field 5: `layer_overrides`
8238            #[must_use]
8239            pub fn layer_overrides(
8240                &self,
8241            ) -> &::buffa::RepeatedView<
8242                '_,
8243                super::super::__buffa::view::LayerVisibilityOverrideView<'_>,
8244            > {
8245                &self.0.reborrow().layer_overrides
8246            }
8247            /// When true, chart follows the latest candle/price (UI behavior).
8248            ///
8249            /// Field 6: `follow_latest`
8250            #[must_use]
8251            pub fn follow_latest(&self) -> bool {
8252                self.0.reborrow().follow_latest
8253            }
8254        }
8255        impl ::core::convert::From<::buffa::OwnedView<ChartWidgetConfigView<'static>>>
8256        for ChartWidgetConfigOwnedView {
8257            fn from(inner: ::buffa::OwnedView<ChartWidgetConfigView<'static>>) -> Self {
8258                ChartWidgetConfigOwnedView(inner)
8259            }
8260        }
8261        impl ::core::convert::From<ChartWidgetConfigOwnedView>
8262        for ::buffa::OwnedView<ChartWidgetConfigView<'static>> {
8263            fn from(wrapper: ChartWidgetConfigOwnedView) -> Self {
8264                wrapper.0
8265            }
8266        }
8267        impl ::core::convert::AsRef<::buffa::OwnedView<ChartWidgetConfigView<'static>>>
8268        for ChartWidgetConfigOwnedView {
8269            fn as_ref(&self) -> &::buffa::OwnedView<ChartWidgetConfigView<'static>> {
8270                &self.0
8271            }
8272        }
8273        impl ::buffa::HasMessageView for super::super::ChartWidgetConfig {
8274            type View<'a> = ChartWidgetConfigView<'a>;
8275            type ViewHandle = ChartWidgetConfigOwnedView;
8276        }
8277        impl ::serde::Serialize for ChartWidgetConfigOwnedView {
8278            fn serialize<__S: ::serde::Serializer>(
8279                &self,
8280                __s: __S,
8281            ) -> ::core::result::Result<__S::Ok, __S::Error> {
8282                ::serde::Serialize::serialize(&self.0, __s)
8283            }
8284        }
8285        /// ChartIndicator stores one configured technical indicator.
8286        #[derive(Clone, Debug, Default)]
8287        pub struct ChartIndicatorView<'a> {
8288            /// Indicator type, such as "RSI", "MACD", or "BB".
8289            ///
8290            /// Field 1: `indicator_type`
8291            pub indicator_type: &'a str,
8292            /// Serialized indicator parameters understood by the chart client.
8293            ///
8294            /// Field 2: `params`
8295            pub params: &'a [u8],
8296            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
8297        }
8298        impl<'a> ::buffa::MessageView<'a> for ChartIndicatorView<'a> {
8299            type Owned = super::super::ChartIndicator;
8300            fn decode_view(
8301                buf: &'a [u8],
8302            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8303                let __limit = ::core::cell::Cell::new(
8304                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
8305                );
8306                <Self as ::buffa::MessageView>::decode_view_ctx(
8307                    buf,
8308                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
8309                )
8310            }
8311            fn decode_view_with_ctx(
8312                buf: &'a [u8],
8313                ctx: ::buffa::DecodeContext<'_>,
8314            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8315                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
8316            }
8317            fn merge_view_field(
8318                &mut self,
8319                tag: ::buffa::encoding::Tag,
8320                cur: &'a [u8],
8321                before_tag: &'a [u8],
8322                ctx: ::buffa::DecodeContext<'_>,
8323            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
8324                let _ = ctx;
8325                #[allow(unused_variables)]
8326                let view = self;
8327                let mut cur = cur;
8328                match tag.field_number() {
8329                    1u32 => {
8330                        ::buffa::encoding::check_wire_type(
8331                            tag,
8332                            ::buffa::encoding::WireType::LengthDelimited,
8333                        )?;
8334                        view.indicator_type = ::buffa::types::borrow_str(&mut cur)?;
8335                    }
8336                    2u32 => {
8337                        ::buffa::encoding::check_wire_type(
8338                            tag,
8339                            ::buffa::encoding::WireType::LengthDelimited,
8340                        )?;
8341                        view.params = ::buffa::types::borrow_bytes(&mut cur)?;
8342                    }
8343                    _ => {
8344                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
8345                        let span_len = before_tag.len() - cur.len();
8346                        view.__buffa_unknown_fields
8347                            .push_record(before_tag, span_len, ctx)?;
8348                    }
8349                }
8350                ::core::result::Result::Ok(cur)
8351            }
8352            fn to_owned_message(
8353                &self,
8354            ) -> ::core::result::Result<
8355                super::super::ChartIndicator,
8356                ::buffa::DecodeError,
8357            > {
8358                self.to_owned_from_source(None)
8359            }
8360            #[allow(clippy::useless_conversion, clippy::needless_update)]
8361            fn to_owned_from_source(
8362                &self,
8363                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
8364            ) -> ::core::result::Result<
8365                super::super::ChartIndicator,
8366                ::buffa::DecodeError,
8367            > {
8368                #[allow(unused_imports)]
8369                use ::buffa::alloc::string::ToString as _;
8370                let _ = __buffa_src;
8371                ::core::result::Result::Ok(super::super::ChartIndicator {
8372                    indicator_type: self.indicator_type.to_string(),
8373                    params: (self.params).to_vec(),
8374                    __buffa_unknown_fields: self
8375                        .__buffa_unknown_fields
8376                        .to_owned()?
8377                        .into(),
8378                    ..::core::default::Default::default()
8379                })
8380            }
8381        }
8382        impl<'a> ::buffa::ViewEncode<'a> for ChartIndicatorView<'a> {
8383            #[allow(clippy::needless_borrow, clippy::let_and_return)]
8384            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
8385                #[allow(unused_imports)]
8386                use ::buffa::Enumeration as _;
8387                let mut size = 0u32;
8388                if !self.indicator_type.is_empty() {
8389                    size
8390                        += 1u32
8391                            + ::buffa::types::string_encoded_len(&self.indicator_type)
8392                                as u32;
8393                }
8394                if !self.params.is_empty() {
8395                    size
8396                        += 1u32 + ::buffa::types::bytes_encoded_len(&self.params) as u32;
8397                }
8398                size += self.__buffa_unknown_fields.encoded_len() as u32;
8399                size
8400            }
8401            #[allow(clippy::needless_borrow)]
8402            fn write_to(
8403                &self,
8404                _cache: &mut ::buffa::SizeCache,
8405                buf: &mut impl ::buffa::bytes::BufMut,
8406            ) {
8407                #[allow(unused_imports)]
8408                use ::buffa::Enumeration as _;
8409                if !self.indicator_type.is_empty() {
8410                    ::buffa::types::put_string_field(1u32, &self.indicator_type, buf);
8411                }
8412                if !self.params.is_empty() {
8413                    ::buffa::types::put_bytes_field(2u32, &self.params, buf);
8414                }
8415                self.__buffa_unknown_fields.write_to(buf);
8416            }
8417        }
8418        /// Serializes this view as protobuf JSON.
8419        ///
8420        /// Implicit-presence fields with default values are omitted, `required`
8421        /// fields are always emitted, explicit-presence (`optional`) fields are
8422        /// emitted only when set, bytes fields are base64-encoded, and enum
8423        /// values are their proto name strings.
8424        ///
8425        /// This impl uses `serialize_map(None)` because the number of emitted
8426        /// fields depends on default-omission rules; serializers that require
8427        /// known map lengths (e.g. `bincode`) will return a runtime error.
8428        /// Use the owned message type for those formats.
8429        impl<'__a> ::serde::Serialize for ChartIndicatorView<'__a> {
8430            fn serialize<__S: ::serde::Serializer>(
8431                &self,
8432                __s: __S,
8433            ) -> ::core::result::Result<__S::Ok, __S::Error> {
8434                use ::serde::ser::SerializeMap as _;
8435                let mut __map = __s.serialize_map(::core::option::Option::None)?;
8436                if !::buffa::json_helpers::skip_if::is_empty_str(self.indicator_type) {
8437                    __map.serialize_entry("indicatorType", self.indicator_type)?;
8438                }
8439                if !::buffa::json_helpers::skip_if::is_empty_bytes(self.params) {
8440                    __map
8441                        .serialize_entry(
8442                            "params",
8443                            &::buffa::json_helpers::BytesJson(self.params),
8444                        )?;
8445                }
8446                __map.end()
8447            }
8448        }
8449        impl<'a> ::buffa::MessageName for ChartIndicatorView<'a> {
8450            const PACKAGE: &'static str = "layout.v1";
8451            const NAME: &'static str = "ChartIndicator";
8452            const FULL_NAME: &'static str = "layout.v1.ChartIndicator";
8453            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ChartIndicator";
8454        }
8455        ::buffa::impl_default_view_instance!(ChartIndicatorView);
8456        ::buffa::impl_view_reborrow!(ChartIndicatorView);
8457        /** Self-contained, `'static` owned view of a `ChartIndicator` message.
8458
8459 Wraps [`::buffa::OwnedView`]`<`[`ChartIndicatorView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
8460
8461 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ChartIndicatorView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
8462        #[derive(Clone, Debug)]
8463        pub struct ChartIndicatorOwnedView(
8464            ::buffa::OwnedView<ChartIndicatorView<'static>>,
8465        );
8466        impl ChartIndicatorOwnedView {
8467            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
8468            ///
8469            /// The view borrows directly from the buffer's data; the buffer is
8470            /// retained inside the returned handle.
8471            ///
8472            /// # Errors
8473            ///
8474            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
8475            /// protobuf data.
8476            pub fn decode(
8477                bytes: ::buffa::bytes::Bytes,
8478            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8479                ::core::result::Result::Ok(
8480                    ChartIndicatorOwnedView(::buffa::OwnedView::decode(bytes)?),
8481                )
8482            }
8483            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
8484            /// max message size).
8485            ///
8486            /// # Errors
8487            ///
8488            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
8489            /// exceeds the configured limits.
8490            pub fn decode_with_options(
8491                bytes: ::buffa::bytes::Bytes,
8492                opts: &::buffa::DecodeOptions,
8493            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8494                ::core::result::Result::Ok(
8495                    ChartIndicatorOwnedView(
8496                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
8497                    ),
8498                )
8499            }
8500            /// Build from an owned message via an encode → decode round-trip.
8501            ///
8502            /// # Errors
8503            ///
8504            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
8505            /// somehow invalid (should not happen for well-formed messages).
8506            pub fn from_owned(
8507                msg: &super::super::ChartIndicator,
8508            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8509                ::core::result::Result::Ok(
8510                    ChartIndicatorOwnedView(::buffa::OwnedView::from_owned(msg)?),
8511                )
8512            }
8513            /// Borrow the full [`ChartIndicatorView`] with its lifetime tied to `&self`.
8514            #[must_use]
8515            pub fn view(&self) -> &ChartIndicatorView<'_> {
8516                self.0.reborrow()
8517            }
8518            /// Convert to the owned message type.
8519            ///
8520            /// # Errors
8521            ///
8522            /// Returns an error if re-materializing preserved unknown fields
8523            /// fails (e.g. the unknown-field limit is exceeded).
8524            pub fn to_owned_message(
8525                &self,
8526            ) -> ::core::result::Result<
8527                super::super::ChartIndicator,
8528                ::buffa::DecodeError,
8529            > {
8530                self.0.to_owned_message()
8531            }
8532            /// The underlying bytes buffer.
8533            #[must_use]
8534            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
8535                self.0.bytes()
8536            }
8537            /// Consume the handle, returning the underlying bytes buffer.
8538            #[must_use]
8539            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
8540                self.0.into_bytes()
8541            }
8542            /// Indicator type, such as "RSI", "MACD", or "BB".
8543            ///
8544            /// Field 1: `indicator_type`
8545            #[must_use]
8546            pub fn indicator_type(&self) -> &'_ str {
8547                self.0.reborrow().indicator_type
8548            }
8549            /// Serialized indicator parameters understood by the chart client.
8550            ///
8551            /// Field 2: `params`
8552            #[must_use]
8553            pub fn params(&self) -> &'_ [u8] {
8554                self.0.reborrow().params
8555            }
8556        }
8557        impl ::core::convert::From<::buffa::OwnedView<ChartIndicatorView<'static>>>
8558        for ChartIndicatorOwnedView {
8559            fn from(inner: ::buffa::OwnedView<ChartIndicatorView<'static>>) -> Self {
8560                ChartIndicatorOwnedView(inner)
8561            }
8562        }
8563        impl ::core::convert::From<ChartIndicatorOwnedView>
8564        for ::buffa::OwnedView<ChartIndicatorView<'static>> {
8565            fn from(wrapper: ChartIndicatorOwnedView) -> Self {
8566                wrapper.0
8567            }
8568        }
8569        impl ::core::convert::AsRef<::buffa::OwnedView<ChartIndicatorView<'static>>>
8570        for ChartIndicatorOwnedView {
8571            fn as_ref(&self) -> &::buffa::OwnedView<ChartIndicatorView<'static>> {
8572                &self.0
8573            }
8574        }
8575        impl ::buffa::HasMessageView for super::super::ChartIndicator {
8576            type View<'a> = ChartIndicatorView<'a>;
8577            type ViewHandle = ChartIndicatorOwnedView;
8578        }
8579        impl ::serde::Serialize for ChartIndicatorOwnedView {
8580            fn serialize<__S: ::serde::Serializer>(
8581                &self,
8582                __s: __S,
8583            ) -> ::core::result::Result<__S::Ok, __S::Error> {
8584                ::serde::Serialize::serialize(&self.0, __s)
8585            }
8586        }
8587        /// ChartStyle stores visual chart style settings.
8588        #[derive(Clone, Debug, Default)]
8589        pub struct ChartStyleView<'a> {
8590            /// Serialized style settings understood by the chart client.
8591            ///
8592            /// Field 1: `style_bytes`
8593            pub style_bytes: &'a [u8],
8594            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
8595        }
8596        impl<'a> ::buffa::MessageView<'a> for ChartStyleView<'a> {
8597            type Owned = super::super::ChartStyle;
8598            fn decode_view(
8599                buf: &'a [u8],
8600            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8601                let __limit = ::core::cell::Cell::new(
8602                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
8603                );
8604                <Self as ::buffa::MessageView>::decode_view_ctx(
8605                    buf,
8606                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
8607                )
8608            }
8609            fn decode_view_with_ctx(
8610                buf: &'a [u8],
8611                ctx: ::buffa::DecodeContext<'_>,
8612            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8613                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
8614            }
8615            fn merge_view_field(
8616                &mut self,
8617                tag: ::buffa::encoding::Tag,
8618                cur: &'a [u8],
8619                before_tag: &'a [u8],
8620                ctx: ::buffa::DecodeContext<'_>,
8621            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
8622                let _ = ctx;
8623                #[allow(unused_variables)]
8624                let view = self;
8625                let mut cur = cur;
8626                match tag.field_number() {
8627                    1u32 => {
8628                        ::buffa::encoding::check_wire_type(
8629                            tag,
8630                            ::buffa::encoding::WireType::LengthDelimited,
8631                        )?;
8632                        view.style_bytes = ::buffa::types::borrow_bytes(&mut cur)?;
8633                    }
8634                    _ => {
8635                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
8636                        let span_len = before_tag.len() - cur.len();
8637                        view.__buffa_unknown_fields
8638                            .push_record(before_tag, span_len, ctx)?;
8639                    }
8640                }
8641                ::core::result::Result::Ok(cur)
8642            }
8643            fn to_owned_message(
8644                &self,
8645            ) -> ::core::result::Result<super::super::ChartStyle, ::buffa::DecodeError> {
8646                self.to_owned_from_source(None)
8647            }
8648            #[allow(clippy::useless_conversion, clippy::needless_update)]
8649            fn to_owned_from_source(
8650                &self,
8651                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
8652            ) -> ::core::result::Result<super::super::ChartStyle, ::buffa::DecodeError> {
8653                #[allow(unused_imports)]
8654                use ::buffa::alloc::string::ToString as _;
8655                let _ = __buffa_src;
8656                ::core::result::Result::Ok(super::super::ChartStyle {
8657                    style_bytes: (self.style_bytes).to_vec(),
8658                    __buffa_unknown_fields: self
8659                        .__buffa_unknown_fields
8660                        .to_owned()?
8661                        .into(),
8662                    ..::core::default::Default::default()
8663                })
8664            }
8665        }
8666        impl<'a> ::buffa::ViewEncode<'a> for ChartStyleView<'a> {
8667            #[allow(clippy::needless_borrow, clippy::let_and_return)]
8668            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
8669                #[allow(unused_imports)]
8670                use ::buffa::Enumeration as _;
8671                let mut size = 0u32;
8672                if !self.style_bytes.is_empty() {
8673                    size
8674                        += 1u32
8675                            + ::buffa::types::bytes_encoded_len(&self.style_bytes)
8676                                as u32;
8677                }
8678                size += self.__buffa_unknown_fields.encoded_len() as u32;
8679                size
8680            }
8681            #[allow(clippy::needless_borrow)]
8682            fn write_to(
8683                &self,
8684                _cache: &mut ::buffa::SizeCache,
8685                buf: &mut impl ::buffa::bytes::BufMut,
8686            ) {
8687                #[allow(unused_imports)]
8688                use ::buffa::Enumeration as _;
8689                if !self.style_bytes.is_empty() {
8690                    ::buffa::types::put_bytes_field(1u32, &self.style_bytes, buf);
8691                }
8692                self.__buffa_unknown_fields.write_to(buf);
8693            }
8694        }
8695        /// Serializes this view as protobuf JSON.
8696        ///
8697        /// Implicit-presence fields with default values are omitted, `required`
8698        /// fields are always emitted, explicit-presence (`optional`) fields are
8699        /// emitted only when set, bytes fields are base64-encoded, and enum
8700        /// values are their proto name strings.
8701        ///
8702        /// This impl uses `serialize_map(None)` because the number of emitted
8703        /// fields depends on default-omission rules; serializers that require
8704        /// known map lengths (e.g. `bincode`) will return a runtime error.
8705        /// Use the owned message type for those formats.
8706        impl<'__a> ::serde::Serialize for ChartStyleView<'__a> {
8707            fn serialize<__S: ::serde::Serializer>(
8708                &self,
8709                __s: __S,
8710            ) -> ::core::result::Result<__S::Ok, __S::Error> {
8711                use ::serde::ser::SerializeMap as _;
8712                let mut __map = __s.serialize_map(::core::option::Option::None)?;
8713                if !::buffa::json_helpers::skip_if::is_empty_bytes(self.style_bytes) {
8714                    __map
8715                        .serialize_entry(
8716                            "styleBytes",
8717                            &::buffa::json_helpers::BytesJson(self.style_bytes),
8718                        )?;
8719                }
8720                __map.end()
8721            }
8722        }
8723        impl<'a> ::buffa::MessageName for ChartStyleView<'a> {
8724            const PACKAGE: &'static str = "layout.v1";
8725            const NAME: &'static str = "ChartStyle";
8726            const FULL_NAME: &'static str = "layout.v1.ChartStyle";
8727            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ChartStyle";
8728        }
8729        ::buffa::impl_default_view_instance!(ChartStyleView);
8730        ::buffa::impl_view_reborrow!(ChartStyleView);
8731        /** Self-contained, `'static` owned view of a `ChartStyle` message.
8732
8733 Wraps [`::buffa::OwnedView`]`<`[`ChartStyleView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
8734
8735 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ChartStyleView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
8736        #[derive(Clone, Debug)]
8737        pub struct ChartStyleOwnedView(::buffa::OwnedView<ChartStyleView<'static>>);
8738        impl ChartStyleOwnedView {
8739            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
8740            ///
8741            /// The view borrows directly from the buffer's data; the buffer is
8742            /// retained inside the returned handle.
8743            ///
8744            /// # Errors
8745            ///
8746            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
8747            /// protobuf data.
8748            pub fn decode(
8749                bytes: ::buffa::bytes::Bytes,
8750            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8751                ::core::result::Result::Ok(
8752                    ChartStyleOwnedView(::buffa::OwnedView::decode(bytes)?),
8753                )
8754            }
8755            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
8756            /// max message size).
8757            ///
8758            /// # Errors
8759            ///
8760            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
8761            /// exceeds the configured limits.
8762            pub fn decode_with_options(
8763                bytes: ::buffa::bytes::Bytes,
8764                opts: &::buffa::DecodeOptions,
8765            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8766                ::core::result::Result::Ok(
8767                    ChartStyleOwnedView(
8768                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
8769                    ),
8770                )
8771            }
8772            /// Build from an owned message via an encode → decode round-trip.
8773            ///
8774            /// # Errors
8775            ///
8776            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
8777            /// somehow invalid (should not happen for well-formed messages).
8778            pub fn from_owned(
8779                msg: &super::super::ChartStyle,
8780            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8781                ::core::result::Result::Ok(
8782                    ChartStyleOwnedView(::buffa::OwnedView::from_owned(msg)?),
8783                )
8784            }
8785            /// Borrow the full [`ChartStyleView`] with its lifetime tied to `&self`.
8786            #[must_use]
8787            pub fn view(&self) -> &ChartStyleView<'_> {
8788                self.0.reborrow()
8789            }
8790            /// Convert to the owned message type.
8791            ///
8792            /// # Errors
8793            ///
8794            /// Returns an error if re-materializing preserved unknown fields
8795            /// fails (e.g. the unknown-field limit is exceeded).
8796            pub fn to_owned_message(
8797                &self,
8798            ) -> ::core::result::Result<super::super::ChartStyle, ::buffa::DecodeError> {
8799                self.0.to_owned_message()
8800            }
8801            /// The underlying bytes buffer.
8802            #[must_use]
8803            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
8804                self.0.bytes()
8805            }
8806            /// Consume the handle, returning the underlying bytes buffer.
8807            #[must_use]
8808            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
8809                self.0.into_bytes()
8810            }
8811            /// Serialized style settings understood by the chart client.
8812            ///
8813            /// Field 1: `style_bytes`
8814            #[must_use]
8815            pub fn style_bytes(&self) -> &'_ [u8] {
8816                self.0.reborrow().style_bytes
8817            }
8818        }
8819        impl ::core::convert::From<::buffa::OwnedView<ChartStyleView<'static>>>
8820        for ChartStyleOwnedView {
8821            fn from(inner: ::buffa::OwnedView<ChartStyleView<'static>>) -> Self {
8822                ChartStyleOwnedView(inner)
8823            }
8824        }
8825        impl ::core::convert::From<ChartStyleOwnedView>
8826        for ::buffa::OwnedView<ChartStyleView<'static>> {
8827            fn from(wrapper: ChartStyleOwnedView) -> Self {
8828                wrapper.0
8829            }
8830        }
8831        impl ::core::convert::AsRef<::buffa::OwnedView<ChartStyleView<'static>>>
8832        for ChartStyleOwnedView {
8833            fn as_ref(&self) -> &::buffa::OwnedView<ChartStyleView<'static>> {
8834                &self.0
8835            }
8836        }
8837        impl ::buffa::HasMessageView for super::super::ChartStyle {
8838            type View<'a> = ChartStyleView<'a>;
8839            type ViewHandle = ChartStyleOwnedView;
8840        }
8841        impl ::serde::Serialize for ChartStyleOwnedView {
8842            fn serialize<__S: ::serde::Serializer>(
8843                &self,
8844                __s: __S,
8845            ) -> ::core::result::Result<__S::Ok, __S::Error> {
8846                ::serde::Serialize::serialize(&self.0, __s)
8847            }
8848        }
8849        /// LayerVisibilityOverride sets per-chart visibility for one chart layer.
8850        #[derive(Clone, Debug, Default)]
8851        pub struct LayerVisibilityOverrideView<'a> {
8852            /// Chart layer whose visibility is overridden.
8853            ///
8854            /// Field 1: `layer`
8855            pub layer: ::buffa::MessageFieldView<
8856                super::super::super::super::polychart::v1::__buffa::view::LayerRefView<
8857                    'a,
8858                >,
8859            >,
8860            /// True when the layer should be visible in this chart.
8861            ///
8862            /// Field 2: `visible`
8863            pub visible: bool,
8864            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
8865        }
8866        impl<'a> ::buffa::MessageView<'a> for LayerVisibilityOverrideView<'a> {
8867            type Owned = super::super::LayerVisibilityOverride;
8868            fn decode_view(
8869                buf: &'a [u8],
8870            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8871                let __limit = ::core::cell::Cell::new(
8872                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
8873                );
8874                <Self as ::buffa::MessageView>::decode_view_ctx(
8875                    buf,
8876                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
8877                )
8878            }
8879            fn decode_view_with_ctx(
8880                buf: &'a [u8],
8881                ctx: ::buffa::DecodeContext<'_>,
8882            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8883                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
8884            }
8885            fn merge_view_field(
8886                &mut self,
8887                tag: ::buffa::encoding::Tag,
8888                cur: &'a [u8],
8889                before_tag: &'a [u8],
8890                ctx: ::buffa::DecodeContext<'_>,
8891            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
8892                let _ = ctx;
8893                #[allow(unused_variables)]
8894                let view = self;
8895                let mut cur = cur;
8896                match tag.field_number() {
8897                    1u32 => {
8898                        ::buffa::encoding::check_wire_type(
8899                            tag,
8900                            ::buffa::encoding::WireType::LengthDelimited,
8901                        )?;
8902                        let __sub_ctx = ctx.descend()?;
8903                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
8904                        match view.layer.as_mut() {
8905                            Some(existing) => {
8906                                ::buffa::MessageView::merge_into_view(
8907                                    existing,
8908                                    sub,
8909                                    __sub_ctx,
8910                                )?
8911                            }
8912                            None => {
8913                                view.layer = ::buffa::MessageFieldView::set(
8914                                    <super::super::super::super::polychart::v1::__buffa::view::LayerRefView as ::buffa::MessageView>::decode_view_ctx(
8915                                        sub,
8916                                        __sub_ctx,
8917                                    )?,
8918                                );
8919                            }
8920                        }
8921                    }
8922                    2u32 => {
8923                        ::buffa::encoding::check_wire_type(
8924                            tag,
8925                            ::buffa::encoding::WireType::Varint,
8926                        )?;
8927                        view.visible = ::buffa::types::decode_bool(&mut cur)?;
8928                    }
8929                    _ => {
8930                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
8931                        let span_len = before_tag.len() - cur.len();
8932                        view.__buffa_unknown_fields
8933                            .push_record(before_tag, span_len, ctx)?;
8934                    }
8935                }
8936                ::core::result::Result::Ok(cur)
8937            }
8938            fn to_owned_message(
8939                &self,
8940            ) -> ::core::result::Result<
8941                super::super::LayerVisibilityOverride,
8942                ::buffa::DecodeError,
8943            > {
8944                self.to_owned_from_source(None)
8945            }
8946            #[allow(clippy::useless_conversion, clippy::needless_update)]
8947            fn to_owned_from_source(
8948                &self,
8949                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
8950            ) -> ::core::result::Result<
8951                super::super::LayerVisibilityOverride,
8952                ::buffa::DecodeError,
8953            > {
8954                #[allow(unused_imports)]
8955                use ::buffa::alloc::string::ToString as _;
8956                let _ = __buffa_src;
8957                ::core::result::Result::Ok(super::super::LayerVisibilityOverride {
8958                    layer: match self.layer.as_option() {
8959                        Some(v) => {
8960                            ::buffa::MessageField::<
8961                                super::super::super::super::polychart::v1::LayerRef,
8962                            >::some(v.to_owned_from_source(__buffa_src)?)
8963                        }
8964                        None => ::buffa::MessageField::none(),
8965                    },
8966                    visible: self.visible,
8967                    __buffa_unknown_fields: self
8968                        .__buffa_unknown_fields
8969                        .to_owned()?
8970                        .into(),
8971                    ..::core::default::Default::default()
8972                })
8973            }
8974        }
8975        impl<'a> ::buffa::ViewEncode<'a> for LayerVisibilityOverrideView<'a> {
8976            #[allow(clippy::needless_borrow, clippy::let_and_return)]
8977            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
8978                #[allow(unused_imports)]
8979                use ::buffa::Enumeration as _;
8980                let mut size = 0u32;
8981                if self.layer.is_set() {
8982                    let __slot = __cache.reserve();
8983                    let inner_size = self.layer.compute_size(__cache);
8984                    __cache.set(__slot, inner_size);
8985                    size
8986                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
8987                            + inner_size;
8988                }
8989                if self.visible {
8990                    size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
8991                }
8992                size += self.__buffa_unknown_fields.encoded_len() as u32;
8993                size
8994            }
8995            #[allow(clippy::needless_borrow)]
8996            fn write_to(
8997                &self,
8998                __cache: &mut ::buffa::SizeCache,
8999                buf: &mut impl ::buffa::bytes::BufMut,
9000            ) {
9001                #[allow(unused_imports)]
9002                use ::buffa::Enumeration as _;
9003                if self.layer.is_set() {
9004                    ::buffa::types::put_len_delimited_header(
9005                        1u32,
9006                        __cache.consume_next(),
9007                        buf,
9008                    );
9009                    self.layer.write_to(__cache, buf);
9010                }
9011                if self.visible {
9012                    ::buffa::types::put_bool_field(2u32, self.visible, buf);
9013                }
9014                self.__buffa_unknown_fields.write_to(buf);
9015            }
9016        }
9017        /// Serializes this view as protobuf JSON.
9018        ///
9019        /// Implicit-presence fields with default values are omitted, `required`
9020        /// fields are always emitted, explicit-presence (`optional`) fields are
9021        /// emitted only when set, bytes fields are base64-encoded, and enum
9022        /// values are their proto name strings.
9023        ///
9024        /// This impl uses `serialize_map(None)` because the number of emitted
9025        /// fields depends on default-omission rules; serializers that require
9026        /// known map lengths (e.g. `bincode`) will return a runtime error.
9027        /// Use the owned message type for those formats.
9028        impl<'__a> ::serde::Serialize for LayerVisibilityOverrideView<'__a> {
9029            fn serialize<__S: ::serde::Serializer>(
9030                &self,
9031                __s: __S,
9032            ) -> ::core::result::Result<__S::Ok, __S::Error> {
9033                use ::serde::ser::SerializeMap as _;
9034                let mut __map = __s.serialize_map(::core::option::Option::None)?;
9035                {
9036                    if let ::core::option::Option::Some(__v) = self.layer.as_option() {
9037                        __map.serialize_entry("layer", __v)?;
9038                    }
9039                }
9040                if self.visible {
9041                    __map.serialize_entry("visible", &self.visible)?;
9042                }
9043                __map.end()
9044            }
9045        }
9046        impl<'a> ::buffa::MessageName for LayerVisibilityOverrideView<'a> {
9047            const PACKAGE: &'static str = "layout.v1";
9048            const NAME: &'static str = "LayerVisibilityOverride";
9049            const FULL_NAME: &'static str = "layout.v1.LayerVisibilityOverride";
9050            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayerVisibilityOverride";
9051        }
9052        ::buffa::impl_default_view_instance!(LayerVisibilityOverrideView);
9053        ::buffa::impl_view_reborrow!(LayerVisibilityOverrideView);
9054        /** Self-contained, `'static` owned view of a `LayerVisibilityOverride` message.
9055
9056 Wraps [`::buffa::OwnedView`]`<`[`LayerVisibilityOverrideView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
9057
9058 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`LayerVisibilityOverrideView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
9059        #[derive(Clone, Debug)]
9060        pub struct LayerVisibilityOverrideOwnedView(
9061            ::buffa::OwnedView<LayerVisibilityOverrideView<'static>>,
9062        );
9063        impl LayerVisibilityOverrideOwnedView {
9064            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
9065            ///
9066            /// The view borrows directly from the buffer's data; the buffer is
9067            /// retained inside the returned handle.
9068            ///
9069            /// # Errors
9070            ///
9071            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
9072            /// protobuf data.
9073            pub fn decode(
9074                bytes: ::buffa::bytes::Bytes,
9075            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9076                ::core::result::Result::Ok(
9077                    LayerVisibilityOverrideOwnedView(::buffa::OwnedView::decode(bytes)?),
9078                )
9079            }
9080            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
9081            /// max message size).
9082            ///
9083            /// # Errors
9084            ///
9085            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
9086            /// exceeds the configured limits.
9087            pub fn decode_with_options(
9088                bytes: ::buffa::bytes::Bytes,
9089                opts: &::buffa::DecodeOptions,
9090            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9091                ::core::result::Result::Ok(
9092                    LayerVisibilityOverrideOwnedView(
9093                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
9094                    ),
9095                )
9096            }
9097            /// Build from an owned message via an encode → decode round-trip.
9098            ///
9099            /// # Errors
9100            ///
9101            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
9102            /// somehow invalid (should not happen for well-formed messages).
9103            pub fn from_owned(
9104                msg: &super::super::LayerVisibilityOverride,
9105            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9106                ::core::result::Result::Ok(
9107                    LayerVisibilityOverrideOwnedView(
9108                        ::buffa::OwnedView::from_owned(msg)?,
9109                    ),
9110                )
9111            }
9112            /// Borrow the full [`LayerVisibilityOverrideView`] with its lifetime tied to `&self`.
9113            #[must_use]
9114            pub fn view(&self) -> &LayerVisibilityOverrideView<'_> {
9115                self.0.reborrow()
9116            }
9117            /// Convert to the owned message type.
9118            ///
9119            /// # Errors
9120            ///
9121            /// Returns an error if re-materializing preserved unknown fields
9122            /// fails (e.g. the unknown-field limit is exceeded).
9123            pub fn to_owned_message(
9124                &self,
9125            ) -> ::core::result::Result<
9126                super::super::LayerVisibilityOverride,
9127                ::buffa::DecodeError,
9128            > {
9129                self.0.to_owned_message()
9130            }
9131            /// The underlying bytes buffer.
9132            #[must_use]
9133            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
9134                self.0.bytes()
9135            }
9136            /// Consume the handle, returning the underlying bytes buffer.
9137            #[must_use]
9138            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
9139                self.0.into_bytes()
9140            }
9141            /// Chart layer whose visibility is overridden.
9142            ///
9143            /// Field 1: `layer`
9144            #[must_use]
9145            pub fn layer(
9146                &self,
9147            ) -> &::buffa::MessageFieldView<
9148                super::super::super::super::polychart::v1::__buffa::view::LayerRefView<
9149                    '_,
9150                >,
9151            > {
9152                &self.0.reborrow().layer
9153            }
9154            /// True when the layer should be visible in this chart.
9155            ///
9156            /// Field 2: `visible`
9157            #[must_use]
9158            pub fn visible(&self) -> bool {
9159                self.0.reborrow().visible
9160            }
9161        }
9162        impl ::core::convert::From<
9163            ::buffa::OwnedView<LayerVisibilityOverrideView<'static>>,
9164        > for LayerVisibilityOverrideOwnedView {
9165            fn from(
9166                inner: ::buffa::OwnedView<LayerVisibilityOverrideView<'static>>,
9167            ) -> Self {
9168                LayerVisibilityOverrideOwnedView(inner)
9169            }
9170        }
9171        impl ::core::convert::From<LayerVisibilityOverrideOwnedView>
9172        for ::buffa::OwnedView<LayerVisibilityOverrideView<'static>> {
9173            fn from(wrapper: LayerVisibilityOverrideOwnedView) -> Self {
9174                wrapper.0
9175            }
9176        }
9177        impl ::core::convert::AsRef<
9178            ::buffa::OwnedView<LayerVisibilityOverrideView<'static>>,
9179        > for LayerVisibilityOverrideOwnedView {
9180            fn as_ref(
9181                &self,
9182            ) -> &::buffa::OwnedView<LayerVisibilityOverrideView<'static>> {
9183                &self.0
9184            }
9185        }
9186        impl ::buffa::HasMessageView for super::super::LayerVisibilityOverride {
9187            type View<'a> = LayerVisibilityOverrideView<'a>;
9188            type ViewHandle = LayerVisibilityOverrideOwnedView;
9189        }
9190        impl ::serde::Serialize for LayerVisibilityOverrideOwnedView {
9191            fn serialize<__S: ::serde::Serializer>(
9192                &self,
9193                __s: __S,
9194            ) -> ::core::result::Result<__S::Ok, __S::Error> {
9195                ::serde::Serialize::serialize(&self.0, __s)
9196            }
9197        }
9198        /// =============================================================================
9199        /// Snapshots
9200        /// =============================================================================
9201        ///
9202        /// GetLayoutsRequest lists saved layouts for the authenticated caller.
9203        #[derive(Clone, Debug, Default)]
9204        pub struct GetLayoutsRequestView<'a> {
9205            /// Maximum number of layouts to return. Defaults to 100 when omitted; maximum
9206            /// is 500.
9207            ///
9208            /// Field 1: `limit`
9209            pub limit: u32,
9210            /// Opaque keyset cursor from a previous response. The cursor is exclusive and
9211            /// bound to the authenticated caller and newest-updated sort order.
9212            ///
9213            /// Field 2: `page_token`
9214            pub page_token: &'a str,
9215            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
9216        }
9217        impl<'a> ::buffa::MessageView<'a> for GetLayoutsRequestView<'a> {
9218            type Owned = super::super::GetLayoutsRequest;
9219            fn decode_view(
9220                buf: &'a [u8],
9221            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9222                let __limit = ::core::cell::Cell::new(
9223                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
9224                );
9225                <Self as ::buffa::MessageView>::decode_view_ctx(
9226                    buf,
9227                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
9228                )
9229            }
9230            fn decode_view_with_ctx(
9231                buf: &'a [u8],
9232                ctx: ::buffa::DecodeContext<'_>,
9233            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9234                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
9235            }
9236            fn merge_view_field(
9237                &mut self,
9238                tag: ::buffa::encoding::Tag,
9239                cur: &'a [u8],
9240                before_tag: &'a [u8],
9241                ctx: ::buffa::DecodeContext<'_>,
9242            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
9243                let _ = ctx;
9244                #[allow(unused_variables)]
9245                let view = self;
9246                let mut cur = cur;
9247                match tag.field_number() {
9248                    1u32 => {
9249                        ::buffa::encoding::check_wire_type(
9250                            tag,
9251                            ::buffa::encoding::WireType::Varint,
9252                        )?;
9253                        view.limit = ::buffa::types::decode_uint32(&mut cur)?;
9254                    }
9255                    2u32 => {
9256                        ::buffa::encoding::check_wire_type(
9257                            tag,
9258                            ::buffa::encoding::WireType::LengthDelimited,
9259                        )?;
9260                        view.page_token = ::buffa::types::borrow_str(&mut cur)?;
9261                    }
9262                    _ => {
9263                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
9264                        let span_len = before_tag.len() - cur.len();
9265                        view.__buffa_unknown_fields
9266                            .push_record(before_tag, span_len, ctx)?;
9267                    }
9268                }
9269                ::core::result::Result::Ok(cur)
9270            }
9271            fn to_owned_message(
9272                &self,
9273            ) -> ::core::result::Result<
9274                super::super::GetLayoutsRequest,
9275                ::buffa::DecodeError,
9276            > {
9277                self.to_owned_from_source(None)
9278            }
9279            #[allow(clippy::useless_conversion, clippy::needless_update)]
9280            fn to_owned_from_source(
9281                &self,
9282                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
9283            ) -> ::core::result::Result<
9284                super::super::GetLayoutsRequest,
9285                ::buffa::DecodeError,
9286            > {
9287                #[allow(unused_imports)]
9288                use ::buffa::alloc::string::ToString as _;
9289                let _ = __buffa_src;
9290                ::core::result::Result::Ok(super::super::GetLayoutsRequest {
9291                    limit: self.limit,
9292                    page_token: self.page_token.to_string(),
9293                    __buffa_unknown_fields: self
9294                        .__buffa_unknown_fields
9295                        .to_owned()?
9296                        .into(),
9297                    ..::core::default::Default::default()
9298                })
9299            }
9300        }
9301        impl<'a> ::buffa::ViewEncode<'a> for GetLayoutsRequestView<'a> {
9302            #[allow(clippy::needless_borrow, clippy::let_and_return)]
9303            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
9304                #[allow(unused_imports)]
9305                use ::buffa::Enumeration as _;
9306                let mut size = 0u32;
9307                if self.limit != 0u32 {
9308                    size += 1u32 + ::buffa::types::uint32_encoded_len(self.limit) as u32;
9309                }
9310                if !self.page_token.is_empty() {
9311                    size
9312                        += 1u32
9313                            + ::buffa::types::string_encoded_len(&self.page_token)
9314                                as u32;
9315                }
9316                size += self.__buffa_unknown_fields.encoded_len() as u32;
9317                size
9318            }
9319            #[allow(clippy::needless_borrow)]
9320            fn write_to(
9321                &self,
9322                _cache: &mut ::buffa::SizeCache,
9323                buf: &mut impl ::buffa::bytes::BufMut,
9324            ) {
9325                #[allow(unused_imports)]
9326                use ::buffa::Enumeration as _;
9327                if self.limit != 0u32 {
9328                    ::buffa::types::put_uint32_field(1u32, self.limit, buf);
9329                }
9330                if !self.page_token.is_empty() {
9331                    ::buffa::types::put_string_field(2u32, &self.page_token, buf);
9332                }
9333                self.__buffa_unknown_fields.write_to(buf);
9334            }
9335        }
9336        /// Serializes this view as protobuf JSON.
9337        ///
9338        /// Implicit-presence fields with default values are omitted, `required`
9339        /// fields are always emitted, explicit-presence (`optional`) fields are
9340        /// emitted only when set, bytes fields are base64-encoded, and enum
9341        /// values are their proto name strings.
9342        ///
9343        /// This impl uses `serialize_map(None)` because the number of emitted
9344        /// fields depends on default-omission rules; serializers that require
9345        /// known map lengths (e.g. `bincode`) will return a runtime error.
9346        /// Use the owned message type for those formats.
9347        impl<'__a> ::serde::Serialize for GetLayoutsRequestView<'__a> {
9348            fn serialize<__S: ::serde::Serializer>(
9349                &self,
9350                __s: __S,
9351            ) -> ::core::result::Result<__S::Ok, __S::Error> {
9352                use ::serde::ser::SerializeMap as _;
9353                let mut __map = __s.serialize_map(::core::option::Option::None)?;
9354                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.limit) {
9355                    __map
9356                        .serialize_entry(
9357                            "limit",
9358                            &::buffa::json_helpers::ProtoJson(&self.limit),
9359                        )?;
9360                }
9361                if !::buffa::json_helpers::skip_if::is_empty_str(self.page_token) {
9362                    __map.serialize_entry("pageToken", self.page_token)?;
9363                }
9364                __map.end()
9365            }
9366        }
9367        impl<'a> ::buffa::MessageName for GetLayoutsRequestView<'a> {
9368            const PACKAGE: &'static str = "layout.v1";
9369            const NAME: &'static str = "GetLayoutsRequest";
9370            const FULL_NAME: &'static str = "layout.v1.GetLayoutsRequest";
9371            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutsRequest";
9372        }
9373        ::buffa::impl_default_view_instance!(GetLayoutsRequestView);
9374        ::buffa::impl_view_reborrow!(GetLayoutsRequestView);
9375        /** Self-contained, `'static` owned view of a `GetLayoutsRequest` message.
9376
9377 Wraps [`::buffa::OwnedView`]`<`[`GetLayoutsRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
9378
9379 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`GetLayoutsRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
9380        #[derive(Clone, Debug)]
9381        pub struct GetLayoutsRequestOwnedView(
9382            ::buffa::OwnedView<GetLayoutsRequestView<'static>>,
9383        );
9384        impl GetLayoutsRequestOwnedView {
9385            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
9386            ///
9387            /// The view borrows directly from the buffer's data; the buffer is
9388            /// retained inside the returned handle.
9389            ///
9390            /// # Errors
9391            ///
9392            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
9393            /// protobuf data.
9394            pub fn decode(
9395                bytes: ::buffa::bytes::Bytes,
9396            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9397                ::core::result::Result::Ok(
9398                    GetLayoutsRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
9399                )
9400            }
9401            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
9402            /// max message size).
9403            ///
9404            /// # Errors
9405            ///
9406            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
9407            /// exceeds the configured limits.
9408            pub fn decode_with_options(
9409                bytes: ::buffa::bytes::Bytes,
9410                opts: &::buffa::DecodeOptions,
9411            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9412                ::core::result::Result::Ok(
9413                    GetLayoutsRequestOwnedView(
9414                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
9415                    ),
9416                )
9417            }
9418            /// Build from an owned message via an encode → decode round-trip.
9419            ///
9420            /// # Errors
9421            ///
9422            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
9423            /// somehow invalid (should not happen for well-formed messages).
9424            pub fn from_owned(
9425                msg: &super::super::GetLayoutsRequest,
9426            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9427                ::core::result::Result::Ok(
9428                    GetLayoutsRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
9429                )
9430            }
9431            /// Borrow the full [`GetLayoutsRequestView`] with its lifetime tied to `&self`.
9432            #[must_use]
9433            pub fn view(&self) -> &GetLayoutsRequestView<'_> {
9434                self.0.reborrow()
9435            }
9436            /// Convert to the owned message type.
9437            ///
9438            /// # Errors
9439            ///
9440            /// Returns an error if re-materializing preserved unknown fields
9441            /// fails (e.g. the unknown-field limit is exceeded).
9442            pub fn to_owned_message(
9443                &self,
9444            ) -> ::core::result::Result<
9445                super::super::GetLayoutsRequest,
9446                ::buffa::DecodeError,
9447            > {
9448                self.0.to_owned_message()
9449            }
9450            /// The underlying bytes buffer.
9451            #[must_use]
9452            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
9453                self.0.bytes()
9454            }
9455            /// Consume the handle, returning the underlying bytes buffer.
9456            #[must_use]
9457            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
9458                self.0.into_bytes()
9459            }
9460            /// Maximum number of layouts to return. Defaults to 100 when omitted; maximum
9461            /// is 500.
9462            ///
9463            /// Field 1: `limit`
9464            #[must_use]
9465            pub fn limit(&self) -> u32 {
9466                self.0.reborrow().limit
9467            }
9468            /// Opaque keyset cursor from a previous response. The cursor is exclusive and
9469            /// bound to the authenticated caller and newest-updated sort order.
9470            ///
9471            /// Field 2: `page_token`
9472            #[must_use]
9473            pub fn page_token(&self) -> &'_ str {
9474                self.0.reborrow().page_token
9475            }
9476        }
9477        impl ::core::convert::From<::buffa::OwnedView<GetLayoutsRequestView<'static>>>
9478        for GetLayoutsRequestOwnedView {
9479            fn from(inner: ::buffa::OwnedView<GetLayoutsRequestView<'static>>) -> Self {
9480                GetLayoutsRequestOwnedView(inner)
9481            }
9482        }
9483        impl ::core::convert::From<GetLayoutsRequestOwnedView>
9484        for ::buffa::OwnedView<GetLayoutsRequestView<'static>> {
9485            fn from(wrapper: GetLayoutsRequestOwnedView) -> Self {
9486                wrapper.0
9487            }
9488        }
9489        impl ::core::convert::AsRef<::buffa::OwnedView<GetLayoutsRequestView<'static>>>
9490        for GetLayoutsRequestOwnedView {
9491            fn as_ref(&self) -> &::buffa::OwnedView<GetLayoutsRequestView<'static>> {
9492                &self.0
9493            }
9494        }
9495        impl ::buffa::HasMessageView for super::super::GetLayoutsRequest {
9496            type View<'a> = GetLayoutsRequestView<'a>;
9497            type ViewHandle = GetLayoutsRequestOwnedView;
9498        }
9499        impl ::serde::Serialize for GetLayoutsRequestOwnedView {
9500            fn serialize<__S: ::serde::Serializer>(
9501                &self,
9502                __s: __S,
9503            ) -> ::core::result::Result<__S::Ok, __S::Error> {
9504                ::serde::Serialize::serialize(&self.0, __s)
9505            }
9506        }
9507        /// GetLayoutsResponse contains the caller's saved layouts.
9508        #[derive(Clone, Debug, Default)]
9509        pub struct GetLayoutsResponseView<'a> {
9510            /// Saved layouts for the caller, returned newest-updated first.
9511            ///
9512            /// Field 1: `layouts`
9513            pub layouts: ::buffa::RepeatedView<
9514                'a,
9515                super::super::__buffa::view::LayoutView<'a>,
9516            >,
9517            /// Opaque cursor for the next page. Empty when no more results exist.
9518            ///
9519            /// Field 2: `next_page_token`
9520            pub next_page_token: &'a str,
9521            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
9522        }
9523        impl<'a> ::buffa::MessageView<'a> for GetLayoutsResponseView<'a> {
9524            type Owned = super::super::GetLayoutsResponse;
9525            fn decode_view(
9526                buf: &'a [u8],
9527            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9528                let __limit = ::core::cell::Cell::new(
9529                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
9530                );
9531                <Self as ::buffa::MessageView>::decode_view_ctx(
9532                    buf,
9533                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
9534                )
9535            }
9536            fn decode_view_with_ctx(
9537                buf: &'a [u8],
9538                ctx: ::buffa::DecodeContext<'_>,
9539            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9540                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
9541            }
9542            fn merge_view_field(
9543                &mut self,
9544                tag: ::buffa::encoding::Tag,
9545                cur: &'a [u8],
9546                before_tag: &'a [u8],
9547                ctx: ::buffa::DecodeContext<'_>,
9548            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
9549                let _ = ctx;
9550                #[allow(unused_variables)]
9551                let view = self;
9552                let mut cur = cur;
9553                match tag.field_number() {
9554                    2u32 => {
9555                        ::buffa::encoding::check_wire_type(
9556                            tag,
9557                            ::buffa::encoding::WireType::LengthDelimited,
9558                        )?;
9559                        view.next_page_token = ::buffa::types::borrow_str(&mut cur)?;
9560                    }
9561                    1u32 => {
9562                        ::buffa::encoding::check_wire_type(
9563                            tag,
9564                            ::buffa::encoding::WireType::LengthDelimited,
9565                        )?;
9566                        let __sub_ctx = ctx.descend()?;
9567                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
9568                        view.layouts
9569                            .push(
9570                                <super::super::__buffa::view::LayoutView as ::buffa::MessageView>::decode_view_ctx(
9571                                    sub,
9572                                    __sub_ctx,
9573                                )?,
9574                            );
9575                    }
9576                    _ => {
9577                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
9578                        let span_len = before_tag.len() - cur.len();
9579                        view.__buffa_unknown_fields
9580                            .push_record(before_tag, span_len, ctx)?;
9581                    }
9582                }
9583                ::core::result::Result::Ok(cur)
9584            }
9585            fn to_owned_message(
9586                &self,
9587            ) -> ::core::result::Result<
9588                super::super::GetLayoutsResponse,
9589                ::buffa::DecodeError,
9590            > {
9591                self.to_owned_from_source(None)
9592            }
9593            #[allow(clippy::useless_conversion, clippy::needless_update)]
9594            fn to_owned_from_source(
9595                &self,
9596                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
9597            ) -> ::core::result::Result<
9598                super::super::GetLayoutsResponse,
9599                ::buffa::DecodeError,
9600            > {
9601                #[allow(unused_imports)]
9602                use ::buffa::alloc::string::ToString as _;
9603                let _ = __buffa_src;
9604                ::core::result::Result::Ok(super::super::GetLayoutsResponse {
9605                    layouts: self
9606                        .layouts
9607                        .iter()
9608                        .map(|v| v.to_owned_from_source(__buffa_src))
9609                        .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
9610                    next_page_token: self.next_page_token.to_string(),
9611                    __buffa_unknown_fields: self
9612                        .__buffa_unknown_fields
9613                        .to_owned()?
9614                        .into(),
9615                    ..::core::default::Default::default()
9616                })
9617            }
9618        }
9619        impl<'a> ::buffa::ViewEncode<'a> for GetLayoutsResponseView<'a> {
9620            #[allow(clippy::needless_borrow, clippy::let_and_return)]
9621            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
9622                #[allow(unused_imports)]
9623                use ::buffa::Enumeration as _;
9624                let mut size = 0u32;
9625                for v in &self.layouts {
9626                    let __slot = __cache.reserve();
9627                    let inner_size = v.compute_size(__cache);
9628                    __cache.set(__slot, inner_size);
9629                    size
9630                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
9631                            + inner_size;
9632                }
9633                if !self.next_page_token.is_empty() {
9634                    size
9635                        += 1u32
9636                            + ::buffa::types::string_encoded_len(&self.next_page_token)
9637                                as u32;
9638                }
9639                size += self.__buffa_unknown_fields.encoded_len() as u32;
9640                size
9641            }
9642            #[allow(clippy::needless_borrow)]
9643            fn write_to(
9644                &self,
9645                __cache: &mut ::buffa::SizeCache,
9646                buf: &mut impl ::buffa::bytes::BufMut,
9647            ) {
9648                #[allow(unused_imports)]
9649                use ::buffa::Enumeration as _;
9650                for v in &self.layouts {
9651                    ::buffa::types::put_len_delimited_header(
9652                        1u32,
9653                        __cache.consume_next(),
9654                        buf,
9655                    );
9656                    v.write_to(__cache, buf);
9657                }
9658                if !self.next_page_token.is_empty() {
9659                    ::buffa::types::put_string_field(2u32, &self.next_page_token, buf);
9660                }
9661                self.__buffa_unknown_fields.write_to(buf);
9662            }
9663        }
9664        /// Serializes this view as protobuf JSON.
9665        ///
9666        /// Implicit-presence fields with default values are omitted, `required`
9667        /// fields are always emitted, explicit-presence (`optional`) fields are
9668        /// emitted only when set, bytes fields are base64-encoded, and enum
9669        /// values are their proto name strings.
9670        ///
9671        /// This impl uses `serialize_map(None)` because the number of emitted
9672        /// fields depends on default-omission rules; serializers that require
9673        /// known map lengths (e.g. `bincode`) will return a runtime error.
9674        /// Use the owned message type for those formats.
9675        impl<'__a> ::serde::Serialize for GetLayoutsResponseView<'__a> {
9676            fn serialize<__S: ::serde::Serializer>(
9677                &self,
9678                __s: __S,
9679            ) -> ::core::result::Result<__S::Ok, __S::Error> {
9680                use ::serde::ser::SerializeMap as _;
9681                let mut __map = __s.serialize_map(::core::option::Option::None)?;
9682                if !self.layouts.is_empty() {
9683                    __map.serialize_entry("layouts", &*self.layouts)?;
9684                }
9685                if !::buffa::json_helpers::skip_if::is_empty_str(self.next_page_token) {
9686                    __map.serialize_entry("nextPageToken", self.next_page_token)?;
9687                }
9688                __map.end()
9689            }
9690        }
9691        impl<'a> ::buffa::MessageName for GetLayoutsResponseView<'a> {
9692            const PACKAGE: &'static str = "layout.v1";
9693            const NAME: &'static str = "GetLayoutsResponse";
9694            const FULL_NAME: &'static str = "layout.v1.GetLayoutsResponse";
9695            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutsResponse";
9696        }
9697        ::buffa::impl_default_view_instance!(GetLayoutsResponseView);
9698        ::buffa::impl_view_reborrow!(GetLayoutsResponseView);
9699        /** Self-contained, `'static` owned view of a `GetLayoutsResponse` message.
9700
9701 Wraps [`::buffa::OwnedView`]`<`[`GetLayoutsResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
9702
9703 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`GetLayoutsResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
9704        #[derive(Clone, Debug)]
9705        pub struct GetLayoutsResponseOwnedView(
9706            ::buffa::OwnedView<GetLayoutsResponseView<'static>>,
9707        );
9708        impl GetLayoutsResponseOwnedView {
9709            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
9710            ///
9711            /// The view borrows directly from the buffer's data; the buffer is
9712            /// retained inside the returned handle.
9713            ///
9714            /// # Errors
9715            ///
9716            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
9717            /// protobuf data.
9718            pub fn decode(
9719                bytes: ::buffa::bytes::Bytes,
9720            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9721                ::core::result::Result::Ok(
9722                    GetLayoutsResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
9723                )
9724            }
9725            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
9726            /// max message size).
9727            ///
9728            /// # Errors
9729            ///
9730            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
9731            /// exceeds the configured limits.
9732            pub fn decode_with_options(
9733                bytes: ::buffa::bytes::Bytes,
9734                opts: &::buffa::DecodeOptions,
9735            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9736                ::core::result::Result::Ok(
9737                    GetLayoutsResponseOwnedView(
9738                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
9739                    ),
9740                )
9741            }
9742            /// Build from an owned message via an encode → decode round-trip.
9743            ///
9744            /// # Errors
9745            ///
9746            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
9747            /// somehow invalid (should not happen for well-formed messages).
9748            pub fn from_owned(
9749                msg: &super::super::GetLayoutsResponse,
9750            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9751                ::core::result::Result::Ok(
9752                    GetLayoutsResponseOwnedView(::buffa::OwnedView::from_owned(msg)?),
9753                )
9754            }
9755            /// Borrow the full [`GetLayoutsResponseView`] with its lifetime tied to `&self`.
9756            #[must_use]
9757            pub fn view(&self) -> &GetLayoutsResponseView<'_> {
9758                self.0.reborrow()
9759            }
9760            /// Convert to the owned message type.
9761            ///
9762            /// # Errors
9763            ///
9764            /// Returns an error if re-materializing preserved unknown fields
9765            /// fails (e.g. the unknown-field limit is exceeded).
9766            pub fn to_owned_message(
9767                &self,
9768            ) -> ::core::result::Result<
9769                super::super::GetLayoutsResponse,
9770                ::buffa::DecodeError,
9771            > {
9772                self.0.to_owned_message()
9773            }
9774            /// The underlying bytes buffer.
9775            #[must_use]
9776            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
9777                self.0.bytes()
9778            }
9779            /// Consume the handle, returning the underlying bytes buffer.
9780            #[must_use]
9781            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
9782                self.0.into_bytes()
9783            }
9784            /// Saved layouts for the caller, returned newest-updated first.
9785            ///
9786            /// Field 1: `layouts`
9787            #[must_use]
9788            pub fn layouts(
9789                &self,
9790            ) -> &::buffa::RepeatedView<
9791                '_,
9792                super::super::__buffa::view::LayoutView<'_>,
9793            > {
9794                &self.0.reborrow().layouts
9795            }
9796            /// Opaque cursor for the next page. Empty when no more results exist.
9797            ///
9798            /// Field 2: `next_page_token`
9799            #[must_use]
9800            pub fn next_page_token(&self) -> &'_ str {
9801                self.0.reborrow().next_page_token
9802            }
9803        }
9804        impl ::core::convert::From<::buffa::OwnedView<GetLayoutsResponseView<'static>>>
9805        for GetLayoutsResponseOwnedView {
9806            fn from(inner: ::buffa::OwnedView<GetLayoutsResponseView<'static>>) -> Self {
9807                GetLayoutsResponseOwnedView(inner)
9808            }
9809        }
9810        impl ::core::convert::From<GetLayoutsResponseOwnedView>
9811        for ::buffa::OwnedView<GetLayoutsResponseView<'static>> {
9812            fn from(wrapper: GetLayoutsResponseOwnedView) -> Self {
9813                wrapper.0
9814            }
9815        }
9816        impl ::core::convert::AsRef<::buffa::OwnedView<GetLayoutsResponseView<'static>>>
9817        for GetLayoutsResponseOwnedView {
9818            fn as_ref(&self) -> &::buffa::OwnedView<GetLayoutsResponseView<'static>> {
9819                &self.0
9820            }
9821        }
9822        impl ::buffa::HasMessageView for super::super::GetLayoutsResponse {
9823            type View<'a> = GetLayoutsResponseView<'a>;
9824            type ViewHandle = GetLayoutsResponseOwnedView;
9825        }
9826        impl ::serde::Serialize for GetLayoutsResponseOwnedView {
9827            fn serialize<__S: ::serde::Serializer>(
9828                &self,
9829                __s: __S,
9830            ) -> ::core::result::Result<__S::Ok, __S::Error> {
9831                ::serde::Serialize::serialize(&self.0, __s)
9832            }
9833        }
9834        /// GetLayoutRequest fetches one saved layout by ID.
9835        #[derive(Clone, Debug, Default)]
9836        pub struct GetLayoutRequestView<'a> {
9837            /// Layout identifier to fetch.
9838            ///
9839            /// Field 1: `layout_id`
9840            pub layout_id: u64,
9841            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
9842        }
9843        impl<'a> ::buffa::MessageView<'a> for GetLayoutRequestView<'a> {
9844            type Owned = super::super::GetLayoutRequest;
9845            fn decode_view(
9846                buf: &'a [u8],
9847            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9848                let __limit = ::core::cell::Cell::new(
9849                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
9850                );
9851                <Self as ::buffa::MessageView>::decode_view_ctx(
9852                    buf,
9853                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
9854                )
9855            }
9856            fn decode_view_with_ctx(
9857                buf: &'a [u8],
9858                ctx: ::buffa::DecodeContext<'_>,
9859            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9860                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
9861            }
9862            fn merge_view_field(
9863                &mut self,
9864                tag: ::buffa::encoding::Tag,
9865                cur: &'a [u8],
9866                before_tag: &'a [u8],
9867                ctx: ::buffa::DecodeContext<'_>,
9868            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
9869                let _ = ctx;
9870                #[allow(unused_variables)]
9871                let view = self;
9872                let mut cur = cur;
9873                match tag.field_number() {
9874                    1u32 => {
9875                        ::buffa::encoding::check_wire_type(
9876                            tag,
9877                            ::buffa::encoding::WireType::Fixed64,
9878                        )?;
9879                        view.layout_id = ::buffa::types::decode_fixed64(&mut cur)?;
9880                    }
9881                    _ => {
9882                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
9883                        let span_len = before_tag.len() - cur.len();
9884                        view.__buffa_unknown_fields
9885                            .push_record(before_tag, span_len, ctx)?;
9886                    }
9887                }
9888                ::core::result::Result::Ok(cur)
9889            }
9890            fn to_owned_message(
9891                &self,
9892            ) -> ::core::result::Result<
9893                super::super::GetLayoutRequest,
9894                ::buffa::DecodeError,
9895            > {
9896                self.to_owned_from_source(None)
9897            }
9898            #[allow(clippy::useless_conversion, clippy::needless_update)]
9899            fn to_owned_from_source(
9900                &self,
9901                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
9902            ) -> ::core::result::Result<
9903                super::super::GetLayoutRequest,
9904                ::buffa::DecodeError,
9905            > {
9906                #[allow(unused_imports)]
9907                use ::buffa::alloc::string::ToString as _;
9908                let _ = __buffa_src;
9909                ::core::result::Result::Ok(super::super::GetLayoutRequest {
9910                    layout_id: self.layout_id,
9911                    __buffa_unknown_fields: self
9912                        .__buffa_unknown_fields
9913                        .to_owned()?
9914                        .into(),
9915                    ..::core::default::Default::default()
9916                })
9917            }
9918        }
9919        impl<'a> ::buffa::ViewEncode<'a> for GetLayoutRequestView<'a> {
9920            #[allow(clippy::needless_borrow, clippy::let_and_return)]
9921            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
9922                #[allow(unused_imports)]
9923                use ::buffa::Enumeration as _;
9924                let mut size = 0u32;
9925                if self.layout_id != 0u64 {
9926                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
9927                }
9928                size += self.__buffa_unknown_fields.encoded_len() as u32;
9929                size
9930            }
9931            #[allow(clippy::needless_borrow)]
9932            fn write_to(
9933                &self,
9934                _cache: &mut ::buffa::SizeCache,
9935                buf: &mut impl ::buffa::bytes::BufMut,
9936            ) {
9937                #[allow(unused_imports)]
9938                use ::buffa::Enumeration as _;
9939                if self.layout_id != 0u64 {
9940                    ::buffa::types::put_fixed64_field(1u32, self.layout_id, buf);
9941                }
9942                self.__buffa_unknown_fields.write_to(buf);
9943            }
9944        }
9945        /// Serializes this view as protobuf JSON.
9946        ///
9947        /// Implicit-presence fields with default values are omitted, `required`
9948        /// fields are always emitted, explicit-presence (`optional`) fields are
9949        /// emitted only when set, bytes fields are base64-encoded, and enum
9950        /// values are their proto name strings.
9951        ///
9952        /// This impl uses `serialize_map(None)` because the number of emitted
9953        /// fields depends on default-omission rules; serializers that require
9954        /// known map lengths (e.g. `bincode`) will return a runtime error.
9955        /// Use the owned message type for those formats.
9956        impl<'__a> ::serde::Serialize for GetLayoutRequestView<'__a> {
9957            fn serialize<__S: ::serde::Serializer>(
9958                &self,
9959                __s: __S,
9960            ) -> ::core::result::Result<__S::Ok, __S::Error> {
9961                use ::serde::ser::SerializeMap as _;
9962                let mut __map = __s.serialize_map(::core::option::Option::None)?;
9963                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.layout_id) {
9964                    __map
9965                        .serialize_entry(
9966                            "layoutId",
9967                            &::buffa::json_helpers::ProtoJson(&self.layout_id),
9968                        )?;
9969                }
9970                __map.end()
9971            }
9972        }
9973        impl<'a> ::buffa::MessageName for GetLayoutRequestView<'a> {
9974            const PACKAGE: &'static str = "layout.v1";
9975            const NAME: &'static str = "GetLayoutRequest";
9976            const FULL_NAME: &'static str = "layout.v1.GetLayoutRequest";
9977            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutRequest";
9978        }
9979        ::buffa::impl_default_view_instance!(GetLayoutRequestView);
9980        ::buffa::impl_view_reborrow!(GetLayoutRequestView);
9981        /** Self-contained, `'static` owned view of a `GetLayoutRequest` message.
9982
9983 Wraps [`::buffa::OwnedView`]`<`[`GetLayoutRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
9984
9985 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`GetLayoutRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
9986        #[derive(Clone, Debug)]
9987        pub struct GetLayoutRequestOwnedView(
9988            ::buffa::OwnedView<GetLayoutRequestView<'static>>,
9989        );
9990        impl GetLayoutRequestOwnedView {
9991            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
9992            ///
9993            /// The view borrows directly from the buffer's data; the buffer is
9994            /// retained inside the returned handle.
9995            ///
9996            /// # Errors
9997            ///
9998            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
9999            /// protobuf data.
10000            pub fn decode(
10001                bytes: ::buffa::bytes::Bytes,
10002            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10003                ::core::result::Result::Ok(
10004                    GetLayoutRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
10005                )
10006            }
10007            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
10008            /// max message size).
10009            ///
10010            /// # Errors
10011            ///
10012            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
10013            /// exceeds the configured limits.
10014            pub fn decode_with_options(
10015                bytes: ::buffa::bytes::Bytes,
10016                opts: &::buffa::DecodeOptions,
10017            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10018                ::core::result::Result::Ok(
10019                    GetLayoutRequestOwnedView(
10020                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
10021                    ),
10022                )
10023            }
10024            /// Build from an owned message via an encode → decode round-trip.
10025            ///
10026            /// # Errors
10027            ///
10028            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
10029            /// somehow invalid (should not happen for well-formed messages).
10030            pub fn from_owned(
10031                msg: &super::super::GetLayoutRequest,
10032            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10033                ::core::result::Result::Ok(
10034                    GetLayoutRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
10035                )
10036            }
10037            /// Borrow the full [`GetLayoutRequestView`] with its lifetime tied to `&self`.
10038            #[must_use]
10039            pub fn view(&self) -> &GetLayoutRequestView<'_> {
10040                self.0.reborrow()
10041            }
10042            /// Convert to the owned message type.
10043            ///
10044            /// # Errors
10045            ///
10046            /// Returns an error if re-materializing preserved unknown fields
10047            /// fails (e.g. the unknown-field limit is exceeded).
10048            pub fn to_owned_message(
10049                &self,
10050            ) -> ::core::result::Result<
10051                super::super::GetLayoutRequest,
10052                ::buffa::DecodeError,
10053            > {
10054                self.0.to_owned_message()
10055            }
10056            /// The underlying bytes buffer.
10057            #[must_use]
10058            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
10059                self.0.bytes()
10060            }
10061            /// Consume the handle, returning the underlying bytes buffer.
10062            #[must_use]
10063            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
10064                self.0.into_bytes()
10065            }
10066            /// Layout identifier to fetch.
10067            ///
10068            /// Field 1: `layout_id`
10069            #[must_use]
10070            pub fn layout_id(&self) -> u64 {
10071                self.0.reborrow().layout_id
10072            }
10073        }
10074        impl ::core::convert::From<::buffa::OwnedView<GetLayoutRequestView<'static>>>
10075        for GetLayoutRequestOwnedView {
10076            fn from(inner: ::buffa::OwnedView<GetLayoutRequestView<'static>>) -> Self {
10077                GetLayoutRequestOwnedView(inner)
10078            }
10079        }
10080        impl ::core::convert::From<GetLayoutRequestOwnedView>
10081        for ::buffa::OwnedView<GetLayoutRequestView<'static>> {
10082            fn from(wrapper: GetLayoutRequestOwnedView) -> Self {
10083                wrapper.0
10084            }
10085        }
10086        impl ::core::convert::AsRef<::buffa::OwnedView<GetLayoutRequestView<'static>>>
10087        for GetLayoutRequestOwnedView {
10088            fn as_ref(&self) -> &::buffa::OwnedView<GetLayoutRequestView<'static>> {
10089                &self.0
10090            }
10091        }
10092        impl ::buffa::HasMessageView for super::super::GetLayoutRequest {
10093            type View<'a> = GetLayoutRequestView<'a>;
10094            type ViewHandle = GetLayoutRequestOwnedView;
10095        }
10096        impl ::serde::Serialize for GetLayoutRequestOwnedView {
10097            fn serialize<__S: ::serde::Serializer>(
10098                &self,
10099                __s: __S,
10100            ) -> ::core::result::Result<__S::Ok, __S::Error> {
10101                ::serde::Serialize::serialize(&self.0, __s)
10102            }
10103        }
10104        /// GetLayoutResponse contains one saved layout.
10105        #[derive(Clone, Debug, Default)]
10106        pub struct GetLayoutResponseView<'a> {
10107            /// Saved layout matching the requested id.
10108            ///
10109            /// Field 1: `layout`
10110            pub layout: ::buffa::MessageFieldView<
10111                super::super::__buffa::view::LayoutView<'a>,
10112            >,
10113            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
10114        }
10115        impl<'a> ::buffa::MessageView<'a> for GetLayoutResponseView<'a> {
10116            type Owned = super::super::GetLayoutResponse;
10117            fn decode_view(
10118                buf: &'a [u8],
10119            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10120                let __limit = ::core::cell::Cell::new(
10121                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
10122                );
10123                <Self as ::buffa::MessageView>::decode_view_ctx(
10124                    buf,
10125                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
10126                )
10127            }
10128            fn decode_view_with_ctx(
10129                buf: &'a [u8],
10130                ctx: ::buffa::DecodeContext<'_>,
10131            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10132                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
10133            }
10134            fn merge_view_field(
10135                &mut self,
10136                tag: ::buffa::encoding::Tag,
10137                cur: &'a [u8],
10138                before_tag: &'a [u8],
10139                ctx: ::buffa::DecodeContext<'_>,
10140            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
10141                let _ = ctx;
10142                #[allow(unused_variables)]
10143                let view = self;
10144                let mut cur = cur;
10145                match tag.field_number() {
10146                    1u32 => {
10147                        ::buffa::encoding::check_wire_type(
10148                            tag,
10149                            ::buffa::encoding::WireType::LengthDelimited,
10150                        )?;
10151                        let __sub_ctx = ctx.descend()?;
10152                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
10153                        match view.layout.as_mut() {
10154                            Some(existing) => {
10155                                ::buffa::MessageView::merge_into_view(
10156                                    existing,
10157                                    sub,
10158                                    __sub_ctx,
10159                                )?
10160                            }
10161                            None => {
10162                                view.layout = ::buffa::MessageFieldView::set(
10163                                    <super::super::__buffa::view::LayoutView as ::buffa::MessageView>::decode_view_ctx(
10164                                        sub,
10165                                        __sub_ctx,
10166                                    )?,
10167                                );
10168                            }
10169                        }
10170                    }
10171                    _ => {
10172                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
10173                        let span_len = before_tag.len() - cur.len();
10174                        view.__buffa_unknown_fields
10175                            .push_record(before_tag, span_len, ctx)?;
10176                    }
10177                }
10178                ::core::result::Result::Ok(cur)
10179            }
10180            fn to_owned_message(
10181                &self,
10182            ) -> ::core::result::Result<
10183                super::super::GetLayoutResponse,
10184                ::buffa::DecodeError,
10185            > {
10186                self.to_owned_from_source(None)
10187            }
10188            #[allow(clippy::useless_conversion, clippy::needless_update)]
10189            fn to_owned_from_source(
10190                &self,
10191                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
10192            ) -> ::core::result::Result<
10193                super::super::GetLayoutResponse,
10194                ::buffa::DecodeError,
10195            > {
10196                #[allow(unused_imports)]
10197                use ::buffa::alloc::string::ToString as _;
10198                let _ = __buffa_src;
10199                ::core::result::Result::Ok(super::super::GetLayoutResponse {
10200                    layout: match self.layout.as_option() {
10201                        Some(v) => {
10202                            ::buffa::MessageField::<
10203                                super::super::Layout,
10204                            >::some(v.to_owned_from_source(__buffa_src)?)
10205                        }
10206                        None => ::buffa::MessageField::none(),
10207                    },
10208                    __buffa_unknown_fields: self
10209                        .__buffa_unknown_fields
10210                        .to_owned()?
10211                        .into(),
10212                    ..::core::default::Default::default()
10213                })
10214            }
10215        }
10216        impl<'a> ::buffa::ViewEncode<'a> for GetLayoutResponseView<'a> {
10217            #[allow(clippy::needless_borrow, clippy::let_and_return)]
10218            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
10219                #[allow(unused_imports)]
10220                use ::buffa::Enumeration as _;
10221                let mut size = 0u32;
10222                if self.layout.is_set() {
10223                    let __slot = __cache.reserve();
10224                    let inner_size = self.layout.compute_size(__cache);
10225                    __cache.set(__slot, inner_size);
10226                    size
10227                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
10228                            + inner_size;
10229                }
10230                size += self.__buffa_unknown_fields.encoded_len() as u32;
10231                size
10232            }
10233            #[allow(clippy::needless_borrow)]
10234            fn write_to(
10235                &self,
10236                __cache: &mut ::buffa::SizeCache,
10237                buf: &mut impl ::buffa::bytes::BufMut,
10238            ) {
10239                #[allow(unused_imports)]
10240                use ::buffa::Enumeration as _;
10241                if self.layout.is_set() {
10242                    ::buffa::types::put_len_delimited_header(
10243                        1u32,
10244                        __cache.consume_next(),
10245                        buf,
10246                    );
10247                    self.layout.write_to(__cache, buf);
10248                }
10249                self.__buffa_unknown_fields.write_to(buf);
10250            }
10251        }
10252        /// Serializes this view as protobuf JSON.
10253        ///
10254        /// Implicit-presence fields with default values are omitted, `required`
10255        /// fields are always emitted, explicit-presence (`optional`) fields are
10256        /// emitted only when set, bytes fields are base64-encoded, and enum
10257        /// values are their proto name strings.
10258        ///
10259        /// This impl uses `serialize_map(None)` because the number of emitted
10260        /// fields depends on default-omission rules; serializers that require
10261        /// known map lengths (e.g. `bincode`) will return a runtime error.
10262        /// Use the owned message type for those formats.
10263        impl<'__a> ::serde::Serialize for GetLayoutResponseView<'__a> {
10264            fn serialize<__S: ::serde::Serializer>(
10265                &self,
10266                __s: __S,
10267            ) -> ::core::result::Result<__S::Ok, __S::Error> {
10268                use ::serde::ser::SerializeMap as _;
10269                let mut __map = __s.serialize_map(::core::option::Option::None)?;
10270                {
10271                    if let ::core::option::Option::Some(__v) = self.layout.as_option() {
10272                        __map.serialize_entry("layout", __v)?;
10273                    }
10274                }
10275                __map.end()
10276            }
10277        }
10278        impl<'a> ::buffa::MessageName for GetLayoutResponseView<'a> {
10279            const PACKAGE: &'static str = "layout.v1";
10280            const NAME: &'static str = "GetLayoutResponse";
10281            const FULL_NAME: &'static str = "layout.v1.GetLayoutResponse";
10282            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutResponse";
10283        }
10284        ::buffa::impl_default_view_instance!(GetLayoutResponseView);
10285        ::buffa::impl_view_reborrow!(GetLayoutResponseView);
10286        /** Self-contained, `'static` owned view of a `GetLayoutResponse` message.
10287
10288 Wraps [`::buffa::OwnedView`]`<`[`GetLayoutResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
10289
10290 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`GetLayoutResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
10291        #[derive(Clone, Debug)]
10292        pub struct GetLayoutResponseOwnedView(
10293            ::buffa::OwnedView<GetLayoutResponseView<'static>>,
10294        );
10295        impl GetLayoutResponseOwnedView {
10296            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
10297            ///
10298            /// The view borrows directly from the buffer's data; the buffer is
10299            /// retained inside the returned handle.
10300            ///
10301            /// # Errors
10302            ///
10303            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
10304            /// protobuf data.
10305            pub fn decode(
10306                bytes: ::buffa::bytes::Bytes,
10307            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10308                ::core::result::Result::Ok(
10309                    GetLayoutResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
10310                )
10311            }
10312            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
10313            /// max message size).
10314            ///
10315            /// # Errors
10316            ///
10317            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
10318            /// exceeds the configured limits.
10319            pub fn decode_with_options(
10320                bytes: ::buffa::bytes::Bytes,
10321                opts: &::buffa::DecodeOptions,
10322            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10323                ::core::result::Result::Ok(
10324                    GetLayoutResponseOwnedView(
10325                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
10326                    ),
10327                )
10328            }
10329            /// Build from an owned message via an encode → decode round-trip.
10330            ///
10331            /// # Errors
10332            ///
10333            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
10334            /// somehow invalid (should not happen for well-formed messages).
10335            pub fn from_owned(
10336                msg: &super::super::GetLayoutResponse,
10337            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10338                ::core::result::Result::Ok(
10339                    GetLayoutResponseOwnedView(::buffa::OwnedView::from_owned(msg)?),
10340                )
10341            }
10342            /// Borrow the full [`GetLayoutResponseView`] with its lifetime tied to `&self`.
10343            #[must_use]
10344            pub fn view(&self) -> &GetLayoutResponseView<'_> {
10345                self.0.reborrow()
10346            }
10347            /// Convert to the owned message type.
10348            ///
10349            /// # Errors
10350            ///
10351            /// Returns an error if re-materializing preserved unknown fields
10352            /// fails (e.g. the unknown-field limit is exceeded).
10353            pub fn to_owned_message(
10354                &self,
10355            ) -> ::core::result::Result<
10356                super::super::GetLayoutResponse,
10357                ::buffa::DecodeError,
10358            > {
10359                self.0.to_owned_message()
10360            }
10361            /// The underlying bytes buffer.
10362            #[must_use]
10363            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
10364                self.0.bytes()
10365            }
10366            /// Consume the handle, returning the underlying bytes buffer.
10367            #[must_use]
10368            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
10369                self.0.into_bytes()
10370            }
10371            /// Saved layout matching the requested id.
10372            ///
10373            /// Field 1: `layout`
10374            #[must_use]
10375            pub fn layout(
10376                &self,
10377            ) -> &::buffa::MessageFieldView<
10378                super::super::__buffa::view::LayoutView<'_>,
10379            > {
10380                &self.0.reborrow().layout
10381            }
10382        }
10383        impl ::core::convert::From<::buffa::OwnedView<GetLayoutResponseView<'static>>>
10384        for GetLayoutResponseOwnedView {
10385            fn from(inner: ::buffa::OwnedView<GetLayoutResponseView<'static>>) -> Self {
10386                GetLayoutResponseOwnedView(inner)
10387            }
10388        }
10389        impl ::core::convert::From<GetLayoutResponseOwnedView>
10390        for ::buffa::OwnedView<GetLayoutResponseView<'static>> {
10391            fn from(wrapper: GetLayoutResponseOwnedView) -> Self {
10392                wrapper.0
10393            }
10394        }
10395        impl ::core::convert::AsRef<::buffa::OwnedView<GetLayoutResponseView<'static>>>
10396        for GetLayoutResponseOwnedView {
10397            fn as_ref(&self) -> &::buffa::OwnedView<GetLayoutResponseView<'static>> {
10398                &self.0
10399            }
10400        }
10401        impl ::buffa::HasMessageView for super::super::GetLayoutResponse {
10402            type View<'a> = GetLayoutResponseView<'a>;
10403            type ViewHandle = GetLayoutResponseOwnedView;
10404        }
10405        impl ::serde::Serialize for GetLayoutResponseOwnedView {
10406            fn serialize<__S: ::serde::Serializer>(
10407                &self,
10408                __s: __S,
10409            ) -> ::core::result::Result<__S::Ok, __S::Error> {
10410                ::serde::Serialize::serialize(&self.0, __s)
10411            }
10412        }
10413        /// =============================================================================
10414        /// Share links (create/revoke) and share token resolution (no auth)
10415        /// =============================================================================
10416        ///
10417        /// Resolve a share token to a layout snapshot (template). No auth required.
10418        #[derive(Clone, Debug, Default)]
10419        pub struct ResolveLayoutShareTokenRequestView<'a> {
10420            /// Opaque share token from a layout share link.
10421            ///
10422            /// Field 1: `token`
10423            pub token: &'a str,
10424            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
10425        }
10426        impl<'a> ::buffa::MessageView<'a> for ResolveLayoutShareTokenRequestView<'a> {
10427            type Owned = super::super::ResolveLayoutShareTokenRequest;
10428            fn decode_view(
10429                buf: &'a [u8],
10430            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10431                let __limit = ::core::cell::Cell::new(
10432                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
10433                );
10434                <Self as ::buffa::MessageView>::decode_view_ctx(
10435                    buf,
10436                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
10437                )
10438            }
10439            fn decode_view_with_ctx(
10440                buf: &'a [u8],
10441                ctx: ::buffa::DecodeContext<'_>,
10442            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10443                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
10444            }
10445            fn merge_view_field(
10446                &mut self,
10447                tag: ::buffa::encoding::Tag,
10448                cur: &'a [u8],
10449                before_tag: &'a [u8],
10450                ctx: ::buffa::DecodeContext<'_>,
10451            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
10452                let _ = ctx;
10453                #[allow(unused_variables)]
10454                let view = self;
10455                let mut cur = cur;
10456                match tag.field_number() {
10457                    1u32 => {
10458                        ::buffa::encoding::check_wire_type(
10459                            tag,
10460                            ::buffa::encoding::WireType::LengthDelimited,
10461                        )?;
10462                        view.token = ::buffa::types::borrow_str(&mut cur)?;
10463                    }
10464                    _ => {
10465                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
10466                        let span_len = before_tag.len() - cur.len();
10467                        view.__buffa_unknown_fields
10468                            .push_record(before_tag, span_len, ctx)?;
10469                    }
10470                }
10471                ::core::result::Result::Ok(cur)
10472            }
10473            fn to_owned_message(
10474                &self,
10475            ) -> ::core::result::Result<
10476                super::super::ResolveLayoutShareTokenRequest,
10477                ::buffa::DecodeError,
10478            > {
10479                self.to_owned_from_source(None)
10480            }
10481            #[allow(clippy::useless_conversion, clippy::needless_update)]
10482            fn to_owned_from_source(
10483                &self,
10484                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
10485            ) -> ::core::result::Result<
10486                super::super::ResolveLayoutShareTokenRequest,
10487                ::buffa::DecodeError,
10488            > {
10489                #[allow(unused_imports)]
10490                use ::buffa::alloc::string::ToString as _;
10491                let _ = __buffa_src;
10492                ::core::result::Result::Ok(super::super::ResolveLayoutShareTokenRequest {
10493                    token: self.token.to_string(),
10494                    __buffa_unknown_fields: self
10495                        .__buffa_unknown_fields
10496                        .to_owned()?
10497                        .into(),
10498                    ..::core::default::Default::default()
10499                })
10500            }
10501        }
10502        impl<'a> ::buffa::ViewEncode<'a> for ResolveLayoutShareTokenRequestView<'a> {
10503            #[allow(clippy::needless_borrow, clippy::let_and_return)]
10504            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
10505                #[allow(unused_imports)]
10506                use ::buffa::Enumeration as _;
10507                let mut size = 0u32;
10508                if !self.token.is_empty() {
10509                    size
10510                        += 1u32 + ::buffa::types::string_encoded_len(&self.token) as u32;
10511                }
10512                size += self.__buffa_unknown_fields.encoded_len() as u32;
10513                size
10514            }
10515            #[allow(clippy::needless_borrow)]
10516            fn write_to(
10517                &self,
10518                _cache: &mut ::buffa::SizeCache,
10519                buf: &mut impl ::buffa::bytes::BufMut,
10520            ) {
10521                #[allow(unused_imports)]
10522                use ::buffa::Enumeration as _;
10523                if !self.token.is_empty() {
10524                    ::buffa::types::put_string_field(1u32, &self.token, buf);
10525                }
10526                self.__buffa_unknown_fields.write_to(buf);
10527            }
10528        }
10529        /// Serializes this view as protobuf JSON.
10530        ///
10531        /// Implicit-presence fields with default values are omitted, `required`
10532        /// fields are always emitted, explicit-presence (`optional`) fields are
10533        /// emitted only when set, bytes fields are base64-encoded, and enum
10534        /// values are their proto name strings.
10535        ///
10536        /// This impl uses `serialize_map(None)` because the number of emitted
10537        /// fields depends on default-omission rules; serializers that require
10538        /// known map lengths (e.g. `bincode`) will return a runtime error.
10539        /// Use the owned message type for those formats.
10540        impl<'__a> ::serde::Serialize for ResolveLayoutShareTokenRequestView<'__a> {
10541            fn serialize<__S: ::serde::Serializer>(
10542                &self,
10543                __s: __S,
10544            ) -> ::core::result::Result<__S::Ok, __S::Error> {
10545                use ::serde::ser::SerializeMap as _;
10546                let mut __map = __s.serialize_map(::core::option::Option::None)?;
10547                if !::buffa::json_helpers::skip_if::is_empty_str(self.token) {
10548                    __map.serialize_entry("token", self.token)?;
10549                }
10550                __map.end()
10551            }
10552        }
10553        impl<'a> ::buffa::MessageName for ResolveLayoutShareTokenRequestView<'a> {
10554            const PACKAGE: &'static str = "layout.v1";
10555            const NAME: &'static str = "ResolveLayoutShareTokenRequest";
10556            const FULL_NAME: &'static str = "layout.v1.ResolveLayoutShareTokenRequest";
10557            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ResolveLayoutShareTokenRequest";
10558        }
10559        ::buffa::impl_default_view_instance!(ResolveLayoutShareTokenRequestView);
10560        ::buffa::impl_view_reborrow!(ResolveLayoutShareTokenRequestView);
10561        /** Self-contained, `'static` owned view of a `ResolveLayoutShareTokenRequest` message.
10562
10563 Wraps [`::buffa::OwnedView`]`<`[`ResolveLayoutShareTokenRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
10564
10565 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ResolveLayoutShareTokenRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
10566        #[derive(Clone, Debug)]
10567        pub struct ResolveLayoutShareTokenRequestOwnedView(
10568            ::buffa::OwnedView<ResolveLayoutShareTokenRequestView<'static>>,
10569        );
10570        impl ResolveLayoutShareTokenRequestOwnedView {
10571            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
10572            ///
10573            /// The view borrows directly from the buffer's data; the buffer is
10574            /// retained inside the returned handle.
10575            ///
10576            /// # Errors
10577            ///
10578            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
10579            /// protobuf data.
10580            pub fn decode(
10581                bytes: ::buffa::bytes::Bytes,
10582            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10583                ::core::result::Result::Ok(
10584                    ResolveLayoutShareTokenRequestOwnedView(
10585                        ::buffa::OwnedView::decode(bytes)?,
10586                    ),
10587                )
10588            }
10589            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
10590            /// max message size).
10591            ///
10592            /// # Errors
10593            ///
10594            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
10595            /// exceeds the configured limits.
10596            pub fn decode_with_options(
10597                bytes: ::buffa::bytes::Bytes,
10598                opts: &::buffa::DecodeOptions,
10599            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10600                ::core::result::Result::Ok(
10601                    ResolveLayoutShareTokenRequestOwnedView(
10602                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
10603                    ),
10604                )
10605            }
10606            /// Build from an owned message via an encode → decode round-trip.
10607            ///
10608            /// # Errors
10609            ///
10610            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
10611            /// somehow invalid (should not happen for well-formed messages).
10612            pub fn from_owned(
10613                msg: &super::super::ResolveLayoutShareTokenRequest,
10614            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10615                ::core::result::Result::Ok(
10616                    ResolveLayoutShareTokenRequestOwnedView(
10617                        ::buffa::OwnedView::from_owned(msg)?,
10618                    ),
10619                )
10620            }
10621            /// Borrow the full [`ResolveLayoutShareTokenRequestView`] with its lifetime tied to `&self`.
10622            #[must_use]
10623            pub fn view(&self) -> &ResolveLayoutShareTokenRequestView<'_> {
10624                self.0.reborrow()
10625            }
10626            /// Convert to the owned message type.
10627            ///
10628            /// # Errors
10629            ///
10630            /// Returns an error if re-materializing preserved unknown fields
10631            /// fails (e.g. the unknown-field limit is exceeded).
10632            pub fn to_owned_message(
10633                &self,
10634            ) -> ::core::result::Result<
10635                super::super::ResolveLayoutShareTokenRequest,
10636                ::buffa::DecodeError,
10637            > {
10638                self.0.to_owned_message()
10639            }
10640            /// The underlying bytes buffer.
10641            #[must_use]
10642            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
10643                self.0.bytes()
10644            }
10645            /// Consume the handle, returning the underlying bytes buffer.
10646            #[must_use]
10647            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
10648                self.0.into_bytes()
10649            }
10650            /// Opaque share token from a layout share link.
10651            ///
10652            /// Field 1: `token`
10653            #[must_use]
10654            pub fn token(&self) -> &'_ str {
10655                self.0.reborrow().token
10656            }
10657        }
10658        impl ::core::convert::From<
10659            ::buffa::OwnedView<ResolveLayoutShareTokenRequestView<'static>>,
10660        > for ResolveLayoutShareTokenRequestOwnedView {
10661            fn from(
10662                inner: ::buffa::OwnedView<ResolveLayoutShareTokenRequestView<'static>>,
10663            ) -> Self {
10664                ResolveLayoutShareTokenRequestOwnedView(inner)
10665            }
10666        }
10667        impl ::core::convert::From<ResolveLayoutShareTokenRequestOwnedView>
10668        for ::buffa::OwnedView<ResolveLayoutShareTokenRequestView<'static>> {
10669            fn from(wrapper: ResolveLayoutShareTokenRequestOwnedView) -> Self {
10670                wrapper.0
10671            }
10672        }
10673        impl ::core::convert::AsRef<
10674            ::buffa::OwnedView<ResolveLayoutShareTokenRequestView<'static>>,
10675        > for ResolveLayoutShareTokenRequestOwnedView {
10676            fn as_ref(
10677                &self,
10678            ) -> &::buffa::OwnedView<ResolveLayoutShareTokenRequestView<'static>> {
10679                &self.0
10680            }
10681        }
10682        impl ::buffa::HasMessageView for super::super::ResolveLayoutShareTokenRequest {
10683            type View<'a> = ResolveLayoutShareTokenRequestView<'a>;
10684            type ViewHandle = ResolveLayoutShareTokenRequestOwnedView;
10685        }
10686        impl ::serde::Serialize for ResolveLayoutShareTokenRequestOwnedView {
10687            fn serialize<__S: ::serde::Serializer>(
10688                &self,
10689                __s: __S,
10690            ) -> ::core::result::Result<__S::Ok, __S::Error> {
10691                ::serde::Serialize::serialize(&self.0, __s)
10692            }
10693        }
10694        /// ResolveLayoutShareTokenResponse returns the immutable layout snapshot for a share token.
10695        #[derive(Clone, Debug, Default)]
10696        pub struct ResolveLayoutShareTokenResponseView<'a> {
10697            /// Shared layout snapshot.
10698            ///
10699            /// Field 1: `layout`
10700            pub layout: ::buffa::MessageFieldView<
10701                super::super::__buffa::view::LayoutView<'a>,
10702            >,
10703            /// Viewer that owns the shared template.
10704            ///
10705            /// Field 2: `owner_id`
10706            pub owner_id: u64,
10707            /// Template identifier referenced by the share token.
10708            ///
10709            /// Field 3: `template_id`
10710            pub template_id: u64,
10711            /// Immutable template version referenced by the share token.
10712            ///
10713            /// Field 4: `version`
10714            pub version: u32,
10715            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
10716        }
10717        impl<'a> ::buffa::MessageView<'a> for ResolveLayoutShareTokenResponseView<'a> {
10718            type Owned = super::super::ResolveLayoutShareTokenResponse;
10719            fn decode_view(
10720                buf: &'a [u8],
10721            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10722                let __limit = ::core::cell::Cell::new(
10723                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
10724                );
10725                <Self as ::buffa::MessageView>::decode_view_ctx(
10726                    buf,
10727                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
10728                )
10729            }
10730            fn decode_view_with_ctx(
10731                buf: &'a [u8],
10732                ctx: ::buffa::DecodeContext<'_>,
10733            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10734                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
10735            }
10736            fn merge_view_field(
10737                &mut self,
10738                tag: ::buffa::encoding::Tag,
10739                cur: &'a [u8],
10740                before_tag: &'a [u8],
10741                ctx: ::buffa::DecodeContext<'_>,
10742            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
10743                let _ = ctx;
10744                #[allow(unused_variables)]
10745                let view = self;
10746                let mut cur = cur;
10747                match tag.field_number() {
10748                    1u32 => {
10749                        ::buffa::encoding::check_wire_type(
10750                            tag,
10751                            ::buffa::encoding::WireType::LengthDelimited,
10752                        )?;
10753                        let __sub_ctx = ctx.descend()?;
10754                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
10755                        match view.layout.as_mut() {
10756                            Some(existing) => {
10757                                ::buffa::MessageView::merge_into_view(
10758                                    existing,
10759                                    sub,
10760                                    __sub_ctx,
10761                                )?
10762                            }
10763                            None => {
10764                                view.layout = ::buffa::MessageFieldView::set(
10765                                    <super::super::__buffa::view::LayoutView as ::buffa::MessageView>::decode_view_ctx(
10766                                        sub,
10767                                        __sub_ctx,
10768                                    )?,
10769                                );
10770                            }
10771                        }
10772                    }
10773                    2u32 => {
10774                        ::buffa::encoding::check_wire_type(
10775                            tag,
10776                            ::buffa::encoding::WireType::Fixed64,
10777                        )?;
10778                        view.owner_id = ::buffa::types::decode_fixed64(&mut cur)?;
10779                    }
10780                    3u32 => {
10781                        ::buffa::encoding::check_wire_type(
10782                            tag,
10783                            ::buffa::encoding::WireType::Fixed64,
10784                        )?;
10785                        view.template_id = ::buffa::types::decode_fixed64(&mut cur)?;
10786                    }
10787                    4u32 => {
10788                        ::buffa::encoding::check_wire_type(
10789                            tag,
10790                            ::buffa::encoding::WireType::Varint,
10791                        )?;
10792                        view.version = ::buffa::types::decode_uint32(&mut cur)?;
10793                    }
10794                    _ => {
10795                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
10796                        let span_len = before_tag.len() - cur.len();
10797                        view.__buffa_unknown_fields
10798                            .push_record(before_tag, span_len, ctx)?;
10799                    }
10800                }
10801                ::core::result::Result::Ok(cur)
10802            }
10803            fn to_owned_message(
10804                &self,
10805            ) -> ::core::result::Result<
10806                super::super::ResolveLayoutShareTokenResponse,
10807                ::buffa::DecodeError,
10808            > {
10809                self.to_owned_from_source(None)
10810            }
10811            #[allow(clippy::useless_conversion, clippy::needless_update)]
10812            fn to_owned_from_source(
10813                &self,
10814                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
10815            ) -> ::core::result::Result<
10816                super::super::ResolveLayoutShareTokenResponse,
10817                ::buffa::DecodeError,
10818            > {
10819                #[allow(unused_imports)]
10820                use ::buffa::alloc::string::ToString as _;
10821                let _ = __buffa_src;
10822                ::core::result::Result::Ok(super::super::ResolveLayoutShareTokenResponse {
10823                    layout: match self.layout.as_option() {
10824                        Some(v) => {
10825                            ::buffa::MessageField::<
10826                                super::super::Layout,
10827                            >::some(v.to_owned_from_source(__buffa_src)?)
10828                        }
10829                        None => ::buffa::MessageField::none(),
10830                    },
10831                    owner_id: self.owner_id,
10832                    template_id: self.template_id,
10833                    version: self.version,
10834                    __buffa_unknown_fields: self
10835                        .__buffa_unknown_fields
10836                        .to_owned()?
10837                        .into(),
10838                    ..::core::default::Default::default()
10839                })
10840            }
10841        }
10842        impl<'a> ::buffa::ViewEncode<'a> for ResolveLayoutShareTokenResponseView<'a> {
10843            #[allow(clippy::needless_borrow, clippy::let_and_return)]
10844            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
10845                #[allow(unused_imports)]
10846                use ::buffa::Enumeration as _;
10847                let mut size = 0u32;
10848                if self.layout.is_set() {
10849                    let __slot = __cache.reserve();
10850                    let inner_size = self.layout.compute_size(__cache);
10851                    __cache.set(__slot, inner_size);
10852                    size
10853                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
10854                            + inner_size;
10855                }
10856                if self.owner_id != 0u64 {
10857                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
10858                }
10859                if self.template_id != 0u64 {
10860                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
10861                }
10862                if self.version != 0u32 {
10863                    size
10864                        += 1u32
10865                            + ::buffa::types::uint32_encoded_len(self.version) as u32;
10866                }
10867                size += self.__buffa_unknown_fields.encoded_len() as u32;
10868                size
10869            }
10870            #[allow(clippy::needless_borrow)]
10871            fn write_to(
10872                &self,
10873                __cache: &mut ::buffa::SizeCache,
10874                buf: &mut impl ::buffa::bytes::BufMut,
10875            ) {
10876                #[allow(unused_imports)]
10877                use ::buffa::Enumeration as _;
10878                if self.layout.is_set() {
10879                    ::buffa::types::put_len_delimited_header(
10880                        1u32,
10881                        __cache.consume_next(),
10882                        buf,
10883                    );
10884                    self.layout.write_to(__cache, buf);
10885                }
10886                if self.owner_id != 0u64 {
10887                    ::buffa::types::put_fixed64_field(2u32, self.owner_id, buf);
10888                }
10889                if self.template_id != 0u64 {
10890                    ::buffa::types::put_fixed64_field(3u32, self.template_id, buf);
10891                }
10892                if self.version != 0u32 {
10893                    ::buffa::types::put_uint32_field(4u32, self.version, buf);
10894                }
10895                self.__buffa_unknown_fields.write_to(buf);
10896            }
10897        }
10898        /// Serializes this view as protobuf JSON.
10899        ///
10900        /// Implicit-presence fields with default values are omitted, `required`
10901        /// fields are always emitted, explicit-presence (`optional`) fields are
10902        /// emitted only when set, bytes fields are base64-encoded, and enum
10903        /// values are their proto name strings.
10904        ///
10905        /// This impl uses `serialize_map(None)` because the number of emitted
10906        /// fields depends on default-omission rules; serializers that require
10907        /// known map lengths (e.g. `bincode`) will return a runtime error.
10908        /// Use the owned message type for those formats.
10909        impl<'__a> ::serde::Serialize for ResolveLayoutShareTokenResponseView<'__a> {
10910            fn serialize<__S: ::serde::Serializer>(
10911                &self,
10912                __s: __S,
10913            ) -> ::core::result::Result<__S::Ok, __S::Error> {
10914                use ::serde::ser::SerializeMap as _;
10915                let mut __map = __s.serialize_map(::core::option::Option::None)?;
10916                {
10917                    if let ::core::option::Option::Some(__v) = self.layout.as_option() {
10918                        __map.serialize_entry("layout", __v)?;
10919                    }
10920                }
10921                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.owner_id) {
10922                    __map
10923                        .serialize_entry(
10924                            "ownerId",
10925                            &::buffa::json_helpers::ProtoJson(&self.owner_id),
10926                        )?;
10927                }
10928                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.template_id) {
10929                    __map
10930                        .serialize_entry(
10931                            "templateId",
10932                            &::buffa::json_helpers::ProtoJson(&self.template_id),
10933                        )?;
10934                }
10935                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.version) {
10936                    __map
10937                        .serialize_entry(
10938                            "version",
10939                            &::buffa::json_helpers::ProtoJson(&self.version),
10940                        )?;
10941                }
10942                __map.end()
10943            }
10944        }
10945        impl<'a> ::buffa::MessageName for ResolveLayoutShareTokenResponseView<'a> {
10946            const PACKAGE: &'static str = "layout.v1";
10947            const NAME: &'static str = "ResolveLayoutShareTokenResponse";
10948            const FULL_NAME: &'static str = "layout.v1.ResolveLayoutShareTokenResponse";
10949            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ResolveLayoutShareTokenResponse";
10950        }
10951        ::buffa::impl_default_view_instance!(ResolveLayoutShareTokenResponseView);
10952        ::buffa::impl_view_reborrow!(ResolveLayoutShareTokenResponseView);
10953        /** Self-contained, `'static` owned view of a `ResolveLayoutShareTokenResponse` message.
10954
10955 Wraps [`::buffa::OwnedView`]`<`[`ResolveLayoutShareTokenResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
10956
10957 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ResolveLayoutShareTokenResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
10958        #[derive(Clone, Debug)]
10959        pub struct ResolveLayoutShareTokenResponseOwnedView(
10960            ::buffa::OwnedView<ResolveLayoutShareTokenResponseView<'static>>,
10961        );
10962        impl ResolveLayoutShareTokenResponseOwnedView {
10963            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
10964            ///
10965            /// The view borrows directly from the buffer's data; the buffer is
10966            /// retained inside the returned handle.
10967            ///
10968            /// # Errors
10969            ///
10970            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
10971            /// protobuf data.
10972            pub fn decode(
10973                bytes: ::buffa::bytes::Bytes,
10974            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10975                ::core::result::Result::Ok(
10976                    ResolveLayoutShareTokenResponseOwnedView(
10977                        ::buffa::OwnedView::decode(bytes)?,
10978                    ),
10979                )
10980            }
10981            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
10982            /// max message size).
10983            ///
10984            /// # Errors
10985            ///
10986            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
10987            /// exceeds the configured limits.
10988            pub fn decode_with_options(
10989                bytes: ::buffa::bytes::Bytes,
10990                opts: &::buffa::DecodeOptions,
10991            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10992                ::core::result::Result::Ok(
10993                    ResolveLayoutShareTokenResponseOwnedView(
10994                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
10995                    ),
10996                )
10997            }
10998            /// Build from an owned message via an encode → decode round-trip.
10999            ///
11000            /// # Errors
11001            ///
11002            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
11003            /// somehow invalid (should not happen for well-formed messages).
11004            pub fn from_owned(
11005                msg: &super::super::ResolveLayoutShareTokenResponse,
11006            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11007                ::core::result::Result::Ok(
11008                    ResolveLayoutShareTokenResponseOwnedView(
11009                        ::buffa::OwnedView::from_owned(msg)?,
11010                    ),
11011                )
11012            }
11013            /// Borrow the full [`ResolveLayoutShareTokenResponseView`] with its lifetime tied to `&self`.
11014            #[must_use]
11015            pub fn view(&self) -> &ResolveLayoutShareTokenResponseView<'_> {
11016                self.0.reborrow()
11017            }
11018            /// Convert to the owned message type.
11019            ///
11020            /// # Errors
11021            ///
11022            /// Returns an error if re-materializing preserved unknown fields
11023            /// fails (e.g. the unknown-field limit is exceeded).
11024            pub fn to_owned_message(
11025                &self,
11026            ) -> ::core::result::Result<
11027                super::super::ResolveLayoutShareTokenResponse,
11028                ::buffa::DecodeError,
11029            > {
11030                self.0.to_owned_message()
11031            }
11032            /// The underlying bytes buffer.
11033            #[must_use]
11034            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
11035                self.0.bytes()
11036            }
11037            /// Consume the handle, returning the underlying bytes buffer.
11038            #[must_use]
11039            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
11040                self.0.into_bytes()
11041            }
11042            /// Shared layout snapshot.
11043            ///
11044            /// Field 1: `layout`
11045            #[must_use]
11046            pub fn layout(
11047                &self,
11048            ) -> &::buffa::MessageFieldView<
11049                super::super::__buffa::view::LayoutView<'_>,
11050            > {
11051                &self.0.reborrow().layout
11052            }
11053            /// Viewer that owns the shared template.
11054            ///
11055            /// Field 2: `owner_id`
11056            #[must_use]
11057            pub fn owner_id(&self) -> u64 {
11058                self.0.reborrow().owner_id
11059            }
11060            /// Template identifier referenced by the share token.
11061            ///
11062            /// Field 3: `template_id`
11063            #[must_use]
11064            pub fn template_id(&self) -> u64 {
11065                self.0.reborrow().template_id
11066            }
11067            /// Immutable template version referenced by the share token.
11068            ///
11069            /// Field 4: `version`
11070            #[must_use]
11071            pub fn version(&self) -> u32 {
11072                self.0.reborrow().version
11073            }
11074        }
11075        impl ::core::convert::From<
11076            ::buffa::OwnedView<ResolveLayoutShareTokenResponseView<'static>>,
11077        > for ResolveLayoutShareTokenResponseOwnedView {
11078            fn from(
11079                inner: ::buffa::OwnedView<ResolveLayoutShareTokenResponseView<'static>>,
11080            ) -> Self {
11081                ResolveLayoutShareTokenResponseOwnedView(inner)
11082            }
11083        }
11084        impl ::core::convert::From<ResolveLayoutShareTokenResponseOwnedView>
11085        for ::buffa::OwnedView<ResolveLayoutShareTokenResponseView<'static>> {
11086            fn from(wrapper: ResolveLayoutShareTokenResponseOwnedView) -> Self {
11087                wrapper.0
11088            }
11089        }
11090        impl ::core::convert::AsRef<
11091            ::buffa::OwnedView<ResolveLayoutShareTokenResponseView<'static>>,
11092        > for ResolveLayoutShareTokenResponseOwnedView {
11093            fn as_ref(
11094                &self,
11095            ) -> &::buffa::OwnedView<ResolveLayoutShareTokenResponseView<'static>> {
11096                &self.0
11097            }
11098        }
11099        impl ::buffa::HasMessageView for super::super::ResolveLayoutShareTokenResponse {
11100            type View<'a> = ResolveLayoutShareTokenResponseView<'a>;
11101            type ViewHandle = ResolveLayoutShareTokenResponseOwnedView;
11102        }
11103        impl ::serde::Serialize for ResolveLayoutShareTokenResponseOwnedView {
11104            fn serialize<__S: ::serde::Serializer>(
11105                &self,
11106                __s: __S,
11107            ) -> ::core::result::Result<__S::Ok, __S::Error> {
11108                ::serde::Serialize::serialize(&self.0, __s)
11109            }
11110        }
11111        /// CreateLayoutShareLinkRequest creates a share token for one saved layout.
11112        #[derive(Clone, Debug, Default)]
11113        pub struct CreateLayoutShareLinkRequestView<'a> {
11114            /// Saved layout identifier to share.
11115            ///
11116            /// Field 1: `layout_id`
11117            pub layout_id: u64,
11118            /// Expiration time in milliseconds since epoch (UTC); 0 means the link does not expire.
11119            ///
11120            /// Field 2: `expires_at_ms`
11121            pub expires_at_ms: u64,
11122            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
11123        }
11124        impl<'a> ::buffa::MessageView<'a> for CreateLayoutShareLinkRequestView<'a> {
11125            type Owned = super::super::CreateLayoutShareLinkRequest;
11126            fn decode_view(
11127                buf: &'a [u8],
11128            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11129                let __limit = ::core::cell::Cell::new(
11130                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
11131                );
11132                <Self as ::buffa::MessageView>::decode_view_ctx(
11133                    buf,
11134                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
11135                )
11136            }
11137            fn decode_view_with_ctx(
11138                buf: &'a [u8],
11139                ctx: ::buffa::DecodeContext<'_>,
11140            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11141                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
11142            }
11143            fn merge_view_field(
11144                &mut self,
11145                tag: ::buffa::encoding::Tag,
11146                cur: &'a [u8],
11147                before_tag: &'a [u8],
11148                ctx: ::buffa::DecodeContext<'_>,
11149            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
11150                let _ = ctx;
11151                #[allow(unused_variables)]
11152                let view = self;
11153                let mut cur = cur;
11154                match tag.field_number() {
11155                    1u32 => {
11156                        ::buffa::encoding::check_wire_type(
11157                            tag,
11158                            ::buffa::encoding::WireType::Fixed64,
11159                        )?;
11160                        view.layout_id = ::buffa::types::decode_fixed64(&mut cur)?;
11161                    }
11162                    2u32 => {
11163                        ::buffa::encoding::check_wire_type(
11164                            tag,
11165                            ::buffa::encoding::WireType::Fixed64,
11166                        )?;
11167                        view.expires_at_ms = ::buffa::types::decode_fixed64(&mut cur)?;
11168                    }
11169                    _ => {
11170                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
11171                        let span_len = before_tag.len() - cur.len();
11172                        view.__buffa_unknown_fields
11173                            .push_record(before_tag, span_len, ctx)?;
11174                    }
11175                }
11176                ::core::result::Result::Ok(cur)
11177            }
11178            fn to_owned_message(
11179                &self,
11180            ) -> ::core::result::Result<
11181                super::super::CreateLayoutShareLinkRequest,
11182                ::buffa::DecodeError,
11183            > {
11184                self.to_owned_from_source(None)
11185            }
11186            #[allow(clippy::useless_conversion, clippy::needless_update)]
11187            fn to_owned_from_source(
11188                &self,
11189                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
11190            ) -> ::core::result::Result<
11191                super::super::CreateLayoutShareLinkRequest,
11192                ::buffa::DecodeError,
11193            > {
11194                #[allow(unused_imports)]
11195                use ::buffa::alloc::string::ToString as _;
11196                let _ = __buffa_src;
11197                ::core::result::Result::Ok(super::super::CreateLayoutShareLinkRequest {
11198                    layout_id: self.layout_id,
11199                    expires_at_ms: self.expires_at_ms,
11200                    __buffa_unknown_fields: self
11201                        .__buffa_unknown_fields
11202                        .to_owned()?
11203                        .into(),
11204                    ..::core::default::Default::default()
11205                })
11206            }
11207        }
11208        impl<'a> ::buffa::ViewEncode<'a> for CreateLayoutShareLinkRequestView<'a> {
11209            #[allow(clippy::needless_borrow, clippy::let_and_return)]
11210            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
11211                #[allow(unused_imports)]
11212                use ::buffa::Enumeration as _;
11213                let mut size = 0u32;
11214                if self.layout_id != 0u64 {
11215                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
11216                }
11217                if self.expires_at_ms != 0u64 {
11218                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
11219                }
11220                size += self.__buffa_unknown_fields.encoded_len() as u32;
11221                size
11222            }
11223            #[allow(clippy::needless_borrow)]
11224            fn write_to(
11225                &self,
11226                _cache: &mut ::buffa::SizeCache,
11227                buf: &mut impl ::buffa::bytes::BufMut,
11228            ) {
11229                #[allow(unused_imports)]
11230                use ::buffa::Enumeration as _;
11231                if self.layout_id != 0u64 {
11232                    ::buffa::types::put_fixed64_field(1u32, self.layout_id, buf);
11233                }
11234                if self.expires_at_ms != 0u64 {
11235                    ::buffa::types::put_fixed64_field(2u32, self.expires_at_ms, buf);
11236                }
11237                self.__buffa_unknown_fields.write_to(buf);
11238            }
11239        }
11240        /// Serializes this view as protobuf JSON.
11241        ///
11242        /// Implicit-presence fields with default values are omitted, `required`
11243        /// fields are always emitted, explicit-presence (`optional`) fields are
11244        /// emitted only when set, bytes fields are base64-encoded, and enum
11245        /// values are their proto name strings.
11246        ///
11247        /// This impl uses `serialize_map(None)` because the number of emitted
11248        /// fields depends on default-omission rules; serializers that require
11249        /// known map lengths (e.g. `bincode`) will return a runtime error.
11250        /// Use the owned message type for those formats.
11251        impl<'__a> ::serde::Serialize for CreateLayoutShareLinkRequestView<'__a> {
11252            fn serialize<__S: ::serde::Serializer>(
11253                &self,
11254                __s: __S,
11255            ) -> ::core::result::Result<__S::Ok, __S::Error> {
11256                use ::serde::ser::SerializeMap as _;
11257                let mut __map = __s.serialize_map(::core::option::Option::None)?;
11258                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.layout_id) {
11259                    __map
11260                        .serialize_entry(
11261                            "layoutId",
11262                            &::buffa::json_helpers::ProtoJson(&self.layout_id),
11263                        )?;
11264                }
11265                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.expires_at_ms) {
11266                    __map
11267                        .serialize_entry(
11268                            "expiresAtMs",
11269                            &::buffa::json_helpers::ProtoJson(&self.expires_at_ms),
11270                        )?;
11271                }
11272                __map.end()
11273            }
11274        }
11275        impl<'a> ::buffa::MessageName for CreateLayoutShareLinkRequestView<'a> {
11276            const PACKAGE: &'static str = "layout.v1";
11277            const NAME: &'static str = "CreateLayoutShareLinkRequest";
11278            const FULL_NAME: &'static str = "layout.v1.CreateLayoutShareLinkRequest";
11279            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.CreateLayoutShareLinkRequest";
11280        }
11281        ::buffa::impl_default_view_instance!(CreateLayoutShareLinkRequestView);
11282        ::buffa::impl_view_reborrow!(CreateLayoutShareLinkRequestView);
11283        /** Self-contained, `'static` owned view of a `CreateLayoutShareLinkRequest` message.
11284
11285 Wraps [`::buffa::OwnedView`]`<`[`CreateLayoutShareLinkRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
11286
11287 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`CreateLayoutShareLinkRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
11288        #[derive(Clone, Debug)]
11289        pub struct CreateLayoutShareLinkRequestOwnedView(
11290            ::buffa::OwnedView<CreateLayoutShareLinkRequestView<'static>>,
11291        );
11292        impl CreateLayoutShareLinkRequestOwnedView {
11293            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
11294            ///
11295            /// The view borrows directly from the buffer's data; the buffer is
11296            /// retained inside the returned handle.
11297            ///
11298            /// # Errors
11299            ///
11300            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
11301            /// protobuf data.
11302            pub fn decode(
11303                bytes: ::buffa::bytes::Bytes,
11304            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11305                ::core::result::Result::Ok(
11306                    CreateLayoutShareLinkRequestOwnedView(
11307                        ::buffa::OwnedView::decode(bytes)?,
11308                    ),
11309                )
11310            }
11311            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
11312            /// max message size).
11313            ///
11314            /// # Errors
11315            ///
11316            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
11317            /// exceeds the configured limits.
11318            pub fn decode_with_options(
11319                bytes: ::buffa::bytes::Bytes,
11320                opts: &::buffa::DecodeOptions,
11321            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11322                ::core::result::Result::Ok(
11323                    CreateLayoutShareLinkRequestOwnedView(
11324                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
11325                    ),
11326                )
11327            }
11328            /// Build from an owned message via an encode → decode round-trip.
11329            ///
11330            /// # Errors
11331            ///
11332            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
11333            /// somehow invalid (should not happen for well-formed messages).
11334            pub fn from_owned(
11335                msg: &super::super::CreateLayoutShareLinkRequest,
11336            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11337                ::core::result::Result::Ok(
11338                    CreateLayoutShareLinkRequestOwnedView(
11339                        ::buffa::OwnedView::from_owned(msg)?,
11340                    ),
11341                )
11342            }
11343            /// Borrow the full [`CreateLayoutShareLinkRequestView`] with its lifetime tied to `&self`.
11344            #[must_use]
11345            pub fn view(&self) -> &CreateLayoutShareLinkRequestView<'_> {
11346                self.0.reborrow()
11347            }
11348            /// Convert to the owned message type.
11349            ///
11350            /// # Errors
11351            ///
11352            /// Returns an error if re-materializing preserved unknown fields
11353            /// fails (e.g. the unknown-field limit is exceeded).
11354            pub fn to_owned_message(
11355                &self,
11356            ) -> ::core::result::Result<
11357                super::super::CreateLayoutShareLinkRequest,
11358                ::buffa::DecodeError,
11359            > {
11360                self.0.to_owned_message()
11361            }
11362            /// The underlying bytes buffer.
11363            #[must_use]
11364            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
11365                self.0.bytes()
11366            }
11367            /// Consume the handle, returning the underlying bytes buffer.
11368            #[must_use]
11369            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
11370                self.0.into_bytes()
11371            }
11372            /// Saved layout identifier to share.
11373            ///
11374            /// Field 1: `layout_id`
11375            #[must_use]
11376            pub fn layout_id(&self) -> u64 {
11377                self.0.reborrow().layout_id
11378            }
11379            /// Expiration time in milliseconds since epoch (UTC); 0 means the link does not expire.
11380            ///
11381            /// Field 2: `expires_at_ms`
11382            #[must_use]
11383            pub fn expires_at_ms(&self) -> u64 {
11384                self.0.reborrow().expires_at_ms
11385            }
11386        }
11387        impl ::core::convert::From<
11388            ::buffa::OwnedView<CreateLayoutShareLinkRequestView<'static>>,
11389        > for CreateLayoutShareLinkRequestOwnedView {
11390            fn from(
11391                inner: ::buffa::OwnedView<CreateLayoutShareLinkRequestView<'static>>,
11392            ) -> Self {
11393                CreateLayoutShareLinkRequestOwnedView(inner)
11394            }
11395        }
11396        impl ::core::convert::From<CreateLayoutShareLinkRequestOwnedView>
11397        for ::buffa::OwnedView<CreateLayoutShareLinkRequestView<'static>> {
11398            fn from(wrapper: CreateLayoutShareLinkRequestOwnedView) -> Self {
11399                wrapper.0
11400            }
11401        }
11402        impl ::core::convert::AsRef<
11403            ::buffa::OwnedView<CreateLayoutShareLinkRequestView<'static>>,
11404        > for CreateLayoutShareLinkRequestOwnedView {
11405            fn as_ref(
11406                &self,
11407            ) -> &::buffa::OwnedView<CreateLayoutShareLinkRequestView<'static>> {
11408                &self.0
11409            }
11410        }
11411        impl ::buffa::HasMessageView for super::super::CreateLayoutShareLinkRequest {
11412            type View<'a> = CreateLayoutShareLinkRequestView<'a>;
11413            type ViewHandle = CreateLayoutShareLinkRequestOwnedView;
11414        }
11415        impl ::serde::Serialize for CreateLayoutShareLinkRequestOwnedView {
11416            fn serialize<__S: ::serde::Serializer>(
11417                &self,
11418                __s: __S,
11419            ) -> ::core::result::Result<__S::Ok, __S::Error> {
11420                ::serde::Serialize::serialize(&self.0, __s)
11421            }
11422        }
11423        /// CreateLayoutShareLinkResponse returns the minted share token and target snapshot.
11424        #[derive(Clone, Debug, Default)]
11425        pub struct CreateLayoutShareLinkResponseView<'a> {
11426            /// Opaque share token that can resolve the layout snapshot.
11427            ///
11428            /// Field 1: `token`
11429            pub token: &'a str,
11430            /// Viewer that owns the shared template.
11431            ///
11432            /// Field 2: `owner_id`
11433            pub owner_id: u64,
11434            /// Template identifier created or reused for this layout.
11435            ///
11436            /// Field 3: `template_id`
11437            pub template_id: u64,
11438            /// Immutable template version captured by this share link.
11439            ///
11440            /// Field 4: `version`
11441            pub version: u32,
11442            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
11443        }
11444        impl<'a> ::buffa::MessageView<'a> for CreateLayoutShareLinkResponseView<'a> {
11445            type Owned = super::super::CreateLayoutShareLinkResponse;
11446            fn decode_view(
11447                buf: &'a [u8],
11448            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11449                let __limit = ::core::cell::Cell::new(
11450                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
11451                );
11452                <Self as ::buffa::MessageView>::decode_view_ctx(
11453                    buf,
11454                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
11455                )
11456            }
11457            fn decode_view_with_ctx(
11458                buf: &'a [u8],
11459                ctx: ::buffa::DecodeContext<'_>,
11460            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11461                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
11462            }
11463            fn merge_view_field(
11464                &mut self,
11465                tag: ::buffa::encoding::Tag,
11466                cur: &'a [u8],
11467                before_tag: &'a [u8],
11468                ctx: ::buffa::DecodeContext<'_>,
11469            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
11470                let _ = ctx;
11471                #[allow(unused_variables)]
11472                let view = self;
11473                let mut cur = cur;
11474                match tag.field_number() {
11475                    1u32 => {
11476                        ::buffa::encoding::check_wire_type(
11477                            tag,
11478                            ::buffa::encoding::WireType::LengthDelimited,
11479                        )?;
11480                        view.token = ::buffa::types::borrow_str(&mut cur)?;
11481                    }
11482                    2u32 => {
11483                        ::buffa::encoding::check_wire_type(
11484                            tag,
11485                            ::buffa::encoding::WireType::Fixed64,
11486                        )?;
11487                        view.owner_id = ::buffa::types::decode_fixed64(&mut cur)?;
11488                    }
11489                    3u32 => {
11490                        ::buffa::encoding::check_wire_type(
11491                            tag,
11492                            ::buffa::encoding::WireType::Fixed64,
11493                        )?;
11494                        view.template_id = ::buffa::types::decode_fixed64(&mut cur)?;
11495                    }
11496                    4u32 => {
11497                        ::buffa::encoding::check_wire_type(
11498                            tag,
11499                            ::buffa::encoding::WireType::Varint,
11500                        )?;
11501                        view.version = ::buffa::types::decode_uint32(&mut cur)?;
11502                    }
11503                    _ => {
11504                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
11505                        let span_len = before_tag.len() - cur.len();
11506                        view.__buffa_unknown_fields
11507                            .push_record(before_tag, span_len, ctx)?;
11508                    }
11509                }
11510                ::core::result::Result::Ok(cur)
11511            }
11512            fn to_owned_message(
11513                &self,
11514            ) -> ::core::result::Result<
11515                super::super::CreateLayoutShareLinkResponse,
11516                ::buffa::DecodeError,
11517            > {
11518                self.to_owned_from_source(None)
11519            }
11520            #[allow(clippy::useless_conversion, clippy::needless_update)]
11521            fn to_owned_from_source(
11522                &self,
11523                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
11524            ) -> ::core::result::Result<
11525                super::super::CreateLayoutShareLinkResponse,
11526                ::buffa::DecodeError,
11527            > {
11528                #[allow(unused_imports)]
11529                use ::buffa::alloc::string::ToString as _;
11530                let _ = __buffa_src;
11531                ::core::result::Result::Ok(super::super::CreateLayoutShareLinkResponse {
11532                    token: self.token.to_string(),
11533                    owner_id: self.owner_id,
11534                    template_id: self.template_id,
11535                    version: self.version,
11536                    __buffa_unknown_fields: self
11537                        .__buffa_unknown_fields
11538                        .to_owned()?
11539                        .into(),
11540                    ..::core::default::Default::default()
11541                })
11542            }
11543        }
11544        impl<'a> ::buffa::ViewEncode<'a> for CreateLayoutShareLinkResponseView<'a> {
11545            #[allow(clippy::needless_borrow, clippy::let_and_return)]
11546            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
11547                #[allow(unused_imports)]
11548                use ::buffa::Enumeration as _;
11549                let mut size = 0u32;
11550                if !self.token.is_empty() {
11551                    size
11552                        += 1u32 + ::buffa::types::string_encoded_len(&self.token) as u32;
11553                }
11554                if self.owner_id != 0u64 {
11555                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
11556                }
11557                if self.template_id != 0u64 {
11558                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
11559                }
11560                if self.version != 0u32 {
11561                    size
11562                        += 1u32
11563                            + ::buffa::types::uint32_encoded_len(self.version) as u32;
11564                }
11565                size += self.__buffa_unknown_fields.encoded_len() as u32;
11566                size
11567            }
11568            #[allow(clippy::needless_borrow)]
11569            fn write_to(
11570                &self,
11571                _cache: &mut ::buffa::SizeCache,
11572                buf: &mut impl ::buffa::bytes::BufMut,
11573            ) {
11574                #[allow(unused_imports)]
11575                use ::buffa::Enumeration as _;
11576                if !self.token.is_empty() {
11577                    ::buffa::types::put_string_field(1u32, &self.token, buf);
11578                }
11579                if self.owner_id != 0u64 {
11580                    ::buffa::types::put_fixed64_field(2u32, self.owner_id, buf);
11581                }
11582                if self.template_id != 0u64 {
11583                    ::buffa::types::put_fixed64_field(3u32, self.template_id, buf);
11584                }
11585                if self.version != 0u32 {
11586                    ::buffa::types::put_uint32_field(4u32, self.version, buf);
11587                }
11588                self.__buffa_unknown_fields.write_to(buf);
11589            }
11590        }
11591        /// Serializes this view as protobuf JSON.
11592        ///
11593        /// Implicit-presence fields with default values are omitted, `required`
11594        /// fields are always emitted, explicit-presence (`optional`) fields are
11595        /// emitted only when set, bytes fields are base64-encoded, and enum
11596        /// values are their proto name strings.
11597        ///
11598        /// This impl uses `serialize_map(None)` because the number of emitted
11599        /// fields depends on default-omission rules; serializers that require
11600        /// known map lengths (e.g. `bincode`) will return a runtime error.
11601        /// Use the owned message type for those formats.
11602        impl<'__a> ::serde::Serialize for CreateLayoutShareLinkResponseView<'__a> {
11603            fn serialize<__S: ::serde::Serializer>(
11604                &self,
11605                __s: __S,
11606            ) -> ::core::result::Result<__S::Ok, __S::Error> {
11607                use ::serde::ser::SerializeMap as _;
11608                let mut __map = __s.serialize_map(::core::option::Option::None)?;
11609                if !::buffa::json_helpers::skip_if::is_empty_str(self.token) {
11610                    __map.serialize_entry("token", self.token)?;
11611                }
11612                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.owner_id) {
11613                    __map
11614                        .serialize_entry(
11615                            "ownerId",
11616                            &::buffa::json_helpers::ProtoJson(&self.owner_id),
11617                        )?;
11618                }
11619                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.template_id) {
11620                    __map
11621                        .serialize_entry(
11622                            "templateId",
11623                            &::buffa::json_helpers::ProtoJson(&self.template_id),
11624                        )?;
11625                }
11626                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.version) {
11627                    __map
11628                        .serialize_entry(
11629                            "version",
11630                            &::buffa::json_helpers::ProtoJson(&self.version),
11631                        )?;
11632                }
11633                __map.end()
11634            }
11635        }
11636        impl<'a> ::buffa::MessageName for CreateLayoutShareLinkResponseView<'a> {
11637            const PACKAGE: &'static str = "layout.v1";
11638            const NAME: &'static str = "CreateLayoutShareLinkResponse";
11639            const FULL_NAME: &'static str = "layout.v1.CreateLayoutShareLinkResponse";
11640            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.CreateLayoutShareLinkResponse";
11641        }
11642        ::buffa::impl_default_view_instance!(CreateLayoutShareLinkResponseView);
11643        ::buffa::impl_view_reborrow!(CreateLayoutShareLinkResponseView);
11644        /** Self-contained, `'static` owned view of a `CreateLayoutShareLinkResponse` message.
11645
11646 Wraps [`::buffa::OwnedView`]`<`[`CreateLayoutShareLinkResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
11647
11648 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`CreateLayoutShareLinkResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
11649        #[derive(Clone, Debug)]
11650        pub struct CreateLayoutShareLinkResponseOwnedView(
11651            ::buffa::OwnedView<CreateLayoutShareLinkResponseView<'static>>,
11652        );
11653        impl CreateLayoutShareLinkResponseOwnedView {
11654            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
11655            ///
11656            /// The view borrows directly from the buffer's data; the buffer is
11657            /// retained inside the returned handle.
11658            ///
11659            /// # Errors
11660            ///
11661            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
11662            /// protobuf data.
11663            pub fn decode(
11664                bytes: ::buffa::bytes::Bytes,
11665            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11666                ::core::result::Result::Ok(
11667                    CreateLayoutShareLinkResponseOwnedView(
11668                        ::buffa::OwnedView::decode(bytes)?,
11669                    ),
11670                )
11671            }
11672            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
11673            /// max message size).
11674            ///
11675            /// # Errors
11676            ///
11677            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
11678            /// exceeds the configured limits.
11679            pub fn decode_with_options(
11680                bytes: ::buffa::bytes::Bytes,
11681                opts: &::buffa::DecodeOptions,
11682            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11683                ::core::result::Result::Ok(
11684                    CreateLayoutShareLinkResponseOwnedView(
11685                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
11686                    ),
11687                )
11688            }
11689            /// Build from an owned message via an encode → decode round-trip.
11690            ///
11691            /// # Errors
11692            ///
11693            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
11694            /// somehow invalid (should not happen for well-formed messages).
11695            pub fn from_owned(
11696                msg: &super::super::CreateLayoutShareLinkResponse,
11697            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11698                ::core::result::Result::Ok(
11699                    CreateLayoutShareLinkResponseOwnedView(
11700                        ::buffa::OwnedView::from_owned(msg)?,
11701                    ),
11702                )
11703            }
11704            /// Borrow the full [`CreateLayoutShareLinkResponseView`] with its lifetime tied to `&self`.
11705            #[must_use]
11706            pub fn view(&self) -> &CreateLayoutShareLinkResponseView<'_> {
11707                self.0.reborrow()
11708            }
11709            /// Convert to the owned message type.
11710            ///
11711            /// # Errors
11712            ///
11713            /// Returns an error if re-materializing preserved unknown fields
11714            /// fails (e.g. the unknown-field limit is exceeded).
11715            pub fn to_owned_message(
11716                &self,
11717            ) -> ::core::result::Result<
11718                super::super::CreateLayoutShareLinkResponse,
11719                ::buffa::DecodeError,
11720            > {
11721                self.0.to_owned_message()
11722            }
11723            /// The underlying bytes buffer.
11724            #[must_use]
11725            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
11726                self.0.bytes()
11727            }
11728            /// Consume the handle, returning the underlying bytes buffer.
11729            #[must_use]
11730            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
11731                self.0.into_bytes()
11732            }
11733            /// Opaque share token that can resolve the layout snapshot.
11734            ///
11735            /// Field 1: `token`
11736            #[must_use]
11737            pub fn token(&self) -> &'_ str {
11738                self.0.reborrow().token
11739            }
11740            /// Viewer that owns the shared template.
11741            ///
11742            /// Field 2: `owner_id`
11743            #[must_use]
11744            pub fn owner_id(&self) -> u64 {
11745                self.0.reborrow().owner_id
11746            }
11747            /// Template identifier created or reused for this layout.
11748            ///
11749            /// Field 3: `template_id`
11750            #[must_use]
11751            pub fn template_id(&self) -> u64 {
11752                self.0.reborrow().template_id
11753            }
11754            /// Immutable template version captured by this share link.
11755            ///
11756            /// Field 4: `version`
11757            #[must_use]
11758            pub fn version(&self) -> u32 {
11759                self.0.reborrow().version
11760            }
11761        }
11762        impl ::core::convert::From<
11763            ::buffa::OwnedView<CreateLayoutShareLinkResponseView<'static>>,
11764        > for CreateLayoutShareLinkResponseOwnedView {
11765            fn from(
11766                inner: ::buffa::OwnedView<CreateLayoutShareLinkResponseView<'static>>,
11767            ) -> Self {
11768                CreateLayoutShareLinkResponseOwnedView(inner)
11769            }
11770        }
11771        impl ::core::convert::From<CreateLayoutShareLinkResponseOwnedView>
11772        for ::buffa::OwnedView<CreateLayoutShareLinkResponseView<'static>> {
11773            fn from(wrapper: CreateLayoutShareLinkResponseOwnedView) -> Self {
11774                wrapper.0
11775            }
11776        }
11777        impl ::core::convert::AsRef<
11778            ::buffa::OwnedView<CreateLayoutShareLinkResponseView<'static>>,
11779        > for CreateLayoutShareLinkResponseOwnedView {
11780            fn as_ref(
11781                &self,
11782            ) -> &::buffa::OwnedView<CreateLayoutShareLinkResponseView<'static>> {
11783                &self.0
11784            }
11785        }
11786        impl ::buffa::HasMessageView for super::super::CreateLayoutShareLinkResponse {
11787            type View<'a> = CreateLayoutShareLinkResponseView<'a>;
11788            type ViewHandle = CreateLayoutShareLinkResponseOwnedView;
11789        }
11790        impl ::serde::Serialize for CreateLayoutShareLinkResponseOwnedView {
11791            fn serialize<__S: ::serde::Serializer>(
11792                &self,
11793                __s: __S,
11794            ) -> ::core::result::Result<__S::Ok, __S::Error> {
11795                ::serde::Serialize::serialize(&self.0, __s)
11796            }
11797        }
11798        /// RevokeLayoutShareLinkRequest revokes one previously minted share token.
11799        #[derive(Clone, Debug, Default)]
11800        pub struct RevokeLayoutShareLinkRequestView<'a> {
11801            /// Opaque share token to revoke.
11802            ///
11803            /// Field 1: `token`
11804            pub token: &'a str,
11805            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
11806        }
11807        impl<'a> ::buffa::MessageView<'a> for RevokeLayoutShareLinkRequestView<'a> {
11808            type Owned = super::super::RevokeLayoutShareLinkRequest;
11809            fn decode_view(
11810                buf: &'a [u8],
11811            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11812                let __limit = ::core::cell::Cell::new(
11813                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
11814                );
11815                <Self as ::buffa::MessageView>::decode_view_ctx(
11816                    buf,
11817                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
11818                )
11819            }
11820            fn decode_view_with_ctx(
11821                buf: &'a [u8],
11822                ctx: ::buffa::DecodeContext<'_>,
11823            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11824                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
11825            }
11826            fn merge_view_field(
11827                &mut self,
11828                tag: ::buffa::encoding::Tag,
11829                cur: &'a [u8],
11830                before_tag: &'a [u8],
11831                ctx: ::buffa::DecodeContext<'_>,
11832            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
11833                let _ = ctx;
11834                #[allow(unused_variables)]
11835                let view = self;
11836                let mut cur = cur;
11837                match tag.field_number() {
11838                    1u32 => {
11839                        ::buffa::encoding::check_wire_type(
11840                            tag,
11841                            ::buffa::encoding::WireType::LengthDelimited,
11842                        )?;
11843                        view.token = ::buffa::types::borrow_str(&mut cur)?;
11844                    }
11845                    _ => {
11846                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
11847                        let span_len = before_tag.len() - cur.len();
11848                        view.__buffa_unknown_fields
11849                            .push_record(before_tag, span_len, ctx)?;
11850                    }
11851                }
11852                ::core::result::Result::Ok(cur)
11853            }
11854            fn to_owned_message(
11855                &self,
11856            ) -> ::core::result::Result<
11857                super::super::RevokeLayoutShareLinkRequest,
11858                ::buffa::DecodeError,
11859            > {
11860                self.to_owned_from_source(None)
11861            }
11862            #[allow(clippy::useless_conversion, clippy::needless_update)]
11863            fn to_owned_from_source(
11864                &self,
11865                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
11866            ) -> ::core::result::Result<
11867                super::super::RevokeLayoutShareLinkRequest,
11868                ::buffa::DecodeError,
11869            > {
11870                #[allow(unused_imports)]
11871                use ::buffa::alloc::string::ToString as _;
11872                let _ = __buffa_src;
11873                ::core::result::Result::Ok(super::super::RevokeLayoutShareLinkRequest {
11874                    token: self.token.to_string(),
11875                    __buffa_unknown_fields: self
11876                        .__buffa_unknown_fields
11877                        .to_owned()?
11878                        .into(),
11879                    ..::core::default::Default::default()
11880                })
11881            }
11882        }
11883        impl<'a> ::buffa::ViewEncode<'a> for RevokeLayoutShareLinkRequestView<'a> {
11884            #[allow(clippy::needless_borrow, clippy::let_and_return)]
11885            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
11886                #[allow(unused_imports)]
11887                use ::buffa::Enumeration as _;
11888                let mut size = 0u32;
11889                if !self.token.is_empty() {
11890                    size
11891                        += 1u32 + ::buffa::types::string_encoded_len(&self.token) as u32;
11892                }
11893                size += self.__buffa_unknown_fields.encoded_len() as u32;
11894                size
11895            }
11896            #[allow(clippy::needless_borrow)]
11897            fn write_to(
11898                &self,
11899                _cache: &mut ::buffa::SizeCache,
11900                buf: &mut impl ::buffa::bytes::BufMut,
11901            ) {
11902                #[allow(unused_imports)]
11903                use ::buffa::Enumeration as _;
11904                if !self.token.is_empty() {
11905                    ::buffa::types::put_string_field(1u32, &self.token, buf);
11906                }
11907                self.__buffa_unknown_fields.write_to(buf);
11908            }
11909        }
11910        /// Serializes this view as protobuf JSON.
11911        ///
11912        /// Implicit-presence fields with default values are omitted, `required`
11913        /// fields are always emitted, explicit-presence (`optional`) fields are
11914        /// emitted only when set, bytes fields are base64-encoded, and enum
11915        /// values are their proto name strings.
11916        ///
11917        /// This impl uses `serialize_map(None)` because the number of emitted
11918        /// fields depends on default-omission rules; serializers that require
11919        /// known map lengths (e.g. `bincode`) will return a runtime error.
11920        /// Use the owned message type for those formats.
11921        impl<'__a> ::serde::Serialize for RevokeLayoutShareLinkRequestView<'__a> {
11922            fn serialize<__S: ::serde::Serializer>(
11923                &self,
11924                __s: __S,
11925            ) -> ::core::result::Result<__S::Ok, __S::Error> {
11926                use ::serde::ser::SerializeMap as _;
11927                let mut __map = __s.serialize_map(::core::option::Option::None)?;
11928                if !::buffa::json_helpers::skip_if::is_empty_str(self.token) {
11929                    __map.serialize_entry("token", self.token)?;
11930                }
11931                __map.end()
11932            }
11933        }
11934        impl<'a> ::buffa::MessageName for RevokeLayoutShareLinkRequestView<'a> {
11935            const PACKAGE: &'static str = "layout.v1";
11936            const NAME: &'static str = "RevokeLayoutShareLinkRequest";
11937            const FULL_NAME: &'static str = "layout.v1.RevokeLayoutShareLinkRequest";
11938            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.RevokeLayoutShareLinkRequest";
11939        }
11940        ::buffa::impl_default_view_instance!(RevokeLayoutShareLinkRequestView);
11941        ::buffa::impl_view_reborrow!(RevokeLayoutShareLinkRequestView);
11942        /** Self-contained, `'static` owned view of a `RevokeLayoutShareLinkRequest` message.
11943
11944 Wraps [`::buffa::OwnedView`]`<`[`RevokeLayoutShareLinkRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
11945
11946 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`RevokeLayoutShareLinkRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
11947        #[derive(Clone, Debug)]
11948        pub struct RevokeLayoutShareLinkRequestOwnedView(
11949            ::buffa::OwnedView<RevokeLayoutShareLinkRequestView<'static>>,
11950        );
11951        impl RevokeLayoutShareLinkRequestOwnedView {
11952            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
11953            ///
11954            /// The view borrows directly from the buffer's data; the buffer is
11955            /// retained inside the returned handle.
11956            ///
11957            /// # Errors
11958            ///
11959            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
11960            /// protobuf data.
11961            pub fn decode(
11962                bytes: ::buffa::bytes::Bytes,
11963            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11964                ::core::result::Result::Ok(
11965                    RevokeLayoutShareLinkRequestOwnedView(
11966                        ::buffa::OwnedView::decode(bytes)?,
11967                    ),
11968                )
11969            }
11970            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
11971            /// max message size).
11972            ///
11973            /// # Errors
11974            ///
11975            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
11976            /// exceeds the configured limits.
11977            pub fn decode_with_options(
11978                bytes: ::buffa::bytes::Bytes,
11979                opts: &::buffa::DecodeOptions,
11980            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11981                ::core::result::Result::Ok(
11982                    RevokeLayoutShareLinkRequestOwnedView(
11983                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
11984                    ),
11985                )
11986            }
11987            /// Build from an owned message via an encode → decode round-trip.
11988            ///
11989            /// # Errors
11990            ///
11991            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
11992            /// somehow invalid (should not happen for well-formed messages).
11993            pub fn from_owned(
11994                msg: &super::super::RevokeLayoutShareLinkRequest,
11995            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11996                ::core::result::Result::Ok(
11997                    RevokeLayoutShareLinkRequestOwnedView(
11998                        ::buffa::OwnedView::from_owned(msg)?,
11999                    ),
12000                )
12001            }
12002            /// Borrow the full [`RevokeLayoutShareLinkRequestView`] with its lifetime tied to `&self`.
12003            #[must_use]
12004            pub fn view(&self) -> &RevokeLayoutShareLinkRequestView<'_> {
12005                self.0.reborrow()
12006            }
12007            /// Convert to the owned message type.
12008            ///
12009            /// # Errors
12010            ///
12011            /// Returns an error if re-materializing preserved unknown fields
12012            /// fails (e.g. the unknown-field limit is exceeded).
12013            pub fn to_owned_message(
12014                &self,
12015            ) -> ::core::result::Result<
12016                super::super::RevokeLayoutShareLinkRequest,
12017                ::buffa::DecodeError,
12018            > {
12019                self.0.to_owned_message()
12020            }
12021            /// The underlying bytes buffer.
12022            #[must_use]
12023            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
12024                self.0.bytes()
12025            }
12026            /// Consume the handle, returning the underlying bytes buffer.
12027            #[must_use]
12028            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
12029                self.0.into_bytes()
12030            }
12031            /// Opaque share token to revoke.
12032            ///
12033            /// Field 1: `token`
12034            #[must_use]
12035            pub fn token(&self) -> &'_ str {
12036                self.0.reborrow().token
12037            }
12038        }
12039        impl ::core::convert::From<
12040            ::buffa::OwnedView<RevokeLayoutShareLinkRequestView<'static>>,
12041        > for RevokeLayoutShareLinkRequestOwnedView {
12042            fn from(
12043                inner: ::buffa::OwnedView<RevokeLayoutShareLinkRequestView<'static>>,
12044            ) -> Self {
12045                RevokeLayoutShareLinkRequestOwnedView(inner)
12046            }
12047        }
12048        impl ::core::convert::From<RevokeLayoutShareLinkRequestOwnedView>
12049        for ::buffa::OwnedView<RevokeLayoutShareLinkRequestView<'static>> {
12050            fn from(wrapper: RevokeLayoutShareLinkRequestOwnedView) -> Self {
12051                wrapper.0
12052            }
12053        }
12054        impl ::core::convert::AsRef<
12055            ::buffa::OwnedView<RevokeLayoutShareLinkRequestView<'static>>,
12056        > for RevokeLayoutShareLinkRequestOwnedView {
12057            fn as_ref(
12058                &self,
12059            ) -> &::buffa::OwnedView<RevokeLayoutShareLinkRequestView<'static>> {
12060                &self.0
12061            }
12062        }
12063        impl ::buffa::HasMessageView for super::super::RevokeLayoutShareLinkRequest {
12064            type View<'a> = RevokeLayoutShareLinkRequestView<'a>;
12065            type ViewHandle = RevokeLayoutShareLinkRequestOwnedView;
12066        }
12067        impl ::serde::Serialize for RevokeLayoutShareLinkRequestOwnedView {
12068            fn serialize<__S: ::serde::Serializer>(
12069                &self,
12070                __s: __S,
12071            ) -> ::core::result::Result<__S::Ok, __S::Error> {
12072                ::serde::Serialize::serialize(&self.0, __s)
12073            }
12074        }
12075        /// RevokeLayoutShareLinkResponse is empty when the token was revoked.
12076        #[derive(Clone, Debug, Default)]
12077        pub struct RevokeLayoutShareLinkResponseView<'a> {
12078            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
12079        }
12080        impl<'a> ::buffa::MessageView<'a> for RevokeLayoutShareLinkResponseView<'a> {
12081            type Owned = super::super::RevokeLayoutShareLinkResponse;
12082            fn decode_view(
12083                buf: &'a [u8],
12084            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12085                let __limit = ::core::cell::Cell::new(
12086                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
12087                );
12088                <Self as ::buffa::MessageView>::decode_view_ctx(
12089                    buf,
12090                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
12091                )
12092            }
12093            fn decode_view_with_ctx(
12094                buf: &'a [u8],
12095                ctx: ::buffa::DecodeContext<'_>,
12096            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12097                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
12098            }
12099            fn merge_view_field(
12100                &mut self,
12101                tag: ::buffa::encoding::Tag,
12102                cur: &'a [u8],
12103                before_tag: &'a [u8],
12104                ctx: ::buffa::DecodeContext<'_>,
12105            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
12106                let _ = ctx;
12107                #[allow(unused_variables)]
12108                let view = self;
12109                let mut cur = cur;
12110                match tag.field_number() {
12111                    _ => {
12112                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
12113                        let span_len = before_tag.len() - cur.len();
12114                        view.__buffa_unknown_fields
12115                            .push_record(before_tag, span_len, ctx)?;
12116                    }
12117                }
12118                ::core::result::Result::Ok(cur)
12119            }
12120            fn to_owned_message(
12121                &self,
12122            ) -> ::core::result::Result<
12123                super::super::RevokeLayoutShareLinkResponse,
12124                ::buffa::DecodeError,
12125            > {
12126                self.to_owned_from_source(None)
12127            }
12128            #[allow(clippy::useless_conversion, clippy::needless_update)]
12129            fn to_owned_from_source(
12130                &self,
12131                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
12132            ) -> ::core::result::Result<
12133                super::super::RevokeLayoutShareLinkResponse,
12134                ::buffa::DecodeError,
12135            > {
12136                #[allow(unused_imports)]
12137                use ::buffa::alloc::string::ToString as _;
12138                let _ = __buffa_src;
12139                ::core::result::Result::Ok(super::super::RevokeLayoutShareLinkResponse {
12140                    __buffa_unknown_fields: self
12141                        .__buffa_unknown_fields
12142                        .to_owned()?
12143                        .into(),
12144                    ..::core::default::Default::default()
12145                })
12146            }
12147        }
12148        impl<'a> ::buffa::ViewEncode<'a> for RevokeLayoutShareLinkResponseView<'a> {
12149            #[allow(clippy::needless_borrow, clippy::let_and_return)]
12150            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
12151                #[allow(unused_imports)]
12152                use ::buffa::Enumeration as _;
12153                let mut size = 0u32;
12154                size += self.__buffa_unknown_fields.encoded_len() as u32;
12155                size
12156            }
12157            #[allow(clippy::needless_borrow)]
12158            fn write_to(
12159                &self,
12160                _cache: &mut ::buffa::SizeCache,
12161                buf: &mut impl ::buffa::bytes::BufMut,
12162            ) {
12163                #[allow(unused_imports)]
12164                use ::buffa::Enumeration as _;
12165                self.__buffa_unknown_fields.write_to(buf);
12166            }
12167        }
12168        /// Serializes this view as protobuf JSON.
12169        ///
12170        /// Implicit-presence fields with default values are omitted, `required`
12171        /// fields are always emitted, explicit-presence (`optional`) fields are
12172        /// emitted only when set, bytes fields are base64-encoded, and enum
12173        /// values are their proto name strings.
12174        ///
12175        /// This impl uses `serialize_map(None)` because the number of emitted
12176        /// fields depends on default-omission rules; serializers that require
12177        /// known map lengths (e.g. `bincode`) will return a runtime error.
12178        /// Use the owned message type for those formats.
12179        impl<'__a> ::serde::Serialize for RevokeLayoutShareLinkResponseView<'__a> {
12180            fn serialize<__S: ::serde::Serializer>(
12181                &self,
12182                __s: __S,
12183            ) -> ::core::result::Result<__S::Ok, __S::Error> {
12184                use ::serde::ser::SerializeMap as _;
12185                let mut __map = __s.serialize_map(::core::option::Option::None)?;
12186                __map.end()
12187            }
12188        }
12189        impl<'a> ::buffa::MessageName for RevokeLayoutShareLinkResponseView<'a> {
12190            const PACKAGE: &'static str = "layout.v1";
12191            const NAME: &'static str = "RevokeLayoutShareLinkResponse";
12192            const FULL_NAME: &'static str = "layout.v1.RevokeLayoutShareLinkResponse";
12193            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.RevokeLayoutShareLinkResponse";
12194        }
12195        ::buffa::impl_default_view_instance!(RevokeLayoutShareLinkResponseView);
12196        ::buffa::impl_view_reborrow!(RevokeLayoutShareLinkResponseView);
12197        /** Self-contained, `'static` owned view of a `RevokeLayoutShareLinkResponse` message.
12198
12199 Wraps [`::buffa::OwnedView`]`<`[`RevokeLayoutShareLinkResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
12200
12201 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`RevokeLayoutShareLinkResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
12202        #[derive(Clone, Debug)]
12203        pub struct RevokeLayoutShareLinkResponseOwnedView(
12204            ::buffa::OwnedView<RevokeLayoutShareLinkResponseView<'static>>,
12205        );
12206        impl RevokeLayoutShareLinkResponseOwnedView {
12207            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
12208            ///
12209            /// The view borrows directly from the buffer's data; the buffer is
12210            /// retained inside the returned handle.
12211            ///
12212            /// # Errors
12213            ///
12214            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
12215            /// protobuf data.
12216            pub fn decode(
12217                bytes: ::buffa::bytes::Bytes,
12218            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12219                ::core::result::Result::Ok(
12220                    RevokeLayoutShareLinkResponseOwnedView(
12221                        ::buffa::OwnedView::decode(bytes)?,
12222                    ),
12223                )
12224            }
12225            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
12226            /// max message size).
12227            ///
12228            /// # Errors
12229            ///
12230            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
12231            /// exceeds the configured limits.
12232            pub fn decode_with_options(
12233                bytes: ::buffa::bytes::Bytes,
12234                opts: &::buffa::DecodeOptions,
12235            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12236                ::core::result::Result::Ok(
12237                    RevokeLayoutShareLinkResponseOwnedView(
12238                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
12239                    ),
12240                )
12241            }
12242            /// Build from an owned message via an encode → decode round-trip.
12243            ///
12244            /// # Errors
12245            ///
12246            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
12247            /// somehow invalid (should not happen for well-formed messages).
12248            pub fn from_owned(
12249                msg: &super::super::RevokeLayoutShareLinkResponse,
12250            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12251                ::core::result::Result::Ok(
12252                    RevokeLayoutShareLinkResponseOwnedView(
12253                        ::buffa::OwnedView::from_owned(msg)?,
12254                    ),
12255                )
12256            }
12257            /// Borrow the full [`RevokeLayoutShareLinkResponseView`] with its lifetime tied to `&self`.
12258            #[must_use]
12259            pub fn view(&self) -> &RevokeLayoutShareLinkResponseView<'_> {
12260                self.0.reborrow()
12261            }
12262            /// Convert to the owned message type.
12263            ///
12264            /// # Errors
12265            ///
12266            /// Returns an error if re-materializing preserved unknown fields
12267            /// fails (e.g. the unknown-field limit is exceeded).
12268            pub fn to_owned_message(
12269                &self,
12270            ) -> ::core::result::Result<
12271                super::super::RevokeLayoutShareLinkResponse,
12272                ::buffa::DecodeError,
12273            > {
12274                self.0.to_owned_message()
12275            }
12276            /// The underlying bytes buffer.
12277            #[must_use]
12278            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
12279                self.0.bytes()
12280            }
12281            /// Consume the handle, returning the underlying bytes buffer.
12282            #[must_use]
12283            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
12284                self.0.into_bytes()
12285            }
12286        }
12287        impl ::core::convert::From<
12288            ::buffa::OwnedView<RevokeLayoutShareLinkResponseView<'static>>,
12289        > for RevokeLayoutShareLinkResponseOwnedView {
12290            fn from(
12291                inner: ::buffa::OwnedView<RevokeLayoutShareLinkResponseView<'static>>,
12292            ) -> Self {
12293                RevokeLayoutShareLinkResponseOwnedView(inner)
12294            }
12295        }
12296        impl ::core::convert::From<RevokeLayoutShareLinkResponseOwnedView>
12297        for ::buffa::OwnedView<RevokeLayoutShareLinkResponseView<'static>> {
12298            fn from(wrapper: RevokeLayoutShareLinkResponseOwnedView) -> Self {
12299                wrapper.0
12300            }
12301        }
12302        impl ::core::convert::AsRef<
12303            ::buffa::OwnedView<RevokeLayoutShareLinkResponseView<'static>>,
12304        > for RevokeLayoutShareLinkResponseOwnedView {
12305            fn as_ref(
12306                &self,
12307            ) -> &::buffa::OwnedView<RevokeLayoutShareLinkResponseView<'static>> {
12308                &self.0
12309            }
12310        }
12311        impl ::buffa::HasMessageView for super::super::RevokeLayoutShareLinkResponse {
12312            type View<'a> = RevokeLayoutShareLinkResponseView<'a>;
12313            type ViewHandle = RevokeLayoutShareLinkResponseOwnedView;
12314        }
12315        impl ::serde::Serialize for RevokeLayoutShareLinkResponseOwnedView {
12316            fn serialize<__S: ::serde::Serializer>(
12317                &self,
12318                __s: __S,
12319            ) -> ::core::result::Result<__S::Ok, __S::Error> {
12320                ::serde::Serialize::serialize(&self.0, __s)
12321            }
12322        }
12323        /// =============================================================================
12324        /// Templates (versioned community layouts)
12325        /// =============================================================================
12326        ///
12327        /// LayoutTemplateRef identifies a published layout template.
12328        #[derive(Clone, Debug, Default)]
12329        pub struct LayoutTemplateRefView<'a> {
12330            /// Viewer that owns the template.
12331            ///
12332            /// Field 1: `owner_id`
12333            pub owner_id: u64,
12334            /// Template identifier unique within the owner.
12335            ///
12336            /// Field 2: `template_id`
12337            pub template_id: u64,
12338            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
12339        }
12340        impl<'a> ::buffa::MessageView<'a> for LayoutTemplateRefView<'a> {
12341            type Owned = super::super::LayoutTemplateRef;
12342            fn decode_view(
12343                buf: &'a [u8],
12344            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12345                let __limit = ::core::cell::Cell::new(
12346                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
12347                );
12348                <Self as ::buffa::MessageView>::decode_view_ctx(
12349                    buf,
12350                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
12351                )
12352            }
12353            fn decode_view_with_ctx(
12354                buf: &'a [u8],
12355                ctx: ::buffa::DecodeContext<'_>,
12356            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12357                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
12358            }
12359            fn merge_view_field(
12360                &mut self,
12361                tag: ::buffa::encoding::Tag,
12362                cur: &'a [u8],
12363                before_tag: &'a [u8],
12364                ctx: ::buffa::DecodeContext<'_>,
12365            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
12366                let _ = ctx;
12367                #[allow(unused_variables)]
12368                let view = self;
12369                let mut cur = cur;
12370                match tag.field_number() {
12371                    1u32 => {
12372                        ::buffa::encoding::check_wire_type(
12373                            tag,
12374                            ::buffa::encoding::WireType::Fixed64,
12375                        )?;
12376                        view.owner_id = ::buffa::types::decode_fixed64(&mut cur)?;
12377                    }
12378                    2u32 => {
12379                        ::buffa::encoding::check_wire_type(
12380                            tag,
12381                            ::buffa::encoding::WireType::Fixed64,
12382                        )?;
12383                        view.template_id = ::buffa::types::decode_fixed64(&mut cur)?;
12384                    }
12385                    _ => {
12386                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
12387                        let span_len = before_tag.len() - cur.len();
12388                        view.__buffa_unknown_fields
12389                            .push_record(before_tag, span_len, ctx)?;
12390                    }
12391                }
12392                ::core::result::Result::Ok(cur)
12393            }
12394            fn to_owned_message(
12395                &self,
12396            ) -> ::core::result::Result<
12397                super::super::LayoutTemplateRef,
12398                ::buffa::DecodeError,
12399            > {
12400                self.to_owned_from_source(None)
12401            }
12402            #[allow(clippy::useless_conversion, clippy::needless_update)]
12403            fn to_owned_from_source(
12404                &self,
12405                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
12406            ) -> ::core::result::Result<
12407                super::super::LayoutTemplateRef,
12408                ::buffa::DecodeError,
12409            > {
12410                #[allow(unused_imports)]
12411                use ::buffa::alloc::string::ToString as _;
12412                let _ = __buffa_src;
12413                ::core::result::Result::Ok(super::super::LayoutTemplateRef {
12414                    owner_id: self.owner_id,
12415                    template_id: self.template_id,
12416                    __buffa_unknown_fields: self
12417                        .__buffa_unknown_fields
12418                        .to_owned()?
12419                        .into(),
12420                    ..::core::default::Default::default()
12421                })
12422            }
12423        }
12424        impl<'a> ::buffa::ViewEncode<'a> for LayoutTemplateRefView<'a> {
12425            #[allow(clippy::needless_borrow, clippy::let_and_return)]
12426            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
12427                #[allow(unused_imports)]
12428                use ::buffa::Enumeration as _;
12429                let mut size = 0u32;
12430                if self.owner_id != 0u64 {
12431                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
12432                }
12433                if self.template_id != 0u64 {
12434                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
12435                }
12436                size += self.__buffa_unknown_fields.encoded_len() as u32;
12437                size
12438            }
12439            #[allow(clippy::needless_borrow)]
12440            fn write_to(
12441                &self,
12442                _cache: &mut ::buffa::SizeCache,
12443                buf: &mut impl ::buffa::bytes::BufMut,
12444            ) {
12445                #[allow(unused_imports)]
12446                use ::buffa::Enumeration as _;
12447                if self.owner_id != 0u64 {
12448                    ::buffa::types::put_fixed64_field(1u32, self.owner_id, buf);
12449                }
12450                if self.template_id != 0u64 {
12451                    ::buffa::types::put_fixed64_field(2u32, self.template_id, buf);
12452                }
12453                self.__buffa_unknown_fields.write_to(buf);
12454            }
12455        }
12456        /// Serializes this view as protobuf JSON.
12457        ///
12458        /// Implicit-presence fields with default values are omitted, `required`
12459        /// fields are always emitted, explicit-presence (`optional`) fields are
12460        /// emitted only when set, bytes fields are base64-encoded, and enum
12461        /// values are their proto name strings.
12462        ///
12463        /// This impl uses `serialize_map(None)` because the number of emitted
12464        /// fields depends on default-omission rules; serializers that require
12465        /// known map lengths (e.g. `bincode`) will return a runtime error.
12466        /// Use the owned message type for those formats.
12467        impl<'__a> ::serde::Serialize for LayoutTemplateRefView<'__a> {
12468            fn serialize<__S: ::serde::Serializer>(
12469                &self,
12470                __s: __S,
12471            ) -> ::core::result::Result<__S::Ok, __S::Error> {
12472                use ::serde::ser::SerializeMap as _;
12473                let mut __map = __s.serialize_map(::core::option::Option::None)?;
12474                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.owner_id) {
12475                    __map
12476                        .serialize_entry(
12477                            "ownerId",
12478                            &::buffa::json_helpers::ProtoJson(&self.owner_id),
12479                        )?;
12480                }
12481                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.template_id) {
12482                    __map
12483                        .serialize_entry(
12484                            "templateId",
12485                            &::buffa::json_helpers::ProtoJson(&self.template_id),
12486                        )?;
12487                }
12488                __map.end()
12489            }
12490        }
12491        impl<'a> ::buffa::MessageName for LayoutTemplateRefView<'a> {
12492            const PACKAGE: &'static str = "layout.v1";
12493            const NAME: &'static str = "LayoutTemplateRef";
12494            const FULL_NAME: &'static str = "layout.v1.LayoutTemplateRef";
12495            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutTemplateRef";
12496        }
12497        ::buffa::impl_default_view_instance!(LayoutTemplateRefView);
12498        ::buffa::impl_view_reborrow!(LayoutTemplateRefView);
12499        /** Self-contained, `'static` owned view of a `LayoutTemplateRef` message.
12500
12501 Wraps [`::buffa::OwnedView`]`<`[`LayoutTemplateRefView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
12502
12503 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`LayoutTemplateRefView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
12504        #[derive(Clone, Debug)]
12505        pub struct LayoutTemplateRefOwnedView(
12506            ::buffa::OwnedView<LayoutTemplateRefView<'static>>,
12507        );
12508        impl LayoutTemplateRefOwnedView {
12509            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
12510            ///
12511            /// The view borrows directly from the buffer's data; the buffer is
12512            /// retained inside the returned handle.
12513            ///
12514            /// # Errors
12515            ///
12516            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
12517            /// protobuf data.
12518            pub fn decode(
12519                bytes: ::buffa::bytes::Bytes,
12520            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12521                ::core::result::Result::Ok(
12522                    LayoutTemplateRefOwnedView(::buffa::OwnedView::decode(bytes)?),
12523                )
12524            }
12525            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
12526            /// max message size).
12527            ///
12528            /// # Errors
12529            ///
12530            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
12531            /// exceeds the configured limits.
12532            pub fn decode_with_options(
12533                bytes: ::buffa::bytes::Bytes,
12534                opts: &::buffa::DecodeOptions,
12535            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12536                ::core::result::Result::Ok(
12537                    LayoutTemplateRefOwnedView(
12538                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
12539                    ),
12540                )
12541            }
12542            /// Build from an owned message via an encode → decode round-trip.
12543            ///
12544            /// # Errors
12545            ///
12546            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
12547            /// somehow invalid (should not happen for well-formed messages).
12548            pub fn from_owned(
12549                msg: &super::super::LayoutTemplateRef,
12550            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12551                ::core::result::Result::Ok(
12552                    LayoutTemplateRefOwnedView(::buffa::OwnedView::from_owned(msg)?),
12553                )
12554            }
12555            /// Borrow the full [`LayoutTemplateRefView`] with its lifetime tied to `&self`.
12556            #[must_use]
12557            pub fn view(&self) -> &LayoutTemplateRefView<'_> {
12558                self.0.reborrow()
12559            }
12560            /// Convert to the owned message type.
12561            ///
12562            /// # Errors
12563            ///
12564            /// Returns an error if re-materializing preserved unknown fields
12565            /// fails (e.g. the unknown-field limit is exceeded).
12566            pub fn to_owned_message(
12567                &self,
12568            ) -> ::core::result::Result<
12569                super::super::LayoutTemplateRef,
12570                ::buffa::DecodeError,
12571            > {
12572                self.0.to_owned_message()
12573            }
12574            /// The underlying bytes buffer.
12575            #[must_use]
12576            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
12577                self.0.bytes()
12578            }
12579            /// Consume the handle, returning the underlying bytes buffer.
12580            #[must_use]
12581            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
12582                self.0.into_bytes()
12583            }
12584            /// Viewer that owns the template.
12585            ///
12586            /// Field 1: `owner_id`
12587            #[must_use]
12588            pub fn owner_id(&self) -> u64 {
12589                self.0.reborrow().owner_id
12590            }
12591            /// Template identifier unique within the owner.
12592            ///
12593            /// Field 2: `template_id`
12594            #[must_use]
12595            pub fn template_id(&self) -> u64 {
12596                self.0.reborrow().template_id
12597            }
12598        }
12599        impl ::core::convert::From<::buffa::OwnedView<LayoutTemplateRefView<'static>>>
12600        for LayoutTemplateRefOwnedView {
12601            fn from(inner: ::buffa::OwnedView<LayoutTemplateRefView<'static>>) -> Self {
12602                LayoutTemplateRefOwnedView(inner)
12603            }
12604        }
12605        impl ::core::convert::From<LayoutTemplateRefOwnedView>
12606        for ::buffa::OwnedView<LayoutTemplateRefView<'static>> {
12607            fn from(wrapper: LayoutTemplateRefOwnedView) -> Self {
12608                wrapper.0
12609            }
12610        }
12611        impl ::core::convert::AsRef<::buffa::OwnedView<LayoutTemplateRefView<'static>>>
12612        for LayoutTemplateRefOwnedView {
12613            fn as_ref(&self) -> &::buffa::OwnedView<LayoutTemplateRefView<'static>> {
12614                &self.0
12615            }
12616        }
12617        impl ::buffa::HasMessageView for super::super::LayoutTemplateRef {
12618            type View<'a> = LayoutTemplateRefView<'a>;
12619            type ViewHandle = LayoutTemplateRefOwnedView;
12620        }
12621        impl ::serde::Serialize for LayoutTemplateRefOwnedView {
12622            fn serialize<__S: ::serde::Serializer>(
12623                &self,
12624                __s: __S,
12625            ) -> ::core::result::Result<__S::Ok, __S::Error> {
12626                ::serde::Serialize::serialize(&self.0, __s)
12627            }
12628        }
12629        /// LayoutTemplate contains discovery metadata for a versioned layout template.
12630        #[derive(Clone, Debug, Default)]
12631        pub struct LayoutTemplateView<'a> {
12632            /// Template identifier.
12633            ///
12634            /// Field 1: `template`
12635            pub template: ::buffa::MessageFieldView<
12636                super::super::__buffa::view::LayoutTemplateRefView<'a>,
12637            >,
12638            /// Public display title.
12639            ///
12640            /// Field 2: `title`
12641            pub title: &'a str,
12642            /// Public description shown with the template.
12643            ///
12644            /// Field 3: `description`
12645            pub description: &'a str,
12646            /// Public tags used for grouping or filtering.
12647            ///
12648            /// Field 4: `tags`
12649            pub tags: ::buffa::RepeatedView<'a, &'a str>,
12650            /// True when the template appears in discovery listings.
12651            ///
12652            /// Field 5: `is_listed`
12653            pub is_listed: bool,
12654            /// Latest immutable version number for this template.
12655            ///
12656            /// Field 6: `latest_version`
12657            pub latest_version: u32,
12658            /// Initial publication time in milliseconds since epoch (UTC).
12659            ///
12660            /// Field 7: `published_at_ms`
12661            pub published_at_ms: u64,
12662            /// Last metadata update time in milliseconds since epoch (UTC).
12663            ///
12664            /// Field 8: `updated_at_ms`
12665            pub updated_at_ms: u64,
12666            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
12667        }
12668        impl<'a> ::buffa::MessageView<'a> for LayoutTemplateView<'a> {
12669            type Owned = super::super::LayoutTemplate;
12670            fn decode_view(
12671                buf: &'a [u8],
12672            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12673                let __limit = ::core::cell::Cell::new(
12674                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
12675                );
12676                <Self as ::buffa::MessageView>::decode_view_ctx(
12677                    buf,
12678                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
12679                )
12680            }
12681            fn decode_view_with_ctx(
12682                buf: &'a [u8],
12683                ctx: ::buffa::DecodeContext<'_>,
12684            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12685                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
12686            }
12687            fn merge_view_field(
12688                &mut self,
12689                tag: ::buffa::encoding::Tag,
12690                cur: &'a [u8],
12691                before_tag: &'a [u8],
12692                ctx: ::buffa::DecodeContext<'_>,
12693            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
12694                let _ = ctx;
12695                #[allow(unused_variables)]
12696                let view = self;
12697                let mut cur = cur;
12698                match tag.field_number() {
12699                    1u32 => {
12700                        ::buffa::encoding::check_wire_type(
12701                            tag,
12702                            ::buffa::encoding::WireType::LengthDelimited,
12703                        )?;
12704                        let __sub_ctx = ctx.descend()?;
12705                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
12706                        match view.template.as_mut() {
12707                            Some(existing) => {
12708                                ::buffa::MessageView::merge_into_view(
12709                                    existing,
12710                                    sub,
12711                                    __sub_ctx,
12712                                )?
12713                            }
12714                            None => {
12715                                view.template = ::buffa::MessageFieldView::set(
12716                                    <super::super::__buffa::view::LayoutTemplateRefView as ::buffa::MessageView>::decode_view_ctx(
12717                                        sub,
12718                                        __sub_ctx,
12719                                    )?,
12720                                );
12721                            }
12722                        }
12723                    }
12724                    2u32 => {
12725                        ::buffa::encoding::check_wire_type(
12726                            tag,
12727                            ::buffa::encoding::WireType::LengthDelimited,
12728                        )?;
12729                        view.title = ::buffa::types::borrow_str(&mut cur)?;
12730                    }
12731                    3u32 => {
12732                        ::buffa::encoding::check_wire_type(
12733                            tag,
12734                            ::buffa::encoding::WireType::LengthDelimited,
12735                        )?;
12736                        view.description = ::buffa::types::borrow_str(&mut cur)?;
12737                    }
12738                    5u32 => {
12739                        ::buffa::encoding::check_wire_type(
12740                            tag,
12741                            ::buffa::encoding::WireType::Varint,
12742                        )?;
12743                        view.is_listed = ::buffa::types::decode_bool(&mut cur)?;
12744                    }
12745                    6u32 => {
12746                        ::buffa::encoding::check_wire_type(
12747                            tag,
12748                            ::buffa::encoding::WireType::Varint,
12749                        )?;
12750                        view.latest_version = ::buffa::types::decode_uint32(&mut cur)?;
12751                    }
12752                    7u32 => {
12753                        ::buffa::encoding::check_wire_type(
12754                            tag,
12755                            ::buffa::encoding::WireType::Fixed64,
12756                        )?;
12757                        view.published_at_ms = ::buffa::types::decode_fixed64(&mut cur)?;
12758                    }
12759                    8u32 => {
12760                        ::buffa::encoding::check_wire_type(
12761                            tag,
12762                            ::buffa::encoding::WireType::Fixed64,
12763                        )?;
12764                        view.updated_at_ms = ::buffa::types::decode_fixed64(&mut cur)?;
12765                    }
12766                    4u32 => {
12767                        ::buffa::encoding::check_wire_type(
12768                            tag,
12769                            ::buffa::encoding::WireType::LengthDelimited,
12770                        )?;
12771                        view.tags.push(::buffa::types::borrow_str(&mut cur)?);
12772                    }
12773                    _ => {
12774                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
12775                        let span_len = before_tag.len() - cur.len();
12776                        view.__buffa_unknown_fields
12777                            .push_record(before_tag, span_len, ctx)?;
12778                    }
12779                }
12780                ::core::result::Result::Ok(cur)
12781            }
12782            fn to_owned_message(
12783                &self,
12784            ) -> ::core::result::Result<
12785                super::super::LayoutTemplate,
12786                ::buffa::DecodeError,
12787            > {
12788                self.to_owned_from_source(None)
12789            }
12790            #[allow(clippy::useless_conversion, clippy::needless_update)]
12791            fn to_owned_from_source(
12792                &self,
12793                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
12794            ) -> ::core::result::Result<
12795                super::super::LayoutTemplate,
12796                ::buffa::DecodeError,
12797            > {
12798                #[allow(unused_imports)]
12799                use ::buffa::alloc::string::ToString as _;
12800                let _ = __buffa_src;
12801                ::core::result::Result::Ok(super::super::LayoutTemplate {
12802                    template: match self.template.as_option() {
12803                        Some(v) => {
12804                            ::buffa::MessageField::<
12805                                super::super::LayoutTemplateRef,
12806                            >::some(v.to_owned_from_source(__buffa_src)?)
12807                        }
12808                        None => ::buffa::MessageField::none(),
12809                    },
12810                    title: self.title.to_string(),
12811                    description: self.description.to_string(),
12812                    tags: self.tags.iter().map(|s| s.to_string()).collect(),
12813                    is_listed: self.is_listed,
12814                    latest_version: self.latest_version,
12815                    published_at_ms: self.published_at_ms,
12816                    updated_at_ms: self.updated_at_ms,
12817                    __buffa_unknown_fields: self
12818                        .__buffa_unknown_fields
12819                        .to_owned()?
12820                        .into(),
12821                    ..::core::default::Default::default()
12822                })
12823            }
12824        }
12825        impl<'a> ::buffa::ViewEncode<'a> for LayoutTemplateView<'a> {
12826            #[allow(clippy::needless_borrow, clippy::let_and_return)]
12827            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
12828                #[allow(unused_imports)]
12829                use ::buffa::Enumeration as _;
12830                let mut size = 0u32;
12831                if self.template.is_set() {
12832                    let __slot = __cache.reserve();
12833                    let inner_size = self.template.compute_size(__cache);
12834                    __cache.set(__slot, inner_size);
12835                    size
12836                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
12837                            + inner_size;
12838                }
12839                if !self.title.is_empty() {
12840                    size
12841                        += 1u32 + ::buffa::types::string_encoded_len(&self.title) as u32;
12842                }
12843                if !self.description.is_empty() {
12844                    size
12845                        += 1u32
12846                            + ::buffa::types::string_encoded_len(&self.description)
12847                                as u32;
12848                }
12849                for v in &self.tags {
12850                    size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
12851                }
12852                if self.is_listed {
12853                    size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
12854                }
12855                if self.latest_version != 0u32 {
12856                    size
12857                        += 1u32
12858                            + ::buffa::types::uint32_encoded_len(self.latest_version)
12859                                as u32;
12860                }
12861                if self.published_at_ms != 0u64 {
12862                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
12863                }
12864                if self.updated_at_ms != 0u64 {
12865                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
12866                }
12867                size += self.__buffa_unknown_fields.encoded_len() as u32;
12868                size
12869            }
12870            #[allow(clippy::needless_borrow)]
12871            fn write_to(
12872                &self,
12873                __cache: &mut ::buffa::SizeCache,
12874                buf: &mut impl ::buffa::bytes::BufMut,
12875            ) {
12876                #[allow(unused_imports)]
12877                use ::buffa::Enumeration as _;
12878                if self.template.is_set() {
12879                    ::buffa::types::put_len_delimited_header(
12880                        1u32,
12881                        __cache.consume_next(),
12882                        buf,
12883                    );
12884                    self.template.write_to(__cache, buf);
12885                }
12886                if !self.title.is_empty() {
12887                    ::buffa::types::put_string_field(2u32, &self.title, buf);
12888                }
12889                if !self.description.is_empty() {
12890                    ::buffa::types::put_string_field(3u32, &self.description, buf);
12891                }
12892                for v in &self.tags {
12893                    ::buffa::types::put_string_field(4u32, v, buf);
12894                }
12895                if self.is_listed {
12896                    ::buffa::types::put_bool_field(5u32, self.is_listed, buf);
12897                }
12898                if self.latest_version != 0u32 {
12899                    ::buffa::types::put_uint32_field(6u32, self.latest_version, buf);
12900                }
12901                if self.published_at_ms != 0u64 {
12902                    ::buffa::types::put_fixed64_field(7u32, self.published_at_ms, buf);
12903                }
12904                if self.updated_at_ms != 0u64 {
12905                    ::buffa::types::put_fixed64_field(8u32, self.updated_at_ms, buf);
12906                }
12907                self.__buffa_unknown_fields.write_to(buf);
12908            }
12909        }
12910        /// Serializes this view as protobuf JSON.
12911        ///
12912        /// Implicit-presence fields with default values are omitted, `required`
12913        /// fields are always emitted, explicit-presence (`optional`) fields are
12914        /// emitted only when set, bytes fields are base64-encoded, and enum
12915        /// values are their proto name strings.
12916        ///
12917        /// This impl uses `serialize_map(None)` because the number of emitted
12918        /// fields depends on default-omission rules; serializers that require
12919        /// known map lengths (e.g. `bincode`) will return a runtime error.
12920        /// Use the owned message type for those formats.
12921        impl<'__a> ::serde::Serialize for LayoutTemplateView<'__a> {
12922            fn serialize<__S: ::serde::Serializer>(
12923                &self,
12924                __s: __S,
12925            ) -> ::core::result::Result<__S::Ok, __S::Error> {
12926                use ::serde::ser::SerializeMap as _;
12927                let mut __map = __s.serialize_map(::core::option::Option::None)?;
12928                {
12929                    if let ::core::option::Option::Some(__v) = self.template.as_option()
12930                    {
12931                        __map.serialize_entry("template", __v)?;
12932                    }
12933                }
12934                if !::buffa::json_helpers::skip_if::is_empty_str(self.title) {
12935                    __map.serialize_entry("title", self.title)?;
12936                }
12937                if !::buffa::json_helpers::skip_if::is_empty_str(self.description) {
12938                    __map.serialize_entry("description", self.description)?;
12939                }
12940                if !self.tags.is_empty() {
12941                    __map.serialize_entry("tags", &*self.tags)?;
12942                }
12943                if self.is_listed {
12944                    __map.serialize_entry("isListed", &self.is_listed)?;
12945                }
12946                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.latest_version) {
12947                    __map
12948                        .serialize_entry(
12949                            "latestVersion",
12950                            &::buffa::json_helpers::ProtoJson(&self.latest_version),
12951                        )?;
12952                }
12953                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.published_at_ms) {
12954                    __map
12955                        .serialize_entry(
12956                            "publishedAtMs",
12957                            &::buffa::json_helpers::ProtoJson(&self.published_at_ms),
12958                        )?;
12959                }
12960                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.updated_at_ms) {
12961                    __map
12962                        .serialize_entry(
12963                            "updatedAtMs",
12964                            &::buffa::json_helpers::ProtoJson(&self.updated_at_ms),
12965                        )?;
12966                }
12967                __map.end()
12968            }
12969        }
12970        impl<'a> ::buffa::MessageName for LayoutTemplateView<'a> {
12971            const PACKAGE: &'static str = "layout.v1";
12972            const NAME: &'static str = "LayoutTemplate";
12973            const FULL_NAME: &'static str = "layout.v1.LayoutTemplate";
12974            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutTemplate";
12975        }
12976        ::buffa::impl_default_view_instance!(LayoutTemplateView);
12977        ::buffa::impl_view_reborrow!(LayoutTemplateView);
12978        /** Self-contained, `'static` owned view of a `LayoutTemplate` message.
12979
12980 Wraps [`::buffa::OwnedView`]`<`[`LayoutTemplateView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
12981
12982 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`LayoutTemplateView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
12983        #[derive(Clone, Debug)]
12984        pub struct LayoutTemplateOwnedView(
12985            ::buffa::OwnedView<LayoutTemplateView<'static>>,
12986        );
12987        impl LayoutTemplateOwnedView {
12988            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
12989            ///
12990            /// The view borrows directly from the buffer's data; the buffer is
12991            /// retained inside the returned handle.
12992            ///
12993            /// # Errors
12994            ///
12995            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
12996            /// protobuf data.
12997            pub fn decode(
12998                bytes: ::buffa::bytes::Bytes,
12999            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13000                ::core::result::Result::Ok(
13001                    LayoutTemplateOwnedView(::buffa::OwnedView::decode(bytes)?),
13002                )
13003            }
13004            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
13005            /// max message size).
13006            ///
13007            /// # Errors
13008            ///
13009            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
13010            /// exceeds the configured limits.
13011            pub fn decode_with_options(
13012                bytes: ::buffa::bytes::Bytes,
13013                opts: &::buffa::DecodeOptions,
13014            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13015                ::core::result::Result::Ok(
13016                    LayoutTemplateOwnedView(
13017                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
13018                    ),
13019                )
13020            }
13021            /// Build from an owned message via an encode → decode round-trip.
13022            ///
13023            /// # Errors
13024            ///
13025            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
13026            /// somehow invalid (should not happen for well-formed messages).
13027            pub fn from_owned(
13028                msg: &super::super::LayoutTemplate,
13029            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13030                ::core::result::Result::Ok(
13031                    LayoutTemplateOwnedView(::buffa::OwnedView::from_owned(msg)?),
13032                )
13033            }
13034            /// Borrow the full [`LayoutTemplateView`] with its lifetime tied to `&self`.
13035            #[must_use]
13036            pub fn view(&self) -> &LayoutTemplateView<'_> {
13037                self.0.reborrow()
13038            }
13039            /// Convert to the owned message type.
13040            ///
13041            /// # Errors
13042            ///
13043            /// Returns an error if re-materializing preserved unknown fields
13044            /// fails (e.g. the unknown-field limit is exceeded).
13045            pub fn to_owned_message(
13046                &self,
13047            ) -> ::core::result::Result<
13048                super::super::LayoutTemplate,
13049                ::buffa::DecodeError,
13050            > {
13051                self.0.to_owned_message()
13052            }
13053            /// The underlying bytes buffer.
13054            #[must_use]
13055            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
13056                self.0.bytes()
13057            }
13058            /// Consume the handle, returning the underlying bytes buffer.
13059            #[must_use]
13060            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
13061                self.0.into_bytes()
13062            }
13063            /// Template identifier.
13064            ///
13065            /// Field 1: `template`
13066            #[must_use]
13067            pub fn template(
13068                &self,
13069            ) -> &::buffa::MessageFieldView<
13070                super::super::__buffa::view::LayoutTemplateRefView<'_>,
13071            > {
13072                &self.0.reborrow().template
13073            }
13074            /// Public display title.
13075            ///
13076            /// Field 2: `title`
13077            #[must_use]
13078            pub fn title(&self) -> &'_ str {
13079                self.0.reborrow().title
13080            }
13081            /// Public description shown with the template.
13082            ///
13083            /// Field 3: `description`
13084            #[must_use]
13085            pub fn description(&self) -> &'_ str {
13086                self.0.reborrow().description
13087            }
13088            /// Public tags used for grouping or filtering.
13089            ///
13090            /// Field 4: `tags`
13091            #[must_use]
13092            pub fn tags(&self) -> &::buffa::RepeatedView<'_, &'_ str> {
13093                &self.0.reborrow().tags
13094            }
13095            /// True when the template appears in discovery listings.
13096            ///
13097            /// Field 5: `is_listed`
13098            #[must_use]
13099            pub fn is_listed(&self) -> bool {
13100                self.0.reborrow().is_listed
13101            }
13102            /// Latest immutable version number for this template.
13103            ///
13104            /// Field 6: `latest_version`
13105            #[must_use]
13106            pub fn latest_version(&self) -> u32 {
13107                self.0.reborrow().latest_version
13108            }
13109            /// Initial publication time in milliseconds since epoch (UTC).
13110            ///
13111            /// Field 7: `published_at_ms`
13112            #[must_use]
13113            pub fn published_at_ms(&self) -> u64 {
13114                self.0.reborrow().published_at_ms
13115            }
13116            /// Last metadata update time in milliseconds since epoch (UTC).
13117            ///
13118            /// Field 8: `updated_at_ms`
13119            #[must_use]
13120            pub fn updated_at_ms(&self) -> u64 {
13121                self.0.reborrow().updated_at_ms
13122            }
13123        }
13124        impl ::core::convert::From<::buffa::OwnedView<LayoutTemplateView<'static>>>
13125        for LayoutTemplateOwnedView {
13126            fn from(inner: ::buffa::OwnedView<LayoutTemplateView<'static>>) -> Self {
13127                LayoutTemplateOwnedView(inner)
13128            }
13129        }
13130        impl ::core::convert::From<LayoutTemplateOwnedView>
13131        for ::buffa::OwnedView<LayoutTemplateView<'static>> {
13132            fn from(wrapper: LayoutTemplateOwnedView) -> Self {
13133                wrapper.0
13134            }
13135        }
13136        impl ::core::convert::AsRef<::buffa::OwnedView<LayoutTemplateView<'static>>>
13137        for LayoutTemplateOwnedView {
13138            fn as_ref(&self) -> &::buffa::OwnedView<LayoutTemplateView<'static>> {
13139                &self.0
13140            }
13141        }
13142        impl ::buffa::HasMessageView for super::super::LayoutTemplate {
13143            type View<'a> = LayoutTemplateView<'a>;
13144            type ViewHandle = LayoutTemplateOwnedView;
13145        }
13146        impl ::serde::Serialize for LayoutTemplateOwnedView {
13147            fn serialize<__S: ::serde::Serializer>(
13148                &self,
13149                __s: __S,
13150            ) -> ::core::result::Result<__S::Ok, __S::Error> {
13151                ::serde::Serialize::serialize(&self.0, __s)
13152            }
13153        }
13154        /// LayoutTemplateVersionInfo contains metadata for one immutable template version.
13155        #[derive(Clone, Debug, Default)]
13156        pub struct LayoutTemplateVersionInfoView<'a> {
13157            /// Immutable template version number.
13158            ///
13159            /// Field 1: `version`
13160            pub version: u32,
13161            /// Optional release notes for this version.
13162            ///
13163            /// Field 2: `changelog`
13164            pub changelog: &'a str,
13165            /// Version creation time in milliseconds since epoch (UTC).
13166            ///
13167            /// Field 3: `created_at_ms`
13168            pub created_at_ms: u64,
13169            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
13170        }
13171        impl<'a> ::buffa::MessageView<'a> for LayoutTemplateVersionInfoView<'a> {
13172            type Owned = super::super::LayoutTemplateVersionInfo;
13173            fn decode_view(
13174                buf: &'a [u8],
13175            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13176                let __limit = ::core::cell::Cell::new(
13177                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
13178                );
13179                <Self as ::buffa::MessageView>::decode_view_ctx(
13180                    buf,
13181                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
13182                )
13183            }
13184            fn decode_view_with_ctx(
13185                buf: &'a [u8],
13186                ctx: ::buffa::DecodeContext<'_>,
13187            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13188                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
13189            }
13190            fn merge_view_field(
13191                &mut self,
13192                tag: ::buffa::encoding::Tag,
13193                cur: &'a [u8],
13194                before_tag: &'a [u8],
13195                ctx: ::buffa::DecodeContext<'_>,
13196            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
13197                let _ = ctx;
13198                #[allow(unused_variables)]
13199                let view = self;
13200                let mut cur = cur;
13201                match tag.field_number() {
13202                    1u32 => {
13203                        ::buffa::encoding::check_wire_type(
13204                            tag,
13205                            ::buffa::encoding::WireType::Varint,
13206                        )?;
13207                        view.version = ::buffa::types::decode_uint32(&mut cur)?;
13208                    }
13209                    2u32 => {
13210                        ::buffa::encoding::check_wire_type(
13211                            tag,
13212                            ::buffa::encoding::WireType::LengthDelimited,
13213                        )?;
13214                        view.changelog = ::buffa::types::borrow_str(&mut cur)?;
13215                    }
13216                    3u32 => {
13217                        ::buffa::encoding::check_wire_type(
13218                            tag,
13219                            ::buffa::encoding::WireType::Fixed64,
13220                        )?;
13221                        view.created_at_ms = ::buffa::types::decode_fixed64(&mut cur)?;
13222                    }
13223                    _ => {
13224                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
13225                        let span_len = before_tag.len() - cur.len();
13226                        view.__buffa_unknown_fields
13227                            .push_record(before_tag, span_len, ctx)?;
13228                    }
13229                }
13230                ::core::result::Result::Ok(cur)
13231            }
13232            fn to_owned_message(
13233                &self,
13234            ) -> ::core::result::Result<
13235                super::super::LayoutTemplateVersionInfo,
13236                ::buffa::DecodeError,
13237            > {
13238                self.to_owned_from_source(None)
13239            }
13240            #[allow(clippy::useless_conversion, clippy::needless_update)]
13241            fn to_owned_from_source(
13242                &self,
13243                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
13244            ) -> ::core::result::Result<
13245                super::super::LayoutTemplateVersionInfo,
13246                ::buffa::DecodeError,
13247            > {
13248                #[allow(unused_imports)]
13249                use ::buffa::alloc::string::ToString as _;
13250                let _ = __buffa_src;
13251                ::core::result::Result::Ok(super::super::LayoutTemplateVersionInfo {
13252                    version: self.version,
13253                    changelog: self.changelog.to_string(),
13254                    created_at_ms: self.created_at_ms,
13255                    __buffa_unknown_fields: self
13256                        .__buffa_unknown_fields
13257                        .to_owned()?
13258                        .into(),
13259                    ..::core::default::Default::default()
13260                })
13261            }
13262        }
13263        impl<'a> ::buffa::ViewEncode<'a> for LayoutTemplateVersionInfoView<'a> {
13264            #[allow(clippy::needless_borrow, clippy::let_and_return)]
13265            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
13266                #[allow(unused_imports)]
13267                use ::buffa::Enumeration as _;
13268                let mut size = 0u32;
13269                if self.version != 0u32 {
13270                    size
13271                        += 1u32
13272                            + ::buffa::types::uint32_encoded_len(self.version) as u32;
13273                }
13274                if !self.changelog.is_empty() {
13275                    size
13276                        += 1u32
13277                            + ::buffa::types::string_encoded_len(&self.changelog) as u32;
13278                }
13279                if self.created_at_ms != 0u64 {
13280                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
13281                }
13282                size += self.__buffa_unknown_fields.encoded_len() as u32;
13283                size
13284            }
13285            #[allow(clippy::needless_borrow)]
13286            fn write_to(
13287                &self,
13288                _cache: &mut ::buffa::SizeCache,
13289                buf: &mut impl ::buffa::bytes::BufMut,
13290            ) {
13291                #[allow(unused_imports)]
13292                use ::buffa::Enumeration as _;
13293                if self.version != 0u32 {
13294                    ::buffa::types::put_uint32_field(1u32, self.version, buf);
13295                }
13296                if !self.changelog.is_empty() {
13297                    ::buffa::types::put_string_field(2u32, &self.changelog, buf);
13298                }
13299                if self.created_at_ms != 0u64 {
13300                    ::buffa::types::put_fixed64_field(3u32, self.created_at_ms, buf);
13301                }
13302                self.__buffa_unknown_fields.write_to(buf);
13303            }
13304        }
13305        /// Serializes this view as protobuf JSON.
13306        ///
13307        /// Implicit-presence fields with default values are omitted, `required`
13308        /// fields are always emitted, explicit-presence (`optional`) fields are
13309        /// emitted only when set, bytes fields are base64-encoded, and enum
13310        /// values are their proto name strings.
13311        ///
13312        /// This impl uses `serialize_map(None)` because the number of emitted
13313        /// fields depends on default-omission rules; serializers that require
13314        /// known map lengths (e.g. `bincode`) will return a runtime error.
13315        /// Use the owned message type for those formats.
13316        impl<'__a> ::serde::Serialize for LayoutTemplateVersionInfoView<'__a> {
13317            fn serialize<__S: ::serde::Serializer>(
13318                &self,
13319                __s: __S,
13320            ) -> ::core::result::Result<__S::Ok, __S::Error> {
13321                use ::serde::ser::SerializeMap as _;
13322                let mut __map = __s.serialize_map(::core::option::Option::None)?;
13323                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.version) {
13324                    __map
13325                        .serialize_entry(
13326                            "version",
13327                            &::buffa::json_helpers::ProtoJson(&self.version),
13328                        )?;
13329                }
13330                if !::buffa::json_helpers::skip_if::is_empty_str(self.changelog) {
13331                    __map.serialize_entry("changelog", self.changelog)?;
13332                }
13333                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.created_at_ms) {
13334                    __map
13335                        .serialize_entry(
13336                            "createdAtMs",
13337                            &::buffa::json_helpers::ProtoJson(&self.created_at_ms),
13338                        )?;
13339                }
13340                __map.end()
13341            }
13342        }
13343        impl<'a> ::buffa::MessageName for LayoutTemplateVersionInfoView<'a> {
13344            const PACKAGE: &'static str = "layout.v1";
13345            const NAME: &'static str = "LayoutTemplateVersionInfo";
13346            const FULL_NAME: &'static str = "layout.v1.LayoutTemplateVersionInfo";
13347            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutTemplateVersionInfo";
13348        }
13349        ::buffa::impl_default_view_instance!(LayoutTemplateVersionInfoView);
13350        ::buffa::impl_view_reborrow!(LayoutTemplateVersionInfoView);
13351        /** Self-contained, `'static` owned view of a `LayoutTemplateVersionInfo` message.
13352
13353 Wraps [`::buffa::OwnedView`]`<`[`LayoutTemplateVersionInfoView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
13354
13355 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`LayoutTemplateVersionInfoView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
13356        #[derive(Clone, Debug)]
13357        pub struct LayoutTemplateVersionInfoOwnedView(
13358            ::buffa::OwnedView<LayoutTemplateVersionInfoView<'static>>,
13359        );
13360        impl LayoutTemplateVersionInfoOwnedView {
13361            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
13362            ///
13363            /// The view borrows directly from the buffer's data; the buffer is
13364            /// retained inside the returned handle.
13365            ///
13366            /// # Errors
13367            ///
13368            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
13369            /// protobuf data.
13370            pub fn decode(
13371                bytes: ::buffa::bytes::Bytes,
13372            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13373                ::core::result::Result::Ok(
13374                    LayoutTemplateVersionInfoOwnedView(
13375                        ::buffa::OwnedView::decode(bytes)?,
13376                    ),
13377                )
13378            }
13379            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
13380            /// max message size).
13381            ///
13382            /// # Errors
13383            ///
13384            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
13385            /// exceeds the configured limits.
13386            pub fn decode_with_options(
13387                bytes: ::buffa::bytes::Bytes,
13388                opts: &::buffa::DecodeOptions,
13389            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13390                ::core::result::Result::Ok(
13391                    LayoutTemplateVersionInfoOwnedView(
13392                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
13393                    ),
13394                )
13395            }
13396            /// Build from an owned message via an encode → decode round-trip.
13397            ///
13398            /// # Errors
13399            ///
13400            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
13401            /// somehow invalid (should not happen for well-formed messages).
13402            pub fn from_owned(
13403                msg: &super::super::LayoutTemplateVersionInfo,
13404            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13405                ::core::result::Result::Ok(
13406                    LayoutTemplateVersionInfoOwnedView(
13407                        ::buffa::OwnedView::from_owned(msg)?,
13408                    ),
13409                )
13410            }
13411            /// Borrow the full [`LayoutTemplateVersionInfoView`] with its lifetime tied to `&self`.
13412            #[must_use]
13413            pub fn view(&self) -> &LayoutTemplateVersionInfoView<'_> {
13414                self.0.reborrow()
13415            }
13416            /// Convert to the owned message type.
13417            ///
13418            /// # Errors
13419            ///
13420            /// Returns an error if re-materializing preserved unknown fields
13421            /// fails (e.g. the unknown-field limit is exceeded).
13422            pub fn to_owned_message(
13423                &self,
13424            ) -> ::core::result::Result<
13425                super::super::LayoutTemplateVersionInfo,
13426                ::buffa::DecodeError,
13427            > {
13428                self.0.to_owned_message()
13429            }
13430            /// The underlying bytes buffer.
13431            #[must_use]
13432            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
13433                self.0.bytes()
13434            }
13435            /// Consume the handle, returning the underlying bytes buffer.
13436            #[must_use]
13437            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
13438                self.0.into_bytes()
13439            }
13440            /// Immutable template version number.
13441            ///
13442            /// Field 1: `version`
13443            #[must_use]
13444            pub fn version(&self) -> u32 {
13445                self.0.reborrow().version
13446            }
13447            /// Optional release notes for this version.
13448            ///
13449            /// Field 2: `changelog`
13450            #[must_use]
13451            pub fn changelog(&self) -> &'_ str {
13452                self.0.reborrow().changelog
13453            }
13454            /// Version creation time in milliseconds since epoch (UTC).
13455            ///
13456            /// Field 3: `created_at_ms`
13457            #[must_use]
13458            pub fn created_at_ms(&self) -> u64 {
13459                self.0.reborrow().created_at_ms
13460            }
13461        }
13462        impl ::core::convert::From<
13463            ::buffa::OwnedView<LayoutTemplateVersionInfoView<'static>>,
13464        > for LayoutTemplateVersionInfoOwnedView {
13465            fn from(
13466                inner: ::buffa::OwnedView<LayoutTemplateVersionInfoView<'static>>,
13467            ) -> Self {
13468                LayoutTemplateVersionInfoOwnedView(inner)
13469            }
13470        }
13471        impl ::core::convert::From<LayoutTemplateVersionInfoOwnedView>
13472        for ::buffa::OwnedView<LayoutTemplateVersionInfoView<'static>> {
13473            fn from(wrapper: LayoutTemplateVersionInfoOwnedView) -> Self {
13474                wrapper.0
13475            }
13476        }
13477        impl ::core::convert::AsRef<
13478            ::buffa::OwnedView<LayoutTemplateVersionInfoView<'static>>,
13479        > for LayoutTemplateVersionInfoOwnedView {
13480            fn as_ref(
13481                &self,
13482            ) -> &::buffa::OwnedView<LayoutTemplateVersionInfoView<'static>> {
13483                &self.0
13484            }
13485        }
13486        impl ::buffa::HasMessageView for super::super::LayoutTemplateVersionInfo {
13487            type View<'a> = LayoutTemplateVersionInfoView<'a>;
13488            type ViewHandle = LayoutTemplateVersionInfoOwnedView;
13489        }
13490        impl ::serde::Serialize for LayoutTemplateVersionInfoOwnedView {
13491            fn serialize<__S: ::serde::Serializer>(
13492                &self,
13493                __s: __S,
13494            ) -> ::core::result::Result<__S::Ok, __S::Error> {
13495                ::serde::Serialize::serialize(&self.0, __s)
13496            }
13497        }
13498        /// ListOwnerPublishedLayoutsRequest lists published templates owned by one viewer.
13499        #[derive(Clone, Debug, Default)]
13500        pub struct ListOwnerPublishedLayoutsRequestView<'a> {
13501            /// Owner whose published layouts should be listed.
13502            ///
13503            /// Field 1: `owner_id`
13504            pub owner_id: u64,
13505            /// Maximum number of templates to return. Defaults to 100 when omitted;
13506            /// maximum is 500.
13507            ///
13508            /// Field 2: `limit`
13509            pub limit: u32,
13510            /// Opaque keyset cursor from a previous response. The cursor is exclusive and
13511            /// bound to owner and newest-published sort order.
13512            ///
13513            /// Field 3: `page_token`
13514            pub page_token: &'a str,
13515            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
13516        }
13517        impl<'a> ::buffa::MessageView<'a> for ListOwnerPublishedLayoutsRequestView<'a> {
13518            type Owned = super::super::ListOwnerPublishedLayoutsRequest;
13519            fn decode_view(
13520                buf: &'a [u8],
13521            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13522                let __limit = ::core::cell::Cell::new(
13523                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
13524                );
13525                <Self as ::buffa::MessageView>::decode_view_ctx(
13526                    buf,
13527                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
13528                )
13529            }
13530            fn decode_view_with_ctx(
13531                buf: &'a [u8],
13532                ctx: ::buffa::DecodeContext<'_>,
13533            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13534                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
13535            }
13536            fn merge_view_field(
13537                &mut self,
13538                tag: ::buffa::encoding::Tag,
13539                cur: &'a [u8],
13540                before_tag: &'a [u8],
13541                ctx: ::buffa::DecodeContext<'_>,
13542            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
13543                let _ = ctx;
13544                #[allow(unused_variables)]
13545                let view = self;
13546                let mut cur = cur;
13547                match tag.field_number() {
13548                    1u32 => {
13549                        ::buffa::encoding::check_wire_type(
13550                            tag,
13551                            ::buffa::encoding::WireType::Fixed64,
13552                        )?;
13553                        view.owner_id = ::buffa::types::decode_fixed64(&mut cur)?;
13554                    }
13555                    2u32 => {
13556                        ::buffa::encoding::check_wire_type(
13557                            tag,
13558                            ::buffa::encoding::WireType::Varint,
13559                        )?;
13560                        view.limit = ::buffa::types::decode_uint32(&mut cur)?;
13561                    }
13562                    3u32 => {
13563                        ::buffa::encoding::check_wire_type(
13564                            tag,
13565                            ::buffa::encoding::WireType::LengthDelimited,
13566                        )?;
13567                        view.page_token = ::buffa::types::borrow_str(&mut cur)?;
13568                    }
13569                    _ => {
13570                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
13571                        let span_len = before_tag.len() - cur.len();
13572                        view.__buffa_unknown_fields
13573                            .push_record(before_tag, span_len, ctx)?;
13574                    }
13575                }
13576                ::core::result::Result::Ok(cur)
13577            }
13578            fn to_owned_message(
13579                &self,
13580            ) -> ::core::result::Result<
13581                super::super::ListOwnerPublishedLayoutsRequest,
13582                ::buffa::DecodeError,
13583            > {
13584                self.to_owned_from_source(None)
13585            }
13586            #[allow(clippy::useless_conversion, clippy::needless_update)]
13587            fn to_owned_from_source(
13588                &self,
13589                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
13590            ) -> ::core::result::Result<
13591                super::super::ListOwnerPublishedLayoutsRequest,
13592                ::buffa::DecodeError,
13593            > {
13594                #[allow(unused_imports)]
13595                use ::buffa::alloc::string::ToString as _;
13596                let _ = __buffa_src;
13597                ::core::result::Result::Ok(super::super::ListOwnerPublishedLayoutsRequest {
13598                    owner_id: self.owner_id,
13599                    limit: self.limit,
13600                    page_token: self.page_token.to_string(),
13601                    __buffa_unknown_fields: self
13602                        .__buffa_unknown_fields
13603                        .to_owned()?
13604                        .into(),
13605                    ..::core::default::Default::default()
13606                })
13607            }
13608        }
13609        impl<'a> ::buffa::ViewEncode<'a> for ListOwnerPublishedLayoutsRequestView<'a> {
13610            #[allow(clippy::needless_borrow, clippy::let_and_return)]
13611            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
13612                #[allow(unused_imports)]
13613                use ::buffa::Enumeration as _;
13614                let mut size = 0u32;
13615                if self.owner_id != 0u64 {
13616                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
13617                }
13618                if self.limit != 0u32 {
13619                    size += 1u32 + ::buffa::types::uint32_encoded_len(self.limit) as u32;
13620                }
13621                if !self.page_token.is_empty() {
13622                    size
13623                        += 1u32
13624                            + ::buffa::types::string_encoded_len(&self.page_token)
13625                                as u32;
13626                }
13627                size += self.__buffa_unknown_fields.encoded_len() as u32;
13628                size
13629            }
13630            #[allow(clippy::needless_borrow)]
13631            fn write_to(
13632                &self,
13633                _cache: &mut ::buffa::SizeCache,
13634                buf: &mut impl ::buffa::bytes::BufMut,
13635            ) {
13636                #[allow(unused_imports)]
13637                use ::buffa::Enumeration as _;
13638                if self.owner_id != 0u64 {
13639                    ::buffa::types::put_fixed64_field(1u32, self.owner_id, buf);
13640                }
13641                if self.limit != 0u32 {
13642                    ::buffa::types::put_uint32_field(2u32, self.limit, buf);
13643                }
13644                if !self.page_token.is_empty() {
13645                    ::buffa::types::put_string_field(3u32, &self.page_token, buf);
13646                }
13647                self.__buffa_unknown_fields.write_to(buf);
13648            }
13649        }
13650        /// Serializes this view as protobuf JSON.
13651        ///
13652        /// Implicit-presence fields with default values are omitted, `required`
13653        /// fields are always emitted, explicit-presence (`optional`) fields are
13654        /// emitted only when set, bytes fields are base64-encoded, and enum
13655        /// values are their proto name strings.
13656        ///
13657        /// This impl uses `serialize_map(None)` because the number of emitted
13658        /// fields depends on default-omission rules; serializers that require
13659        /// known map lengths (e.g. `bincode`) will return a runtime error.
13660        /// Use the owned message type for those formats.
13661        impl<'__a> ::serde::Serialize for ListOwnerPublishedLayoutsRequestView<'__a> {
13662            fn serialize<__S: ::serde::Serializer>(
13663                &self,
13664                __s: __S,
13665            ) -> ::core::result::Result<__S::Ok, __S::Error> {
13666                use ::serde::ser::SerializeMap as _;
13667                let mut __map = __s.serialize_map(::core::option::Option::None)?;
13668                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.owner_id) {
13669                    __map
13670                        .serialize_entry(
13671                            "ownerId",
13672                            &::buffa::json_helpers::ProtoJson(&self.owner_id),
13673                        )?;
13674                }
13675                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.limit) {
13676                    __map
13677                        .serialize_entry(
13678                            "limit",
13679                            &::buffa::json_helpers::ProtoJson(&self.limit),
13680                        )?;
13681                }
13682                if !::buffa::json_helpers::skip_if::is_empty_str(self.page_token) {
13683                    __map.serialize_entry("pageToken", self.page_token)?;
13684                }
13685                __map.end()
13686            }
13687        }
13688        impl<'a> ::buffa::MessageName for ListOwnerPublishedLayoutsRequestView<'a> {
13689            const PACKAGE: &'static str = "layout.v1";
13690            const NAME: &'static str = "ListOwnerPublishedLayoutsRequest";
13691            const FULL_NAME: &'static str = "layout.v1.ListOwnerPublishedLayoutsRequest";
13692            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListOwnerPublishedLayoutsRequest";
13693        }
13694        ::buffa::impl_default_view_instance!(ListOwnerPublishedLayoutsRequestView);
13695        ::buffa::impl_view_reborrow!(ListOwnerPublishedLayoutsRequestView);
13696        /** Self-contained, `'static` owned view of a `ListOwnerPublishedLayoutsRequest` message.
13697
13698 Wraps [`::buffa::OwnedView`]`<`[`ListOwnerPublishedLayoutsRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
13699
13700 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ListOwnerPublishedLayoutsRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
13701        #[derive(Clone, Debug)]
13702        pub struct ListOwnerPublishedLayoutsRequestOwnedView(
13703            ::buffa::OwnedView<ListOwnerPublishedLayoutsRequestView<'static>>,
13704        );
13705        impl ListOwnerPublishedLayoutsRequestOwnedView {
13706            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
13707            ///
13708            /// The view borrows directly from the buffer's data; the buffer is
13709            /// retained inside the returned handle.
13710            ///
13711            /// # Errors
13712            ///
13713            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
13714            /// protobuf data.
13715            pub fn decode(
13716                bytes: ::buffa::bytes::Bytes,
13717            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13718                ::core::result::Result::Ok(
13719                    ListOwnerPublishedLayoutsRequestOwnedView(
13720                        ::buffa::OwnedView::decode(bytes)?,
13721                    ),
13722                )
13723            }
13724            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
13725            /// max message size).
13726            ///
13727            /// # Errors
13728            ///
13729            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
13730            /// exceeds the configured limits.
13731            pub fn decode_with_options(
13732                bytes: ::buffa::bytes::Bytes,
13733                opts: &::buffa::DecodeOptions,
13734            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13735                ::core::result::Result::Ok(
13736                    ListOwnerPublishedLayoutsRequestOwnedView(
13737                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
13738                    ),
13739                )
13740            }
13741            /// Build from an owned message via an encode → decode round-trip.
13742            ///
13743            /// # Errors
13744            ///
13745            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
13746            /// somehow invalid (should not happen for well-formed messages).
13747            pub fn from_owned(
13748                msg: &super::super::ListOwnerPublishedLayoutsRequest,
13749            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13750                ::core::result::Result::Ok(
13751                    ListOwnerPublishedLayoutsRequestOwnedView(
13752                        ::buffa::OwnedView::from_owned(msg)?,
13753                    ),
13754                )
13755            }
13756            /// Borrow the full [`ListOwnerPublishedLayoutsRequestView`] with its lifetime tied to `&self`.
13757            #[must_use]
13758            pub fn view(&self) -> &ListOwnerPublishedLayoutsRequestView<'_> {
13759                self.0.reborrow()
13760            }
13761            /// Convert to the owned message type.
13762            ///
13763            /// # Errors
13764            ///
13765            /// Returns an error if re-materializing preserved unknown fields
13766            /// fails (e.g. the unknown-field limit is exceeded).
13767            pub fn to_owned_message(
13768                &self,
13769            ) -> ::core::result::Result<
13770                super::super::ListOwnerPublishedLayoutsRequest,
13771                ::buffa::DecodeError,
13772            > {
13773                self.0.to_owned_message()
13774            }
13775            /// The underlying bytes buffer.
13776            #[must_use]
13777            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
13778                self.0.bytes()
13779            }
13780            /// Consume the handle, returning the underlying bytes buffer.
13781            #[must_use]
13782            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
13783                self.0.into_bytes()
13784            }
13785            /// Owner whose published layouts should be listed.
13786            ///
13787            /// Field 1: `owner_id`
13788            #[must_use]
13789            pub fn owner_id(&self) -> u64 {
13790                self.0.reborrow().owner_id
13791            }
13792            /// Maximum number of templates to return. Defaults to 100 when omitted;
13793            /// maximum is 500.
13794            ///
13795            /// Field 2: `limit`
13796            #[must_use]
13797            pub fn limit(&self) -> u32 {
13798                self.0.reborrow().limit
13799            }
13800            /// Opaque keyset cursor from a previous response. The cursor is exclusive and
13801            /// bound to owner and newest-published sort order.
13802            ///
13803            /// Field 3: `page_token`
13804            #[must_use]
13805            pub fn page_token(&self) -> &'_ str {
13806                self.0.reborrow().page_token
13807            }
13808        }
13809        impl ::core::convert::From<
13810            ::buffa::OwnedView<ListOwnerPublishedLayoutsRequestView<'static>>,
13811        > for ListOwnerPublishedLayoutsRequestOwnedView {
13812            fn from(
13813                inner: ::buffa::OwnedView<ListOwnerPublishedLayoutsRequestView<'static>>,
13814            ) -> Self {
13815                ListOwnerPublishedLayoutsRequestOwnedView(inner)
13816            }
13817        }
13818        impl ::core::convert::From<ListOwnerPublishedLayoutsRequestOwnedView>
13819        for ::buffa::OwnedView<ListOwnerPublishedLayoutsRequestView<'static>> {
13820            fn from(wrapper: ListOwnerPublishedLayoutsRequestOwnedView) -> Self {
13821                wrapper.0
13822            }
13823        }
13824        impl ::core::convert::AsRef<
13825            ::buffa::OwnedView<ListOwnerPublishedLayoutsRequestView<'static>>,
13826        > for ListOwnerPublishedLayoutsRequestOwnedView {
13827            fn as_ref(
13828                &self,
13829            ) -> &::buffa::OwnedView<ListOwnerPublishedLayoutsRequestView<'static>> {
13830                &self.0
13831            }
13832        }
13833        impl ::buffa::HasMessageView for super::super::ListOwnerPublishedLayoutsRequest {
13834            type View<'a> = ListOwnerPublishedLayoutsRequestView<'a>;
13835            type ViewHandle = ListOwnerPublishedLayoutsRequestOwnedView;
13836        }
13837        impl ::serde::Serialize for ListOwnerPublishedLayoutsRequestOwnedView {
13838            fn serialize<__S: ::serde::Serializer>(
13839                &self,
13840                __s: __S,
13841            ) -> ::core::result::Result<__S::Ok, __S::Error> {
13842                ::serde::Serialize::serialize(&self.0, __s)
13843            }
13844        }
13845        /// ListOwnerPublishedLayoutsResponse contains one page of published templates.
13846        #[derive(Clone, Debug, Default)]
13847        pub struct ListOwnerPublishedLayoutsResponseView<'a> {
13848            /// Published templates for the owner, returned newest-published first.
13849            ///
13850            /// Field 1: `templates`
13851            pub templates: ::buffa::RepeatedView<
13852                'a,
13853                super::super::__buffa::view::LayoutTemplateView<'a>,
13854            >,
13855            /// Opaque cursor for the next page. Empty when no more results exist.
13856            ///
13857            /// Field 2: `next_page_token`
13858            pub next_page_token: &'a str,
13859            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
13860        }
13861        impl<'a> ::buffa::MessageView<'a> for ListOwnerPublishedLayoutsResponseView<'a> {
13862            type Owned = super::super::ListOwnerPublishedLayoutsResponse;
13863            fn decode_view(
13864                buf: &'a [u8],
13865            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13866                let __limit = ::core::cell::Cell::new(
13867                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
13868                );
13869                <Self as ::buffa::MessageView>::decode_view_ctx(
13870                    buf,
13871                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
13872                )
13873            }
13874            fn decode_view_with_ctx(
13875                buf: &'a [u8],
13876                ctx: ::buffa::DecodeContext<'_>,
13877            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13878                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
13879            }
13880            fn merge_view_field(
13881                &mut self,
13882                tag: ::buffa::encoding::Tag,
13883                cur: &'a [u8],
13884                before_tag: &'a [u8],
13885                ctx: ::buffa::DecodeContext<'_>,
13886            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
13887                let _ = ctx;
13888                #[allow(unused_variables)]
13889                let view = self;
13890                let mut cur = cur;
13891                match tag.field_number() {
13892                    2u32 => {
13893                        ::buffa::encoding::check_wire_type(
13894                            tag,
13895                            ::buffa::encoding::WireType::LengthDelimited,
13896                        )?;
13897                        view.next_page_token = ::buffa::types::borrow_str(&mut cur)?;
13898                    }
13899                    1u32 => {
13900                        ::buffa::encoding::check_wire_type(
13901                            tag,
13902                            ::buffa::encoding::WireType::LengthDelimited,
13903                        )?;
13904                        let __sub_ctx = ctx.descend()?;
13905                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
13906                        view.templates
13907                            .push(
13908                                <super::super::__buffa::view::LayoutTemplateView as ::buffa::MessageView>::decode_view_ctx(
13909                                    sub,
13910                                    __sub_ctx,
13911                                )?,
13912                            );
13913                    }
13914                    _ => {
13915                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
13916                        let span_len = before_tag.len() - cur.len();
13917                        view.__buffa_unknown_fields
13918                            .push_record(before_tag, span_len, ctx)?;
13919                    }
13920                }
13921                ::core::result::Result::Ok(cur)
13922            }
13923            fn to_owned_message(
13924                &self,
13925            ) -> ::core::result::Result<
13926                super::super::ListOwnerPublishedLayoutsResponse,
13927                ::buffa::DecodeError,
13928            > {
13929                self.to_owned_from_source(None)
13930            }
13931            #[allow(clippy::useless_conversion, clippy::needless_update)]
13932            fn to_owned_from_source(
13933                &self,
13934                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
13935            ) -> ::core::result::Result<
13936                super::super::ListOwnerPublishedLayoutsResponse,
13937                ::buffa::DecodeError,
13938            > {
13939                #[allow(unused_imports)]
13940                use ::buffa::alloc::string::ToString as _;
13941                let _ = __buffa_src;
13942                ::core::result::Result::Ok(super::super::ListOwnerPublishedLayoutsResponse {
13943                    templates: self
13944                        .templates
13945                        .iter()
13946                        .map(|v| v.to_owned_from_source(__buffa_src))
13947                        .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
13948                    next_page_token: self.next_page_token.to_string(),
13949                    __buffa_unknown_fields: self
13950                        .__buffa_unknown_fields
13951                        .to_owned()?
13952                        .into(),
13953                    ..::core::default::Default::default()
13954                })
13955            }
13956        }
13957        impl<'a> ::buffa::ViewEncode<'a> for ListOwnerPublishedLayoutsResponseView<'a> {
13958            #[allow(clippy::needless_borrow, clippy::let_and_return)]
13959            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
13960                #[allow(unused_imports)]
13961                use ::buffa::Enumeration as _;
13962                let mut size = 0u32;
13963                for v in &self.templates {
13964                    let __slot = __cache.reserve();
13965                    let inner_size = v.compute_size(__cache);
13966                    __cache.set(__slot, inner_size);
13967                    size
13968                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
13969                            + inner_size;
13970                }
13971                if !self.next_page_token.is_empty() {
13972                    size
13973                        += 1u32
13974                            + ::buffa::types::string_encoded_len(&self.next_page_token)
13975                                as u32;
13976                }
13977                size += self.__buffa_unknown_fields.encoded_len() as u32;
13978                size
13979            }
13980            #[allow(clippy::needless_borrow)]
13981            fn write_to(
13982                &self,
13983                __cache: &mut ::buffa::SizeCache,
13984                buf: &mut impl ::buffa::bytes::BufMut,
13985            ) {
13986                #[allow(unused_imports)]
13987                use ::buffa::Enumeration as _;
13988                for v in &self.templates {
13989                    ::buffa::types::put_len_delimited_header(
13990                        1u32,
13991                        __cache.consume_next(),
13992                        buf,
13993                    );
13994                    v.write_to(__cache, buf);
13995                }
13996                if !self.next_page_token.is_empty() {
13997                    ::buffa::types::put_string_field(2u32, &self.next_page_token, buf);
13998                }
13999                self.__buffa_unknown_fields.write_to(buf);
14000            }
14001        }
14002        /// Serializes this view as protobuf JSON.
14003        ///
14004        /// Implicit-presence fields with default values are omitted, `required`
14005        /// fields are always emitted, explicit-presence (`optional`) fields are
14006        /// emitted only when set, bytes fields are base64-encoded, and enum
14007        /// values are their proto name strings.
14008        ///
14009        /// This impl uses `serialize_map(None)` because the number of emitted
14010        /// fields depends on default-omission rules; serializers that require
14011        /// known map lengths (e.g. `bincode`) will return a runtime error.
14012        /// Use the owned message type for those formats.
14013        impl<'__a> ::serde::Serialize for ListOwnerPublishedLayoutsResponseView<'__a> {
14014            fn serialize<__S: ::serde::Serializer>(
14015                &self,
14016                __s: __S,
14017            ) -> ::core::result::Result<__S::Ok, __S::Error> {
14018                use ::serde::ser::SerializeMap as _;
14019                let mut __map = __s.serialize_map(::core::option::Option::None)?;
14020                if !self.templates.is_empty() {
14021                    __map.serialize_entry("templates", &*self.templates)?;
14022                }
14023                if !::buffa::json_helpers::skip_if::is_empty_str(self.next_page_token) {
14024                    __map.serialize_entry("nextPageToken", self.next_page_token)?;
14025                }
14026                __map.end()
14027            }
14028        }
14029        impl<'a> ::buffa::MessageName for ListOwnerPublishedLayoutsResponseView<'a> {
14030            const PACKAGE: &'static str = "layout.v1";
14031            const NAME: &'static str = "ListOwnerPublishedLayoutsResponse";
14032            const FULL_NAME: &'static str = "layout.v1.ListOwnerPublishedLayoutsResponse";
14033            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListOwnerPublishedLayoutsResponse";
14034        }
14035        ::buffa::impl_default_view_instance!(ListOwnerPublishedLayoutsResponseView);
14036        ::buffa::impl_view_reborrow!(ListOwnerPublishedLayoutsResponseView);
14037        /** Self-contained, `'static` owned view of a `ListOwnerPublishedLayoutsResponse` message.
14038
14039 Wraps [`::buffa::OwnedView`]`<`[`ListOwnerPublishedLayoutsResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
14040
14041 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ListOwnerPublishedLayoutsResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
14042        #[derive(Clone, Debug)]
14043        pub struct ListOwnerPublishedLayoutsResponseOwnedView(
14044            ::buffa::OwnedView<ListOwnerPublishedLayoutsResponseView<'static>>,
14045        );
14046        impl ListOwnerPublishedLayoutsResponseOwnedView {
14047            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
14048            ///
14049            /// The view borrows directly from the buffer's data; the buffer is
14050            /// retained inside the returned handle.
14051            ///
14052            /// # Errors
14053            ///
14054            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
14055            /// protobuf data.
14056            pub fn decode(
14057                bytes: ::buffa::bytes::Bytes,
14058            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14059                ::core::result::Result::Ok(
14060                    ListOwnerPublishedLayoutsResponseOwnedView(
14061                        ::buffa::OwnedView::decode(bytes)?,
14062                    ),
14063                )
14064            }
14065            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
14066            /// max message size).
14067            ///
14068            /// # Errors
14069            ///
14070            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
14071            /// exceeds the configured limits.
14072            pub fn decode_with_options(
14073                bytes: ::buffa::bytes::Bytes,
14074                opts: &::buffa::DecodeOptions,
14075            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14076                ::core::result::Result::Ok(
14077                    ListOwnerPublishedLayoutsResponseOwnedView(
14078                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
14079                    ),
14080                )
14081            }
14082            /// Build from an owned message via an encode → decode round-trip.
14083            ///
14084            /// # Errors
14085            ///
14086            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
14087            /// somehow invalid (should not happen for well-formed messages).
14088            pub fn from_owned(
14089                msg: &super::super::ListOwnerPublishedLayoutsResponse,
14090            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14091                ::core::result::Result::Ok(
14092                    ListOwnerPublishedLayoutsResponseOwnedView(
14093                        ::buffa::OwnedView::from_owned(msg)?,
14094                    ),
14095                )
14096            }
14097            /// Borrow the full [`ListOwnerPublishedLayoutsResponseView`] with its lifetime tied to `&self`.
14098            #[must_use]
14099            pub fn view(&self) -> &ListOwnerPublishedLayoutsResponseView<'_> {
14100                self.0.reborrow()
14101            }
14102            /// Convert to the owned message type.
14103            ///
14104            /// # Errors
14105            ///
14106            /// Returns an error if re-materializing preserved unknown fields
14107            /// fails (e.g. the unknown-field limit is exceeded).
14108            pub fn to_owned_message(
14109                &self,
14110            ) -> ::core::result::Result<
14111                super::super::ListOwnerPublishedLayoutsResponse,
14112                ::buffa::DecodeError,
14113            > {
14114                self.0.to_owned_message()
14115            }
14116            /// The underlying bytes buffer.
14117            #[must_use]
14118            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
14119                self.0.bytes()
14120            }
14121            /// Consume the handle, returning the underlying bytes buffer.
14122            #[must_use]
14123            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
14124                self.0.into_bytes()
14125            }
14126            /// Published templates for the owner, returned newest-published first.
14127            ///
14128            /// Field 1: `templates`
14129            #[must_use]
14130            pub fn templates(
14131                &self,
14132            ) -> &::buffa::RepeatedView<
14133                '_,
14134                super::super::__buffa::view::LayoutTemplateView<'_>,
14135            > {
14136                &self.0.reborrow().templates
14137            }
14138            /// Opaque cursor for the next page. Empty when no more results exist.
14139            ///
14140            /// Field 2: `next_page_token`
14141            #[must_use]
14142            pub fn next_page_token(&self) -> &'_ str {
14143                self.0.reborrow().next_page_token
14144            }
14145        }
14146        impl ::core::convert::From<
14147            ::buffa::OwnedView<ListOwnerPublishedLayoutsResponseView<'static>>,
14148        > for ListOwnerPublishedLayoutsResponseOwnedView {
14149            fn from(
14150                inner: ::buffa::OwnedView<ListOwnerPublishedLayoutsResponseView<'static>>,
14151            ) -> Self {
14152                ListOwnerPublishedLayoutsResponseOwnedView(inner)
14153            }
14154        }
14155        impl ::core::convert::From<ListOwnerPublishedLayoutsResponseOwnedView>
14156        for ::buffa::OwnedView<ListOwnerPublishedLayoutsResponseView<'static>> {
14157            fn from(wrapper: ListOwnerPublishedLayoutsResponseOwnedView) -> Self {
14158                wrapper.0
14159            }
14160        }
14161        impl ::core::convert::AsRef<
14162            ::buffa::OwnedView<ListOwnerPublishedLayoutsResponseView<'static>>,
14163        > for ListOwnerPublishedLayoutsResponseOwnedView {
14164            fn as_ref(
14165                &self,
14166            ) -> &::buffa::OwnedView<ListOwnerPublishedLayoutsResponseView<'static>> {
14167                &self.0
14168            }
14169        }
14170        impl ::buffa::HasMessageView
14171        for super::super::ListOwnerPublishedLayoutsResponse {
14172            type View<'a> = ListOwnerPublishedLayoutsResponseView<'a>;
14173            type ViewHandle = ListOwnerPublishedLayoutsResponseOwnedView;
14174        }
14175        impl ::serde::Serialize for ListOwnerPublishedLayoutsResponseOwnedView {
14176            fn serialize<__S: ::serde::Serializer>(
14177                &self,
14178                __s: __S,
14179            ) -> ::core::result::Result<__S::Ok, __S::Error> {
14180                ::serde::Serialize::serialize(&self.0, __s)
14181            }
14182        }
14183        /// ListLayoutTemplateVersionsRequest lists immutable versions for one template.
14184        #[derive(Clone, Debug, Default)]
14185        pub struct ListLayoutTemplateVersionsRequestView<'a> {
14186            /// Viewer that owns the template.
14187            ///
14188            /// Field 1: `owner_id`
14189            pub owner_id: u64,
14190            /// Template identifier.
14191            ///
14192            /// Field 2: `template_id`
14193            pub template_id: u64,
14194            /// Maximum number of versions to return. Defaults to 100 when omitted; maximum
14195            /// is 500.
14196            ///
14197            /// Field 3: `limit`
14198            pub limit: u32,
14199            /// Opaque keyset cursor from a previous response. The cursor is exclusive and
14200            /// bound to owner, template, and newest-version sort order.
14201            ///
14202            /// Field 4: `page_token`
14203            pub page_token: &'a str,
14204            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
14205        }
14206        impl<'a> ::buffa::MessageView<'a> for ListLayoutTemplateVersionsRequestView<'a> {
14207            type Owned = super::super::ListLayoutTemplateVersionsRequest;
14208            fn decode_view(
14209                buf: &'a [u8],
14210            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14211                let __limit = ::core::cell::Cell::new(
14212                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
14213                );
14214                <Self as ::buffa::MessageView>::decode_view_ctx(
14215                    buf,
14216                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
14217                )
14218            }
14219            fn decode_view_with_ctx(
14220                buf: &'a [u8],
14221                ctx: ::buffa::DecodeContext<'_>,
14222            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14223                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
14224            }
14225            fn merge_view_field(
14226                &mut self,
14227                tag: ::buffa::encoding::Tag,
14228                cur: &'a [u8],
14229                before_tag: &'a [u8],
14230                ctx: ::buffa::DecodeContext<'_>,
14231            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
14232                let _ = ctx;
14233                #[allow(unused_variables)]
14234                let view = self;
14235                let mut cur = cur;
14236                match tag.field_number() {
14237                    1u32 => {
14238                        ::buffa::encoding::check_wire_type(
14239                            tag,
14240                            ::buffa::encoding::WireType::Fixed64,
14241                        )?;
14242                        view.owner_id = ::buffa::types::decode_fixed64(&mut cur)?;
14243                    }
14244                    2u32 => {
14245                        ::buffa::encoding::check_wire_type(
14246                            tag,
14247                            ::buffa::encoding::WireType::Fixed64,
14248                        )?;
14249                        view.template_id = ::buffa::types::decode_fixed64(&mut cur)?;
14250                    }
14251                    3u32 => {
14252                        ::buffa::encoding::check_wire_type(
14253                            tag,
14254                            ::buffa::encoding::WireType::Varint,
14255                        )?;
14256                        view.limit = ::buffa::types::decode_uint32(&mut cur)?;
14257                    }
14258                    4u32 => {
14259                        ::buffa::encoding::check_wire_type(
14260                            tag,
14261                            ::buffa::encoding::WireType::LengthDelimited,
14262                        )?;
14263                        view.page_token = ::buffa::types::borrow_str(&mut cur)?;
14264                    }
14265                    _ => {
14266                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
14267                        let span_len = before_tag.len() - cur.len();
14268                        view.__buffa_unknown_fields
14269                            .push_record(before_tag, span_len, ctx)?;
14270                    }
14271                }
14272                ::core::result::Result::Ok(cur)
14273            }
14274            fn to_owned_message(
14275                &self,
14276            ) -> ::core::result::Result<
14277                super::super::ListLayoutTemplateVersionsRequest,
14278                ::buffa::DecodeError,
14279            > {
14280                self.to_owned_from_source(None)
14281            }
14282            #[allow(clippy::useless_conversion, clippy::needless_update)]
14283            fn to_owned_from_source(
14284                &self,
14285                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
14286            ) -> ::core::result::Result<
14287                super::super::ListLayoutTemplateVersionsRequest,
14288                ::buffa::DecodeError,
14289            > {
14290                #[allow(unused_imports)]
14291                use ::buffa::alloc::string::ToString as _;
14292                let _ = __buffa_src;
14293                ::core::result::Result::Ok(super::super::ListLayoutTemplateVersionsRequest {
14294                    owner_id: self.owner_id,
14295                    template_id: self.template_id,
14296                    limit: self.limit,
14297                    page_token: self.page_token.to_string(),
14298                    __buffa_unknown_fields: self
14299                        .__buffa_unknown_fields
14300                        .to_owned()?
14301                        .into(),
14302                    ..::core::default::Default::default()
14303                })
14304            }
14305        }
14306        impl<'a> ::buffa::ViewEncode<'a> for ListLayoutTemplateVersionsRequestView<'a> {
14307            #[allow(clippy::needless_borrow, clippy::let_and_return)]
14308            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
14309                #[allow(unused_imports)]
14310                use ::buffa::Enumeration as _;
14311                let mut size = 0u32;
14312                if self.owner_id != 0u64 {
14313                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
14314                }
14315                if self.template_id != 0u64 {
14316                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
14317                }
14318                if self.limit != 0u32 {
14319                    size += 1u32 + ::buffa::types::uint32_encoded_len(self.limit) as u32;
14320                }
14321                if !self.page_token.is_empty() {
14322                    size
14323                        += 1u32
14324                            + ::buffa::types::string_encoded_len(&self.page_token)
14325                                as u32;
14326                }
14327                size += self.__buffa_unknown_fields.encoded_len() as u32;
14328                size
14329            }
14330            #[allow(clippy::needless_borrow)]
14331            fn write_to(
14332                &self,
14333                _cache: &mut ::buffa::SizeCache,
14334                buf: &mut impl ::buffa::bytes::BufMut,
14335            ) {
14336                #[allow(unused_imports)]
14337                use ::buffa::Enumeration as _;
14338                if self.owner_id != 0u64 {
14339                    ::buffa::types::put_fixed64_field(1u32, self.owner_id, buf);
14340                }
14341                if self.template_id != 0u64 {
14342                    ::buffa::types::put_fixed64_field(2u32, self.template_id, buf);
14343                }
14344                if self.limit != 0u32 {
14345                    ::buffa::types::put_uint32_field(3u32, self.limit, buf);
14346                }
14347                if !self.page_token.is_empty() {
14348                    ::buffa::types::put_string_field(4u32, &self.page_token, buf);
14349                }
14350                self.__buffa_unknown_fields.write_to(buf);
14351            }
14352        }
14353        /// Serializes this view as protobuf JSON.
14354        ///
14355        /// Implicit-presence fields with default values are omitted, `required`
14356        /// fields are always emitted, explicit-presence (`optional`) fields are
14357        /// emitted only when set, bytes fields are base64-encoded, and enum
14358        /// values are their proto name strings.
14359        ///
14360        /// This impl uses `serialize_map(None)` because the number of emitted
14361        /// fields depends on default-omission rules; serializers that require
14362        /// known map lengths (e.g. `bincode`) will return a runtime error.
14363        /// Use the owned message type for those formats.
14364        impl<'__a> ::serde::Serialize for ListLayoutTemplateVersionsRequestView<'__a> {
14365            fn serialize<__S: ::serde::Serializer>(
14366                &self,
14367                __s: __S,
14368            ) -> ::core::result::Result<__S::Ok, __S::Error> {
14369                use ::serde::ser::SerializeMap as _;
14370                let mut __map = __s.serialize_map(::core::option::Option::None)?;
14371                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.owner_id) {
14372                    __map
14373                        .serialize_entry(
14374                            "ownerId",
14375                            &::buffa::json_helpers::ProtoJson(&self.owner_id),
14376                        )?;
14377                }
14378                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.template_id) {
14379                    __map
14380                        .serialize_entry(
14381                            "templateId",
14382                            &::buffa::json_helpers::ProtoJson(&self.template_id),
14383                        )?;
14384                }
14385                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.limit) {
14386                    __map
14387                        .serialize_entry(
14388                            "limit",
14389                            &::buffa::json_helpers::ProtoJson(&self.limit),
14390                        )?;
14391                }
14392                if !::buffa::json_helpers::skip_if::is_empty_str(self.page_token) {
14393                    __map.serialize_entry("pageToken", self.page_token)?;
14394                }
14395                __map.end()
14396            }
14397        }
14398        impl<'a> ::buffa::MessageName for ListLayoutTemplateVersionsRequestView<'a> {
14399            const PACKAGE: &'static str = "layout.v1";
14400            const NAME: &'static str = "ListLayoutTemplateVersionsRequest";
14401            const FULL_NAME: &'static str = "layout.v1.ListLayoutTemplateVersionsRequest";
14402            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListLayoutTemplateVersionsRequest";
14403        }
14404        ::buffa::impl_default_view_instance!(ListLayoutTemplateVersionsRequestView);
14405        ::buffa::impl_view_reborrow!(ListLayoutTemplateVersionsRequestView);
14406        /** Self-contained, `'static` owned view of a `ListLayoutTemplateVersionsRequest` message.
14407
14408 Wraps [`::buffa::OwnedView`]`<`[`ListLayoutTemplateVersionsRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
14409
14410 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ListLayoutTemplateVersionsRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
14411        #[derive(Clone, Debug)]
14412        pub struct ListLayoutTemplateVersionsRequestOwnedView(
14413            ::buffa::OwnedView<ListLayoutTemplateVersionsRequestView<'static>>,
14414        );
14415        impl ListLayoutTemplateVersionsRequestOwnedView {
14416            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
14417            ///
14418            /// The view borrows directly from the buffer's data; the buffer is
14419            /// retained inside the returned handle.
14420            ///
14421            /// # Errors
14422            ///
14423            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
14424            /// protobuf data.
14425            pub fn decode(
14426                bytes: ::buffa::bytes::Bytes,
14427            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14428                ::core::result::Result::Ok(
14429                    ListLayoutTemplateVersionsRequestOwnedView(
14430                        ::buffa::OwnedView::decode(bytes)?,
14431                    ),
14432                )
14433            }
14434            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
14435            /// max message size).
14436            ///
14437            /// # Errors
14438            ///
14439            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
14440            /// exceeds the configured limits.
14441            pub fn decode_with_options(
14442                bytes: ::buffa::bytes::Bytes,
14443                opts: &::buffa::DecodeOptions,
14444            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14445                ::core::result::Result::Ok(
14446                    ListLayoutTemplateVersionsRequestOwnedView(
14447                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
14448                    ),
14449                )
14450            }
14451            /// Build from an owned message via an encode → decode round-trip.
14452            ///
14453            /// # Errors
14454            ///
14455            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
14456            /// somehow invalid (should not happen for well-formed messages).
14457            pub fn from_owned(
14458                msg: &super::super::ListLayoutTemplateVersionsRequest,
14459            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14460                ::core::result::Result::Ok(
14461                    ListLayoutTemplateVersionsRequestOwnedView(
14462                        ::buffa::OwnedView::from_owned(msg)?,
14463                    ),
14464                )
14465            }
14466            /// Borrow the full [`ListLayoutTemplateVersionsRequestView`] with its lifetime tied to `&self`.
14467            #[must_use]
14468            pub fn view(&self) -> &ListLayoutTemplateVersionsRequestView<'_> {
14469                self.0.reborrow()
14470            }
14471            /// Convert to the owned message type.
14472            ///
14473            /// # Errors
14474            ///
14475            /// Returns an error if re-materializing preserved unknown fields
14476            /// fails (e.g. the unknown-field limit is exceeded).
14477            pub fn to_owned_message(
14478                &self,
14479            ) -> ::core::result::Result<
14480                super::super::ListLayoutTemplateVersionsRequest,
14481                ::buffa::DecodeError,
14482            > {
14483                self.0.to_owned_message()
14484            }
14485            /// The underlying bytes buffer.
14486            #[must_use]
14487            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
14488                self.0.bytes()
14489            }
14490            /// Consume the handle, returning the underlying bytes buffer.
14491            #[must_use]
14492            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
14493                self.0.into_bytes()
14494            }
14495            /// Viewer that owns the template.
14496            ///
14497            /// Field 1: `owner_id`
14498            #[must_use]
14499            pub fn owner_id(&self) -> u64 {
14500                self.0.reborrow().owner_id
14501            }
14502            /// Template identifier.
14503            ///
14504            /// Field 2: `template_id`
14505            #[must_use]
14506            pub fn template_id(&self) -> u64 {
14507                self.0.reborrow().template_id
14508            }
14509            /// Maximum number of versions to return. Defaults to 100 when omitted; maximum
14510            /// is 500.
14511            ///
14512            /// Field 3: `limit`
14513            #[must_use]
14514            pub fn limit(&self) -> u32 {
14515                self.0.reborrow().limit
14516            }
14517            /// Opaque keyset cursor from a previous response. The cursor is exclusive and
14518            /// bound to owner, template, and newest-version sort order.
14519            ///
14520            /// Field 4: `page_token`
14521            #[must_use]
14522            pub fn page_token(&self) -> &'_ str {
14523                self.0.reborrow().page_token
14524            }
14525        }
14526        impl ::core::convert::From<
14527            ::buffa::OwnedView<ListLayoutTemplateVersionsRequestView<'static>>,
14528        > for ListLayoutTemplateVersionsRequestOwnedView {
14529            fn from(
14530                inner: ::buffa::OwnedView<ListLayoutTemplateVersionsRequestView<'static>>,
14531            ) -> Self {
14532                ListLayoutTemplateVersionsRequestOwnedView(inner)
14533            }
14534        }
14535        impl ::core::convert::From<ListLayoutTemplateVersionsRequestOwnedView>
14536        for ::buffa::OwnedView<ListLayoutTemplateVersionsRequestView<'static>> {
14537            fn from(wrapper: ListLayoutTemplateVersionsRequestOwnedView) -> Self {
14538                wrapper.0
14539            }
14540        }
14541        impl ::core::convert::AsRef<
14542            ::buffa::OwnedView<ListLayoutTemplateVersionsRequestView<'static>>,
14543        > for ListLayoutTemplateVersionsRequestOwnedView {
14544            fn as_ref(
14545                &self,
14546            ) -> &::buffa::OwnedView<ListLayoutTemplateVersionsRequestView<'static>> {
14547                &self.0
14548            }
14549        }
14550        impl ::buffa::HasMessageView
14551        for super::super::ListLayoutTemplateVersionsRequest {
14552            type View<'a> = ListLayoutTemplateVersionsRequestView<'a>;
14553            type ViewHandle = ListLayoutTemplateVersionsRequestOwnedView;
14554        }
14555        impl ::serde::Serialize for ListLayoutTemplateVersionsRequestOwnedView {
14556            fn serialize<__S: ::serde::Serializer>(
14557                &self,
14558                __s: __S,
14559            ) -> ::core::result::Result<__S::Ok, __S::Error> {
14560                ::serde::Serialize::serialize(&self.0, __s)
14561            }
14562        }
14563        /// ListLayoutTemplateVersionsResponse contains version metadata for a template.
14564        #[derive(Clone, Debug, Default)]
14565        pub struct ListLayoutTemplateVersionsResponseView<'a> {
14566            /// Template versions, returned newest version first.
14567            ///
14568            /// Field 1: `versions`
14569            pub versions: ::buffa::RepeatedView<
14570                'a,
14571                super::super::__buffa::view::LayoutTemplateVersionInfoView<'a>,
14572            >,
14573            /// Opaque cursor for the next page. Empty when no more results exist.
14574            ///
14575            /// Field 2: `next_page_token`
14576            pub next_page_token: &'a str,
14577            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
14578        }
14579        impl<'a> ::buffa::MessageView<'a>
14580        for ListLayoutTemplateVersionsResponseView<'a> {
14581            type Owned = super::super::ListLayoutTemplateVersionsResponse;
14582            fn decode_view(
14583                buf: &'a [u8],
14584            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14585                let __limit = ::core::cell::Cell::new(
14586                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
14587                );
14588                <Self as ::buffa::MessageView>::decode_view_ctx(
14589                    buf,
14590                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
14591                )
14592            }
14593            fn decode_view_with_ctx(
14594                buf: &'a [u8],
14595                ctx: ::buffa::DecodeContext<'_>,
14596            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14597                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
14598            }
14599            fn merge_view_field(
14600                &mut self,
14601                tag: ::buffa::encoding::Tag,
14602                cur: &'a [u8],
14603                before_tag: &'a [u8],
14604                ctx: ::buffa::DecodeContext<'_>,
14605            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
14606                let _ = ctx;
14607                #[allow(unused_variables)]
14608                let view = self;
14609                let mut cur = cur;
14610                match tag.field_number() {
14611                    2u32 => {
14612                        ::buffa::encoding::check_wire_type(
14613                            tag,
14614                            ::buffa::encoding::WireType::LengthDelimited,
14615                        )?;
14616                        view.next_page_token = ::buffa::types::borrow_str(&mut cur)?;
14617                    }
14618                    1u32 => {
14619                        ::buffa::encoding::check_wire_type(
14620                            tag,
14621                            ::buffa::encoding::WireType::LengthDelimited,
14622                        )?;
14623                        let __sub_ctx = ctx.descend()?;
14624                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
14625                        view.versions
14626                            .push(
14627                                <super::super::__buffa::view::LayoutTemplateVersionInfoView as ::buffa::MessageView>::decode_view_ctx(
14628                                    sub,
14629                                    __sub_ctx,
14630                                )?,
14631                            );
14632                    }
14633                    _ => {
14634                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
14635                        let span_len = before_tag.len() - cur.len();
14636                        view.__buffa_unknown_fields
14637                            .push_record(before_tag, span_len, ctx)?;
14638                    }
14639                }
14640                ::core::result::Result::Ok(cur)
14641            }
14642            fn to_owned_message(
14643                &self,
14644            ) -> ::core::result::Result<
14645                super::super::ListLayoutTemplateVersionsResponse,
14646                ::buffa::DecodeError,
14647            > {
14648                self.to_owned_from_source(None)
14649            }
14650            #[allow(clippy::useless_conversion, clippy::needless_update)]
14651            fn to_owned_from_source(
14652                &self,
14653                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
14654            ) -> ::core::result::Result<
14655                super::super::ListLayoutTemplateVersionsResponse,
14656                ::buffa::DecodeError,
14657            > {
14658                #[allow(unused_imports)]
14659                use ::buffa::alloc::string::ToString as _;
14660                let _ = __buffa_src;
14661                ::core::result::Result::Ok(super::super::ListLayoutTemplateVersionsResponse {
14662                    versions: self
14663                        .versions
14664                        .iter()
14665                        .map(|v| v.to_owned_from_source(__buffa_src))
14666                        .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
14667                    next_page_token: self.next_page_token.to_string(),
14668                    __buffa_unknown_fields: self
14669                        .__buffa_unknown_fields
14670                        .to_owned()?
14671                        .into(),
14672                    ..::core::default::Default::default()
14673                })
14674            }
14675        }
14676        impl<'a> ::buffa::ViewEncode<'a> for ListLayoutTemplateVersionsResponseView<'a> {
14677            #[allow(clippy::needless_borrow, clippy::let_and_return)]
14678            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
14679                #[allow(unused_imports)]
14680                use ::buffa::Enumeration as _;
14681                let mut size = 0u32;
14682                for v in &self.versions {
14683                    let __slot = __cache.reserve();
14684                    let inner_size = v.compute_size(__cache);
14685                    __cache.set(__slot, inner_size);
14686                    size
14687                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
14688                            + inner_size;
14689                }
14690                if !self.next_page_token.is_empty() {
14691                    size
14692                        += 1u32
14693                            + ::buffa::types::string_encoded_len(&self.next_page_token)
14694                                as u32;
14695                }
14696                size += self.__buffa_unknown_fields.encoded_len() as u32;
14697                size
14698            }
14699            #[allow(clippy::needless_borrow)]
14700            fn write_to(
14701                &self,
14702                __cache: &mut ::buffa::SizeCache,
14703                buf: &mut impl ::buffa::bytes::BufMut,
14704            ) {
14705                #[allow(unused_imports)]
14706                use ::buffa::Enumeration as _;
14707                for v in &self.versions {
14708                    ::buffa::types::put_len_delimited_header(
14709                        1u32,
14710                        __cache.consume_next(),
14711                        buf,
14712                    );
14713                    v.write_to(__cache, buf);
14714                }
14715                if !self.next_page_token.is_empty() {
14716                    ::buffa::types::put_string_field(2u32, &self.next_page_token, buf);
14717                }
14718                self.__buffa_unknown_fields.write_to(buf);
14719            }
14720        }
14721        /// Serializes this view as protobuf JSON.
14722        ///
14723        /// Implicit-presence fields with default values are omitted, `required`
14724        /// fields are always emitted, explicit-presence (`optional`) fields are
14725        /// emitted only when set, bytes fields are base64-encoded, and enum
14726        /// values are their proto name strings.
14727        ///
14728        /// This impl uses `serialize_map(None)` because the number of emitted
14729        /// fields depends on default-omission rules; serializers that require
14730        /// known map lengths (e.g. `bincode`) will return a runtime error.
14731        /// Use the owned message type for those formats.
14732        impl<'__a> ::serde::Serialize for ListLayoutTemplateVersionsResponseView<'__a> {
14733            fn serialize<__S: ::serde::Serializer>(
14734                &self,
14735                __s: __S,
14736            ) -> ::core::result::Result<__S::Ok, __S::Error> {
14737                use ::serde::ser::SerializeMap as _;
14738                let mut __map = __s.serialize_map(::core::option::Option::None)?;
14739                if !self.versions.is_empty() {
14740                    __map.serialize_entry("versions", &*self.versions)?;
14741                }
14742                if !::buffa::json_helpers::skip_if::is_empty_str(self.next_page_token) {
14743                    __map.serialize_entry("nextPageToken", self.next_page_token)?;
14744                }
14745                __map.end()
14746            }
14747        }
14748        impl<'a> ::buffa::MessageName for ListLayoutTemplateVersionsResponseView<'a> {
14749            const PACKAGE: &'static str = "layout.v1";
14750            const NAME: &'static str = "ListLayoutTemplateVersionsResponse";
14751            const FULL_NAME: &'static str = "layout.v1.ListLayoutTemplateVersionsResponse";
14752            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListLayoutTemplateVersionsResponse";
14753        }
14754        ::buffa::impl_default_view_instance!(ListLayoutTemplateVersionsResponseView);
14755        ::buffa::impl_view_reborrow!(ListLayoutTemplateVersionsResponseView);
14756        /** Self-contained, `'static` owned view of a `ListLayoutTemplateVersionsResponse` message.
14757
14758 Wraps [`::buffa::OwnedView`]`<`[`ListLayoutTemplateVersionsResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
14759
14760 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ListLayoutTemplateVersionsResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
14761        #[derive(Clone, Debug)]
14762        pub struct ListLayoutTemplateVersionsResponseOwnedView(
14763            ::buffa::OwnedView<ListLayoutTemplateVersionsResponseView<'static>>,
14764        );
14765        impl ListLayoutTemplateVersionsResponseOwnedView {
14766            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
14767            ///
14768            /// The view borrows directly from the buffer's data; the buffer is
14769            /// retained inside the returned handle.
14770            ///
14771            /// # Errors
14772            ///
14773            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
14774            /// protobuf data.
14775            pub fn decode(
14776                bytes: ::buffa::bytes::Bytes,
14777            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14778                ::core::result::Result::Ok(
14779                    ListLayoutTemplateVersionsResponseOwnedView(
14780                        ::buffa::OwnedView::decode(bytes)?,
14781                    ),
14782                )
14783            }
14784            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
14785            /// max message size).
14786            ///
14787            /// # Errors
14788            ///
14789            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
14790            /// exceeds the configured limits.
14791            pub fn decode_with_options(
14792                bytes: ::buffa::bytes::Bytes,
14793                opts: &::buffa::DecodeOptions,
14794            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14795                ::core::result::Result::Ok(
14796                    ListLayoutTemplateVersionsResponseOwnedView(
14797                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
14798                    ),
14799                )
14800            }
14801            /// Build from an owned message via an encode → decode round-trip.
14802            ///
14803            /// # Errors
14804            ///
14805            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
14806            /// somehow invalid (should not happen for well-formed messages).
14807            pub fn from_owned(
14808                msg: &super::super::ListLayoutTemplateVersionsResponse,
14809            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14810                ::core::result::Result::Ok(
14811                    ListLayoutTemplateVersionsResponseOwnedView(
14812                        ::buffa::OwnedView::from_owned(msg)?,
14813                    ),
14814                )
14815            }
14816            /// Borrow the full [`ListLayoutTemplateVersionsResponseView`] with its lifetime tied to `&self`.
14817            #[must_use]
14818            pub fn view(&self) -> &ListLayoutTemplateVersionsResponseView<'_> {
14819                self.0.reborrow()
14820            }
14821            /// Convert to the owned message type.
14822            ///
14823            /// # Errors
14824            ///
14825            /// Returns an error if re-materializing preserved unknown fields
14826            /// fails (e.g. the unknown-field limit is exceeded).
14827            pub fn to_owned_message(
14828                &self,
14829            ) -> ::core::result::Result<
14830                super::super::ListLayoutTemplateVersionsResponse,
14831                ::buffa::DecodeError,
14832            > {
14833                self.0.to_owned_message()
14834            }
14835            /// The underlying bytes buffer.
14836            #[must_use]
14837            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
14838                self.0.bytes()
14839            }
14840            /// Consume the handle, returning the underlying bytes buffer.
14841            #[must_use]
14842            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
14843                self.0.into_bytes()
14844            }
14845            /// Template versions, returned newest version first.
14846            ///
14847            /// Field 1: `versions`
14848            #[must_use]
14849            pub fn versions(
14850                &self,
14851            ) -> &::buffa::RepeatedView<
14852                '_,
14853                super::super::__buffa::view::LayoutTemplateVersionInfoView<'_>,
14854            > {
14855                &self.0.reborrow().versions
14856            }
14857            /// Opaque cursor for the next page. Empty when no more results exist.
14858            ///
14859            /// Field 2: `next_page_token`
14860            #[must_use]
14861            pub fn next_page_token(&self) -> &'_ str {
14862                self.0.reborrow().next_page_token
14863            }
14864        }
14865        impl ::core::convert::From<
14866            ::buffa::OwnedView<ListLayoutTemplateVersionsResponseView<'static>>,
14867        > for ListLayoutTemplateVersionsResponseOwnedView {
14868            fn from(
14869                inner: ::buffa::OwnedView<
14870                    ListLayoutTemplateVersionsResponseView<'static>,
14871                >,
14872            ) -> Self {
14873                ListLayoutTemplateVersionsResponseOwnedView(inner)
14874            }
14875        }
14876        impl ::core::convert::From<ListLayoutTemplateVersionsResponseOwnedView>
14877        for ::buffa::OwnedView<ListLayoutTemplateVersionsResponseView<'static>> {
14878            fn from(wrapper: ListLayoutTemplateVersionsResponseOwnedView) -> Self {
14879                wrapper.0
14880            }
14881        }
14882        impl ::core::convert::AsRef<
14883            ::buffa::OwnedView<ListLayoutTemplateVersionsResponseView<'static>>,
14884        > for ListLayoutTemplateVersionsResponseOwnedView {
14885            fn as_ref(
14886                &self,
14887            ) -> &::buffa::OwnedView<ListLayoutTemplateVersionsResponseView<'static>> {
14888                &self.0
14889            }
14890        }
14891        impl ::buffa::HasMessageView
14892        for super::super::ListLayoutTemplateVersionsResponse {
14893            type View<'a> = ListLayoutTemplateVersionsResponseView<'a>;
14894            type ViewHandle = ListLayoutTemplateVersionsResponseOwnedView;
14895        }
14896        impl ::serde::Serialize for ListLayoutTemplateVersionsResponseOwnedView {
14897            fn serialize<__S: ::serde::Serializer>(
14898                &self,
14899                __s: __S,
14900            ) -> ::core::result::Result<__S::Ok, __S::Error> {
14901                ::serde::Serialize::serialize(&self.0, __s)
14902            }
14903        }
14904        /// GetLayoutTemplateVersionRequest fetches one immutable template version.
14905        #[derive(Clone, Debug, Default)]
14906        pub struct GetLayoutTemplateVersionRequestView<'a> {
14907            /// Viewer that owns the template.
14908            ///
14909            /// Field 1: `owner_id`
14910            pub owner_id: u64,
14911            /// Template identifier.
14912            ///
14913            /// Field 2: `template_id`
14914            pub template_id: u64,
14915            /// Immutable version number to fetch.
14916            ///
14917            /// Field 3: `version`
14918            pub version: u32,
14919            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
14920        }
14921        impl<'a> ::buffa::MessageView<'a> for GetLayoutTemplateVersionRequestView<'a> {
14922            type Owned = super::super::GetLayoutTemplateVersionRequest;
14923            fn decode_view(
14924                buf: &'a [u8],
14925            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14926                let __limit = ::core::cell::Cell::new(
14927                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
14928                );
14929                <Self as ::buffa::MessageView>::decode_view_ctx(
14930                    buf,
14931                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
14932                )
14933            }
14934            fn decode_view_with_ctx(
14935                buf: &'a [u8],
14936                ctx: ::buffa::DecodeContext<'_>,
14937            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14938                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
14939            }
14940            fn merge_view_field(
14941                &mut self,
14942                tag: ::buffa::encoding::Tag,
14943                cur: &'a [u8],
14944                before_tag: &'a [u8],
14945                ctx: ::buffa::DecodeContext<'_>,
14946            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
14947                let _ = ctx;
14948                #[allow(unused_variables)]
14949                let view = self;
14950                let mut cur = cur;
14951                match tag.field_number() {
14952                    1u32 => {
14953                        ::buffa::encoding::check_wire_type(
14954                            tag,
14955                            ::buffa::encoding::WireType::Fixed64,
14956                        )?;
14957                        view.owner_id = ::buffa::types::decode_fixed64(&mut cur)?;
14958                    }
14959                    2u32 => {
14960                        ::buffa::encoding::check_wire_type(
14961                            tag,
14962                            ::buffa::encoding::WireType::Fixed64,
14963                        )?;
14964                        view.template_id = ::buffa::types::decode_fixed64(&mut cur)?;
14965                    }
14966                    3u32 => {
14967                        ::buffa::encoding::check_wire_type(
14968                            tag,
14969                            ::buffa::encoding::WireType::Varint,
14970                        )?;
14971                        view.version = ::buffa::types::decode_uint32(&mut cur)?;
14972                    }
14973                    _ => {
14974                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
14975                        let span_len = before_tag.len() - cur.len();
14976                        view.__buffa_unknown_fields
14977                            .push_record(before_tag, span_len, ctx)?;
14978                    }
14979                }
14980                ::core::result::Result::Ok(cur)
14981            }
14982            fn to_owned_message(
14983                &self,
14984            ) -> ::core::result::Result<
14985                super::super::GetLayoutTemplateVersionRequest,
14986                ::buffa::DecodeError,
14987            > {
14988                self.to_owned_from_source(None)
14989            }
14990            #[allow(clippy::useless_conversion, clippy::needless_update)]
14991            fn to_owned_from_source(
14992                &self,
14993                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
14994            ) -> ::core::result::Result<
14995                super::super::GetLayoutTemplateVersionRequest,
14996                ::buffa::DecodeError,
14997            > {
14998                #[allow(unused_imports)]
14999                use ::buffa::alloc::string::ToString as _;
15000                let _ = __buffa_src;
15001                ::core::result::Result::Ok(super::super::GetLayoutTemplateVersionRequest {
15002                    owner_id: self.owner_id,
15003                    template_id: self.template_id,
15004                    version: self.version,
15005                    __buffa_unknown_fields: self
15006                        .__buffa_unknown_fields
15007                        .to_owned()?
15008                        .into(),
15009                    ..::core::default::Default::default()
15010                })
15011            }
15012        }
15013        impl<'a> ::buffa::ViewEncode<'a> for GetLayoutTemplateVersionRequestView<'a> {
15014            #[allow(clippy::needless_borrow, clippy::let_and_return)]
15015            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
15016                #[allow(unused_imports)]
15017                use ::buffa::Enumeration as _;
15018                let mut size = 0u32;
15019                if self.owner_id != 0u64 {
15020                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
15021                }
15022                if self.template_id != 0u64 {
15023                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
15024                }
15025                if self.version != 0u32 {
15026                    size
15027                        += 1u32
15028                            + ::buffa::types::uint32_encoded_len(self.version) as u32;
15029                }
15030                size += self.__buffa_unknown_fields.encoded_len() as u32;
15031                size
15032            }
15033            #[allow(clippy::needless_borrow)]
15034            fn write_to(
15035                &self,
15036                _cache: &mut ::buffa::SizeCache,
15037                buf: &mut impl ::buffa::bytes::BufMut,
15038            ) {
15039                #[allow(unused_imports)]
15040                use ::buffa::Enumeration as _;
15041                if self.owner_id != 0u64 {
15042                    ::buffa::types::put_fixed64_field(1u32, self.owner_id, buf);
15043                }
15044                if self.template_id != 0u64 {
15045                    ::buffa::types::put_fixed64_field(2u32, self.template_id, buf);
15046                }
15047                if self.version != 0u32 {
15048                    ::buffa::types::put_uint32_field(3u32, self.version, buf);
15049                }
15050                self.__buffa_unknown_fields.write_to(buf);
15051            }
15052        }
15053        /// Serializes this view as protobuf JSON.
15054        ///
15055        /// Implicit-presence fields with default values are omitted, `required`
15056        /// fields are always emitted, explicit-presence (`optional`) fields are
15057        /// emitted only when set, bytes fields are base64-encoded, and enum
15058        /// values are their proto name strings.
15059        ///
15060        /// This impl uses `serialize_map(None)` because the number of emitted
15061        /// fields depends on default-omission rules; serializers that require
15062        /// known map lengths (e.g. `bincode`) will return a runtime error.
15063        /// Use the owned message type for those formats.
15064        impl<'__a> ::serde::Serialize for GetLayoutTemplateVersionRequestView<'__a> {
15065            fn serialize<__S: ::serde::Serializer>(
15066                &self,
15067                __s: __S,
15068            ) -> ::core::result::Result<__S::Ok, __S::Error> {
15069                use ::serde::ser::SerializeMap as _;
15070                let mut __map = __s.serialize_map(::core::option::Option::None)?;
15071                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.owner_id) {
15072                    __map
15073                        .serialize_entry(
15074                            "ownerId",
15075                            &::buffa::json_helpers::ProtoJson(&self.owner_id),
15076                        )?;
15077                }
15078                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.template_id) {
15079                    __map
15080                        .serialize_entry(
15081                            "templateId",
15082                            &::buffa::json_helpers::ProtoJson(&self.template_id),
15083                        )?;
15084                }
15085                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.version) {
15086                    __map
15087                        .serialize_entry(
15088                            "version",
15089                            &::buffa::json_helpers::ProtoJson(&self.version),
15090                        )?;
15091                }
15092                __map.end()
15093            }
15094        }
15095        impl<'a> ::buffa::MessageName for GetLayoutTemplateVersionRequestView<'a> {
15096            const PACKAGE: &'static str = "layout.v1";
15097            const NAME: &'static str = "GetLayoutTemplateVersionRequest";
15098            const FULL_NAME: &'static str = "layout.v1.GetLayoutTemplateVersionRequest";
15099            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutTemplateVersionRequest";
15100        }
15101        ::buffa::impl_default_view_instance!(GetLayoutTemplateVersionRequestView);
15102        ::buffa::impl_view_reborrow!(GetLayoutTemplateVersionRequestView);
15103        /** Self-contained, `'static` owned view of a `GetLayoutTemplateVersionRequest` message.
15104
15105 Wraps [`::buffa::OwnedView`]`<`[`GetLayoutTemplateVersionRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
15106
15107 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`GetLayoutTemplateVersionRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
15108        #[derive(Clone, Debug)]
15109        pub struct GetLayoutTemplateVersionRequestOwnedView(
15110            ::buffa::OwnedView<GetLayoutTemplateVersionRequestView<'static>>,
15111        );
15112        impl GetLayoutTemplateVersionRequestOwnedView {
15113            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
15114            ///
15115            /// The view borrows directly from the buffer's data; the buffer is
15116            /// retained inside the returned handle.
15117            ///
15118            /// # Errors
15119            ///
15120            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
15121            /// protobuf data.
15122            pub fn decode(
15123                bytes: ::buffa::bytes::Bytes,
15124            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15125                ::core::result::Result::Ok(
15126                    GetLayoutTemplateVersionRequestOwnedView(
15127                        ::buffa::OwnedView::decode(bytes)?,
15128                    ),
15129                )
15130            }
15131            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
15132            /// max message size).
15133            ///
15134            /// # Errors
15135            ///
15136            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
15137            /// exceeds the configured limits.
15138            pub fn decode_with_options(
15139                bytes: ::buffa::bytes::Bytes,
15140                opts: &::buffa::DecodeOptions,
15141            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15142                ::core::result::Result::Ok(
15143                    GetLayoutTemplateVersionRequestOwnedView(
15144                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
15145                    ),
15146                )
15147            }
15148            /// Build from an owned message via an encode → decode round-trip.
15149            ///
15150            /// # Errors
15151            ///
15152            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
15153            /// somehow invalid (should not happen for well-formed messages).
15154            pub fn from_owned(
15155                msg: &super::super::GetLayoutTemplateVersionRequest,
15156            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15157                ::core::result::Result::Ok(
15158                    GetLayoutTemplateVersionRequestOwnedView(
15159                        ::buffa::OwnedView::from_owned(msg)?,
15160                    ),
15161                )
15162            }
15163            /// Borrow the full [`GetLayoutTemplateVersionRequestView`] with its lifetime tied to `&self`.
15164            #[must_use]
15165            pub fn view(&self) -> &GetLayoutTemplateVersionRequestView<'_> {
15166                self.0.reborrow()
15167            }
15168            /// Convert to the owned message type.
15169            ///
15170            /// # Errors
15171            ///
15172            /// Returns an error if re-materializing preserved unknown fields
15173            /// fails (e.g. the unknown-field limit is exceeded).
15174            pub fn to_owned_message(
15175                &self,
15176            ) -> ::core::result::Result<
15177                super::super::GetLayoutTemplateVersionRequest,
15178                ::buffa::DecodeError,
15179            > {
15180                self.0.to_owned_message()
15181            }
15182            /// The underlying bytes buffer.
15183            #[must_use]
15184            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
15185                self.0.bytes()
15186            }
15187            /// Consume the handle, returning the underlying bytes buffer.
15188            #[must_use]
15189            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
15190                self.0.into_bytes()
15191            }
15192            /// Viewer that owns the template.
15193            ///
15194            /// Field 1: `owner_id`
15195            #[must_use]
15196            pub fn owner_id(&self) -> u64 {
15197                self.0.reborrow().owner_id
15198            }
15199            /// Template identifier.
15200            ///
15201            /// Field 2: `template_id`
15202            #[must_use]
15203            pub fn template_id(&self) -> u64 {
15204                self.0.reborrow().template_id
15205            }
15206            /// Immutable version number to fetch.
15207            ///
15208            /// Field 3: `version`
15209            #[must_use]
15210            pub fn version(&self) -> u32 {
15211                self.0.reborrow().version
15212            }
15213        }
15214        impl ::core::convert::From<
15215            ::buffa::OwnedView<GetLayoutTemplateVersionRequestView<'static>>,
15216        > for GetLayoutTemplateVersionRequestOwnedView {
15217            fn from(
15218                inner: ::buffa::OwnedView<GetLayoutTemplateVersionRequestView<'static>>,
15219            ) -> Self {
15220                GetLayoutTemplateVersionRequestOwnedView(inner)
15221            }
15222        }
15223        impl ::core::convert::From<GetLayoutTemplateVersionRequestOwnedView>
15224        for ::buffa::OwnedView<GetLayoutTemplateVersionRequestView<'static>> {
15225            fn from(wrapper: GetLayoutTemplateVersionRequestOwnedView) -> Self {
15226                wrapper.0
15227            }
15228        }
15229        impl ::core::convert::AsRef<
15230            ::buffa::OwnedView<GetLayoutTemplateVersionRequestView<'static>>,
15231        > for GetLayoutTemplateVersionRequestOwnedView {
15232            fn as_ref(
15233                &self,
15234            ) -> &::buffa::OwnedView<GetLayoutTemplateVersionRequestView<'static>> {
15235                &self.0
15236            }
15237        }
15238        impl ::buffa::HasMessageView for super::super::GetLayoutTemplateVersionRequest {
15239            type View<'a> = GetLayoutTemplateVersionRequestView<'a>;
15240            type ViewHandle = GetLayoutTemplateVersionRequestOwnedView;
15241        }
15242        impl ::serde::Serialize for GetLayoutTemplateVersionRequestOwnedView {
15243            fn serialize<__S: ::serde::Serializer>(
15244                &self,
15245                __s: __S,
15246            ) -> ::core::result::Result<__S::Ok, __S::Error> {
15247                ::serde::Serialize::serialize(&self.0, __s)
15248            }
15249        }
15250        /// GetLayoutTemplateVersionResponse returns one immutable template snapshot.
15251        #[derive(Clone, Debug, Default)]
15252        pub struct GetLayoutTemplateVersionResponseView<'a> {
15253            /// Layout snapshot captured for the requested version.
15254            ///
15255            /// Field 1: `layout`
15256            pub layout: ::buffa::MessageFieldView<
15257                super::super::__buffa::view::LayoutView<'a>,
15258            >,
15259            /// Viewer that owns the template.
15260            ///
15261            /// Field 2: `owner_id`
15262            pub owner_id: u64,
15263            /// Template identifier.
15264            ///
15265            /// Field 3: `template_id`
15266            pub template_id: u64,
15267            /// Immutable version number returned.
15268            ///
15269            /// Field 4: `version`
15270            pub version: u32,
15271            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
15272        }
15273        impl<'a> ::buffa::MessageView<'a> for GetLayoutTemplateVersionResponseView<'a> {
15274            type Owned = super::super::GetLayoutTemplateVersionResponse;
15275            fn decode_view(
15276                buf: &'a [u8],
15277            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15278                let __limit = ::core::cell::Cell::new(
15279                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
15280                );
15281                <Self as ::buffa::MessageView>::decode_view_ctx(
15282                    buf,
15283                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
15284                )
15285            }
15286            fn decode_view_with_ctx(
15287                buf: &'a [u8],
15288                ctx: ::buffa::DecodeContext<'_>,
15289            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15290                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
15291            }
15292            fn merge_view_field(
15293                &mut self,
15294                tag: ::buffa::encoding::Tag,
15295                cur: &'a [u8],
15296                before_tag: &'a [u8],
15297                ctx: ::buffa::DecodeContext<'_>,
15298            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
15299                let _ = ctx;
15300                #[allow(unused_variables)]
15301                let view = self;
15302                let mut cur = cur;
15303                match tag.field_number() {
15304                    1u32 => {
15305                        ::buffa::encoding::check_wire_type(
15306                            tag,
15307                            ::buffa::encoding::WireType::LengthDelimited,
15308                        )?;
15309                        let __sub_ctx = ctx.descend()?;
15310                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
15311                        match view.layout.as_mut() {
15312                            Some(existing) => {
15313                                ::buffa::MessageView::merge_into_view(
15314                                    existing,
15315                                    sub,
15316                                    __sub_ctx,
15317                                )?
15318                            }
15319                            None => {
15320                                view.layout = ::buffa::MessageFieldView::set(
15321                                    <super::super::__buffa::view::LayoutView as ::buffa::MessageView>::decode_view_ctx(
15322                                        sub,
15323                                        __sub_ctx,
15324                                    )?,
15325                                );
15326                            }
15327                        }
15328                    }
15329                    2u32 => {
15330                        ::buffa::encoding::check_wire_type(
15331                            tag,
15332                            ::buffa::encoding::WireType::Fixed64,
15333                        )?;
15334                        view.owner_id = ::buffa::types::decode_fixed64(&mut cur)?;
15335                    }
15336                    3u32 => {
15337                        ::buffa::encoding::check_wire_type(
15338                            tag,
15339                            ::buffa::encoding::WireType::Fixed64,
15340                        )?;
15341                        view.template_id = ::buffa::types::decode_fixed64(&mut cur)?;
15342                    }
15343                    4u32 => {
15344                        ::buffa::encoding::check_wire_type(
15345                            tag,
15346                            ::buffa::encoding::WireType::Varint,
15347                        )?;
15348                        view.version = ::buffa::types::decode_uint32(&mut cur)?;
15349                    }
15350                    _ => {
15351                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
15352                        let span_len = before_tag.len() - cur.len();
15353                        view.__buffa_unknown_fields
15354                            .push_record(before_tag, span_len, ctx)?;
15355                    }
15356                }
15357                ::core::result::Result::Ok(cur)
15358            }
15359            fn to_owned_message(
15360                &self,
15361            ) -> ::core::result::Result<
15362                super::super::GetLayoutTemplateVersionResponse,
15363                ::buffa::DecodeError,
15364            > {
15365                self.to_owned_from_source(None)
15366            }
15367            #[allow(clippy::useless_conversion, clippy::needless_update)]
15368            fn to_owned_from_source(
15369                &self,
15370                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
15371            ) -> ::core::result::Result<
15372                super::super::GetLayoutTemplateVersionResponse,
15373                ::buffa::DecodeError,
15374            > {
15375                #[allow(unused_imports)]
15376                use ::buffa::alloc::string::ToString as _;
15377                let _ = __buffa_src;
15378                ::core::result::Result::Ok(super::super::GetLayoutTemplateVersionResponse {
15379                    layout: match self.layout.as_option() {
15380                        Some(v) => {
15381                            ::buffa::MessageField::<
15382                                super::super::Layout,
15383                            >::some(v.to_owned_from_source(__buffa_src)?)
15384                        }
15385                        None => ::buffa::MessageField::none(),
15386                    },
15387                    owner_id: self.owner_id,
15388                    template_id: self.template_id,
15389                    version: self.version,
15390                    __buffa_unknown_fields: self
15391                        .__buffa_unknown_fields
15392                        .to_owned()?
15393                        .into(),
15394                    ..::core::default::Default::default()
15395                })
15396            }
15397        }
15398        impl<'a> ::buffa::ViewEncode<'a> for GetLayoutTemplateVersionResponseView<'a> {
15399            #[allow(clippy::needless_borrow, clippy::let_and_return)]
15400            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
15401                #[allow(unused_imports)]
15402                use ::buffa::Enumeration as _;
15403                let mut size = 0u32;
15404                if self.layout.is_set() {
15405                    let __slot = __cache.reserve();
15406                    let inner_size = self.layout.compute_size(__cache);
15407                    __cache.set(__slot, inner_size);
15408                    size
15409                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
15410                            + inner_size;
15411                }
15412                if self.owner_id != 0u64 {
15413                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
15414                }
15415                if self.template_id != 0u64 {
15416                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
15417                }
15418                if self.version != 0u32 {
15419                    size
15420                        += 1u32
15421                            + ::buffa::types::uint32_encoded_len(self.version) as u32;
15422                }
15423                size += self.__buffa_unknown_fields.encoded_len() as u32;
15424                size
15425            }
15426            #[allow(clippy::needless_borrow)]
15427            fn write_to(
15428                &self,
15429                __cache: &mut ::buffa::SizeCache,
15430                buf: &mut impl ::buffa::bytes::BufMut,
15431            ) {
15432                #[allow(unused_imports)]
15433                use ::buffa::Enumeration as _;
15434                if self.layout.is_set() {
15435                    ::buffa::types::put_len_delimited_header(
15436                        1u32,
15437                        __cache.consume_next(),
15438                        buf,
15439                    );
15440                    self.layout.write_to(__cache, buf);
15441                }
15442                if self.owner_id != 0u64 {
15443                    ::buffa::types::put_fixed64_field(2u32, self.owner_id, buf);
15444                }
15445                if self.template_id != 0u64 {
15446                    ::buffa::types::put_fixed64_field(3u32, self.template_id, buf);
15447                }
15448                if self.version != 0u32 {
15449                    ::buffa::types::put_uint32_field(4u32, self.version, buf);
15450                }
15451                self.__buffa_unknown_fields.write_to(buf);
15452            }
15453        }
15454        /// Serializes this view as protobuf JSON.
15455        ///
15456        /// Implicit-presence fields with default values are omitted, `required`
15457        /// fields are always emitted, explicit-presence (`optional`) fields are
15458        /// emitted only when set, bytes fields are base64-encoded, and enum
15459        /// values are their proto name strings.
15460        ///
15461        /// This impl uses `serialize_map(None)` because the number of emitted
15462        /// fields depends on default-omission rules; serializers that require
15463        /// known map lengths (e.g. `bincode`) will return a runtime error.
15464        /// Use the owned message type for those formats.
15465        impl<'__a> ::serde::Serialize for GetLayoutTemplateVersionResponseView<'__a> {
15466            fn serialize<__S: ::serde::Serializer>(
15467                &self,
15468                __s: __S,
15469            ) -> ::core::result::Result<__S::Ok, __S::Error> {
15470                use ::serde::ser::SerializeMap as _;
15471                let mut __map = __s.serialize_map(::core::option::Option::None)?;
15472                {
15473                    if let ::core::option::Option::Some(__v) = self.layout.as_option() {
15474                        __map.serialize_entry("layout", __v)?;
15475                    }
15476                }
15477                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.owner_id) {
15478                    __map
15479                        .serialize_entry(
15480                            "ownerId",
15481                            &::buffa::json_helpers::ProtoJson(&self.owner_id),
15482                        )?;
15483                }
15484                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.template_id) {
15485                    __map
15486                        .serialize_entry(
15487                            "templateId",
15488                            &::buffa::json_helpers::ProtoJson(&self.template_id),
15489                        )?;
15490                }
15491                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.version) {
15492                    __map
15493                        .serialize_entry(
15494                            "version",
15495                            &::buffa::json_helpers::ProtoJson(&self.version),
15496                        )?;
15497                }
15498                __map.end()
15499            }
15500        }
15501        impl<'a> ::buffa::MessageName for GetLayoutTemplateVersionResponseView<'a> {
15502            const PACKAGE: &'static str = "layout.v1";
15503            const NAME: &'static str = "GetLayoutTemplateVersionResponse";
15504            const FULL_NAME: &'static str = "layout.v1.GetLayoutTemplateVersionResponse";
15505            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.GetLayoutTemplateVersionResponse";
15506        }
15507        ::buffa::impl_default_view_instance!(GetLayoutTemplateVersionResponseView);
15508        ::buffa::impl_view_reborrow!(GetLayoutTemplateVersionResponseView);
15509        /** Self-contained, `'static` owned view of a `GetLayoutTemplateVersionResponse` message.
15510
15511 Wraps [`::buffa::OwnedView`]`<`[`GetLayoutTemplateVersionResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
15512
15513 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`GetLayoutTemplateVersionResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
15514        #[derive(Clone, Debug)]
15515        pub struct GetLayoutTemplateVersionResponseOwnedView(
15516            ::buffa::OwnedView<GetLayoutTemplateVersionResponseView<'static>>,
15517        );
15518        impl GetLayoutTemplateVersionResponseOwnedView {
15519            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
15520            ///
15521            /// The view borrows directly from the buffer's data; the buffer is
15522            /// retained inside the returned handle.
15523            ///
15524            /// # Errors
15525            ///
15526            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
15527            /// protobuf data.
15528            pub fn decode(
15529                bytes: ::buffa::bytes::Bytes,
15530            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15531                ::core::result::Result::Ok(
15532                    GetLayoutTemplateVersionResponseOwnedView(
15533                        ::buffa::OwnedView::decode(bytes)?,
15534                    ),
15535                )
15536            }
15537            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
15538            /// max message size).
15539            ///
15540            /// # Errors
15541            ///
15542            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
15543            /// exceeds the configured limits.
15544            pub fn decode_with_options(
15545                bytes: ::buffa::bytes::Bytes,
15546                opts: &::buffa::DecodeOptions,
15547            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15548                ::core::result::Result::Ok(
15549                    GetLayoutTemplateVersionResponseOwnedView(
15550                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
15551                    ),
15552                )
15553            }
15554            /// Build from an owned message via an encode → decode round-trip.
15555            ///
15556            /// # Errors
15557            ///
15558            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
15559            /// somehow invalid (should not happen for well-formed messages).
15560            pub fn from_owned(
15561                msg: &super::super::GetLayoutTemplateVersionResponse,
15562            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15563                ::core::result::Result::Ok(
15564                    GetLayoutTemplateVersionResponseOwnedView(
15565                        ::buffa::OwnedView::from_owned(msg)?,
15566                    ),
15567                )
15568            }
15569            /// Borrow the full [`GetLayoutTemplateVersionResponseView`] with its lifetime tied to `&self`.
15570            #[must_use]
15571            pub fn view(&self) -> &GetLayoutTemplateVersionResponseView<'_> {
15572                self.0.reborrow()
15573            }
15574            /// Convert to the owned message type.
15575            ///
15576            /// # Errors
15577            ///
15578            /// Returns an error if re-materializing preserved unknown fields
15579            /// fails (e.g. the unknown-field limit is exceeded).
15580            pub fn to_owned_message(
15581                &self,
15582            ) -> ::core::result::Result<
15583                super::super::GetLayoutTemplateVersionResponse,
15584                ::buffa::DecodeError,
15585            > {
15586                self.0.to_owned_message()
15587            }
15588            /// The underlying bytes buffer.
15589            #[must_use]
15590            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
15591                self.0.bytes()
15592            }
15593            /// Consume the handle, returning the underlying bytes buffer.
15594            #[must_use]
15595            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
15596                self.0.into_bytes()
15597            }
15598            /// Layout snapshot captured for the requested version.
15599            ///
15600            /// Field 1: `layout`
15601            #[must_use]
15602            pub fn layout(
15603                &self,
15604            ) -> &::buffa::MessageFieldView<
15605                super::super::__buffa::view::LayoutView<'_>,
15606            > {
15607                &self.0.reborrow().layout
15608            }
15609            /// Viewer that owns the template.
15610            ///
15611            /// Field 2: `owner_id`
15612            #[must_use]
15613            pub fn owner_id(&self) -> u64 {
15614                self.0.reborrow().owner_id
15615            }
15616            /// Template identifier.
15617            ///
15618            /// Field 3: `template_id`
15619            #[must_use]
15620            pub fn template_id(&self) -> u64 {
15621                self.0.reborrow().template_id
15622            }
15623            /// Immutable version number returned.
15624            ///
15625            /// Field 4: `version`
15626            #[must_use]
15627            pub fn version(&self) -> u32 {
15628                self.0.reborrow().version
15629            }
15630        }
15631        impl ::core::convert::From<
15632            ::buffa::OwnedView<GetLayoutTemplateVersionResponseView<'static>>,
15633        > for GetLayoutTemplateVersionResponseOwnedView {
15634            fn from(
15635                inner: ::buffa::OwnedView<GetLayoutTemplateVersionResponseView<'static>>,
15636            ) -> Self {
15637                GetLayoutTemplateVersionResponseOwnedView(inner)
15638            }
15639        }
15640        impl ::core::convert::From<GetLayoutTemplateVersionResponseOwnedView>
15641        for ::buffa::OwnedView<GetLayoutTemplateVersionResponseView<'static>> {
15642            fn from(wrapper: GetLayoutTemplateVersionResponseOwnedView) -> Self {
15643                wrapper.0
15644            }
15645        }
15646        impl ::core::convert::AsRef<
15647            ::buffa::OwnedView<GetLayoutTemplateVersionResponseView<'static>>,
15648        > for GetLayoutTemplateVersionResponseOwnedView {
15649            fn as_ref(
15650                &self,
15651            ) -> &::buffa::OwnedView<GetLayoutTemplateVersionResponseView<'static>> {
15652                &self.0
15653            }
15654        }
15655        impl ::buffa::HasMessageView for super::super::GetLayoutTemplateVersionResponse {
15656            type View<'a> = GetLayoutTemplateVersionResponseView<'a>;
15657            type ViewHandle = GetLayoutTemplateVersionResponseOwnedView;
15658        }
15659        impl ::serde::Serialize for GetLayoutTemplateVersionResponseOwnedView {
15660            fn serialize<__S: ::serde::Serializer>(
15661                &self,
15662                __s: __S,
15663            ) -> ::core::result::Result<__S::Ok, __S::Error> {
15664                ::serde::Serialize::serialize(&self.0, __s)
15665            }
15666        }
15667        /// PublishLayoutRequest creates a new immutable template version from a saved layout.
15668        #[derive(Clone, Debug, Default)]
15669        pub struct PublishLayoutRequestView<'a> {
15670            /// Saved layout identifier to publish.
15671            ///
15672            /// Field 1: `layout_id`
15673            pub layout_id: u64,
15674            /// Public display title.
15675            ///
15676            /// Field 2: `title`
15677            pub title: &'a str,
15678            /// Public description shown with the template.
15679            ///
15680            /// Field 3: `description`
15681            pub description: &'a str,
15682            /// Public tags used for grouping or filtering.
15683            ///
15684            /// Field 4: `tags`
15685            pub tags: ::buffa::RepeatedView<'a, &'a str>,
15686            /// True when the template should appear in discovery listings.
15687            ///
15688            /// Field 5: `is_listed`
15689            pub is_listed: bool,
15690            /// Optional release notes for the new immutable version.
15691            ///
15692            /// Field 6: `changelog`
15693            pub changelog: &'a str,
15694            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
15695        }
15696        impl<'a> ::buffa::MessageView<'a> for PublishLayoutRequestView<'a> {
15697            type Owned = super::super::PublishLayoutRequest;
15698            fn decode_view(
15699                buf: &'a [u8],
15700            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15701                let __limit = ::core::cell::Cell::new(
15702                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
15703                );
15704                <Self as ::buffa::MessageView>::decode_view_ctx(
15705                    buf,
15706                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
15707                )
15708            }
15709            fn decode_view_with_ctx(
15710                buf: &'a [u8],
15711                ctx: ::buffa::DecodeContext<'_>,
15712            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15713                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
15714            }
15715            fn merge_view_field(
15716                &mut self,
15717                tag: ::buffa::encoding::Tag,
15718                cur: &'a [u8],
15719                before_tag: &'a [u8],
15720                ctx: ::buffa::DecodeContext<'_>,
15721            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
15722                let _ = ctx;
15723                #[allow(unused_variables)]
15724                let view = self;
15725                let mut cur = cur;
15726                match tag.field_number() {
15727                    1u32 => {
15728                        ::buffa::encoding::check_wire_type(
15729                            tag,
15730                            ::buffa::encoding::WireType::Fixed64,
15731                        )?;
15732                        view.layout_id = ::buffa::types::decode_fixed64(&mut cur)?;
15733                    }
15734                    2u32 => {
15735                        ::buffa::encoding::check_wire_type(
15736                            tag,
15737                            ::buffa::encoding::WireType::LengthDelimited,
15738                        )?;
15739                        view.title = ::buffa::types::borrow_str(&mut cur)?;
15740                    }
15741                    3u32 => {
15742                        ::buffa::encoding::check_wire_type(
15743                            tag,
15744                            ::buffa::encoding::WireType::LengthDelimited,
15745                        )?;
15746                        view.description = ::buffa::types::borrow_str(&mut cur)?;
15747                    }
15748                    5u32 => {
15749                        ::buffa::encoding::check_wire_type(
15750                            tag,
15751                            ::buffa::encoding::WireType::Varint,
15752                        )?;
15753                        view.is_listed = ::buffa::types::decode_bool(&mut cur)?;
15754                    }
15755                    6u32 => {
15756                        ::buffa::encoding::check_wire_type(
15757                            tag,
15758                            ::buffa::encoding::WireType::LengthDelimited,
15759                        )?;
15760                        view.changelog = ::buffa::types::borrow_str(&mut cur)?;
15761                    }
15762                    4u32 => {
15763                        ::buffa::encoding::check_wire_type(
15764                            tag,
15765                            ::buffa::encoding::WireType::LengthDelimited,
15766                        )?;
15767                        view.tags.push(::buffa::types::borrow_str(&mut cur)?);
15768                    }
15769                    _ => {
15770                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
15771                        let span_len = before_tag.len() - cur.len();
15772                        view.__buffa_unknown_fields
15773                            .push_record(before_tag, span_len, ctx)?;
15774                    }
15775                }
15776                ::core::result::Result::Ok(cur)
15777            }
15778            fn to_owned_message(
15779                &self,
15780            ) -> ::core::result::Result<
15781                super::super::PublishLayoutRequest,
15782                ::buffa::DecodeError,
15783            > {
15784                self.to_owned_from_source(None)
15785            }
15786            #[allow(clippy::useless_conversion, clippy::needless_update)]
15787            fn to_owned_from_source(
15788                &self,
15789                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
15790            ) -> ::core::result::Result<
15791                super::super::PublishLayoutRequest,
15792                ::buffa::DecodeError,
15793            > {
15794                #[allow(unused_imports)]
15795                use ::buffa::alloc::string::ToString as _;
15796                let _ = __buffa_src;
15797                ::core::result::Result::Ok(super::super::PublishLayoutRequest {
15798                    layout_id: self.layout_id,
15799                    title: self.title.to_string(),
15800                    description: self.description.to_string(),
15801                    tags: self.tags.iter().map(|s| s.to_string()).collect(),
15802                    is_listed: self.is_listed,
15803                    changelog: self.changelog.to_string(),
15804                    __buffa_unknown_fields: self
15805                        .__buffa_unknown_fields
15806                        .to_owned()?
15807                        .into(),
15808                    ..::core::default::Default::default()
15809                })
15810            }
15811        }
15812        impl<'a> ::buffa::ViewEncode<'a> for PublishLayoutRequestView<'a> {
15813            #[allow(clippy::needless_borrow, clippy::let_and_return)]
15814            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
15815                #[allow(unused_imports)]
15816                use ::buffa::Enumeration as _;
15817                let mut size = 0u32;
15818                if self.layout_id != 0u64 {
15819                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
15820                }
15821                if !self.title.is_empty() {
15822                    size
15823                        += 1u32 + ::buffa::types::string_encoded_len(&self.title) as u32;
15824                }
15825                if !self.description.is_empty() {
15826                    size
15827                        += 1u32
15828                            + ::buffa::types::string_encoded_len(&self.description)
15829                                as u32;
15830                }
15831                for v in &self.tags {
15832                    size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
15833                }
15834                if self.is_listed {
15835                    size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
15836                }
15837                if !self.changelog.is_empty() {
15838                    size
15839                        += 1u32
15840                            + ::buffa::types::string_encoded_len(&self.changelog) as u32;
15841                }
15842                size += self.__buffa_unknown_fields.encoded_len() as u32;
15843                size
15844            }
15845            #[allow(clippy::needless_borrow)]
15846            fn write_to(
15847                &self,
15848                _cache: &mut ::buffa::SizeCache,
15849                buf: &mut impl ::buffa::bytes::BufMut,
15850            ) {
15851                #[allow(unused_imports)]
15852                use ::buffa::Enumeration as _;
15853                if self.layout_id != 0u64 {
15854                    ::buffa::types::put_fixed64_field(1u32, self.layout_id, buf);
15855                }
15856                if !self.title.is_empty() {
15857                    ::buffa::types::put_string_field(2u32, &self.title, buf);
15858                }
15859                if !self.description.is_empty() {
15860                    ::buffa::types::put_string_field(3u32, &self.description, buf);
15861                }
15862                for v in &self.tags {
15863                    ::buffa::types::put_string_field(4u32, v, buf);
15864                }
15865                if self.is_listed {
15866                    ::buffa::types::put_bool_field(5u32, self.is_listed, buf);
15867                }
15868                if !self.changelog.is_empty() {
15869                    ::buffa::types::put_string_field(6u32, &self.changelog, buf);
15870                }
15871                self.__buffa_unknown_fields.write_to(buf);
15872            }
15873        }
15874        /// Serializes this view as protobuf JSON.
15875        ///
15876        /// Implicit-presence fields with default values are omitted, `required`
15877        /// fields are always emitted, explicit-presence (`optional`) fields are
15878        /// emitted only when set, bytes fields are base64-encoded, and enum
15879        /// values are their proto name strings.
15880        ///
15881        /// This impl uses `serialize_map(None)` because the number of emitted
15882        /// fields depends on default-omission rules; serializers that require
15883        /// known map lengths (e.g. `bincode`) will return a runtime error.
15884        /// Use the owned message type for those formats.
15885        impl<'__a> ::serde::Serialize for PublishLayoutRequestView<'__a> {
15886            fn serialize<__S: ::serde::Serializer>(
15887                &self,
15888                __s: __S,
15889            ) -> ::core::result::Result<__S::Ok, __S::Error> {
15890                use ::serde::ser::SerializeMap as _;
15891                let mut __map = __s.serialize_map(::core::option::Option::None)?;
15892                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.layout_id) {
15893                    __map
15894                        .serialize_entry(
15895                            "layoutId",
15896                            &::buffa::json_helpers::ProtoJson(&self.layout_id),
15897                        )?;
15898                }
15899                if !::buffa::json_helpers::skip_if::is_empty_str(self.title) {
15900                    __map.serialize_entry("title", self.title)?;
15901                }
15902                if !::buffa::json_helpers::skip_if::is_empty_str(self.description) {
15903                    __map.serialize_entry("description", self.description)?;
15904                }
15905                if !self.tags.is_empty() {
15906                    __map.serialize_entry("tags", &*self.tags)?;
15907                }
15908                if self.is_listed {
15909                    __map.serialize_entry("isListed", &self.is_listed)?;
15910                }
15911                if !::buffa::json_helpers::skip_if::is_empty_str(self.changelog) {
15912                    __map.serialize_entry("changelog", self.changelog)?;
15913                }
15914                __map.end()
15915            }
15916        }
15917        impl<'a> ::buffa::MessageName for PublishLayoutRequestView<'a> {
15918            const PACKAGE: &'static str = "layout.v1";
15919            const NAME: &'static str = "PublishLayoutRequest";
15920            const FULL_NAME: &'static str = "layout.v1.PublishLayoutRequest";
15921            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.PublishLayoutRequest";
15922        }
15923        ::buffa::impl_default_view_instance!(PublishLayoutRequestView);
15924        ::buffa::impl_view_reborrow!(PublishLayoutRequestView);
15925        /** Self-contained, `'static` owned view of a `PublishLayoutRequest` message.
15926
15927 Wraps [`::buffa::OwnedView`]`<`[`PublishLayoutRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
15928
15929 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`PublishLayoutRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
15930        #[derive(Clone, Debug)]
15931        pub struct PublishLayoutRequestOwnedView(
15932            ::buffa::OwnedView<PublishLayoutRequestView<'static>>,
15933        );
15934        impl PublishLayoutRequestOwnedView {
15935            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
15936            ///
15937            /// The view borrows directly from the buffer's data; the buffer is
15938            /// retained inside the returned handle.
15939            ///
15940            /// # Errors
15941            ///
15942            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
15943            /// protobuf data.
15944            pub fn decode(
15945                bytes: ::buffa::bytes::Bytes,
15946            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15947                ::core::result::Result::Ok(
15948                    PublishLayoutRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
15949                )
15950            }
15951            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
15952            /// max message size).
15953            ///
15954            /// # Errors
15955            ///
15956            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
15957            /// exceeds the configured limits.
15958            pub fn decode_with_options(
15959                bytes: ::buffa::bytes::Bytes,
15960                opts: &::buffa::DecodeOptions,
15961            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15962                ::core::result::Result::Ok(
15963                    PublishLayoutRequestOwnedView(
15964                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
15965                    ),
15966                )
15967            }
15968            /// Build from an owned message via an encode → decode round-trip.
15969            ///
15970            /// # Errors
15971            ///
15972            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
15973            /// somehow invalid (should not happen for well-formed messages).
15974            pub fn from_owned(
15975                msg: &super::super::PublishLayoutRequest,
15976            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
15977                ::core::result::Result::Ok(
15978                    PublishLayoutRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
15979                )
15980            }
15981            /// Borrow the full [`PublishLayoutRequestView`] with its lifetime tied to `&self`.
15982            #[must_use]
15983            pub fn view(&self) -> &PublishLayoutRequestView<'_> {
15984                self.0.reborrow()
15985            }
15986            /// Convert to the owned message type.
15987            ///
15988            /// # Errors
15989            ///
15990            /// Returns an error if re-materializing preserved unknown fields
15991            /// fails (e.g. the unknown-field limit is exceeded).
15992            pub fn to_owned_message(
15993                &self,
15994            ) -> ::core::result::Result<
15995                super::super::PublishLayoutRequest,
15996                ::buffa::DecodeError,
15997            > {
15998                self.0.to_owned_message()
15999            }
16000            /// The underlying bytes buffer.
16001            #[must_use]
16002            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
16003                self.0.bytes()
16004            }
16005            /// Consume the handle, returning the underlying bytes buffer.
16006            #[must_use]
16007            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
16008                self.0.into_bytes()
16009            }
16010            /// Saved layout identifier to publish.
16011            ///
16012            /// Field 1: `layout_id`
16013            #[must_use]
16014            pub fn layout_id(&self) -> u64 {
16015                self.0.reborrow().layout_id
16016            }
16017            /// Public display title.
16018            ///
16019            /// Field 2: `title`
16020            #[must_use]
16021            pub fn title(&self) -> &'_ str {
16022                self.0.reborrow().title
16023            }
16024            /// Public description shown with the template.
16025            ///
16026            /// Field 3: `description`
16027            #[must_use]
16028            pub fn description(&self) -> &'_ str {
16029                self.0.reborrow().description
16030            }
16031            /// Public tags used for grouping or filtering.
16032            ///
16033            /// Field 4: `tags`
16034            #[must_use]
16035            pub fn tags(&self) -> &::buffa::RepeatedView<'_, &'_ str> {
16036                &self.0.reborrow().tags
16037            }
16038            /// True when the template should appear in discovery listings.
16039            ///
16040            /// Field 5: `is_listed`
16041            #[must_use]
16042            pub fn is_listed(&self) -> bool {
16043                self.0.reborrow().is_listed
16044            }
16045            /// Optional release notes for the new immutable version.
16046            ///
16047            /// Field 6: `changelog`
16048            #[must_use]
16049            pub fn changelog(&self) -> &'_ str {
16050                self.0.reborrow().changelog
16051            }
16052        }
16053        impl ::core::convert::From<::buffa::OwnedView<PublishLayoutRequestView<'static>>>
16054        for PublishLayoutRequestOwnedView {
16055            fn from(
16056                inner: ::buffa::OwnedView<PublishLayoutRequestView<'static>>,
16057            ) -> Self {
16058                PublishLayoutRequestOwnedView(inner)
16059            }
16060        }
16061        impl ::core::convert::From<PublishLayoutRequestOwnedView>
16062        for ::buffa::OwnedView<PublishLayoutRequestView<'static>> {
16063            fn from(wrapper: PublishLayoutRequestOwnedView) -> Self {
16064                wrapper.0
16065            }
16066        }
16067        impl ::core::convert::AsRef<
16068            ::buffa::OwnedView<PublishLayoutRequestView<'static>>,
16069        > for PublishLayoutRequestOwnedView {
16070            fn as_ref(&self) -> &::buffa::OwnedView<PublishLayoutRequestView<'static>> {
16071                &self.0
16072            }
16073        }
16074        impl ::buffa::HasMessageView for super::super::PublishLayoutRequest {
16075            type View<'a> = PublishLayoutRequestView<'a>;
16076            type ViewHandle = PublishLayoutRequestOwnedView;
16077        }
16078        impl ::serde::Serialize for PublishLayoutRequestOwnedView {
16079            fn serialize<__S: ::serde::Serializer>(
16080                &self,
16081                __s: __S,
16082            ) -> ::core::result::Result<__S::Ok, __S::Error> {
16083                ::serde::Serialize::serialize(&self.0, __s)
16084            }
16085        }
16086        /// PublishLayoutResponse returns the published template and version number.
16087        #[derive(Clone, Debug, Default)]
16088        pub struct PublishLayoutResponseView<'a> {
16089            /// Published template metadata after the update.
16090            ///
16091            /// Field 1: `template`
16092            pub template: ::buffa::MessageFieldView<
16093                super::super::__buffa::view::LayoutTemplateView<'a>,
16094            >,
16095            /// Immutable version number created by this publish operation.
16096            ///
16097            /// Field 2: `version`
16098            pub version: u32,
16099            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
16100        }
16101        impl<'a> ::buffa::MessageView<'a> for PublishLayoutResponseView<'a> {
16102            type Owned = super::super::PublishLayoutResponse;
16103            fn decode_view(
16104                buf: &'a [u8],
16105            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16106                let __limit = ::core::cell::Cell::new(
16107                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
16108                );
16109                <Self as ::buffa::MessageView>::decode_view_ctx(
16110                    buf,
16111                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
16112                )
16113            }
16114            fn decode_view_with_ctx(
16115                buf: &'a [u8],
16116                ctx: ::buffa::DecodeContext<'_>,
16117            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16118                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
16119            }
16120            fn merge_view_field(
16121                &mut self,
16122                tag: ::buffa::encoding::Tag,
16123                cur: &'a [u8],
16124                before_tag: &'a [u8],
16125                ctx: ::buffa::DecodeContext<'_>,
16126            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
16127                let _ = ctx;
16128                #[allow(unused_variables)]
16129                let view = self;
16130                let mut cur = cur;
16131                match tag.field_number() {
16132                    1u32 => {
16133                        ::buffa::encoding::check_wire_type(
16134                            tag,
16135                            ::buffa::encoding::WireType::LengthDelimited,
16136                        )?;
16137                        let __sub_ctx = ctx.descend()?;
16138                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
16139                        match view.template.as_mut() {
16140                            Some(existing) => {
16141                                ::buffa::MessageView::merge_into_view(
16142                                    existing,
16143                                    sub,
16144                                    __sub_ctx,
16145                                )?
16146                            }
16147                            None => {
16148                                view.template = ::buffa::MessageFieldView::set(
16149                                    <super::super::__buffa::view::LayoutTemplateView as ::buffa::MessageView>::decode_view_ctx(
16150                                        sub,
16151                                        __sub_ctx,
16152                                    )?,
16153                                );
16154                            }
16155                        }
16156                    }
16157                    2u32 => {
16158                        ::buffa::encoding::check_wire_type(
16159                            tag,
16160                            ::buffa::encoding::WireType::Varint,
16161                        )?;
16162                        view.version = ::buffa::types::decode_uint32(&mut cur)?;
16163                    }
16164                    _ => {
16165                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
16166                        let span_len = before_tag.len() - cur.len();
16167                        view.__buffa_unknown_fields
16168                            .push_record(before_tag, span_len, ctx)?;
16169                    }
16170                }
16171                ::core::result::Result::Ok(cur)
16172            }
16173            fn to_owned_message(
16174                &self,
16175            ) -> ::core::result::Result<
16176                super::super::PublishLayoutResponse,
16177                ::buffa::DecodeError,
16178            > {
16179                self.to_owned_from_source(None)
16180            }
16181            #[allow(clippy::useless_conversion, clippy::needless_update)]
16182            fn to_owned_from_source(
16183                &self,
16184                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
16185            ) -> ::core::result::Result<
16186                super::super::PublishLayoutResponse,
16187                ::buffa::DecodeError,
16188            > {
16189                #[allow(unused_imports)]
16190                use ::buffa::alloc::string::ToString as _;
16191                let _ = __buffa_src;
16192                ::core::result::Result::Ok(super::super::PublishLayoutResponse {
16193                    template: match self.template.as_option() {
16194                        Some(v) => {
16195                            ::buffa::MessageField::<
16196                                super::super::LayoutTemplate,
16197                            >::some(v.to_owned_from_source(__buffa_src)?)
16198                        }
16199                        None => ::buffa::MessageField::none(),
16200                    },
16201                    version: self.version,
16202                    __buffa_unknown_fields: self
16203                        .__buffa_unknown_fields
16204                        .to_owned()?
16205                        .into(),
16206                    ..::core::default::Default::default()
16207                })
16208            }
16209        }
16210        impl<'a> ::buffa::ViewEncode<'a> for PublishLayoutResponseView<'a> {
16211            #[allow(clippy::needless_borrow, clippy::let_and_return)]
16212            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
16213                #[allow(unused_imports)]
16214                use ::buffa::Enumeration as _;
16215                let mut size = 0u32;
16216                if self.template.is_set() {
16217                    let __slot = __cache.reserve();
16218                    let inner_size = self.template.compute_size(__cache);
16219                    __cache.set(__slot, inner_size);
16220                    size
16221                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
16222                            + inner_size;
16223                }
16224                if self.version != 0u32 {
16225                    size
16226                        += 1u32
16227                            + ::buffa::types::uint32_encoded_len(self.version) as u32;
16228                }
16229                size += self.__buffa_unknown_fields.encoded_len() as u32;
16230                size
16231            }
16232            #[allow(clippy::needless_borrow)]
16233            fn write_to(
16234                &self,
16235                __cache: &mut ::buffa::SizeCache,
16236                buf: &mut impl ::buffa::bytes::BufMut,
16237            ) {
16238                #[allow(unused_imports)]
16239                use ::buffa::Enumeration as _;
16240                if self.template.is_set() {
16241                    ::buffa::types::put_len_delimited_header(
16242                        1u32,
16243                        __cache.consume_next(),
16244                        buf,
16245                    );
16246                    self.template.write_to(__cache, buf);
16247                }
16248                if self.version != 0u32 {
16249                    ::buffa::types::put_uint32_field(2u32, self.version, buf);
16250                }
16251                self.__buffa_unknown_fields.write_to(buf);
16252            }
16253        }
16254        /// Serializes this view as protobuf JSON.
16255        ///
16256        /// Implicit-presence fields with default values are omitted, `required`
16257        /// fields are always emitted, explicit-presence (`optional`) fields are
16258        /// emitted only when set, bytes fields are base64-encoded, and enum
16259        /// values are their proto name strings.
16260        ///
16261        /// This impl uses `serialize_map(None)` because the number of emitted
16262        /// fields depends on default-omission rules; serializers that require
16263        /// known map lengths (e.g. `bincode`) will return a runtime error.
16264        /// Use the owned message type for those formats.
16265        impl<'__a> ::serde::Serialize for PublishLayoutResponseView<'__a> {
16266            fn serialize<__S: ::serde::Serializer>(
16267                &self,
16268                __s: __S,
16269            ) -> ::core::result::Result<__S::Ok, __S::Error> {
16270                use ::serde::ser::SerializeMap as _;
16271                let mut __map = __s.serialize_map(::core::option::Option::None)?;
16272                {
16273                    if let ::core::option::Option::Some(__v) = self.template.as_option()
16274                    {
16275                        __map.serialize_entry("template", __v)?;
16276                    }
16277                }
16278                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.version) {
16279                    __map
16280                        .serialize_entry(
16281                            "version",
16282                            &::buffa::json_helpers::ProtoJson(&self.version),
16283                        )?;
16284                }
16285                __map.end()
16286            }
16287        }
16288        impl<'a> ::buffa::MessageName for PublishLayoutResponseView<'a> {
16289            const PACKAGE: &'static str = "layout.v1";
16290            const NAME: &'static str = "PublishLayoutResponse";
16291            const FULL_NAME: &'static str = "layout.v1.PublishLayoutResponse";
16292            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.PublishLayoutResponse";
16293        }
16294        ::buffa::impl_default_view_instance!(PublishLayoutResponseView);
16295        ::buffa::impl_view_reborrow!(PublishLayoutResponseView);
16296        /** Self-contained, `'static` owned view of a `PublishLayoutResponse` message.
16297
16298 Wraps [`::buffa::OwnedView`]`<`[`PublishLayoutResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
16299
16300 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`PublishLayoutResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
16301        #[derive(Clone, Debug)]
16302        pub struct PublishLayoutResponseOwnedView(
16303            ::buffa::OwnedView<PublishLayoutResponseView<'static>>,
16304        );
16305        impl PublishLayoutResponseOwnedView {
16306            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
16307            ///
16308            /// The view borrows directly from the buffer's data; the buffer is
16309            /// retained inside the returned handle.
16310            ///
16311            /// # Errors
16312            ///
16313            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
16314            /// protobuf data.
16315            pub fn decode(
16316                bytes: ::buffa::bytes::Bytes,
16317            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16318                ::core::result::Result::Ok(
16319                    PublishLayoutResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
16320                )
16321            }
16322            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
16323            /// max message size).
16324            ///
16325            /// # Errors
16326            ///
16327            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
16328            /// exceeds the configured limits.
16329            pub fn decode_with_options(
16330                bytes: ::buffa::bytes::Bytes,
16331                opts: &::buffa::DecodeOptions,
16332            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16333                ::core::result::Result::Ok(
16334                    PublishLayoutResponseOwnedView(
16335                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
16336                    ),
16337                )
16338            }
16339            /// Build from an owned message via an encode → decode round-trip.
16340            ///
16341            /// # Errors
16342            ///
16343            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
16344            /// somehow invalid (should not happen for well-formed messages).
16345            pub fn from_owned(
16346                msg: &super::super::PublishLayoutResponse,
16347            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16348                ::core::result::Result::Ok(
16349                    PublishLayoutResponseOwnedView(::buffa::OwnedView::from_owned(msg)?),
16350                )
16351            }
16352            /// Borrow the full [`PublishLayoutResponseView`] with its lifetime tied to `&self`.
16353            #[must_use]
16354            pub fn view(&self) -> &PublishLayoutResponseView<'_> {
16355                self.0.reborrow()
16356            }
16357            /// Convert to the owned message type.
16358            ///
16359            /// # Errors
16360            ///
16361            /// Returns an error if re-materializing preserved unknown fields
16362            /// fails (e.g. the unknown-field limit is exceeded).
16363            pub fn to_owned_message(
16364                &self,
16365            ) -> ::core::result::Result<
16366                super::super::PublishLayoutResponse,
16367                ::buffa::DecodeError,
16368            > {
16369                self.0.to_owned_message()
16370            }
16371            /// The underlying bytes buffer.
16372            #[must_use]
16373            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
16374                self.0.bytes()
16375            }
16376            /// Consume the handle, returning the underlying bytes buffer.
16377            #[must_use]
16378            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
16379                self.0.into_bytes()
16380            }
16381            /// Published template metadata after the update.
16382            ///
16383            /// Field 1: `template`
16384            #[must_use]
16385            pub fn template(
16386                &self,
16387            ) -> &::buffa::MessageFieldView<
16388                super::super::__buffa::view::LayoutTemplateView<'_>,
16389            > {
16390                &self.0.reborrow().template
16391            }
16392            /// Immutable version number created by this publish operation.
16393            ///
16394            /// Field 2: `version`
16395            #[must_use]
16396            pub fn version(&self) -> u32 {
16397                self.0.reborrow().version
16398            }
16399        }
16400        impl ::core::convert::From<
16401            ::buffa::OwnedView<PublishLayoutResponseView<'static>>,
16402        > for PublishLayoutResponseOwnedView {
16403            fn from(
16404                inner: ::buffa::OwnedView<PublishLayoutResponseView<'static>>,
16405            ) -> Self {
16406                PublishLayoutResponseOwnedView(inner)
16407            }
16408        }
16409        impl ::core::convert::From<PublishLayoutResponseOwnedView>
16410        for ::buffa::OwnedView<PublishLayoutResponseView<'static>> {
16411            fn from(wrapper: PublishLayoutResponseOwnedView) -> Self {
16412                wrapper.0
16413            }
16414        }
16415        impl ::core::convert::AsRef<
16416            ::buffa::OwnedView<PublishLayoutResponseView<'static>>,
16417        > for PublishLayoutResponseOwnedView {
16418            fn as_ref(&self) -> &::buffa::OwnedView<PublishLayoutResponseView<'static>> {
16419                &self.0
16420            }
16421        }
16422        impl ::buffa::HasMessageView for super::super::PublishLayoutResponse {
16423            type View<'a> = PublishLayoutResponseView<'a>;
16424            type ViewHandle = PublishLayoutResponseOwnedView;
16425        }
16426        impl ::serde::Serialize for PublishLayoutResponseOwnedView {
16427            fn serialize<__S: ::serde::Serializer>(
16428                &self,
16429                __s: __S,
16430            ) -> ::core::result::Result<__S::Ok, __S::Error> {
16431                ::serde::Serialize::serialize(&self.0, __s)
16432            }
16433        }
16434        /// UnpublishLayoutRequest removes a template from discovery listings.
16435        #[derive(Clone, Debug, Default)]
16436        pub struct UnpublishLayoutRequestView<'a> {
16437            /// Removes the template from discovery (unlisted). Versions and share links remain.
16438            ///
16439            /// Field 1: `template_id`
16440            pub template_id: u64,
16441            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
16442        }
16443        impl<'a> ::buffa::MessageView<'a> for UnpublishLayoutRequestView<'a> {
16444            type Owned = super::super::UnpublishLayoutRequest;
16445            fn decode_view(
16446                buf: &'a [u8],
16447            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16448                let __limit = ::core::cell::Cell::new(
16449                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
16450                );
16451                <Self as ::buffa::MessageView>::decode_view_ctx(
16452                    buf,
16453                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
16454                )
16455            }
16456            fn decode_view_with_ctx(
16457                buf: &'a [u8],
16458                ctx: ::buffa::DecodeContext<'_>,
16459            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16460                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
16461            }
16462            fn merge_view_field(
16463                &mut self,
16464                tag: ::buffa::encoding::Tag,
16465                cur: &'a [u8],
16466                before_tag: &'a [u8],
16467                ctx: ::buffa::DecodeContext<'_>,
16468            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
16469                let _ = ctx;
16470                #[allow(unused_variables)]
16471                let view = self;
16472                let mut cur = cur;
16473                match tag.field_number() {
16474                    1u32 => {
16475                        ::buffa::encoding::check_wire_type(
16476                            tag,
16477                            ::buffa::encoding::WireType::Fixed64,
16478                        )?;
16479                        view.template_id = ::buffa::types::decode_fixed64(&mut cur)?;
16480                    }
16481                    _ => {
16482                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
16483                        let span_len = before_tag.len() - cur.len();
16484                        view.__buffa_unknown_fields
16485                            .push_record(before_tag, span_len, ctx)?;
16486                    }
16487                }
16488                ::core::result::Result::Ok(cur)
16489            }
16490            fn to_owned_message(
16491                &self,
16492            ) -> ::core::result::Result<
16493                super::super::UnpublishLayoutRequest,
16494                ::buffa::DecodeError,
16495            > {
16496                self.to_owned_from_source(None)
16497            }
16498            #[allow(clippy::useless_conversion, clippy::needless_update)]
16499            fn to_owned_from_source(
16500                &self,
16501                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
16502            ) -> ::core::result::Result<
16503                super::super::UnpublishLayoutRequest,
16504                ::buffa::DecodeError,
16505            > {
16506                #[allow(unused_imports)]
16507                use ::buffa::alloc::string::ToString as _;
16508                let _ = __buffa_src;
16509                ::core::result::Result::Ok(super::super::UnpublishLayoutRequest {
16510                    template_id: self.template_id,
16511                    __buffa_unknown_fields: self
16512                        .__buffa_unknown_fields
16513                        .to_owned()?
16514                        .into(),
16515                    ..::core::default::Default::default()
16516                })
16517            }
16518        }
16519        impl<'a> ::buffa::ViewEncode<'a> for UnpublishLayoutRequestView<'a> {
16520            #[allow(clippy::needless_borrow, clippy::let_and_return)]
16521            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
16522                #[allow(unused_imports)]
16523                use ::buffa::Enumeration as _;
16524                let mut size = 0u32;
16525                if self.template_id != 0u64 {
16526                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
16527                }
16528                size += self.__buffa_unknown_fields.encoded_len() as u32;
16529                size
16530            }
16531            #[allow(clippy::needless_borrow)]
16532            fn write_to(
16533                &self,
16534                _cache: &mut ::buffa::SizeCache,
16535                buf: &mut impl ::buffa::bytes::BufMut,
16536            ) {
16537                #[allow(unused_imports)]
16538                use ::buffa::Enumeration as _;
16539                if self.template_id != 0u64 {
16540                    ::buffa::types::put_fixed64_field(1u32, self.template_id, buf);
16541                }
16542                self.__buffa_unknown_fields.write_to(buf);
16543            }
16544        }
16545        /// Serializes this view as protobuf JSON.
16546        ///
16547        /// Implicit-presence fields with default values are omitted, `required`
16548        /// fields are always emitted, explicit-presence (`optional`) fields are
16549        /// emitted only when set, bytes fields are base64-encoded, and enum
16550        /// values are their proto name strings.
16551        ///
16552        /// This impl uses `serialize_map(None)` because the number of emitted
16553        /// fields depends on default-omission rules; serializers that require
16554        /// known map lengths (e.g. `bincode`) will return a runtime error.
16555        /// Use the owned message type for those formats.
16556        impl<'__a> ::serde::Serialize for UnpublishLayoutRequestView<'__a> {
16557            fn serialize<__S: ::serde::Serializer>(
16558                &self,
16559                __s: __S,
16560            ) -> ::core::result::Result<__S::Ok, __S::Error> {
16561                use ::serde::ser::SerializeMap as _;
16562                let mut __map = __s.serialize_map(::core::option::Option::None)?;
16563                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.template_id) {
16564                    __map
16565                        .serialize_entry(
16566                            "templateId",
16567                            &::buffa::json_helpers::ProtoJson(&self.template_id),
16568                        )?;
16569                }
16570                __map.end()
16571            }
16572        }
16573        impl<'a> ::buffa::MessageName for UnpublishLayoutRequestView<'a> {
16574            const PACKAGE: &'static str = "layout.v1";
16575            const NAME: &'static str = "UnpublishLayoutRequest";
16576            const FULL_NAME: &'static str = "layout.v1.UnpublishLayoutRequest";
16577            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.UnpublishLayoutRequest";
16578        }
16579        ::buffa::impl_default_view_instance!(UnpublishLayoutRequestView);
16580        ::buffa::impl_view_reborrow!(UnpublishLayoutRequestView);
16581        /** Self-contained, `'static` owned view of a `UnpublishLayoutRequest` message.
16582
16583 Wraps [`::buffa::OwnedView`]`<`[`UnpublishLayoutRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
16584
16585 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`UnpublishLayoutRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
16586        #[derive(Clone, Debug)]
16587        pub struct UnpublishLayoutRequestOwnedView(
16588            ::buffa::OwnedView<UnpublishLayoutRequestView<'static>>,
16589        );
16590        impl UnpublishLayoutRequestOwnedView {
16591            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
16592            ///
16593            /// The view borrows directly from the buffer's data; the buffer is
16594            /// retained inside the returned handle.
16595            ///
16596            /// # Errors
16597            ///
16598            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
16599            /// protobuf data.
16600            pub fn decode(
16601                bytes: ::buffa::bytes::Bytes,
16602            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16603                ::core::result::Result::Ok(
16604                    UnpublishLayoutRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
16605                )
16606            }
16607            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
16608            /// max message size).
16609            ///
16610            /// # Errors
16611            ///
16612            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
16613            /// exceeds the configured limits.
16614            pub fn decode_with_options(
16615                bytes: ::buffa::bytes::Bytes,
16616                opts: &::buffa::DecodeOptions,
16617            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16618                ::core::result::Result::Ok(
16619                    UnpublishLayoutRequestOwnedView(
16620                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
16621                    ),
16622                )
16623            }
16624            /// Build from an owned message via an encode → decode round-trip.
16625            ///
16626            /// # Errors
16627            ///
16628            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
16629            /// somehow invalid (should not happen for well-formed messages).
16630            pub fn from_owned(
16631                msg: &super::super::UnpublishLayoutRequest,
16632            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16633                ::core::result::Result::Ok(
16634                    UnpublishLayoutRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
16635                )
16636            }
16637            /// Borrow the full [`UnpublishLayoutRequestView`] with its lifetime tied to `&self`.
16638            #[must_use]
16639            pub fn view(&self) -> &UnpublishLayoutRequestView<'_> {
16640                self.0.reborrow()
16641            }
16642            /// Convert to the owned message type.
16643            ///
16644            /// # Errors
16645            ///
16646            /// Returns an error if re-materializing preserved unknown fields
16647            /// fails (e.g. the unknown-field limit is exceeded).
16648            pub fn to_owned_message(
16649                &self,
16650            ) -> ::core::result::Result<
16651                super::super::UnpublishLayoutRequest,
16652                ::buffa::DecodeError,
16653            > {
16654                self.0.to_owned_message()
16655            }
16656            /// The underlying bytes buffer.
16657            #[must_use]
16658            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
16659                self.0.bytes()
16660            }
16661            /// Consume the handle, returning the underlying bytes buffer.
16662            #[must_use]
16663            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
16664                self.0.into_bytes()
16665            }
16666            /// Removes the template from discovery (unlisted). Versions and share links remain.
16667            ///
16668            /// Field 1: `template_id`
16669            #[must_use]
16670            pub fn template_id(&self) -> u64 {
16671                self.0.reborrow().template_id
16672            }
16673        }
16674        impl ::core::convert::From<
16675            ::buffa::OwnedView<UnpublishLayoutRequestView<'static>>,
16676        > for UnpublishLayoutRequestOwnedView {
16677            fn from(
16678                inner: ::buffa::OwnedView<UnpublishLayoutRequestView<'static>>,
16679            ) -> Self {
16680                UnpublishLayoutRequestOwnedView(inner)
16681            }
16682        }
16683        impl ::core::convert::From<UnpublishLayoutRequestOwnedView>
16684        for ::buffa::OwnedView<UnpublishLayoutRequestView<'static>> {
16685            fn from(wrapper: UnpublishLayoutRequestOwnedView) -> Self {
16686                wrapper.0
16687            }
16688        }
16689        impl ::core::convert::AsRef<
16690            ::buffa::OwnedView<UnpublishLayoutRequestView<'static>>,
16691        > for UnpublishLayoutRequestOwnedView {
16692            fn as_ref(
16693                &self,
16694            ) -> &::buffa::OwnedView<UnpublishLayoutRequestView<'static>> {
16695                &self.0
16696            }
16697        }
16698        impl ::buffa::HasMessageView for super::super::UnpublishLayoutRequest {
16699            type View<'a> = UnpublishLayoutRequestView<'a>;
16700            type ViewHandle = UnpublishLayoutRequestOwnedView;
16701        }
16702        impl ::serde::Serialize for UnpublishLayoutRequestOwnedView {
16703            fn serialize<__S: ::serde::Serializer>(
16704                &self,
16705                __s: __S,
16706            ) -> ::core::result::Result<__S::Ok, __S::Error> {
16707                ::serde::Serialize::serialize(&self.0, __s)
16708            }
16709        }
16710        /// UnpublishLayoutResponse is empty when the template was removed from discovery.
16711        #[derive(Clone, Debug, Default)]
16712        pub struct UnpublishLayoutResponseView<'a> {
16713            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
16714        }
16715        impl<'a> ::buffa::MessageView<'a> for UnpublishLayoutResponseView<'a> {
16716            type Owned = super::super::UnpublishLayoutResponse;
16717            fn decode_view(
16718                buf: &'a [u8],
16719            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16720                let __limit = ::core::cell::Cell::new(
16721                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
16722                );
16723                <Self as ::buffa::MessageView>::decode_view_ctx(
16724                    buf,
16725                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
16726                )
16727            }
16728            fn decode_view_with_ctx(
16729                buf: &'a [u8],
16730                ctx: ::buffa::DecodeContext<'_>,
16731            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16732                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
16733            }
16734            fn merge_view_field(
16735                &mut self,
16736                tag: ::buffa::encoding::Tag,
16737                cur: &'a [u8],
16738                before_tag: &'a [u8],
16739                ctx: ::buffa::DecodeContext<'_>,
16740            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
16741                let _ = ctx;
16742                #[allow(unused_variables)]
16743                let view = self;
16744                let mut cur = cur;
16745                match tag.field_number() {
16746                    _ => {
16747                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
16748                        let span_len = before_tag.len() - cur.len();
16749                        view.__buffa_unknown_fields
16750                            .push_record(before_tag, span_len, ctx)?;
16751                    }
16752                }
16753                ::core::result::Result::Ok(cur)
16754            }
16755            fn to_owned_message(
16756                &self,
16757            ) -> ::core::result::Result<
16758                super::super::UnpublishLayoutResponse,
16759                ::buffa::DecodeError,
16760            > {
16761                self.to_owned_from_source(None)
16762            }
16763            #[allow(clippy::useless_conversion, clippy::needless_update)]
16764            fn to_owned_from_source(
16765                &self,
16766                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
16767            ) -> ::core::result::Result<
16768                super::super::UnpublishLayoutResponse,
16769                ::buffa::DecodeError,
16770            > {
16771                #[allow(unused_imports)]
16772                use ::buffa::alloc::string::ToString as _;
16773                let _ = __buffa_src;
16774                ::core::result::Result::Ok(super::super::UnpublishLayoutResponse {
16775                    __buffa_unknown_fields: self
16776                        .__buffa_unknown_fields
16777                        .to_owned()?
16778                        .into(),
16779                    ..::core::default::Default::default()
16780                })
16781            }
16782        }
16783        impl<'a> ::buffa::ViewEncode<'a> for UnpublishLayoutResponseView<'a> {
16784            #[allow(clippy::needless_borrow, clippy::let_and_return)]
16785            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
16786                #[allow(unused_imports)]
16787                use ::buffa::Enumeration as _;
16788                let mut size = 0u32;
16789                size += self.__buffa_unknown_fields.encoded_len() as u32;
16790                size
16791            }
16792            #[allow(clippy::needless_borrow)]
16793            fn write_to(
16794                &self,
16795                _cache: &mut ::buffa::SizeCache,
16796                buf: &mut impl ::buffa::bytes::BufMut,
16797            ) {
16798                #[allow(unused_imports)]
16799                use ::buffa::Enumeration as _;
16800                self.__buffa_unknown_fields.write_to(buf);
16801            }
16802        }
16803        /// Serializes this view as protobuf JSON.
16804        ///
16805        /// Implicit-presence fields with default values are omitted, `required`
16806        /// fields are always emitted, explicit-presence (`optional`) fields are
16807        /// emitted only when set, bytes fields are base64-encoded, and enum
16808        /// values are their proto name strings.
16809        ///
16810        /// This impl uses `serialize_map(None)` because the number of emitted
16811        /// fields depends on default-omission rules; serializers that require
16812        /// known map lengths (e.g. `bincode`) will return a runtime error.
16813        /// Use the owned message type for those formats.
16814        impl<'__a> ::serde::Serialize for UnpublishLayoutResponseView<'__a> {
16815            fn serialize<__S: ::serde::Serializer>(
16816                &self,
16817                __s: __S,
16818            ) -> ::core::result::Result<__S::Ok, __S::Error> {
16819                use ::serde::ser::SerializeMap as _;
16820                let mut __map = __s.serialize_map(::core::option::Option::None)?;
16821                __map.end()
16822            }
16823        }
16824        impl<'a> ::buffa::MessageName for UnpublishLayoutResponseView<'a> {
16825            const PACKAGE: &'static str = "layout.v1";
16826            const NAME: &'static str = "UnpublishLayoutResponse";
16827            const FULL_NAME: &'static str = "layout.v1.UnpublishLayoutResponse";
16828            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.UnpublishLayoutResponse";
16829        }
16830        ::buffa::impl_default_view_instance!(UnpublishLayoutResponseView);
16831        ::buffa::impl_view_reborrow!(UnpublishLayoutResponseView);
16832        /** Self-contained, `'static` owned view of a `UnpublishLayoutResponse` message.
16833
16834 Wraps [`::buffa::OwnedView`]`<`[`UnpublishLayoutResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
16835
16836 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`UnpublishLayoutResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
16837        #[derive(Clone, Debug)]
16838        pub struct UnpublishLayoutResponseOwnedView(
16839            ::buffa::OwnedView<UnpublishLayoutResponseView<'static>>,
16840        );
16841        impl UnpublishLayoutResponseOwnedView {
16842            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
16843            ///
16844            /// The view borrows directly from the buffer's data; the buffer is
16845            /// retained inside the returned handle.
16846            ///
16847            /// # Errors
16848            ///
16849            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
16850            /// protobuf data.
16851            pub fn decode(
16852                bytes: ::buffa::bytes::Bytes,
16853            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16854                ::core::result::Result::Ok(
16855                    UnpublishLayoutResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
16856                )
16857            }
16858            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
16859            /// max message size).
16860            ///
16861            /// # Errors
16862            ///
16863            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
16864            /// exceeds the configured limits.
16865            pub fn decode_with_options(
16866                bytes: ::buffa::bytes::Bytes,
16867                opts: &::buffa::DecodeOptions,
16868            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16869                ::core::result::Result::Ok(
16870                    UnpublishLayoutResponseOwnedView(
16871                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
16872                    ),
16873                )
16874            }
16875            /// Build from an owned message via an encode → decode round-trip.
16876            ///
16877            /// # Errors
16878            ///
16879            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
16880            /// somehow invalid (should not happen for well-formed messages).
16881            pub fn from_owned(
16882                msg: &super::super::UnpublishLayoutResponse,
16883            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16884                ::core::result::Result::Ok(
16885                    UnpublishLayoutResponseOwnedView(
16886                        ::buffa::OwnedView::from_owned(msg)?,
16887                    ),
16888                )
16889            }
16890            /// Borrow the full [`UnpublishLayoutResponseView`] with its lifetime tied to `&self`.
16891            #[must_use]
16892            pub fn view(&self) -> &UnpublishLayoutResponseView<'_> {
16893                self.0.reborrow()
16894            }
16895            /// Convert to the owned message type.
16896            ///
16897            /// # Errors
16898            ///
16899            /// Returns an error if re-materializing preserved unknown fields
16900            /// fails (e.g. the unknown-field limit is exceeded).
16901            pub fn to_owned_message(
16902                &self,
16903            ) -> ::core::result::Result<
16904                super::super::UnpublishLayoutResponse,
16905                ::buffa::DecodeError,
16906            > {
16907                self.0.to_owned_message()
16908            }
16909            /// The underlying bytes buffer.
16910            #[must_use]
16911            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
16912                self.0.bytes()
16913            }
16914            /// Consume the handle, returning the underlying bytes buffer.
16915            #[must_use]
16916            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
16917                self.0.into_bytes()
16918            }
16919        }
16920        impl ::core::convert::From<
16921            ::buffa::OwnedView<UnpublishLayoutResponseView<'static>>,
16922        > for UnpublishLayoutResponseOwnedView {
16923            fn from(
16924                inner: ::buffa::OwnedView<UnpublishLayoutResponseView<'static>>,
16925            ) -> Self {
16926                UnpublishLayoutResponseOwnedView(inner)
16927            }
16928        }
16929        impl ::core::convert::From<UnpublishLayoutResponseOwnedView>
16930        for ::buffa::OwnedView<UnpublishLayoutResponseView<'static>> {
16931            fn from(wrapper: UnpublishLayoutResponseOwnedView) -> Self {
16932                wrapper.0
16933            }
16934        }
16935        impl ::core::convert::AsRef<
16936            ::buffa::OwnedView<UnpublishLayoutResponseView<'static>>,
16937        > for UnpublishLayoutResponseOwnedView {
16938            fn as_ref(
16939                &self,
16940            ) -> &::buffa::OwnedView<UnpublishLayoutResponseView<'static>> {
16941                &self.0
16942            }
16943        }
16944        impl ::buffa::HasMessageView for super::super::UnpublishLayoutResponse {
16945            type View<'a> = UnpublishLayoutResponseView<'a>;
16946            type ViewHandle = UnpublishLayoutResponseOwnedView;
16947        }
16948        impl ::serde::Serialize for UnpublishLayoutResponseOwnedView {
16949            fn serialize<__S: ::serde::Serializer>(
16950                &self,
16951                __s: __S,
16952            ) -> ::core::result::Result<__S::Ok, __S::Error> {
16953                ::serde::Serialize::serialize(&self.0, __s)
16954            }
16955        }
16956        /// SetLayoutTemplateSubscriptionRequest follows a template by tracking latest or pinning a version.
16957        #[derive(Clone, Debug, Default)]
16958        pub struct SetLayoutTemplateSubscriptionRequestView<'a> {
16959            /// Viewer that owns the template.
16960            ///
16961            /// Field 1: `owner_id`
16962            pub owner_id: u64,
16963            /// Template identifier to follow.
16964            ///
16965            /// Field 2: `template_id`
16966            pub template_id: u64,
16967            /// True to follow the latest version automatically.
16968            ///
16969            /// Field 3: `track_latest`
16970            pub track_latest: bool,
16971            /// Version to follow when track_latest is false.
16972            ///
16973            /// Field 4: `pinned_version`
16974            pub pinned_version: ::core::option::Option<u32>,
16975            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
16976        }
16977        impl<'a> ::buffa::MessageView<'a>
16978        for SetLayoutTemplateSubscriptionRequestView<'a> {
16979            type Owned = super::super::SetLayoutTemplateSubscriptionRequest;
16980            fn decode_view(
16981                buf: &'a [u8],
16982            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16983                let __limit = ::core::cell::Cell::new(
16984                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
16985                );
16986                <Self as ::buffa::MessageView>::decode_view_ctx(
16987                    buf,
16988                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
16989                )
16990            }
16991            fn decode_view_with_ctx(
16992                buf: &'a [u8],
16993                ctx: ::buffa::DecodeContext<'_>,
16994            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
16995                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
16996            }
16997            fn merge_view_field(
16998                &mut self,
16999                tag: ::buffa::encoding::Tag,
17000                cur: &'a [u8],
17001                before_tag: &'a [u8],
17002                ctx: ::buffa::DecodeContext<'_>,
17003            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
17004                let _ = ctx;
17005                #[allow(unused_variables)]
17006                let view = self;
17007                let mut cur = cur;
17008                match tag.field_number() {
17009                    1u32 => {
17010                        ::buffa::encoding::check_wire_type(
17011                            tag,
17012                            ::buffa::encoding::WireType::Fixed64,
17013                        )?;
17014                        view.owner_id = ::buffa::types::decode_fixed64(&mut cur)?;
17015                    }
17016                    2u32 => {
17017                        ::buffa::encoding::check_wire_type(
17018                            tag,
17019                            ::buffa::encoding::WireType::Fixed64,
17020                        )?;
17021                        view.template_id = ::buffa::types::decode_fixed64(&mut cur)?;
17022                    }
17023                    3u32 => {
17024                        ::buffa::encoding::check_wire_type(
17025                            tag,
17026                            ::buffa::encoding::WireType::Varint,
17027                        )?;
17028                        view.track_latest = ::buffa::types::decode_bool(&mut cur)?;
17029                    }
17030                    4u32 => {
17031                        ::buffa::encoding::check_wire_type(
17032                            tag,
17033                            ::buffa::encoding::WireType::Varint,
17034                        )?;
17035                        view.pinned_version = Some(
17036                            ::buffa::types::decode_uint32(&mut cur)?,
17037                        );
17038                    }
17039                    _ => {
17040                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
17041                        let span_len = before_tag.len() - cur.len();
17042                        view.__buffa_unknown_fields
17043                            .push_record(before_tag, span_len, ctx)?;
17044                    }
17045                }
17046                ::core::result::Result::Ok(cur)
17047            }
17048            fn to_owned_message(
17049                &self,
17050            ) -> ::core::result::Result<
17051                super::super::SetLayoutTemplateSubscriptionRequest,
17052                ::buffa::DecodeError,
17053            > {
17054                self.to_owned_from_source(None)
17055            }
17056            #[allow(clippy::useless_conversion, clippy::needless_update)]
17057            fn to_owned_from_source(
17058                &self,
17059                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
17060            ) -> ::core::result::Result<
17061                super::super::SetLayoutTemplateSubscriptionRequest,
17062                ::buffa::DecodeError,
17063            > {
17064                #[allow(unused_imports)]
17065                use ::buffa::alloc::string::ToString as _;
17066                let _ = __buffa_src;
17067                ::core::result::Result::Ok(super::super::SetLayoutTemplateSubscriptionRequest {
17068                    owner_id: self.owner_id,
17069                    template_id: self.template_id,
17070                    track_latest: self.track_latest,
17071                    pinned_version: self.pinned_version,
17072                    __buffa_unknown_fields: self
17073                        .__buffa_unknown_fields
17074                        .to_owned()?
17075                        .into(),
17076                    ..::core::default::Default::default()
17077                })
17078            }
17079        }
17080        impl<'a> ::buffa::ViewEncode<'a>
17081        for SetLayoutTemplateSubscriptionRequestView<'a> {
17082            #[allow(clippy::needless_borrow, clippy::let_and_return)]
17083            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
17084                #[allow(unused_imports)]
17085                use ::buffa::Enumeration as _;
17086                let mut size = 0u32;
17087                if self.owner_id != 0u64 {
17088                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
17089                }
17090                if self.template_id != 0u64 {
17091                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
17092                }
17093                if self.track_latest {
17094                    size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
17095                }
17096                if let Some(v) = self.pinned_version {
17097                    size += 1u32 + ::buffa::types::uint32_encoded_len(v) as u32;
17098                }
17099                size += self.__buffa_unknown_fields.encoded_len() as u32;
17100                size
17101            }
17102            #[allow(clippy::needless_borrow)]
17103            fn write_to(
17104                &self,
17105                _cache: &mut ::buffa::SizeCache,
17106                buf: &mut impl ::buffa::bytes::BufMut,
17107            ) {
17108                #[allow(unused_imports)]
17109                use ::buffa::Enumeration as _;
17110                if self.owner_id != 0u64 {
17111                    ::buffa::types::put_fixed64_field(1u32, self.owner_id, buf);
17112                }
17113                if self.template_id != 0u64 {
17114                    ::buffa::types::put_fixed64_field(2u32, self.template_id, buf);
17115                }
17116                if self.track_latest {
17117                    ::buffa::types::put_bool_field(3u32, self.track_latest, buf);
17118                }
17119                if let Some(v) = self.pinned_version {
17120                    ::buffa::types::put_uint32_field(4u32, v, buf);
17121                }
17122                self.__buffa_unknown_fields.write_to(buf);
17123            }
17124        }
17125        /// Serializes this view as protobuf JSON.
17126        ///
17127        /// Implicit-presence fields with default values are omitted, `required`
17128        /// fields are always emitted, explicit-presence (`optional`) fields are
17129        /// emitted only when set, bytes fields are base64-encoded, and enum
17130        /// values are their proto name strings.
17131        ///
17132        /// This impl uses `serialize_map(None)` because the number of emitted
17133        /// fields depends on default-omission rules; serializers that require
17134        /// known map lengths (e.g. `bincode`) will return a runtime error.
17135        /// Use the owned message type for those formats.
17136        impl<'__a> ::serde::Serialize
17137        for SetLayoutTemplateSubscriptionRequestView<'__a> {
17138            fn serialize<__S: ::serde::Serializer>(
17139                &self,
17140                __s: __S,
17141            ) -> ::core::result::Result<__S::Ok, __S::Error> {
17142                use ::serde::ser::SerializeMap as _;
17143                let mut __map = __s.serialize_map(::core::option::Option::None)?;
17144                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.owner_id) {
17145                    __map
17146                        .serialize_entry(
17147                            "ownerId",
17148                            &::buffa::json_helpers::ProtoJson(&self.owner_id),
17149                        )?;
17150                }
17151                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.template_id) {
17152                    __map
17153                        .serialize_entry(
17154                            "templateId",
17155                            &::buffa::json_helpers::ProtoJson(&self.template_id),
17156                        )?;
17157                }
17158                if self.track_latest {
17159                    __map.serialize_entry("trackLatest", &self.track_latest)?;
17160                }
17161                if let ::core::option::Option::Some(__v) = self.pinned_version {
17162                    __map
17163                        .serialize_entry(
17164                            "pinnedVersion",
17165                            &::buffa::json_helpers::ProtoJson(&__v),
17166                        )?;
17167                }
17168                __map.end()
17169            }
17170        }
17171        impl<'a> ::buffa::MessageName for SetLayoutTemplateSubscriptionRequestView<'a> {
17172            const PACKAGE: &'static str = "layout.v1";
17173            const NAME: &'static str = "SetLayoutTemplateSubscriptionRequest";
17174            const FULL_NAME: &'static str = "layout.v1.SetLayoutTemplateSubscriptionRequest";
17175            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.SetLayoutTemplateSubscriptionRequest";
17176        }
17177        ::buffa::impl_default_view_instance!(SetLayoutTemplateSubscriptionRequestView);
17178        ::buffa::impl_view_reborrow!(SetLayoutTemplateSubscriptionRequestView);
17179        /** Self-contained, `'static` owned view of a `SetLayoutTemplateSubscriptionRequest` message.
17180
17181 Wraps [`::buffa::OwnedView`]`<`[`SetLayoutTemplateSubscriptionRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
17182
17183 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`SetLayoutTemplateSubscriptionRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
17184        #[derive(Clone, Debug)]
17185        pub struct SetLayoutTemplateSubscriptionRequestOwnedView(
17186            ::buffa::OwnedView<SetLayoutTemplateSubscriptionRequestView<'static>>,
17187        );
17188        impl SetLayoutTemplateSubscriptionRequestOwnedView {
17189            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
17190            ///
17191            /// The view borrows directly from the buffer's data; the buffer is
17192            /// retained inside the returned handle.
17193            ///
17194            /// # Errors
17195            ///
17196            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
17197            /// protobuf data.
17198            pub fn decode(
17199                bytes: ::buffa::bytes::Bytes,
17200            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17201                ::core::result::Result::Ok(
17202                    SetLayoutTemplateSubscriptionRequestOwnedView(
17203                        ::buffa::OwnedView::decode(bytes)?,
17204                    ),
17205                )
17206            }
17207            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
17208            /// max message size).
17209            ///
17210            /// # Errors
17211            ///
17212            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
17213            /// exceeds the configured limits.
17214            pub fn decode_with_options(
17215                bytes: ::buffa::bytes::Bytes,
17216                opts: &::buffa::DecodeOptions,
17217            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17218                ::core::result::Result::Ok(
17219                    SetLayoutTemplateSubscriptionRequestOwnedView(
17220                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
17221                    ),
17222                )
17223            }
17224            /// Build from an owned message via an encode → decode round-trip.
17225            ///
17226            /// # Errors
17227            ///
17228            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
17229            /// somehow invalid (should not happen for well-formed messages).
17230            pub fn from_owned(
17231                msg: &super::super::SetLayoutTemplateSubscriptionRequest,
17232            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17233                ::core::result::Result::Ok(
17234                    SetLayoutTemplateSubscriptionRequestOwnedView(
17235                        ::buffa::OwnedView::from_owned(msg)?,
17236                    ),
17237                )
17238            }
17239            /// Borrow the full [`SetLayoutTemplateSubscriptionRequestView`] with its lifetime tied to `&self`.
17240            #[must_use]
17241            pub fn view(&self) -> &SetLayoutTemplateSubscriptionRequestView<'_> {
17242                self.0.reborrow()
17243            }
17244            /// Convert to the owned message type.
17245            ///
17246            /// # Errors
17247            ///
17248            /// Returns an error if re-materializing preserved unknown fields
17249            /// fails (e.g. the unknown-field limit is exceeded).
17250            pub fn to_owned_message(
17251                &self,
17252            ) -> ::core::result::Result<
17253                super::super::SetLayoutTemplateSubscriptionRequest,
17254                ::buffa::DecodeError,
17255            > {
17256                self.0.to_owned_message()
17257            }
17258            /// The underlying bytes buffer.
17259            #[must_use]
17260            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
17261                self.0.bytes()
17262            }
17263            /// Consume the handle, returning the underlying bytes buffer.
17264            #[must_use]
17265            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
17266                self.0.into_bytes()
17267            }
17268            /// Viewer that owns the template.
17269            ///
17270            /// Field 1: `owner_id`
17271            #[must_use]
17272            pub fn owner_id(&self) -> u64 {
17273                self.0.reborrow().owner_id
17274            }
17275            /// Template identifier to follow.
17276            ///
17277            /// Field 2: `template_id`
17278            #[must_use]
17279            pub fn template_id(&self) -> u64 {
17280                self.0.reborrow().template_id
17281            }
17282            /// True to follow the latest version automatically.
17283            ///
17284            /// Field 3: `track_latest`
17285            #[must_use]
17286            pub fn track_latest(&self) -> bool {
17287                self.0.reborrow().track_latest
17288            }
17289            /// Version to follow when track_latest is false.
17290            ///
17291            /// Field 4: `pinned_version`
17292            #[must_use]
17293            pub fn pinned_version(&self) -> ::core::option::Option<u32> {
17294                self.0.reborrow().pinned_version
17295            }
17296        }
17297        impl ::core::convert::From<
17298            ::buffa::OwnedView<SetLayoutTemplateSubscriptionRequestView<'static>>,
17299        > for SetLayoutTemplateSubscriptionRequestOwnedView {
17300            fn from(
17301                inner: ::buffa::OwnedView<
17302                    SetLayoutTemplateSubscriptionRequestView<'static>,
17303                >,
17304            ) -> Self {
17305                SetLayoutTemplateSubscriptionRequestOwnedView(inner)
17306            }
17307        }
17308        impl ::core::convert::From<SetLayoutTemplateSubscriptionRequestOwnedView>
17309        for ::buffa::OwnedView<SetLayoutTemplateSubscriptionRequestView<'static>> {
17310            fn from(wrapper: SetLayoutTemplateSubscriptionRequestOwnedView) -> Self {
17311                wrapper.0
17312            }
17313        }
17314        impl ::core::convert::AsRef<
17315            ::buffa::OwnedView<SetLayoutTemplateSubscriptionRequestView<'static>>,
17316        > for SetLayoutTemplateSubscriptionRequestOwnedView {
17317            fn as_ref(
17318                &self,
17319            ) -> &::buffa::OwnedView<SetLayoutTemplateSubscriptionRequestView<'static>> {
17320                &self.0
17321            }
17322        }
17323        impl ::buffa::HasMessageView
17324        for super::super::SetLayoutTemplateSubscriptionRequest {
17325            type View<'a> = SetLayoutTemplateSubscriptionRequestView<'a>;
17326            type ViewHandle = SetLayoutTemplateSubscriptionRequestOwnedView;
17327        }
17328        impl ::serde::Serialize for SetLayoutTemplateSubscriptionRequestOwnedView {
17329            fn serialize<__S: ::serde::Serializer>(
17330                &self,
17331                __s: __S,
17332            ) -> ::core::result::Result<__S::Ok, __S::Error> {
17333                ::serde::Serialize::serialize(&self.0, __s)
17334            }
17335        }
17336        /// SetLayoutTemplateSubscriptionResponse is empty when the subscription was saved.
17337        #[derive(Clone, Debug, Default)]
17338        pub struct SetLayoutTemplateSubscriptionResponseView<'a> {
17339            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
17340        }
17341        impl<'a> ::buffa::MessageView<'a>
17342        for SetLayoutTemplateSubscriptionResponseView<'a> {
17343            type Owned = super::super::SetLayoutTemplateSubscriptionResponse;
17344            fn decode_view(
17345                buf: &'a [u8],
17346            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17347                let __limit = ::core::cell::Cell::new(
17348                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
17349                );
17350                <Self as ::buffa::MessageView>::decode_view_ctx(
17351                    buf,
17352                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
17353                )
17354            }
17355            fn decode_view_with_ctx(
17356                buf: &'a [u8],
17357                ctx: ::buffa::DecodeContext<'_>,
17358            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17359                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
17360            }
17361            fn merge_view_field(
17362                &mut self,
17363                tag: ::buffa::encoding::Tag,
17364                cur: &'a [u8],
17365                before_tag: &'a [u8],
17366                ctx: ::buffa::DecodeContext<'_>,
17367            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
17368                let _ = ctx;
17369                #[allow(unused_variables)]
17370                let view = self;
17371                let mut cur = cur;
17372                match tag.field_number() {
17373                    _ => {
17374                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
17375                        let span_len = before_tag.len() - cur.len();
17376                        view.__buffa_unknown_fields
17377                            .push_record(before_tag, span_len, ctx)?;
17378                    }
17379                }
17380                ::core::result::Result::Ok(cur)
17381            }
17382            fn to_owned_message(
17383                &self,
17384            ) -> ::core::result::Result<
17385                super::super::SetLayoutTemplateSubscriptionResponse,
17386                ::buffa::DecodeError,
17387            > {
17388                self.to_owned_from_source(None)
17389            }
17390            #[allow(clippy::useless_conversion, clippy::needless_update)]
17391            fn to_owned_from_source(
17392                &self,
17393                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
17394            ) -> ::core::result::Result<
17395                super::super::SetLayoutTemplateSubscriptionResponse,
17396                ::buffa::DecodeError,
17397            > {
17398                #[allow(unused_imports)]
17399                use ::buffa::alloc::string::ToString as _;
17400                let _ = __buffa_src;
17401                ::core::result::Result::Ok(super::super::SetLayoutTemplateSubscriptionResponse {
17402                    __buffa_unknown_fields: self
17403                        .__buffa_unknown_fields
17404                        .to_owned()?
17405                        .into(),
17406                    ..::core::default::Default::default()
17407                })
17408            }
17409        }
17410        impl<'a> ::buffa::ViewEncode<'a>
17411        for SetLayoutTemplateSubscriptionResponseView<'a> {
17412            #[allow(clippy::needless_borrow, clippy::let_and_return)]
17413            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
17414                #[allow(unused_imports)]
17415                use ::buffa::Enumeration as _;
17416                let mut size = 0u32;
17417                size += self.__buffa_unknown_fields.encoded_len() as u32;
17418                size
17419            }
17420            #[allow(clippy::needless_borrow)]
17421            fn write_to(
17422                &self,
17423                _cache: &mut ::buffa::SizeCache,
17424                buf: &mut impl ::buffa::bytes::BufMut,
17425            ) {
17426                #[allow(unused_imports)]
17427                use ::buffa::Enumeration as _;
17428                self.__buffa_unknown_fields.write_to(buf);
17429            }
17430        }
17431        /// Serializes this view as protobuf JSON.
17432        ///
17433        /// Implicit-presence fields with default values are omitted, `required`
17434        /// fields are always emitted, explicit-presence (`optional`) fields are
17435        /// emitted only when set, bytes fields are base64-encoded, and enum
17436        /// values are their proto name strings.
17437        ///
17438        /// This impl uses `serialize_map(None)` because the number of emitted
17439        /// fields depends on default-omission rules; serializers that require
17440        /// known map lengths (e.g. `bincode`) will return a runtime error.
17441        /// Use the owned message type for those formats.
17442        impl<'__a> ::serde::Serialize
17443        for SetLayoutTemplateSubscriptionResponseView<'__a> {
17444            fn serialize<__S: ::serde::Serializer>(
17445                &self,
17446                __s: __S,
17447            ) -> ::core::result::Result<__S::Ok, __S::Error> {
17448                use ::serde::ser::SerializeMap as _;
17449                let mut __map = __s.serialize_map(::core::option::Option::None)?;
17450                __map.end()
17451            }
17452        }
17453        impl<'a> ::buffa::MessageName for SetLayoutTemplateSubscriptionResponseView<'a> {
17454            const PACKAGE: &'static str = "layout.v1";
17455            const NAME: &'static str = "SetLayoutTemplateSubscriptionResponse";
17456            const FULL_NAME: &'static str = "layout.v1.SetLayoutTemplateSubscriptionResponse";
17457            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.SetLayoutTemplateSubscriptionResponse";
17458        }
17459        ::buffa::impl_default_view_instance!(SetLayoutTemplateSubscriptionResponseView);
17460        ::buffa::impl_view_reborrow!(SetLayoutTemplateSubscriptionResponseView);
17461        /** Self-contained, `'static` owned view of a `SetLayoutTemplateSubscriptionResponse` message.
17462
17463 Wraps [`::buffa::OwnedView`]`<`[`SetLayoutTemplateSubscriptionResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
17464
17465 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`SetLayoutTemplateSubscriptionResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
17466        #[derive(Clone, Debug)]
17467        pub struct SetLayoutTemplateSubscriptionResponseOwnedView(
17468            ::buffa::OwnedView<SetLayoutTemplateSubscriptionResponseView<'static>>,
17469        );
17470        impl SetLayoutTemplateSubscriptionResponseOwnedView {
17471            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
17472            ///
17473            /// The view borrows directly from the buffer's data; the buffer is
17474            /// retained inside the returned handle.
17475            ///
17476            /// # Errors
17477            ///
17478            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
17479            /// protobuf data.
17480            pub fn decode(
17481                bytes: ::buffa::bytes::Bytes,
17482            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17483                ::core::result::Result::Ok(
17484                    SetLayoutTemplateSubscriptionResponseOwnedView(
17485                        ::buffa::OwnedView::decode(bytes)?,
17486                    ),
17487                )
17488            }
17489            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
17490            /// max message size).
17491            ///
17492            /// # Errors
17493            ///
17494            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
17495            /// exceeds the configured limits.
17496            pub fn decode_with_options(
17497                bytes: ::buffa::bytes::Bytes,
17498                opts: &::buffa::DecodeOptions,
17499            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17500                ::core::result::Result::Ok(
17501                    SetLayoutTemplateSubscriptionResponseOwnedView(
17502                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
17503                    ),
17504                )
17505            }
17506            /// Build from an owned message via an encode → decode round-trip.
17507            ///
17508            /// # Errors
17509            ///
17510            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
17511            /// somehow invalid (should not happen for well-formed messages).
17512            pub fn from_owned(
17513                msg: &super::super::SetLayoutTemplateSubscriptionResponse,
17514            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17515                ::core::result::Result::Ok(
17516                    SetLayoutTemplateSubscriptionResponseOwnedView(
17517                        ::buffa::OwnedView::from_owned(msg)?,
17518                    ),
17519                )
17520            }
17521            /// Borrow the full [`SetLayoutTemplateSubscriptionResponseView`] with its lifetime tied to `&self`.
17522            #[must_use]
17523            pub fn view(&self) -> &SetLayoutTemplateSubscriptionResponseView<'_> {
17524                self.0.reborrow()
17525            }
17526            /// Convert to the owned message type.
17527            ///
17528            /// # Errors
17529            ///
17530            /// Returns an error if re-materializing preserved unknown fields
17531            /// fails (e.g. the unknown-field limit is exceeded).
17532            pub fn to_owned_message(
17533                &self,
17534            ) -> ::core::result::Result<
17535                super::super::SetLayoutTemplateSubscriptionResponse,
17536                ::buffa::DecodeError,
17537            > {
17538                self.0.to_owned_message()
17539            }
17540            /// The underlying bytes buffer.
17541            #[must_use]
17542            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
17543                self.0.bytes()
17544            }
17545            /// Consume the handle, returning the underlying bytes buffer.
17546            #[must_use]
17547            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
17548                self.0.into_bytes()
17549            }
17550        }
17551        impl ::core::convert::From<
17552            ::buffa::OwnedView<SetLayoutTemplateSubscriptionResponseView<'static>>,
17553        > for SetLayoutTemplateSubscriptionResponseOwnedView {
17554            fn from(
17555                inner: ::buffa::OwnedView<
17556                    SetLayoutTemplateSubscriptionResponseView<'static>,
17557                >,
17558            ) -> Self {
17559                SetLayoutTemplateSubscriptionResponseOwnedView(inner)
17560            }
17561        }
17562        impl ::core::convert::From<SetLayoutTemplateSubscriptionResponseOwnedView>
17563        for ::buffa::OwnedView<SetLayoutTemplateSubscriptionResponseView<'static>> {
17564            fn from(wrapper: SetLayoutTemplateSubscriptionResponseOwnedView) -> Self {
17565                wrapper.0
17566            }
17567        }
17568        impl ::core::convert::AsRef<
17569            ::buffa::OwnedView<SetLayoutTemplateSubscriptionResponseView<'static>>,
17570        > for SetLayoutTemplateSubscriptionResponseOwnedView {
17571            fn as_ref(
17572                &self,
17573            ) -> &::buffa::OwnedView<
17574                SetLayoutTemplateSubscriptionResponseView<'static>,
17575            > {
17576                &self.0
17577            }
17578        }
17579        impl ::buffa::HasMessageView
17580        for super::super::SetLayoutTemplateSubscriptionResponse {
17581            type View<'a> = SetLayoutTemplateSubscriptionResponseView<'a>;
17582            type ViewHandle = SetLayoutTemplateSubscriptionResponseOwnedView;
17583        }
17584        impl ::serde::Serialize for SetLayoutTemplateSubscriptionResponseOwnedView {
17585            fn serialize<__S: ::serde::Serializer>(
17586                &self,
17587                __s: __S,
17588            ) -> ::core::result::Result<__S::Ok, __S::Error> {
17589                ::serde::Serialize::serialize(&self.0, __s)
17590            }
17591        }
17592        /// DeleteLayoutTemplateSubscriptionRequest deletes one followed template.
17593        #[derive(Clone, Debug, Default)]
17594        pub struct DeleteLayoutTemplateSubscriptionRequestView<'a> {
17595            /// Viewer that owns the template.
17596            ///
17597            /// Field 1: `owner_id`
17598            pub owner_id: u64,
17599            /// Template identifier to unfollow.
17600            ///
17601            /// Field 2: `template_id`
17602            pub template_id: u64,
17603            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
17604        }
17605        impl<'a> ::buffa::MessageView<'a>
17606        for DeleteLayoutTemplateSubscriptionRequestView<'a> {
17607            type Owned = super::super::DeleteLayoutTemplateSubscriptionRequest;
17608            fn decode_view(
17609                buf: &'a [u8],
17610            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17611                let __limit = ::core::cell::Cell::new(
17612                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
17613                );
17614                <Self as ::buffa::MessageView>::decode_view_ctx(
17615                    buf,
17616                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
17617                )
17618            }
17619            fn decode_view_with_ctx(
17620                buf: &'a [u8],
17621                ctx: ::buffa::DecodeContext<'_>,
17622            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17623                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
17624            }
17625            fn merge_view_field(
17626                &mut self,
17627                tag: ::buffa::encoding::Tag,
17628                cur: &'a [u8],
17629                before_tag: &'a [u8],
17630                ctx: ::buffa::DecodeContext<'_>,
17631            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
17632                let _ = ctx;
17633                #[allow(unused_variables)]
17634                let view = self;
17635                let mut cur = cur;
17636                match tag.field_number() {
17637                    1u32 => {
17638                        ::buffa::encoding::check_wire_type(
17639                            tag,
17640                            ::buffa::encoding::WireType::Fixed64,
17641                        )?;
17642                        view.owner_id = ::buffa::types::decode_fixed64(&mut cur)?;
17643                    }
17644                    2u32 => {
17645                        ::buffa::encoding::check_wire_type(
17646                            tag,
17647                            ::buffa::encoding::WireType::Fixed64,
17648                        )?;
17649                        view.template_id = ::buffa::types::decode_fixed64(&mut cur)?;
17650                    }
17651                    _ => {
17652                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
17653                        let span_len = before_tag.len() - cur.len();
17654                        view.__buffa_unknown_fields
17655                            .push_record(before_tag, span_len, ctx)?;
17656                    }
17657                }
17658                ::core::result::Result::Ok(cur)
17659            }
17660            fn to_owned_message(
17661                &self,
17662            ) -> ::core::result::Result<
17663                super::super::DeleteLayoutTemplateSubscriptionRequest,
17664                ::buffa::DecodeError,
17665            > {
17666                self.to_owned_from_source(None)
17667            }
17668            #[allow(clippy::useless_conversion, clippy::needless_update)]
17669            fn to_owned_from_source(
17670                &self,
17671                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
17672            ) -> ::core::result::Result<
17673                super::super::DeleteLayoutTemplateSubscriptionRequest,
17674                ::buffa::DecodeError,
17675            > {
17676                #[allow(unused_imports)]
17677                use ::buffa::alloc::string::ToString as _;
17678                let _ = __buffa_src;
17679                ::core::result::Result::Ok(super::super::DeleteLayoutTemplateSubscriptionRequest {
17680                    owner_id: self.owner_id,
17681                    template_id: self.template_id,
17682                    __buffa_unknown_fields: self
17683                        .__buffa_unknown_fields
17684                        .to_owned()?
17685                        .into(),
17686                    ..::core::default::Default::default()
17687                })
17688            }
17689        }
17690        impl<'a> ::buffa::ViewEncode<'a>
17691        for DeleteLayoutTemplateSubscriptionRequestView<'a> {
17692            #[allow(clippy::needless_borrow, clippy::let_and_return)]
17693            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
17694                #[allow(unused_imports)]
17695                use ::buffa::Enumeration as _;
17696                let mut size = 0u32;
17697                if self.owner_id != 0u64 {
17698                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
17699                }
17700                if self.template_id != 0u64 {
17701                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
17702                }
17703                size += self.__buffa_unknown_fields.encoded_len() as u32;
17704                size
17705            }
17706            #[allow(clippy::needless_borrow)]
17707            fn write_to(
17708                &self,
17709                _cache: &mut ::buffa::SizeCache,
17710                buf: &mut impl ::buffa::bytes::BufMut,
17711            ) {
17712                #[allow(unused_imports)]
17713                use ::buffa::Enumeration as _;
17714                if self.owner_id != 0u64 {
17715                    ::buffa::types::put_fixed64_field(1u32, self.owner_id, buf);
17716                }
17717                if self.template_id != 0u64 {
17718                    ::buffa::types::put_fixed64_field(2u32, self.template_id, buf);
17719                }
17720                self.__buffa_unknown_fields.write_to(buf);
17721            }
17722        }
17723        /// Serializes this view as protobuf JSON.
17724        ///
17725        /// Implicit-presence fields with default values are omitted, `required`
17726        /// fields are always emitted, explicit-presence (`optional`) fields are
17727        /// emitted only when set, bytes fields are base64-encoded, and enum
17728        /// values are their proto name strings.
17729        ///
17730        /// This impl uses `serialize_map(None)` because the number of emitted
17731        /// fields depends on default-omission rules; serializers that require
17732        /// known map lengths (e.g. `bincode`) will return a runtime error.
17733        /// Use the owned message type for those formats.
17734        impl<'__a> ::serde::Serialize
17735        for DeleteLayoutTemplateSubscriptionRequestView<'__a> {
17736            fn serialize<__S: ::serde::Serializer>(
17737                &self,
17738                __s: __S,
17739            ) -> ::core::result::Result<__S::Ok, __S::Error> {
17740                use ::serde::ser::SerializeMap as _;
17741                let mut __map = __s.serialize_map(::core::option::Option::None)?;
17742                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.owner_id) {
17743                    __map
17744                        .serialize_entry(
17745                            "ownerId",
17746                            &::buffa::json_helpers::ProtoJson(&self.owner_id),
17747                        )?;
17748                }
17749                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.template_id) {
17750                    __map
17751                        .serialize_entry(
17752                            "templateId",
17753                            &::buffa::json_helpers::ProtoJson(&self.template_id),
17754                        )?;
17755                }
17756                __map.end()
17757            }
17758        }
17759        impl<'a> ::buffa::MessageName
17760        for DeleteLayoutTemplateSubscriptionRequestView<'a> {
17761            const PACKAGE: &'static str = "layout.v1";
17762            const NAME: &'static str = "DeleteLayoutTemplateSubscriptionRequest";
17763            const FULL_NAME: &'static str = "layout.v1.DeleteLayoutTemplateSubscriptionRequest";
17764            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.DeleteLayoutTemplateSubscriptionRequest";
17765        }
17766        ::buffa::impl_default_view_instance!(
17767            DeleteLayoutTemplateSubscriptionRequestView
17768        );
17769        ::buffa::impl_view_reborrow!(DeleteLayoutTemplateSubscriptionRequestView);
17770        /** Self-contained, `'static` owned view of a `DeleteLayoutTemplateSubscriptionRequest` message.
17771
17772 Wraps [`::buffa::OwnedView`]`<`[`DeleteLayoutTemplateSubscriptionRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
17773
17774 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`DeleteLayoutTemplateSubscriptionRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
17775        #[derive(Clone, Debug)]
17776        pub struct DeleteLayoutTemplateSubscriptionRequestOwnedView(
17777            ::buffa::OwnedView<DeleteLayoutTemplateSubscriptionRequestView<'static>>,
17778        );
17779        impl DeleteLayoutTemplateSubscriptionRequestOwnedView {
17780            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
17781            ///
17782            /// The view borrows directly from the buffer's data; the buffer is
17783            /// retained inside the returned handle.
17784            ///
17785            /// # Errors
17786            ///
17787            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
17788            /// protobuf data.
17789            pub fn decode(
17790                bytes: ::buffa::bytes::Bytes,
17791            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17792                ::core::result::Result::Ok(
17793                    DeleteLayoutTemplateSubscriptionRequestOwnedView(
17794                        ::buffa::OwnedView::decode(bytes)?,
17795                    ),
17796                )
17797            }
17798            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
17799            /// max message size).
17800            ///
17801            /// # Errors
17802            ///
17803            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
17804            /// exceeds the configured limits.
17805            pub fn decode_with_options(
17806                bytes: ::buffa::bytes::Bytes,
17807                opts: &::buffa::DecodeOptions,
17808            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17809                ::core::result::Result::Ok(
17810                    DeleteLayoutTemplateSubscriptionRequestOwnedView(
17811                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
17812                    ),
17813                )
17814            }
17815            /// Build from an owned message via an encode → decode round-trip.
17816            ///
17817            /// # Errors
17818            ///
17819            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
17820            /// somehow invalid (should not happen for well-formed messages).
17821            pub fn from_owned(
17822                msg: &super::super::DeleteLayoutTemplateSubscriptionRequest,
17823            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17824                ::core::result::Result::Ok(
17825                    DeleteLayoutTemplateSubscriptionRequestOwnedView(
17826                        ::buffa::OwnedView::from_owned(msg)?,
17827                    ),
17828                )
17829            }
17830            /// Borrow the full [`DeleteLayoutTemplateSubscriptionRequestView`] with its lifetime tied to `&self`.
17831            #[must_use]
17832            pub fn view(&self) -> &DeleteLayoutTemplateSubscriptionRequestView<'_> {
17833                self.0.reborrow()
17834            }
17835            /// Convert to the owned message type.
17836            ///
17837            /// # Errors
17838            ///
17839            /// Returns an error if re-materializing preserved unknown fields
17840            /// fails (e.g. the unknown-field limit is exceeded).
17841            pub fn to_owned_message(
17842                &self,
17843            ) -> ::core::result::Result<
17844                super::super::DeleteLayoutTemplateSubscriptionRequest,
17845                ::buffa::DecodeError,
17846            > {
17847                self.0.to_owned_message()
17848            }
17849            /// The underlying bytes buffer.
17850            #[must_use]
17851            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
17852                self.0.bytes()
17853            }
17854            /// Consume the handle, returning the underlying bytes buffer.
17855            #[must_use]
17856            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
17857                self.0.into_bytes()
17858            }
17859            /// Viewer that owns the template.
17860            ///
17861            /// Field 1: `owner_id`
17862            #[must_use]
17863            pub fn owner_id(&self) -> u64 {
17864                self.0.reborrow().owner_id
17865            }
17866            /// Template identifier to unfollow.
17867            ///
17868            /// Field 2: `template_id`
17869            #[must_use]
17870            pub fn template_id(&self) -> u64 {
17871                self.0.reborrow().template_id
17872            }
17873        }
17874        impl ::core::convert::From<
17875            ::buffa::OwnedView<DeleteLayoutTemplateSubscriptionRequestView<'static>>,
17876        > for DeleteLayoutTemplateSubscriptionRequestOwnedView {
17877            fn from(
17878                inner: ::buffa::OwnedView<
17879                    DeleteLayoutTemplateSubscriptionRequestView<'static>,
17880                >,
17881            ) -> Self {
17882                DeleteLayoutTemplateSubscriptionRequestOwnedView(inner)
17883            }
17884        }
17885        impl ::core::convert::From<DeleteLayoutTemplateSubscriptionRequestOwnedView>
17886        for ::buffa::OwnedView<DeleteLayoutTemplateSubscriptionRequestView<'static>> {
17887            fn from(wrapper: DeleteLayoutTemplateSubscriptionRequestOwnedView) -> Self {
17888                wrapper.0
17889            }
17890        }
17891        impl ::core::convert::AsRef<
17892            ::buffa::OwnedView<DeleteLayoutTemplateSubscriptionRequestView<'static>>,
17893        > for DeleteLayoutTemplateSubscriptionRequestOwnedView {
17894            fn as_ref(
17895                &self,
17896            ) -> &::buffa::OwnedView<
17897                DeleteLayoutTemplateSubscriptionRequestView<'static>,
17898            > {
17899                &self.0
17900            }
17901        }
17902        impl ::buffa::HasMessageView
17903        for super::super::DeleteLayoutTemplateSubscriptionRequest {
17904            type View<'a> = DeleteLayoutTemplateSubscriptionRequestView<'a>;
17905            type ViewHandle = DeleteLayoutTemplateSubscriptionRequestOwnedView;
17906        }
17907        impl ::serde::Serialize for DeleteLayoutTemplateSubscriptionRequestOwnedView {
17908            fn serialize<__S: ::serde::Serializer>(
17909                &self,
17910                __s: __S,
17911            ) -> ::core::result::Result<__S::Ok, __S::Error> {
17912                ::serde::Serialize::serialize(&self.0, __s)
17913            }
17914        }
17915        /// DeleteLayoutTemplateSubscriptionResponse is empty when the subscription was deleted.
17916        #[derive(Clone, Debug, Default)]
17917        pub struct DeleteLayoutTemplateSubscriptionResponseView<'a> {
17918            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
17919        }
17920        impl<'a> ::buffa::MessageView<'a>
17921        for DeleteLayoutTemplateSubscriptionResponseView<'a> {
17922            type Owned = super::super::DeleteLayoutTemplateSubscriptionResponse;
17923            fn decode_view(
17924                buf: &'a [u8],
17925            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17926                let __limit = ::core::cell::Cell::new(
17927                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
17928                );
17929                <Self as ::buffa::MessageView>::decode_view_ctx(
17930                    buf,
17931                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
17932                )
17933            }
17934            fn decode_view_with_ctx(
17935                buf: &'a [u8],
17936                ctx: ::buffa::DecodeContext<'_>,
17937            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
17938                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
17939            }
17940            fn merge_view_field(
17941                &mut self,
17942                tag: ::buffa::encoding::Tag,
17943                cur: &'a [u8],
17944                before_tag: &'a [u8],
17945                ctx: ::buffa::DecodeContext<'_>,
17946            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
17947                let _ = ctx;
17948                #[allow(unused_variables)]
17949                let view = self;
17950                let mut cur = cur;
17951                match tag.field_number() {
17952                    _ => {
17953                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
17954                        let span_len = before_tag.len() - cur.len();
17955                        view.__buffa_unknown_fields
17956                            .push_record(before_tag, span_len, ctx)?;
17957                    }
17958                }
17959                ::core::result::Result::Ok(cur)
17960            }
17961            fn to_owned_message(
17962                &self,
17963            ) -> ::core::result::Result<
17964                super::super::DeleteLayoutTemplateSubscriptionResponse,
17965                ::buffa::DecodeError,
17966            > {
17967                self.to_owned_from_source(None)
17968            }
17969            #[allow(clippy::useless_conversion, clippy::needless_update)]
17970            fn to_owned_from_source(
17971                &self,
17972                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
17973            ) -> ::core::result::Result<
17974                super::super::DeleteLayoutTemplateSubscriptionResponse,
17975                ::buffa::DecodeError,
17976            > {
17977                #[allow(unused_imports)]
17978                use ::buffa::alloc::string::ToString as _;
17979                let _ = __buffa_src;
17980                ::core::result::Result::Ok(super::super::DeleteLayoutTemplateSubscriptionResponse {
17981                    __buffa_unknown_fields: self
17982                        .__buffa_unknown_fields
17983                        .to_owned()?
17984                        .into(),
17985                    ..::core::default::Default::default()
17986                })
17987            }
17988        }
17989        impl<'a> ::buffa::ViewEncode<'a>
17990        for DeleteLayoutTemplateSubscriptionResponseView<'a> {
17991            #[allow(clippy::needless_borrow, clippy::let_and_return)]
17992            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
17993                #[allow(unused_imports)]
17994                use ::buffa::Enumeration as _;
17995                let mut size = 0u32;
17996                size += self.__buffa_unknown_fields.encoded_len() as u32;
17997                size
17998            }
17999            #[allow(clippy::needless_borrow)]
18000            fn write_to(
18001                &self,
18002                _cache: &mut ::buffa::SizeCache,
18003                buf: &mut impl ::buffa::bytes::BufMut,
18004            ) {
18005                #[allow(unused_imports)]
18006                use ::buffa::Enumeration as _;
18007                self.__buffa_unknown_fields.write_to(buf);
18008            }
18009        }
18010        /// Serializes this view as protobuf JSON.
18011        ///
18012        /// Implicit-presence fields with default values are omitted, `required`
18013        /// fields are always emitted, explicit-presence (`optional`) fields are
18014        /// emitted only when set, bytes fields are base64-encoded, and enum
18015        /// values are their proto name strings.
18016        ///
18017        /// This impl uses `serialize_map(None)` because the number of emitted
18018        /// fields depends on default-omission rules; serializers that require
18019        /// known map lengths (e.g. `bincode`) will return a runtime error.
18020        /// Use the owned message type for those formats.
18021        impl<'__a> ::serde::Serialize
18022        for DeleteLayoutTemplateSubscriptionResponseView<'__a> {
18023            fn serialize<__S: ::serde::Serializer>(
18024                &self,
18025                __s: __S,
18026            ) -> ::core::result::Result<__S::Ok, __S::Error> {
18027                use ::serde::ser::SerializeMap as _;
18028                let mut __map = __s.serialize_map(::core::option::Option::None)?;
18029                __map.end()
18030            }
18031        }
18032        impl<'a> ::buffa::MessageName
18033        for DeleteLayoutTemplateSubscriptionResponseView<'a> {
18034            const PACKAGE: &'static str = "layout.v1";
18035            const NAME: &'static str = "DeleteLayoutTemplateSubscriptionResponse";
18036            const FULL_NAME: &'static str = "layout.v1.DeleteLayoutTemplateSubscriptionResponse";
18037            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.DeleteLayoutTemplateSubscriptionResponse";
18038        }
18039        ::buffa::impl_default_view_instance!(
18040            DeleteLayoutTemplateSubscriptionResponseView
18041        );
18042        ::buffa::impl_view_reborrow!(DeleteLayoutTemplateSubscriptionResponseView);
18043        /** Self-contained, `'static` owned view of a `DeleteLayoutTemplateSubscriptionResponse` message.
18044
18045 Wraps [`::buffa::OwnedView`]`<`[`DeleteLayoutTemplateSubscriptionResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
18046
18047 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`DeleteLayoutTemplateSubscriptionResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
18048        #[derive(Clone, Debug)]
18049        pub struct DeleteLayoutTemplateSubscriptionResponseOwnedView(
18050            ::buffa::OwnedView<DeleteLayoutTemplateSubscriptionResponseView<'static>>,
18051        );
18052        impl DeleteLayoutTemplateSubscriptionResponseOwnedView {
18053            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
18054            ///
18055            /// The view borrows directly from the buffer's data; the buffer is
18056            /// retained inside the returned handle.
18057            ///
18058            /// # Errors
18059            ///
18060            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
18061            /// protobuf data.
18062            pub fn decode(
18063                bytes: ::buffa::bytes::Bytes,
18064            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18065                ::core::result::Result::Ok(
18066                    DeleteLayoutTemplateSubscriptionResponseOwnedView(
18067                        ::buffa::OwnedView::decode(bytes)?,
18068                    ),
18069                )
18070            }
18071            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
18072            /// max message size).
18073            ///
18074            /// # Errors
18075            ///
18076            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
18077            /// exceeds the configured limits.
18078            pub fn decode_with_options(
18079                bytes: ::buffa::bytes::Bytes,
18080                opts: &::buffa::DecodeOptions,
18081            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18082                ::core::result::Result::Ok(
18083                    DeleteLayoutTemplateSubscriptionResponseOwnedView(
18084                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
18085                    ),
18086                )
18087            }
18088            /// Build from an owned message via an encode → decode round-trip.
18089            ///
18090            /// # Errors
18091            ///
18092            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
18093            /// somehow invalid (should not happen for well-formed messages).
18094            pub fn from_owned(
18095                msg: &super::super::DeleteLayoutTemplateSubscriptionResponse,
18096            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18097                ::core::result::Result::Ok(
18098                    DeleteLayoutTemplateSubscriptionResponseOwnedView(
18099                        ::buffa::OwnedView::from_owned(msg)?,
18100                    ),
18101                )
18102            }
18103            /// Borrow the full [`DeleteLayoutTemplateSubscriptionResponseView`] with its lifetime tied to `&self`.
18104            #[must_use]
18105            pub fn view(&self) -> &DeleteLayoutTemplateSubscriptionResponseView<'_> {
18106                self.0.reborrow()
18107            }
18108            /// Convert to the owned message type.
18109            ///
18110            /// # Errors
18111            ///
18112            /// Returns an error if re-materializing preserved unknown fields
18113            /// fails (e.g. the unknown-field limit is exceeded).
18114            pub fn to_owned_message(
18115                &self,
18116            ) -> ::core::result::Result<
18117                super::super::DeleteLayoutTemplateSubscriptionResponse,
18118                ::buffa::DecodeError,
18119            > {
18120                self.0.to_owned_message()
18121            }
18122            /// The underlying bytes buffer.
18123            #[must_use]
18124            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
18125                self.0.bytes()
18126            }
18127            /// Consume the handle, returning the underlying bytes buffer.
18128            #[must_use]
18129            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
18130                self.0.into_bytes()
18131            }
18132        }
18133        impl ::core::convert::From<
18134            ::buffa::OwnedView<DeleteLayoutTemplateSubscriptionResponseView<'static>>,
18135        > for DeleteLayoutTemplateSubscriptionResponseOwnedView {
18136            fn from(
18137                inner: ::buffa::OwnedView<
18138                    DeleteLayoutTemplateSubscriptionResponseView<'static>,
18139                >,
18140            ) -> Self {
18141                DeleteLayoutTemplateSubscriptionResponseOwnedView(inner)
18142            }
18143        }
18144        impl ::core::convert::From<DeleteLayoutTemplateSubscriptionResponseOwnedView>
18145        for ::buffa::OwnedView<DeleteLayoutTemplateSubscriptionResponseView<'static>> {
18146            fn from(wrapper: DeleteLayoutTemplateSubscriptionResponseOwnedView) -> Self {
18147                wrapper.0
18148            }
18149        }
18150        impl ::core::convert::AsRef<
18151            ::buffa::OwnedView<DeleteLayoutTemplateSubscriptionResponseView<'static>>,
18152        > for DeleteLayoutTemplateSubscriptionResponseOwnedView {
18153            fn as_ref(
18154                &self,
18155            ) -> &::buffa::OwnedView<
18156                DeleteLayoutTemplateSubscriptionResponseView<'static>,
18157            > {
18158                &self.0
18159            }
18160        }
18161        impl ::buffa::HasMessageView
18162        for super::super::DeleteLayoutTemplateSubscriptionResponse {
18163            type View<'a> = DeleteLayoutTemplateSubscriptionResponseView<'a>;
18164            type ViewHandle = DeleteLayoutTemplateSubscriptionResponseOwnedView;
18165        }
18166        impl ::serde::Serialize for DeleteLayoutTemplateSubscriptionResponseOwnedView {
18167            fn serialize<__S: ::serde::Serializer>(
18168                &self,
18169                __s: __S,
18170            ) -> ::core::result::Result<__S::Ok, __S::Error> {
18171                ::serde::Serialize::serialize(&self.0, __s)
18172            }
18173        }
18174        /// LayoutTemplateSubscription describes one template followed by a viewer.
18175        #[derive(Clone, Debug, Default)]
18176        pub struct LayoutTemplateSubscriptionView<'a> {
18177            /// Viewer that follows the template.
18178            ///
18179            /// Field 1: `viewer_id`
18180            pub viewer_id: u64,
18181            /// Viewer that owns the template.
18182            ///
18183            /// Field 2: `owner_id`
18184            pub owner_id: u64,
18185            /// Followed template identifier.
18186            ///
18187            /// Field 3: `template_id`
18188            pub template_id: u64,
18189            /// True when the subscription follows the latest version automatically.
18190            ///
18191            /// Field 4: `track_latest`
18192            pub track_latest: bool,
18193            /// Version followed when track_latest is false.
18194            ///
18195            /// Field 5: `pinned_version`
18196            pub pinned_version: ::core::option::Option<u32>,
18197            /// Subscription update time in milliseconds since epoch (UTC).
18198            ///
18199            /// Field 6: `updated_at_ms`
18200            pub updated_at_ms: u64,
18201            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
18202        }
18203        impl<'a> ::buffa::MessageView<'a> for LayoutTemplateSubscriptionView<'a> {
18204            type Owned = super::super::LayoutTemplateSubscription;
18205            fn decode_view(
18206                buf: &'a [u8],
18207            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18208                let __limit = ::core::cell::Cell::new(
18209                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
18210                );
18211                <Self as ::buffa::MessageView>::decode_view_ctx(
18212                    buf,
18213                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
18214                )
18215            }
18216            fn decode_view_with_ctx(
18217                buf: &'a [u8],
18218                ctx: ::buffa::DecodeContext<'_>,
18219            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18220                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
18221            }
18222            fn merge_view_field(
18223                &mut self,
18224                tag: ::buffa::encoding::Tag,
18225                cur: &'a [u8],
18226                before_tag: &'a [u8],
18227                ctx: ::buffa::DecodeContext<'_>,
18228            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
18229                let _ = ctx;
18230                #[allow(unused_variables)]
18231                let view = self;
18232                let mut cur = cur;
18233                match tag.field_number() {
18234                    1u32 => {
18235                        ::buffa::encoding::check_wire_type(
18236                            tag,
18237                            ::buffa::encoding::WireType::Fixed64,
18238                        )?;
18239                        view.viewer_id = ::buffa::types::decode_fixed64(&mut cur)?;
18240                    }
18241                    2u32 => {
18242                        ::buffa::encoding::check_wire_type(
18243                            tag,
18244                            ::buffa::encoding::WireType::Fixed64,
18245                        )?;
18246                        view.owner_id = ::buffa::types::decode_fixed64(&mut cur)?;
18247                    }
18248                    3u32 => {
18249                        ::buffa::encoding::check_wire_type(
18250                            tag,
18251                            ::buffa::encoding::WireType::Fixed64,
18252                        )?;
18253                        view.template_id = ::buffa::types::decode_fixed64(&mut cur)?;
18254                    }
18255                    4u32 => {
18256                        ::buffa::encoding::check_wire_type(
18257                            tag,
18258                            ::buffa::encoding::WireType::Varint,
18259                        )?;
18260                        view.track_latest = ::buffa::types::decode_bool(&mut cur)?;
18261                    }
18262                    5u32 => {
18263                        ::buffa::encoding::check_wire_type(
18264                            tag,
18265                            ::buffa::encoding::WireType::Varint,
18266                        )?;
18267                        view.pinned_version = Some(
18268                            ::buffa::types::decode_uint32(&mut cur)?,
18269                        );
18270                    }
18271                    6u32 => {
18272                        ::buffa::encoding::check_wire_type(
18273                            tag,
18274                            ::buffa::encoding::WireType::Fixed64,
18275                        )?;
18276                        view.updated_at_ms = ::buffa::types::decode_fixed64(&mut cur)?;
18277                    }
18278                    _ => {
18279                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
18280                        let span_len = before_tag.len() - cur.len();
18281                        view.__buffa_unknown_fields
18282                            .push_record(before_tag, span_len, ctx)?;
18283                    }
18284                }
18285                ::core::result::Result::Ok(cur)
18286            }
18287            fn to_owned_message(
18288                &self,
18289            ) -> ::core::result::Result<
18290                super::super::LayoutTemplateSubscription,
18291                ::buffa::DecodeError,
18292            > {
18293                self.to_owned_from_source(None)
18294            }
18295            #[allow(clippy::useless_conversion, clippy::needless_update)]
18296            fn to_owned_from_source(
18297                &self,
18298                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
18299            ) -> ::core::result::Result<
18300                super::super::LayoutTemplateSubscription,
18301                ::buffa::DecodeError,
18302            > {
18303                #[allow(unused_imports)]
18304                use ::buffa::alloc::string::ToString as _;
18305                let _ = __buffa_src;
18306                ::core::result::Result::Ok(super::super::LayoutTemplateSubscription {
18307                    viewer_id: self.viewer_id,
18308                    owner_id: self.owner_id,
18309                    template_id: self.template_id,
18310                    track_latest: self.track_latest,
18311                    pinned_version: self.pinned_version,
18312                    updated_at_ms: self.updated_at_ms,
18313                    __buffa_unknown_fields: self
18314                        .__buffa_unknown_fields
18315                        .to_owned()?
18316                        .into(),
18317                    ..::core::default::Default::default()
18318                })
18319            }
18320        }
18321        impl<'a> ::buffa::ViewEncode<'a> for LayoutTemplateSubscriptionView<'a> {
18322            #[allow(clippy::needless_borrow, clippy::let_and_return)]
18323            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
18324                #[allow(unused_imports)]
18325                use ::buffa::Enumeration as _;
18326                let mut size = 0u32;
18327                if self.viewer_id != 0u64 {
18328                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
18329                }
18330                if self.owner_id != 0u64 {
18331                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
18332                }
18333                if self.template_id != 0u64 {
18334                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
18335                }
18336                if self.track_latest {
18337                    size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
18338                }
18339                if let Some(v) = self.pinned_version {
18340                    size += 1u32 + ::buffa::types::uint32_encoded_len(v) as u32;
18341                }
18342                if self.updated_at_ms != 0u64 {
18343                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
18344                }
18345                size += self.__buffa_unknown_fields.encoded_len() as u32;
18346                size
18347            }
18348            #[allow(clippy::needless_borrow)]
18349            fn write_to(
18350                &self,
18351                _cache: &mut ::buffa::SizeCache,
18352                buf: &mut impl ::buffa::bytes::BufMut,
18353            ) {
18354                #[allow(unused_imports)]
18355                use ::buffa::Enumeration as _;
18356                if self.viewer_id != 0u64 {
18357                    ::buffa::types::put_fixed64_field(1u32, self.viewer_id, buf);
18358                }
18359                if self.owner_id != 0u64 {
18360                    ::buffa::types::put_fixed64_field(2u32, self.owner_id, buf);
18361                }
18362                if self.template_id != 0u64 {
18363                    ::buffa::types::put_fixed64_field(3u32, self.template_id, buf);
18364                }
18365                if self.track_latest {
18366                    ::buffa::types::put_bool_field(4u32, self.track_latest, buf);
18367                }
18368                if let Some(v) = self.pinned_version {
18369                    ::buffa::types::put_uint32_field(5u32, v, buf);
18370                }
18371                if self.updated_at_ms != 0u64 {
18372                    ::buffa::types::put_fixed64_field(6u32, self.updated_at_ms, buf);
18373                }
18374                self.__buffa_unknown_fields.write_to(buf);
18375            }
18376        }
18377        /// Serializes this view as protobuf JSON.
18378        ///
18379        /// Implicit-presence fields with default values are omitted, `required`
18380        /// fields are always emitted, explicit-presence (`optional`) fields are
18381        /// emitted only when set, bytes fields are base64-encoded, and enum
18382        /// values are their proto name strings.
18383        ///
18384        /// This impl uses `serialize_map(None)` because the number of emitted
18385        /// fields depends on default-omission rules; serializers that require
18386        /// known map lengths (e.g. `bincode`) will return a runtime error.
18387        /// Use the owned message type for those formats.
18388        impl<'__a> ::serde::Serialize for LayoutTemplateSubscriptionView<'__a> {
18389            fn serialize<__S: ::serde::Serializer>(
18390                &self,
18391                __s: __S,
18392            ) -> ::core::result::Result<__S::Ok, __S::Error> {
18393                use ::serde::ser::SerializeMap as _;
18394                let mut __map = __s.serialize_map(::core::option::Option::None)?;
18395                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.viewer_id) {
18396                    __map
18397                        .serialize_entry(
18398                            "viewerId",
18399                            &::buffa::json_helpers::ProtoJson(&self.viewer_id),
18400                        )?;
18401                }
18402                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.owner_id) {
18403                    __map
18404                        .serialize_entry(
18405                            "ownerId",
18406                            &::buffa::json_helpers::ProtoJson(&self.owner_id),
18407                        )?;
18408                }
18409                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.template_id) {
18410                    __map
18411                        .serialize_entry(
18412                            "templateId",
18413                            &::buffa::json_helpers::ProtoJson(&self.template_id),
18414                        )?;
18415                }
18416                if self.track_latest {
18417                    __map.serialize_entry("trackLatest", &self.track_latest)?;
18418                }
18419                if let ::core::option::Option::Some(__v) = self.pinned_version {
18420                    __map
18421                        .serialize_entry(
18422                            "pinnedVersion",
18423                            &::buffa::json_helpers::ProtoJson(&__v),
18424                        )?;
18425                }
18426                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.updated_at_ms) {
18427                    __map
18428                        .serialize_entry(
18429                            "updatedAtMs",
18430                            &::buffa::json_helpers::ProtoJson(&self.updated_at_ms),
18431                        )?;
18432                }
18433                __map.end()
18434            }
18435        }
18436        impl<'a> ::buffa::MessageName for LayoutTemplateSubscriptionView<'a> {
18437            const PACKAGE: &'static str = "layout.v1";
18438            const NAME: &'static str = "LayoutTemplateSubscription";
18439            const FULL_NAME: &'static str = "layout.v1.LayoutTemplateSubscription";
18440            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.LayoutTemplateSubscription";
18441        }
18442        ::buffa::impl_default_view_instance!(LayoutTemplateSubscriptionView);
18443        ::buffa::impl_view_reborrow!(LayoutTemplateSubscriptionView);
18444        /** Self-contained, `'static` owned view of a `LayoutTemplateSubscription` message.
18445
18446 Wraps [`::buffa::OwnedView`]`<`[`LayoutTemplateSubscriptionView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
18447
18448 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`LayoutTemplateSubscriptionView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
18449        #[derive(Clone, Debug)]
18450        pub struct LayoutTemplateSubscriptionOwnedView(
18451            ::buffa::OwnedView<LayoutTemplateSubscriptionView<'static>>,
18452        );
18453        impl LayoutTemplateSubscriptionOwnedView {
18454            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
18455            ///
18456            /// The view borrows directly from the buffer's data; the buffer is
18457            /// retained inside the returned handle.
18458            ///
18459            /// # Errors
18460            ///
18461            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
18462            /// protobuf data.
18463            pub fn decode(
18464                bytes: ::buffa::bytes::Bytes,
18465            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18466                ::core::result::Result::Ok(
18467                    LayoutTemplateSubscriptionOwnedView(
18468                        ::buffa::OwnedView::decode(bytes)?,
18469                    ),
18470                )
18471            }
18472            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
18473            /// max message size).
18474            ///
18475            /// # Errors
18476            ///
18477            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
18478            /// exceeds the configured limits.
18479            pub fn decode_with_options(
18480                bytes: ::buffa::bytes::Bytes,
18481                opts: &::buffa::DecodeOptions,
18482            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18483                ::core::result::Result::Ok(
18484                    LayoutTemplateSubscriptionOwnedView(
18485                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
18486                    ),
18487                )
18488            }
18489            /// Build from an owned message via an encode → decode round-trip.
18490            ///
18491            /// # Errors
18492            ///
18493            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
18494            /// somehow invalid (should not happen for well-formed messages).
18495            pub fn from_owned(
18496                msg: &super::super::LayoutTemplateSubscription,
18497            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18498                ::core::result::Result::Ok(
18499                    LayoutTemplateSubscriptionOwnedView(
18500                        ::buffa::OwnedView::from_owned(msg)?,
18501                    ),
18502                )
18503            }
18504            /// Borrow the full [`LayoutTemplateSubscriptionView`] with its lifetime tied to `&self`.
18505            #[must_use]
18506            pub fn view(&self) -> &LayoutTemplateSubscriptionView<'_> {
18507                self.0.reborrow()
18508            }
18509            /// Convert to the owned message type.
18510            ///
18511            /// # Errors
18512            ///
18513            /// Returns an error if re-materializing preserved unknown fields
18514            /// fails (e.g. the unknown-field limit is exceeded).
18515            pub fn to_owned_message(
18516                &self,
18517            ) -> ::core::result::Result<
18518                super::super::LayoutTemplateSubscription,
18519                ::buffa::DecodeError,
18520            > {
18521                self.0.to_owned_message()
18522            }
18523            /// The underlying bytes buffer.
18524            #[must_use]
18525            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
18526                self.0.bytes()
18527            }
18528            /// Consume the handle, returning the underlying bytes buffer.
18529            #[must_use]
18530            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
18531                self.0.into_bytes()
18532            }
18533            /// Viewer that follows the template.
18534            ///
18535            /// Field 1: `viewer_id`
18536            #[must_use]
18537            pub fn viewer_id(&self) -> u64 {
18538                self.0.reborrow().viewer_id
18539            }
18540            /// Viewer that owns the template.
18541            ///
18542            /// Field 2: `owner_id`
18543            #[must_use]
18544            pub fn owner_id(&self) -> u64 {
18545                self.0.reborrow().owner_id
18546            }
18547            /// Followed template identifier.
18548            ///
18549            /// Field 3: `template_id`
18550            #[must_use]
18551            pub fn template_id(&self) -> u64 {
18552                self.0.reborrow().template_id
18553            }
18554            /// True when the subscription follows the latest version automatically.
18555            ///
18556            /// Field 4: `track_latest`
18557            #[must_use]
18558            pub fn track_latest(&self) -> bool {
18559                self.0.reborrow().track_latest
18560            }
18561            /// Version followed when track_latest is false.
18562            ///
18563            /// Field 5: `pinned_version`
18564            #[must_use]
18565            pub fn pinned_version(&self) -> ::core::option::Option<u32> {
18566                self.0.reborrow().pinned_version
18567            }
18568            /// Subscription update time in milliseconds since epoch (UTC).
18569            ///
18570            /// Field 6: `updated_at_ms`
18571            #[must_use]
18572            pub fn updated_at_ms(&self) -> u64 {
18573                self.0.reborrow().updated_at_ms
18574            }
18575        }
18576        impl ::core::convert::From<
18577            ::buffa::OwnedView<LayoutTemplateSubscriptionView<'static>>,
18578        > for LayoutTemplateSubscriptionOwnedView {
18579            fn from(
18580                inner: ::buffa::OwnedView<LayoutTemplateSubscriptionView<'static>>,
18581            ) -> Self {
18582                LayoutTemplateSubscriptionOwnedView(inner)
18583            }
18584        }
18585        impl ::core::convert::From<LayoutTemplateSubscriptionOwnedView>
18586        for ::buffa::OwnedView<LayoutTemplateSubscriptionView<'static>> {
18587            fn from(wrapper: LayoutTemplateSubscriptionOwnedView) -> Self {
18588                wrapper.0
18589            }
18590        }
18591        impl ::core::convert::AsRef<
18592            ::buffa::OwnedView<LayoutTemplateSubscriptionView<'static>>,
18593        > for LayoutTemplateSubscriptionOwnedView {
18594            fn as_ref(
18595                &self,
18596            ) -> &::buffa::OwnedView<LayoutTemplateSubscriptionView<'static>> {
18597                &self.0
18598            }
18599        }
18600        impl ::buffa::HasMessageView for super::super::LayoutTemplateSubscription {
18601            type View<'a> = LayoutTemplateSubscriptionView<'a>;
18602            type ViewHandle = LayoutTemplateSubscriptionOwnedView;
18603        }
18604        impl ::serde::Serialize for LayoutTemplateSubscriptionOwnedView {
18605            fn serialize<__S: ::serde::Serializer>(
18606                &self,
18607                __s: __S,
18608            ) -> ::core::result::Result<__S::Ok, __S::Error> {
18609                ::serde::Serialize::serialize(&self.0, __s)
18610            }
18611        }
18612        /// ListMyLayoutTemplateSubscriptionsRequest lists templates followed by the authenticated caller.
18613        #[derive(Clone, Debug, Default)]
18614        pub struct ListMyLayoutTemplateSubscriptionsRequestView<'a> {
18615            /// Maximum number of subscriptions to return. Defaults to 100 when omitted;
18616            /// maximum is 500.
18617            ///
18618            /// Field 1: `limit`
18619            pub limit: u32,
18620            /// Opaque keyset cursor from a previous response. The cursor is exclusive and
18621            /// bound to the authenticated caller and newest-updated sort order.
18622            ///
18623            /// Field 2: `page_token`
18624            pub page_token: &'a str,
18625            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
18626        }
18627        impl<'a> ::buffa::MessageView<'a>
18628        for ListMyLayoutTemplateSubscriptionsRequestView<'a> {
18629            type Owned = super::super::ListMyLayoutTemplateSubscriptionsRequest;
18630            fn decode_view(
18631                buf: &'a [u8],
18632            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18633                let __limit = ::core::cell::Cell::new(
18634                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
18635                );
18636                <Self as ::buffa::MessageView>::decode_view_ctx(
18637                    buf,
18638                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
18639                )
18640            }
18641            fn decode_view_with_ctx(
18642                buf: &'a [u8],
18643                ctx: ::buffa::DecodeContext<'_>,
18644            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18645                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
18646            }
18647            fn merge_view_field(
18648                &mut self,
18649                tag: ::buffa::encoding::Tag,
18650                cur: &'a [u8],
18651                before_tag: &'a [u8],
18652                ctx: ::buffa::DecodeContext<'_>,
18653            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
18654                let _ = ctx;
18655                #[allow(unused_variables)]
18656                let view = self;
18657                let mut cur = cur;
18658                match tag.field_number() {
18659                    1u32 => {
18660                        ::buffa::encoding::check_wire_type(
18661                            tag,
18662                            ::buffa::encoding::WireType::Varint,
18663                        )?;
18664                        view.limit = ::buffa::types::decode_uint32(&mut cur)?;
18665                    }
18666                    2u32 => {
18667                        ::buffa::encoding::check_wire_type(
18668                            tag,
18669                            ::buffa::encoding::WireType::LengthDelimited,
18670                        )?;
18671                        view.page_token = ::buffa::types::borrow_str(&mut cur)?;
18672                    }
18673                    _ => {
18674                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
18675                        let span_len = before_tag.len() - cur.len();
18676                        view.__buffa_unknown_fields
18677                            .push_record(before_tag, span_len, ctx)?;
18678                    }
18679                }
18680                ::core::result::Result::Ok(cur)
18681            }
18682            fn to_owned_message(
18683                &self,
18684            ) -> ::core::result::Result<
18685                super::super::ListMyLayoutTemplateSubscriptionsRequest,
18686                ::buffa::DecodeError,
18687            > {
18688                self.to_owned_from_source(None)
18689            }
18690            #[allow(clippy::useless_conversion, clippy::needless_update)]
18691            fn to_owned_from_source(
18692                &self,
18693                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
18694            ) -> ::core::result::Result<
18695                super::super::ListMyLayoutTemplateSubscriptionsRequest,
18696                ::buffa::DecodeError,
18697            > {
18698                #[allow(unused_imports)]
18699                use ::buffa::alloc::string::ToString as _;
18700                let _ = __buffa_src;
18701                ::core::result::Result::Ok(super::super::ListMyLayoutTemplateSubscriptionsRequest {
18702                    limit: self.limit,
18703                    page_token: self.page_token.to_string(),
18704                    __buffa_unknown_fields: self
18705                        .__buffa_unknown_fields
18706                        .to_owned()?
18707                        .into(),
18708                    ..::core::default::Default::default()
18709                })
18710            }
18711        }
18712        impl<'a> ::buffa::ViewEncode<'a>
18713        for ListMyLayoutTemplateSubscriptionsRequestView<'a> {
18714            #[allow(clippy::needless_borrow, clippy::let_and_return)]
18715            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
18716                #[allow(unused_imports)]
18717                use ::buffa::Enumeration as _;
18718                let mut size = 0u32;
18719                if self.limit != 0u32 {
18720                    size += 1u32 + ::buffa::types::uint32_encoded_len(self.limit) as u32;
18721                }
18722                if !self.page_token.is_empty() {
18723                    size
18724                        += 1u32
18725                            + ::buffa::types::string_encoded_len(&self.page_token)
18726                                as u32;
18727                }
18728                size += self.__buffa_unknown_fields.encoded_len() as u32;
18729                size
18730            }
18731            #[allow(clippy::needless_borrow)]
18732            fn write_to(
18733                &self,
18734                _cache: &mut ::buffa::SizeCache,
18735                buf: &mut impl ::buffa::bytes::BufMut,
18736            ) {
18737                #[allow(unused_imports)]
18738                use ::buffa::Enumeration as _;
18739                if self.limit != 0u32 {
18740                    ::buffa::types::put_uint32_field(1u32, self.limit, buf);
18741                }
18742                if !self.page_token.is_empty() {
18743                    ::buffa::types::put_string_field(2u32, &self.page_token, buf);
18744                }
18745                self.__buffa_unknown_fields.write_to(buf);
18746            }
18747        }
18748        /// Serializes this view as protobuf JSON.
18749        ///
18750        /// Implicit-presence fields with default values are omitted, `required`
18751        /// fields are always emitted, explicit-presence (`optional`) fields are
18752        /// emitted only when set, bytes fields are base64-encoded, and enum
18753        /// values are their proto name strings.
18754        ///
18755        /// This impl uses `serialize_map(None)` because the number of emitted
18756        /// fields depends on default-omission rules; serializers that require
18757        /// known map lengths (e.g. `bincode`) will return a runtime error.
18758        /// Use the owned message type for those formats.
18759        impl<'__a> ::serde::Serialize
18760        for ListMyLayoutTemplateSubscriptionsRequestView<'__a> {
18761            fn serialize<__S: ::serde::Serializer>(
18762                &self,
18763                __s: __S,
18764            ) -> ::core::result::Result<__S::Ok, __S::Error> {
18765                use ::serde::ser::SerializeMap as _;
18766                let mut __map = __s.serialize_map(::core::option::Option::None)?;
18767                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.limit) {
18768                    __map
18769                        .serialize_entry(
18770                            "limit",
18771                            &::buffa::json_helpers::ProtoJson(&self.limit),
18772                        )?;
18773                }
18774                if !::buffa::json_helpers::skip_if::is_empty_str(self.page_token) {
18775                    __map.serialize_entry("pageToken", self.page_token)?;
18776                }
18777                __map.end()
18778            }
18779        }
18780        impl<'a> ::buffa::MessageName
18781        for ListMyLayoutTemplateSubscriptionsRequestView<'a> {
18782            const PACKAGE: &'static str = "layout.v1";
18783            const NAME: &'static str = "ListMyLayoutTemplateSubscriptionsRequest";
18784            const FULL_NAME: &'static str = "layout.v1.ListMyLayoutTemplateSubscriptionsRequest";
18785            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListMyLayoutTemplateSubscriptionsRequest";
18786        }
18787        ::buffa::impl_default_view_instance!(
18788            ListMyLayoutTemplateSubscriptionsRequestView
18789        );
18790        ::buffa::impl_view_reborrow!(ListMyLayoutTemplateSubscriptionsRequestView);
18791        /** Self-contained, `'static` owned view of a `ListMyLayoutTemplateSubscriptionsRequest` message.
18792
18793 Wraps [`::buffa::OwnedView`]`<`[`ListMyLayoutTemplateSubscriptionsRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
18794
18795 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ListMyLayoutTemplateSubscriptionsRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
18796        #[derive(Clone, Debug)]
18797        pub struct ListMyLayoutTemplateSubscriptionsRequestOwnedView(
18798            ::buffa::OwnedView<ListMyLayoutTemplateSubscriptionsRequestView<'static>>,
18799        );
18800        impl ListMyLayoutTemplateSubscriptionsRequestOwnedView {
18801            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
18802            ///
18803            /// The view borrows directly from the buffer's data; the buffer is
18804            /// retained inside the returned handle.
18805            ///
18806            /// # Errors
18807            ///
18808            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
18809            /// protobuf data.
18810            pub fn decode(
18811                bytes: ::buffa::bytes::Bytes,
18812            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18813                ::core::result::Result::Ok(
18814                    ListMyLayoutTemplateSubscriptionsRequestOwnedView(
18815                        ::buffa::OwnedView::decode(bytes)?,
18816                    ),
18817                )
18818            }
18819            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
18820            /// max message size).
18821            ///
18822            /// # Errors
18823            ///
18824            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
18825            /// exceeds the configured limits.
18826            pub fn decode_with_options(
18827                bytes: ::buffa::bytes::Bytes,
18828                opts: &::buffa::DecodeOptions,
18829            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18830                ::core::result::Result::Ok(
18831                    ListMyLayoutTemplateSubscriptionsRequestOwnedView(
18832                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
18833                    ),
18834                )
18835            }
18836            /// Build from an owned message via an encode → decode round-trip.
18837            ///
18838            /// # Errors
18839            ///
18840            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
18841            /// somehow invalid (should not happen for well-formed messages).
18842            pub fn from_owned(
18843                msg: &super::super::ListMyLayoutTemplateSubscriptionsRequest,
18844            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18845                ::core::result::Result::Ok(
18846                    ListMyLayoutTemplateSubscriptionsRequestOwnedView(
18847                        ::buffa::OwnedView::from_owned(msg)?,
18848                    ),
18849                )
18850            }
18851            /// Borrow the full [`ListMyLayoutTemplateSubscriptionsRequestView`] with its lifetime tied to `&self`.
18852            #[must_use]
18853            pub fn view(&self) -> &ListMyLayoutTemplateSubscriptionsRequestView<'_> {
18854                self.0.reborrow()
18855            }
18856            /// Convert to the owned message type.
18857            ///
18858            /// # Errors
18859            ///
18860            /// Returns an error if re-materializing preserved unknown fields
18861            /// fails (e.g. the unknown-field limit is exceeded).
18862            pub fn to_owned_message(
18863                &self,
18864            ) -> ::core::result::Result<
18865                super::super::ListMyLayoutTemplateSubscriptionsRequest,
18866                ::buffa::DecodeError,
18867            > {
18868                self.0.to_owned_message()
18869            }
18870            /// The underlying bytes buffer.
18871            #[must_use]
18872            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
18873                self.0.bytes()
18874            }
18875            /// Consume the handle, returning the underlying bytes buffer.
18876            #[must_use]
18877            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
18878                self.0.into_bytes()
18879            }
18880            /// Maximum number of subscriptions to return. Defaults to 100 when omitted;
18881            /// maximum is 500.
18882            ///
18883            /// Field 1: `limit`
18884            #[must_use]
18885            pub fn limit(&self) -> u32 {
18886                self.0.reborrow().limit
18887            }
18888            /// Opaque keyset cursor from a previous response. The cursor is exclusive and
18889            /// bound to the authenticated caller and newest-updated sort order.
18890            ///
18891            /// Field 2: `page_token`
18892            #[must_use]
18893            pub fn page_token(&self) -> &'_ str {
18894                self.0.reborrow().page_token
18895            }
18896        }
18897        impl ::core::convert::From<
18898            ::buffa::OwnedView<ListMyLayoutTemplateSubscriptionsRequestView<'static>>,
18899        > for ListMyLayoutTemplateSubscriptionsRequestOwnedView {
18900            fn from(
18901                inner: ::buffa::OwnedView<
18902                    ListMyLayoutTemplateSubscriptionsRequestView<'static>,
18903                >,
18904            ) -> Self {
18905                ListMyLayoutTemplateSubscriptionsRequestOwnedView(inner)
18906            }
18907        }
18908        impl ::core::convert::From<ListMyLayoutTemplateSubscriptionsRequestOwnedView>
18909        for ::buffa::OwnedView<ListMyLayoutTemplateSubscriptionsRequestView<'static>> {
18910            fn from(wrapper: ListMyLayoutTemplateSubscriptionsRequestOwnedView) -> Self {
18911                wrapper.0
18912            }
18913        }
18914        impl ::core::convert::AsRef<
18915            ::buffa::OwnedView<ListMyLayoutTemplateSubscriptionsRequestView<'static>>,
18916        > for ListMyLayoutTemplateSubscriptionsRequestOwnedView {
18917            fn as_ref(
18918                &self,
18919            ) -> &::buffa::OwnedView<
18920                ListMyLayoutTemplateSubscriptionsRequestView<'static>,
18921            > {
18922                &self.0
18923            }
18924        }
18925        impl ::buffa::HasMessageView
18926        for super::super::ListMyLayoutTemplateSubscriptionsRequest {
18927            type View<'a> = ListMyLayoutTemplateSubscriptionsRequestView<'a>;
18928            type ViewHandle = ListMyLayoutTemplateSubscriptionsRequestOwnedView;
18929        }
18930        impl ::serde::Serialize for ListMyLayoutTemplateSubscriptionsRequestOwnedView {
18931            fn serialize<__S: ::serde::Serializer>(
18932                &self,
18933                __s: __S,
18934            ) -> ::core::result::Result<__S::Ok, __S::Error> {
18935                ::serde::Serialize::serialize(&self.0, __s)
18936            }
18937        }
18938        /// ListMyLayoutTemplateSubscriptionsResponse contains the caller's followed templates.
18939        #[derive(Clone, Debug, Default)]
18940        pub struct ListMyLayoutTemplateSubscriptionsResponseView<'a> {
18941            /// Followed templates for the caller, returned newest-updated first.
18942            ///
18943            /// Field 1: `subscriptions`
18944            pub subscriptions: ::buffa::RepeatedView<
18945                'a,
18946                super::super::__buffa::view::LayoutTemplateSubscriptionView<'a>,
18947            >,
18948            /// Opaque cursor for the next page. Empty when no more results exist.
18949            ///
18950            /// Field 2: `next_page_token`
18951            pub next_page_token: &'a str,
18952            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
18953        }
18954        impl<'a> ::buffa::MessageView<'a>
18955        for ListMyLayoutTemplateSubscriptionsResponseView<'a> {
18956            type Owned = super::super::ListMyLayoutTemplateSubscriptionsResponse;
18957            fn decode_view(
18958                buf: &'a [u8],
18959            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18960                let __limit = ::core::cell::Cell::new(
18961                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
18962                );
18963                <Self as ::buffa::MessageView>::decode_view_ctx(
18964                    buf,
18965                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
18966                )
18967            }
18968            fn decode_view_with_ctx(
18969                buf: &'a [u8],
18970                ctx: ::buffa::DecodeContext<'_>,
18971            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
18972                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
18973            }
18974            fn merge_view_field(
18975                &mut self,
18976                tag: ::buffa::encoding::Tag,
18977                cur: &'a [u8],
18978                before_tag: &'a [u8],
18979                ctx: ::buffa::DecodeContext<'_>,
18980            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
18981                let _ = ctx;
18982                #[allow(unused_variables)]
18983                let view = self;
18984                let mut cur = cur;
18985                match tag.field_number() {
18986                    2u32 => {
18987                        ::buffa::encoding::check_wire_type(
18988                            tag,
18989                            ::buffa::encoding::WireType::LengthDelimited,
18990                        )?;
18991                        view.next_page_token = ::buffa::types::borrow_str(&mut cur)?;
18992                    }
18993                    1u32 => {
18994                        ::buffa::encoding::check_wire_type(
18995                            tag,
18996                            ::buffa::encoding::WireType::LengthDelimited,
18997                        )?;
18998                        let __sub_ctx = ctx.descend()?;
18999                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
19000                        view.subscriptions
19001                            .push(
19002                                <super::super::__buffa::view::LayoutTemplateSubscriptionView as ::buffa::MessageView>::decode_view_ctx(
19003                                    sub,
19004                                    __sub_ctx,
19005                                )?,
19006                            );
19007                    }
19008                    _ => {
19009                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
19010                        let span_len = before_tag.len() - cur.len();
19011                        view.__buffa_unknown_fields
19012                            .push_record(before_tag, span_len, ctx)?;
19013                    }
19014                }
19015                ::core::result::Result::Ok(cur)
19016            }
19017            fn to_owned_message(
19018                &self,
19019            ) -> ::core::result::Result<
19020                super::super::ListMyLayoutTemplateSubscriptionsResponse,
19021                ::buffa::DecodeError,
19022            > {
19023                self.to_owned_from_source(None)
19024            }
19025            #[allow(clippy::useless_conversion, clippy::needless_update)]
19026            fn to_owned_from_source(
19027                &self,
19028                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
19029            ) -> ::core::result::Result<
19030                super::super::ListMyLayoutTemplateSubscriptionsResponse,
19031                ::buffa::DecodeError,
19032            > {
19033                #[allow(unused_imports)]
19034                use ::buffa::alloc::string::ToString as _;
19035                let _ = __buffa_src;
19036                ::core::result::Result::Ok(super::super::ListMyLayoutTemplateSubscriptionsResponse {
19037                    subscriptions: self
19038                        .subscriptions
19039                        .iter()
19040                        .map(|v| v.to_owned_from_source(__buffa_src))
19041                        .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
19042                    next_page_token: self.next_page_token.to_string(),
19043                    __buffa_unknown_fields: self
19044                        .__buffa_unknown_fields
19045                        .to_owned()?
19046                        .into(),
19047                    ..::core::default::Default::default()
19048                })
19049            }
19050        }
19051        impl<'a> ::buffa::ViewEncode<'a>
19052        for ListMyLayoutTemplateSubscriptionsResponseView<'a> {
19053            #[allow(clippy::needless_borrow, clippy::let_and_return)]
19054            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
19055                #[allow(unused_imports)]
19056                use ::buffa::Enumeration as _;
19057                let mut size = 0u32;
19058                for v in &self.subscriptions {
19059                    let __slot = __cache.reserve();
19060                    let inner_size = v.compute_size(__cache);
19061                    __cache.set(__slot, inner_size);
19062                    size
19063                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
19064                            + inner_size;
19065                }
19066                if !self.next_page_token.is_empty() {
19067                    size
19068                        += 1u32
19069                            + ::buffa::types::string_encoded_len(&self.next_page_token)
19070                                as u32;
19071                }
19072                size += self.__buffa_unknown_fields.encoded_len() as u32;
19073                size
19074            }
19075            #[allow(clippy::needless_borrow)]
19076            fn write_to(
19077                &self,
19078                __cache: &mut ::buffa::SizeCache,
19079                buf: &mut impl ::buffa::bytes::BufMut,
19080            ) {
19081                #[allow(unused_imports)]
19082                use ::buffa::Enumeration as _;
19083                for v in &self.subscriptions {
19084                    ::buffa::types::put_len_delimited_header(
19085                        1u32,
19086                        __cache.consume_next(),
19087                        buf,
19088                    );
19089                    v.write_to(__cache, buf);
19090                }
19091                if !self.next_page_token.is_empty() {
19092                    ::buffa::types::put_string_field(2u32, &self.next_page_token, buf);
19093                }
19094                self.__buffa_unknown_fields.write_to(buf);
19095            }
19096        }
19097        /// Serializes this view as protobuf JSON.
19098        ///
19099        /// Implicit-presence fields with default values are omitted, `required`
19100        /// fields are always emitted, explicit-presence (`optional`) fields are
19101        /// emitted only when set, bytes fields are base64-encoded, and enum
19102        /// values are their proto name strings.
19103        ///
19104        /// This impl uses `serialize_map(None)` because the number of emitted
19105        /// fields depends on default-omission rules; serializers that require
19106        /// known map lengths (e.g. `bincode`) will return a runtime error.
19107        /// Use the owned message type for those formats.
19108        impl<'__a> ::serde::Serialize
19109        for ListMyLayoutTemplateSubscriptionsResponseView<'__a> {
19110            fn serialize<__S: ::serde::Serializer>(
19111                &self,
19112                __s: __S,
19113            ) -> ::core::result::Result<__S::Ok, __S::Error> {
19114                use ::serde::ser::SerializeMap as _;
19115                let mut __map = __s.serialize_map(::core::option::Option::None)?;
19116                if !self.subscriptions.is_empty() {
19117                    __map.serialize_entry("subscriptions", &*self.subscriptions)?;
19118                }
19119                if !::buffa::json_helpers::skip_if::is_empty_str(self.next_page_token) {
19120                    __map.serialize_entry("nextPageToken", self.next_page_token)?;
19121                }
19122                __map.end()
19123            }
19124        }
19125        impl<'a> ::buffa::MessageName
19126        for ListMyLayoutTemplateSubscriptionsResponseView<'a> {
19127            const PACKAGE: &'static str = "layout.v1";
19128            const NAME: &'static str = "ListMyLayoutTemplateSubscriptionsResponse";
19129            const FULL_NAME: &'static str = "layout.v1.ListMyLayoutTemplateSubscriptionsResponse";
19130            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.ListMyLayoutTemplateSubscriptionsResponse";
19131        }
19132        ::buffa::impl_default_view_instance!(
19133            ListMyLayoutTemplateSubscriptionsResponseView
19134        );
19135        ::buffa::impl_view_reborrow!(ListMyLayoutTemplateSubscriptionsResponseView);
19136        /** Self-contained, `'static` owned view of a `ListMyLayoutTemplateSubscriptionsResponse` message.
19137
19138 Wraps [`::buffa::OwnedView`]`<`[`ListMyLayoutTemplateSubscriptionsResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
19139
19140 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ListMyLayoutTemplateSubscriptionsResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
19141        #[derive(Clone, Debug)]
19142        pub struct ListMyLayoutTemplateSubscriptionsResponseOwnedView(
19143            ::buffa::OwnedView<ListMyLayoutTemplateSubscriptionsResponseView<'static>>,
19144        );
19145        impl ListMyLayoutTemplateSubscriptionsResponseOwnedView {
19146            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
19147            ///
19148            /// The view borrows directly from the buffer's data; the buffer is
19149            /// retained inside the returned handle.
19150            ///
19151            /// # Errors
19152            ///
19153            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
19154            /// protobuf data.
19155            pub fn decode(
19156                bytes: ::buffa::bytes::Bytes,
19157            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19158                ::core::result::Result::Ok(
19159                    ListMyLayoutTemplateSubscriptionsResponseOwnedView(
19160                        ::buffa::OwnedView::decode(bytes)?,
19161                    ),
19162                )
19163            }
19164            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
19165            /// max message size).
19166            ///
19167            /// # Errors
19168            ///
19169            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
19170            /// exceeds the configured limits.
19171            pub fn decode_with_options(
19172                bytes: ::buffa::bytes::Bytes,
19173                opts: &::buffa::DecodeOptions,
19174            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19175                ::core::result::Result::Ok(
19176                    ListMyLayoutTemplateSubscriptionsResponseOwnedView(
19177                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
19178                    ),
19179                )
19180            }
19181            /// Build from an owned message via an encode → decode round-trip.
19182            ///
19183            /// # Errors
19184            ///
19185            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
19186            /// somehow invalid (should not happen for well-formed messages).
19187            pub fn from_owned(
19188                msg: &super::super::ListMyLayoutTemplateSubscriptionsResponse,
19189            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19190                ::core::result::Result::Ok(
19191                    ListMyLayoutTemplateSubscriptionsResponseOwnedView(
19192                        ::buffa::OwnedView::from_owned(msg)?,
19193                    ),
19194                )
19195            }
19196            /// Borrow the full [`ListMyLayoutTemplateSubscriptionsResponseView`] with its lifetime tied to `&self`.
19197            #[must_use]
19198            pub fn view(&self) -> &ListMyLayoutTemplateSubscriptionsResponseView<'_> {
19199                self.0.reborrow()
19200            }
19201            /// Convert to the owned message type.
19202            ///
19203            /// # Errors
19204            ///
19205            /// Returns an error if re-materializing preserved unknown fields
19206            /// fails (e.g. the unknown-field limit is exceeded).
19207            pub fn to_owned_message(
19208                &self,
19209            ) -> ::core::result::Result<
19210                super::super::ListMyLayoutTemplateSubscriptionsResponse,
19211                ::buffa::DecodeError,
19212            > {
19213                self.0.to_owned_message()
19214            }
19215            /// The underlying bytes buffer.
19216            #[must_use]
19217            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
19218                self.0.bytes()
19219            }
19220            /// Consume the handle, returning the underlying bytes buffer.
19221            #[must_use]
19222            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
19223                self.0.into_bytes()
19224            }
19225            /// Followed templates for the caller, returned newest-updated first.
19226            ///
19227            /// Field 1: `subscriptions`
19228            #[must_use]
19229            pub fn subscriptions(
19230                &self,
19231            ) -> &::buffa::RepeatedView<
19232                '_,
19233                super::super::__buffa::view::LayoutTemplateSubscriptionView<'_>,
19234            > {
19235                &self.0.reborrow().subscriptions
19236            }
19237            /// Opaque cursor for the next page. Empty when no more results exist.
19238            ///
19239            /// Field 2: `next_page_token`
19240            #[must_use]
19241            pub fn next_page_token(&self) -> &'_ str {
19242                self.0.reborrow().next_page_token
19243            }
19244        }
19245        impl ::core::convert::From<
19246            ::buffa::OwnedView<ListMyLayoutTemplateSubscriptionsResponseView<'static>>,
19247        > for ListMyLayoutTemplateSubscriptionsResponseOwnedView {
19248            fn from(
19249                inner: ::buffa::OwnedView<
19250                    ListMyLayoutTemplateSubscriptionsResponseView<'static>,
19251                >,
19252            ) -> Self {
19253                ListMyLayoutTemplateSubscriptionsResponseOwnedView(inner)
19254            }
19255        }
19256        impl ::core::convert::From<ListMyLayoutTemplateSubscriptionsResponseOwnedView>
19257        for ::buffa::OwnedView<ListMyLayoutTemplateSubscriptionsResponseView<'static>> {
19258            fn from(
19259                wrapper: ListMyLayoutTemplateSubscriptionsResponseOwnedView,
19260            ) -> Self {
19261                wrapper.0
19262            }
19263        }
19264        impl ::core::convert::AsRef<
19265            ::buffa::OwnedView<ListMyLayoutTemplateSubscriptionsResponseView<'static>>,
19266        > for ListMyLayoutTemplateSubscriptionsResponseOwnedView {
19267            fn as_ref(
19268                &self,
19269            ) -> &::buffa::OwnedView<
19270                ListMyLayoutTemplateSubscriptionsResponseView<'static>,
19271            > {
19272                &self.0
19273            }
19274        }
19275        impl ::buffa::HasMessageView
19276        for super::super::ListMyLayoutTemplateSubscriptionsResponse {
19277            type View<'a> = ListMyLayoutTemplateSubscriptionsResponseView<'a>;
19278            type ViewHandle = ListMyLayoutTemplateSubscriptionsResponseOwnedView;
19279        }
19280        impl ::serde::Serialize for ListMyLayoutTemplateSubscriptionsResponseOwnedView {
19281            fn serialize<__S: ::serde::Serializer>(
19282                &self,
19283                __s: __S,
19284            ) -> ::core::result::Result<__S::Ok, __S::Error> {
19285                ::serde::Serialize::serialize(&self.0, __s)
19286            }
19287        }
19288        /// =============================================================================
19289        /// Mutations
19290        /// =============================================================================
19291        ///
19292        /// UpsertLayoutRequest creates or updates a saved layout for the authenticated caller.
19293        #[derive(Clone, Debug, Default)]
19294        pub struct UpsertLayoutRequestView<'a> {
19295            /// Layout payload to save.
19296            ///
19297            /// Field 1: `layout`
19298            pub layout: ::buffa::MessageFieldView<
19299                super::super::__buffa::view::LayoutView<'a>,
19300            >,
19301            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
19302        }
19303        impl<'a> ::buffa::MessageView<'a> for UpsertLayoutRequestView<'a> {
19304            type Owned = super::super::UpsertLayoutRequest;
19305            fn decode_view(
19306                buf: &'a [u8],
19307            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19308                let __limit = ::core::cell::Cell::new(
19309                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
19310                );
19311                <Self as ::buffa::MessageView>::decode_view_ctx(
19312                    buf,
19313                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
19314                )
19315            }
19316            fn decode_view_with_ctx(
19317                buf: &'a [u8],
19318                ctx: ::buffa::DecodeContext<'_>,
19319            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19320                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
19321            }
19322            fn merge_view_field(
19323                &mut self,
19324                tag: ::buffa::encoding::Tag,
19325                cur: &'a [u8],
19326                before_tag: &'a [u8],
19327                ctx: ::buffa::DecodeContext<'_>,
19328            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
19329                let _ = ctx;
19330                #[allow(unused_variables)]
19331                let view = self;
19332                let mut cur = cur;
19333                match tag.field_number() {
19334                    1u32 => {
19335                        ::buffa::encoding::check_wire_type(
19336                            tag,
19337                            ::buffa::encoding::WireType::LengthDelimited,
19338                        )?;
19339                        let __sub_ctx = ctx.descend()?;
19340                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
19341                        match view.layout.as_mut() {
19342                            Some(existing) => {
19343                                ::buffa::MessageView::merge_into_view(
19344                                    existing,
19345                                    sub,
19346                                    __sub_ctx,
19347                                )?
19348                            }
19349                            None => {
19350                                view.layout = ::buffa::MessageFieldView::set(
19351                                    <super::super::__buffa::view::LayoutView as ::buffa::MessageView>::decode_view_ctx(
19352                                        sub,
19353                                        __sub_ctx,
19354                                    )?,
19355                                );
19356                            }
19357                        }
19358                    }
19359                    _ => {
19360                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
19361                        let span_len = before_tag.len() - cur.len();
19362                        view.__buffa_unknown_fields
19363                            .push_record(before_tag, span_len, ctx)?;
19364                    }
19365                }
19366                ::core::result::Result::Ok(cur)
19367            }
19368            fn to_owned_message(
19369                &self,
19370            ) -> ::core::result::Result<
19371                super::super::UpsertLayoutRequest,
19372                ::buffa::DecodeError,
19373            > {
19374                self.to_owned_from_source(None)
19375            }
19376            #[allow(clippy::useless_conversion, clippy::needless_update)]
19377            fn to_owned_from_source(
19378                &self,
19379                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
19380            ) -> ::core::result::Result<
19381                super::super::UpsertLayoutRequest,
19382                ::buffa::DecodeError,
19383            > {
19384                #[allow(unused_imports)]
19385                use ::buffa::alloc::string::ToString as _;
19386                let _ = __buffa_src;
19387                ::core::result::Result::Ok(super::super::UpsertLayoutRequest {
19388                    layout: match self.layout.as_option() {
19389                        Some(v) => {
19390                            ::buffa::MessageField::<
19391                                super::super::Layout,
19392                            >::some(v.to_owned_from_source(__buffa_src)?)
19393                        }
19394                        None => ::buffa::MessageField::none(),
19395                    },
19396                    __buffa_unknown_fields: self
19397                        .__buffa_unknown_fields
19398                        .to_owned()?
19399                        .into(),
19400                    ..::core::default::Default::default()
19401                })
19402            }
19403        }
19404        impl<'a> ::buffa::ViewEncode<'a> for UpsertLayoutRequestView<'a> {
19405            #[allow(clippy::needless_borrow, clippy::let_and_return)]
19406            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
19407                #[allow(unused_imports)]
19408                use ::buffa::Enumeration as _;
19409                let mut size = 0u32;
19410                if self.layout.is_set() {
19411                    let __slot = __cache.reserve();
19412                    let inner_size = self.layout.compute_size(__cache);
19413                    __cache.set(__slot, inner_size);
19414                    size
19415                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
19416                            + inner_size;
19417                }
19418                size += self.__buffa_unknown_fields.encoded_len() as u32;
19419                size
19420            }
19421            #[allow(clippy::needless_borrow)]
19422            fn write_to(
19423                &self,
19424                __cache: &mut ::buffa::SizeCache,
19425                buf: &mut impl ::buffa::bytes::BufMut,
19426            ) {
19427                #[allow(unused_imports)]
19428                use ::buffa::Enumeration as _;
19429                if self.layout.is_set() {
19430                    ::buffa::types::put_len_delimited_header(
19431                        1u32,
19432                        __cache.consume_next(),
19433                        buf,
19434                    );
19435                    self.layout.write_to(__cache, buf);
19436                }
19437                self.__buffa_unknown_fields.write_to(buf);
19438            }
19439        }
19440        /// Serializes this view as protobuf JSON.
19441        ///
19442        /// Implicit-presence fields with default values are omitted, `required`
19443        /// fields are always emitted, explicit-presence (`optional`) fields are
19444        /// emitted only when set, bytes fields are base64-encoded, and enum
19445        /// values are their proto name strings.
19446        ///
19447        /// This impl uses `serialize_map(None)` because the number of emitted
19448        /// fields depends on default-omission rules; serializers that require
19449        /// known map lengths (e.g. `bincode`) will return a runtime error.
19450        /// Use the owned message type for those formats.
19451        impl<'__a> ::serde::Serialize for UpsertLayoutRequestView<'__a> {
19452            fn serialize<__S: ::serde::Serializer>(
19453                &self,
19454                __s: __S,
19455            ) -> ::core::result::Result<__S::Ok, __S::Error> {
19456                use ::serde::ser::SerializeMap as _;
19457                let mut __map = __s.serialize_map(::core::option::Option::None)?;
19458                {
19459                    if let ::core::option::Option::Some(__v) = self.layout.as_option() {
19460                        __map.serialize_entry("layout", __v)?;
19461                    }
19462                }
19463                __map.end()
19464            }
19465        }
19466        impl<'a> ::buffa::MessageName for UpsertLayoutRequestView<'a> {
19467            const PACKAGE: &'static str = "layout.v1";
19468            const NAME: &'static str = "UpsertLayoutRequest";
19469            const FULL_NAME: &'static str = "layout.v1.UpsertLayoutRequest";
19470            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.UpsertLayoutRequest";
19471        }
19472        ::buffa::impl_default_view_instance!(UpsertLayoutRequestView);
19473        ::buffa::impl_view_reborrow!(UpsertLayoutRequestView);
19474        /** Self-contained, `'static` owned view of a `UpsertLayoutRequest` message.
19475
19476 Wraps [`::buffa::OwnedView`]`<`[`UpsertLayoutRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
19477
19478 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`UpsertLayoutRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
19479        #[derive(Clone, Debug)]
19480        pub struct UpsertLayoutRequestOwnedView(
19481            ::buffa::OwnedView<UpsertLayoutRequestView<'static>>,
19482        );
19483        impl UpsertLayoutRequestOwnedView {
19484            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
19485            ///
19486            /// The view borrows directly from the buffer's data; the buffer is
19487            /// retained inside the returned handle.
19488            ///
19489            /// # Errors
19490            ///
19491            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
19492            /// protobuf data.
19493            pub fn decode(
19494                bytes: ::buffa::bytes::Bytes,
19495            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19496                ::core::result::Result::Ok(
19497                    UpsertLayoutRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
19498                )
19499            }
19500            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
19501            /// max message size).
19502            ///
19503            /// # Errors
19504            ///
19505            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
19506            /// exceeds the configured limits.
19507            pub fn decode_with_options(
19508                bytes: ::buffa::bytes::Bytes,
19509                opts: &::buffa::DecodeOptions,
19510            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19511                ::core::result::Result::Ok(
19512                    UpsertLayoutRequestOwnedView(
19513                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
19514                    ),
19515                )
19516            }
19517            /// Build from an owned message via an encode → decode round-trip.
19518            ///
19519            /// # Errors
19520            ///
19521            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
19522            /// somehow invalid (should not happen for well-formed messages).
19523            pub fn from_owned(
19524                msg: &super::super::UpsertLayoutRequest,
19525            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19526                ::core::result::Result::Ok(
19527                    UpsertLayoutRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
19528                )
19529            }
19530            /// Borrow the full [`UpsertLayoutRequestView`] with its lifetime tied to `&self`.
19531            #[must_use]
19532            pub fn view(&self) -> &UpsertLayoutRequestView<'_> {
19533                self.0.reborrow()
19534            }
19535            /// Convert to the owned message type.
19536            ///
19537            /// # Errors
19538            ///
19539            /// Returns an error if re-materializing preserved unknown fields
19540            /// fails (e.g. the unknown-field limit is exceeded).
19541            pub fn to_owned_message(
19542                &self,
19543            ) -> ::core::result::Result<
19544                super::super::UpsertLayoutRequest,
19545                ::buffa::DecodeError,
19546            > {
19547                self.0.to_owned_message()
19548            }
19549            /// The underlying bytes buffer.
19550            #[must_use]
19551            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
19552                self.0.bytes()
19553            }
19554            /// Consume the handle, returning the underlying bytes buffer.
19555            #[must_use]
19556            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
19557                self.0.into_bytes()
19558            }
19559            /// Layout payload to save.
19560            ///
19561            /// Field 1: `layout`
19562            #[must_use]
19563            pub fn layout(
19564                &self,
19565            ) -> &::buffa::MessageFieldView<
19566                super::super::__buffa::view::LayoutView<'_>,
19567            > {
19568                &self.0.reborrow().layout
19569            }
19570        }
19571        impl ::core::convert::From<::buffa::OwnedView<UpsertLayoutRequestView<'static>>>
19572        for UpsertLayoutRequestOwnedView {
19573            fn from(
19574                inner: ::buffa::OwnedView<UpsertLayoutRequestView<'static>>,
19575            ) -> Self {
19576                UpsertLayoutRequestOwnedView(inner)
19577            }
19578        }
19579        impl ::core::convert::From<UpsertLayoutRequestOwnedView>
19580        for ::buffa::OwnedView<UpsertLayoutRequestView<'static>> {
19581            fn from(wrapper: UpsertLayoutRequestOwnedView) -> Self {
19582                wrapper.0
19583            }
19584        }
19585        impl ::core::convert::AsRef<::buffa::OwnedView<UpsertLayoutRequestView<'static>>>
19586        for UpsertLayoutRequestOwnedView {
19587            fn as_ref(&self) -> &::buffa::OwnedView<UpsertLayoutRequestView<'static>> {
19588                &self.0
19589            }
19590        }
19591        impl ::buffa::HasMessageView for super::super::UpsertLayoutRequest {
19592            type View<'a> = UpsertLayoutRequestView<'a>;
19593            type ViewHandle = UpsertLayoutRequestOwnedView;
19594        }
19595        impl ::serde::Serialize for UpsertLayoutRequestOwnedView {
19596            fn serialize<__S: ::serde::Serializer>(
19597                &self,
19598                __s: __S,
19599            ) -> ::core::result::Result<__S::Ok, __S::Error> {
19600                ::serde::Serialize::serialize(&self.0, __s)
19601            }
19602        }
19603        /// UpsertLayoutResponse returns the saved layout.
19604        #[derive(Clone, Debug, Default)]
19605        pub struct UpsertLayoutResponseView<'a> {
19606            /// Saved layout after server-side ownership and timestamp handling.
19607            ///
19608            /// Field 1: `layout`
19609            pub layout: ::buffa::MessageFieldView<
19610                super::super::__buffa::view::LayoutView<'a>,
19611            >,
19612            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
19613        }
19614        impl<'a> ::buffa::MessageView<'a> for UpsertLayoutResponseView<'a> {
19615            type Owned = super::super::UpsertLayoutResponse;
19616            fn decode_view(
19617                buf: &'a [u8],
19618            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19619                let __limit = ::core::cell::Cell::new(
19620                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
19621                );
19622                <Self as ::buffa::MessageView>::decode_view_ctx(
19623                    buf,
19624                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
19625                )
19626            }
19627            fn decode_view_with_ctx(
19628                buf: &'a [u8],
19629                ctx: ::buffa::DecodeContext<'_>,
19630            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19631                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
19632            }
19633            fn merge_view_field(
19634                &mut self,
19635                tag: ::buffa::encoding::Tag,
19636                cur: &'a [u8],
19637                before_tag: &'a [u8],
19638                ctx: ::buffa::DecodeContext<'_>,
19639            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
19640                let _ = ctx;
19641                #[allow(unused_variables)]
19642                let view = self;
19643                let mut cur = cur;
19644                match tag.field_number() {
19645                    1u32 => {
19646                        ::buffa::encoding::check_wire_type(
19647                            tag,
19648                            ::buffa::encoding::WireType::LengthDelimited,
19649                        )?;
19650                        let __sub_ctx = ctx.descend()?;
19651                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
19652                        match view.layout.as_mut() {
19653                            Some(existing) => {
19654                                ::buffa::MessageView::merge_into_view(
19655                                    existing,
19656                                    sub,
19657                                    __sub_ctx,
19658                                )?
19659                            }
19660                            None => {
19661                                view.layout = ::buffa::MessageFieldView::set(
19662                                    <super::super::__buffa::view::LayoutView as ::buffa::MessageView>::decode_view_ctx(
19663                                        sub,
19664                                        __sub_ctx,
19665                                    )?,
19666                                );
19667                            }
19668                        }
19669                    }
19670                    _ => {
19671                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
19672                        let span_len = before_tag.len() - cur.len();
19673                        view.__buffa_unknown_fields
19674                            .push_record(before_tag, span_len, ctx)?;
19675                    }
19676                }
19677                ::core::result::Result::Ok(cur)
19678            }
19679            fn to_owned_message(
19680                &self,
19681            ) -> ::core::result::Result<
19682                super::super::UpsertLayoutResponse,
19683                ::buffa::DecodeError,
19684            > {
19685                self.to_owned_from_source(None)
19686            }
19687            #[allow(clippy::useless_conversion, clippy::needless_update)]
19688            fn to_owned_from_source(
19689                &self,
19690                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
19691            ) -> ::core::result::Result<
19692                super::super::UpsertLayoutResponse,
19693                ::buffa::DecodeError,
19694            > {
19695                #[allow(unused_imports)]
19696                use ::buffa::alloc::string::ToString as _;
19697                let _ = __buffa_src;
19698                ::core::result::Result::Ok(super::super::UpsertLayoutResponse {
19699                    layout: match self.layout.as_option() {
19700                        Some(v) => {
19701                            ::buffa::MessageField::<
19702                                super::super::Layout,
19703                            >::some(v.to_owned_from_source(__buffa_src)?)
19704                        }
19705                        None => ::buffa::MessageField::none(),
19706                    },
19707                    __buffa_unknown_fields: self
19708                        .__buffa_unknown_fields
19709                        .to_owned()?
19710                        .into(),
19711                    ..::core::default::Default::default()
19712                })
19713            }
19714        }
19715        impl<'a> ::buffa::ViewEncode<'a> for UpsertLayoutResponseView<'a> {
19716            #[allow(clippy::needless_borrow, clippy::let_and_return)]
19717            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
19718                #[allow(unused_imports)]
19719                use ::buffa::Enumeration as _;
19720                let mut size = 0u32;
19721                if self.layout.is_set() {
19722                    let __slot = __cache.reserve();
19723                    let inner_size = self.layout.compute_size(__cache);
19724                    __cache.set(__slot, inner_size);
19725                    size
19726                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
19727                            + inner_size;
19728                }
19729                size += self.__buffa_unknown_fields.encoded_len() as u32;
19730                size
19731            }
19732            #[allow(clippy::needless_borrow)]
19733            fn write_to(
19734                &self,
19735                __cache: &mut ::buffa::SizeCache,
19736                buf: &mut impl ::buffa::bytes::BufMut,
19737            ) {
19738                #[allow(unused_imports)]
19739                use ::buffa::Enumeration as _;
19740                if self.layout.is_set() {
19741                    ::buffa::types::put_len_delimited_header(
19742                        1u32,
19743                        __cache.consume_next(),
19744                        buf,
19745                    );
19746                    self.layout.write_to(__cache, buf);
19747                }
19748                self.__buffa_unknown_fields.write_to(buf);
19749            }
19750        }
19751        /// Serializes this view as protobuf JSON.
19752        ///
19753        /// Implicit-presence fields with default values are omitted, `required`
19754        /// fields are always emitted, explicit-presence (`optional`) fields are
19755        /// emitted only when set, bytes fields are base64-encoded, and enum
19756        /// values are their proto name strings.
19757        ///
19758        /// This impl uses `serialize_map(None)` because the number of emitted
19759        /// fields depends on default-omission rules; serializers that require
19760        /// known map lengths (e.g. `bincode`) will return a runtime error.
19761        /// Use the owned message type for those formats.
19762        impl<'__a> ::serde::Serialize for UpsertLayoutResponseView<'__a> {
19763            fn serialize<__S: ::serde::Serializer>(
19764                &self,
19765                __s: __S,
19766            ) -> ::core::result::Result<__S::Ok, __S::Error> {
19767                use ::serde::ser::SerializeMap as _;
19768                let mut __map = __s.serialize_map(::core::option::Option::None)?;
19769                {
19770                    if let ::core::option::Option::Some(__v) = self.layout.as_option() {
19771                        __map.serialize_entry("layout", __v)?;
19772                    }
19773                }
19774                __map.end()
19775            }
19776        }
19777        impl<'a> ::buffa::MessageName for UpsertLayoutResponseView<'a> {
19778            const PACKAGE: &'static str = "layout.v1";
19779            const NAME: &'static str = "UpsertLayoutResponse";
19780            const FULL_NAME: &'static str = "layout.v1.UpsertLayoutResponse";
19781            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.UpsertLayoutResponse";
19782        }
19783        ::buffa::impl_default_view_instance!(UpsertLayoutResponseView);
19784        ::buffa::impl_view_reborrow!(UpsertLayoutResponseView);
19785        /** Self-contained, `'static` owned view of a `UpsertLayoutResponse` message.
19786
19787 Wraps [`::buffa::OwnedView`]`<`[`UpsertLayoutResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
19788
19789 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`UpsertLayoutResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
19790        #[derive(Clone, Debug)]
19791        pub struct UpsertLayoutResponseOwnedView(
19792            ::buffa::OwnedView<UpsertLayoutResponseView<'static>>,
19793        );
19794        impl UpsertLayoutResponseOwnedView {
19795            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
19796            ///
19797            /// The view borrows directly from the buffer's data; the buffer is
19798            /// retained inside the returned handle.
19799            ///
19800            /// # Errors
19801            ///
19802            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
19803            /// protobuf data.
19804            pub fn decode(
19805                bytes: ::buffa::bytes::Bytes,
19806            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19807                ::core::result::Result::Ok(
19808                    UpsertLayoutResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
19809                )
19810            }
19811            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
19812            /// max message size).
19813            ///
19814            /// # Errors
19815            ///
19816            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
19817            /// exceeds the configured limits.
19818            pub fn decode_with_options(
19819                bytes: ::buffa::bytes::Bytes,
19820                opts: &::buffa::DecodeOptions,
19821            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19822                ::core::result::Result::Ok(
19823                    UpsertLayoutResponseOwnedView(
19824                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
19825                    ),
19826                )
19827            }
19828            /// Build from an owned message via an encode → decode round-trip.
19829            ///
19830            /// # Errors
19831            ///
19832            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
19833            /// somehow invalid (should not happen for well-formed messages).
19834            pub fn from_owned(
19835                msg: &super::super::UpsertLayoutResponse,
19836            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19837                ::core::result::Result::Ok(
19838                    UpsertLayoutResponseOwnedView(::buffa::OwnedView::from_owned(msg)?),
19839                )
19840            }
19841            /// Borrow the full [`UpsertLayoutResponseView`] with its lifetime tied to `&self`.
19842            #[must_use]
19843            pub fn view(&self) -> &UpsertLayoutResponseView<'_> {
19844                self.0.reborrow()
19845            }
19846            /// Convert to the owned message type.
19847            ///
19848            /// # Errors
19849            ///
19850            /// Returns an error if re-materializing preserved unknown fields
19851            /// fails (e.g. the unknown-field limit is exceeded).
19852            pub fn to_owned_message(
19853                &self,
19854            ) -> ::core::result::Result<
19855                super::super::UpsertLayoutResponse,
19856                ::buffa::DecodeError,
19857            > {
19858                self.0.to_owned_message()
19859            }
19860            /// The underlying bytes buffer.
19861            #[must_use]
19862            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
19863                self.0.bytes()
19864            }
19865            /// Consume the handle, returning the underlying bytes buffer.
19866            #[must_use]
19867            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
19868                self.0.into_bytes()
19869            }
19870            /// Saved layout after server-side ownership and timestamp handling.
19871            ///
19872            /// Field 1: `layout`
19873            #[must_use]
19874            pub fn layout(
19875                &self,
19876            ) -> &::buffa::MessageFieldView<
19877                super::super::__buffa::view::LayoutView<'_>,
19878            > {
19879                &self.0.reborrow().layout
19880            }
19881        }
19882        impl ::core::convert::From<::buffa::OwnedView<UpsertLayoutResponseView<'static>>>
19883        for UpsertLayoutResponseOwnedView {
19884            fn from(
19885                inner: ::buffa::OwnedView<UpsertLayoutResponseView<'static>>,
19886            ) -> Self {
19887                UpsertLayoutResponseOwnedView(inner)
19888            }
19889        }
19890        impl ::core::convert::From<UpsertLayoutResponseOwnedView>
19891        for ::buffa::OwnedView<UpsertLayoutResponseView<'static>> {
19892            fn from(wrapper: UpsertLayoutResponseOwnedView) -> Self {
19893                wrapper.0
19894            }
19895        }
19896        impl ::core::convert::AsRef<
19897            ::buffa::OwnedView<UpsertLayoutResponseView<'static>>,
19898        > for UpsertLayoutResponseOwnedView {
19899            fn as_ref(&self) -> &::buffa::OwnedView<UpsertLayoutResponseView<'static>> {
19900                &self.0
19901            }
19902        }
19903        impl ::buffa::HasMessageView for super::super::UpsertLayoutResponse {
19904            type View<'a> = UpsertLayoutResponseView<'a>;
19905            type ViewHandle = UpsertLayoutResponseOwnedView;
19906        }
19907        impl ::serde::Serialize for UpsertLayoutResponseOwnedView {
19908            fn serialize<__S: ::serde::Serializer>(
19909                &self,
19910                __s: __S,
19911            ) -> ::core::result::Result<__S::Ok, __S::Error> {
19912                ::serde::Serialize::serialize(&self.0, __s)
19913            }
19914        }
19915        /// DeleteLayoutRequest deletes one saved layout owned by the authenticated caller.
19916        #[derive(Clone, Debug, Default)]
19917        pub struct DeleteLayoutRequestView<'a> {
19918            /// Layout identifier to delete.
19919            ///
19920            /// Field 1: `layout_id`
19921            pub layout_id: u64,
19922            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
19923        }
19924        impl<'a> ::buffa::MessageView<'a> for DeleteLayoutRequestView<'a> {
19925            type Owned = super::super::DeleteLayoutRequest;
19926            fn decode_view(
19927                buf: &'a [u8],
19928            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19929                let __limit = ::core::cell::Cell::new(
19930                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
19931                );
19932                <Self as ::buffa::MessageView>::decode_view_ctx(
19933                    buf,
19934                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
19935                )
19936            }
19937            fn decode_view_with_ctx(
19938                buf: &'a [u8],
19939                ctx: ::buffa::DecodeContext<'_>,
19940            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
19941                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
19942            }
19943            fn merge_view_field(
19944                &mut self,
19945                tag: ::buffa::encoding::Tag,
19946                cur: &'a [u8],
19947                before_tag: &'a [u8],
19948                ctx: ::buffa::DecodeContext<'_>,
19949            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
19950                let _ = ctx;
19951                #[allow(unused_variables)]
19952                let view = self;
19953                let mut cur = cur;
19954                match tag.field_number() {
19955                    1u32 => {
19956                        ::buffa::encoding::check_wire_type(
19957                            tag,
19958                            ::buffa::encoding::WireType::Fixed64,
19959                        )?;
19960                        view.layout_id = ::buffa::types::decode_fixed64(&mut cur)?;
19961                    }
19962                    _ => {
19963                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
19964                        let span_len = before_tag.len() - cur.len();
19965                        view.__buffa_unknown_fields
19966                            .push_record(before_tag, span_len, ctx)?;
19967                    }
19968                }
19969                ::core::result::Result::Ok(cur)
19970            }
19971            fn to_owned_message(
19972                &self,
19973            ) -> ::core::result::Result<
19974                super::super::DeleteLayoutRequest,
19975                ::buffa::DecodeError,
19976            > {
19977                self.to_owned_from_source(None)
19978            }
19979            #[allow(clippy::useless_conversion, clippy::needless_update)]
19980            fn to_owned_from_source(
19981                &self,
19982                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
19983            ) -> ::core::result::Result<
19984                super::super::DeleteLayoutRequest,
19985                ::buffa::DecodeError,
19986            > {
19987                #[allow(unused_imports)]
19988                use ::buffa::alloc::string::ToString as _;
19989                let _ = __buffa_src;
19990                ::core::result::Result::Ok(super::super::DeleteLayoutRequest {
19991                    layout_id: self.layout_id,
19992                    __buffa_unknown_fields: self
19993                        .__buffa_unknown_fields
19994                        .to_owned()?
19995                        .into(),
19996                    ..::core::default::Default::default()
19997                })
19998            }
19999        }
20000        impl<'a> ::buffa::ViewEncode<'a> for DeleteLayoutRequestView<'a> {
20001            #[allow(clippy::needless_borrow, clippy::let_and_return)]
20002            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
20003                #[allow(unused_imports)]
20004                use ::buffa::Enumeration as _;
20005                let mut size = 0u32;
20006                if self.layout_id != 0u64 {
20007                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
20008                }
20009                size += self.__buffa_unknown_fields.encoded_len() as u32;
20010                size
20011            }
20012            #[allow(clippy::needless_borrow)]
20013            fn write_to(
20014                &self,
20015                _cache: &mut ::buffa::SizeCache,
20016                buf: &mut impl ::buffa::bytes::BufMut,
20017            ) {
20018                #[allow(unused_imports)]
20019                use ::buffa::Enumeration as _;
20020                if self.layout_id != 0u64 {
20021                    ::buffa::types::put_fixed64_field(1u32, self.layout_id, buf);
20022                }
20023                self.__buffa_unknown_fields.write_to(buf);
20024            }
20025        }
20026        /// Serializes this view as protobuf JSON.
20027        ///
20028        /// Implicit-presence fields with default values are omitted, `required`
20029        /// fields are always emitted, explicit-presence (`optional`) fields are
20030        /// emitted only when set, bytes fields are base64-encoded, and enum
20031        /// values are their proto name strings.
20032        ///
20033        /// This impl uses `serialize_map(None)` because the number of emitted
20034        /// fields depends on default-omission rules; serializers that require
20035        /// known map lengths (e.g. `bincode`) will return a runtime error.
20036        /// Use the owned message type for those formats.
20037        impl<'__a> ::serde::Serialize for DeleteLayoutRequestView<'__a> {
20038            fn serialize<__S: ::serde::Serializer>(
20039                &self,
20040                __s: __S,
20041            ) -> ::core::result::Result<__S::Ok, __S::Error> {
20042                use ::serde::ser::SerializeMap as _;
20043                let mut __map = __s.serialize_map(::core::option::Option::None)?;
20044                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.layout_id) {
20045                    __map
20046                        .serialize_entry(
20047                            "layoutId",
20048                            &::buffa::json_helpers::ProtoJson(&self.layout_id),
20049                        )?;
20050                }
20051                __map.end()
20052            }
20053        }
20054        impl<'a> ::buffa::MessageName for DeleteLayoutRequestView<'a> {
20055            const PACKAGE: &'static str = "layout.v1";
20056            const NAME: &'static str = "DeleteLayoutRequest";
20057            const FULL_NAME: &'static str = "layout.v1.DeleteLayoutRequest";
20058            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.DeleteLayoutRequest";
20059        }
20060        ::buffa::impl_default_view_instance!(DeleteLayoutRequestView);
20061        ::buffa::impl_view_reborrow!(DeleteLayoutRequestView);
20062        /** Self-contained, `'static` owned view of a `DeleteLayoutRequest` message.
20063
20064 Wraps [`::buffa::OwnedView`]`<`[`DeleteLayoutRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
20065
20066 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`DeleteLayoutRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
20067        #[derive(Clone, Debug)]
20068        pub struct DeleteLayoutRequestOwnedView(
20069            ::buffa::OwnedView<DeleteLayoutRequestView<'static>>,
20070        );
20071        impl DeleteLayoutRequestOwnedView {
20072            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
20073            ///
20074            /// The view borrows directly from the buffer's data; the buffer is
20075            /// retained inside the returned handle.
20076            ///
20077            /// # Errors
20078            ///
20079            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
20080            /// protobuf data.
20081            pub fn decode(
20082                bytes: ::buffa::bytes::Bytes,
20083            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
20084                ::core::result::Result::Ok(
20085                    DeleteLayoutRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
20086                )
20087            }
20088            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
20089            /// max message size).
20090            ///
20091            /// # Errors
20092            ///
20093            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
20094            /// exceeds the configured limits.
20095            pub fn decode_with_options(
20096                bytes: ::buffa::bytes::Bytes,
20097                opts: &::buffa::DecodeOptions,
20098            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
20099                ::core::result::Result::Ok(
20100                    DeleteLayoutRequestOwnedView(
20101                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
20102                    ),
20103                )
20104            }
20105            /// Build from an owned message via an encode → decode round-trip.
20106            ///
20107            /// # Errors
20108            ///
20109            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
20110            /// somehow invalid (should not happen for well-formed messages).
20111            pub fn from_owned(
20112                msg: &super::super::DeleteLayoutRequest,
20113            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
20114                ::core::result::Result::Ok(
20115                    DeleteLayoutRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
20116                )
20117            }
20118            /// Borrow the full [`DeleteLayoutRequestView`] with its lifetime tied to `&self`.
20119            #[must_use]
20120            pub fn view(&self) -> &DeleteLayoutRequestView<'_> {
20121                self.0.reborrow()
20122            }
20123            /// Convert to the owned message type.
20124            ///
20125            /// # Errors
20126            ///
20127            /// Returns an error if re-materializing preserved unknown fields
20128            /// fails (e.g. the unknown-field limit is exceeded).
20129            pub fn to_owned_message(
20130                &self,
20131            ) -> ::core::result::Result<
20132                super::super::DeleteLayoutRequest,
20133                ::buffa::DecodeError,
20134            > {
20135                self.0.to_owned_message()
20136            }
20137            /// The underlying bytes buffer.
20138            #[must_use]
20139            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
20140                self.0.bytes()
20141            }
20142            /// Consume the handle, returning the underlying bytes buffer.
20143            #[must_use]
20144            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
20145                self.0.into_bytes()
20146            }
20147            /// Layout identifier to delete.
20148            ///
20149            /// Field 1: `layout_id`
20150            #[must_use]
20151            pub fn layout_id(&self) -> u64 {
20152                self.0.reborrow().layout_id
20153            }
20154        }
20155        impl ::core::convert::From<::buffa::OwnedView<DeleteLayoutRequestView<'static>>>
20156        for DeleteLayoutRequestOwnedView {
20157            fn from(
20158                inner: ::buffa::OwnedView<DeleteLayoutRequestView<'static>>,
20159            ) -> Self {
20160                DeleteLayoutRequestOwnedView(inner)
20161            }
20162        }
20163        impl ::core::convert::From<DeleteLayoutRequestOwnedView>
20164        for ::buffa::OwnedView<DeleteLayoutRequestView<'static>> {
20165            fn from(wrapper: DeleteLayoutRequestOwnedView) -> Self {
20166                wrapper.0
20167            }
20168        }
20169        impl ::core::convert::AsRef<::buffa::OwnedView<DeleteLayoutRequestView<'static>>>
20170        for DeleteLayoutRequestOwnedView {
20171            fn as_ref(&self) -> &::buffa::OwnedView<DeleteLayoutRequestView<'static>> {
20172                &self.0
20173            }
20174        }
20175        impl ::buffa::HasMessageView for super::super::DeleteLayoutRequest {
20176            type View<'a> = DeleteLayoutRequestView<'a>;
20177            type ViewHandle = DeleteLayoutRequestOwnedView;
20178        }
20179        impl ::serde::Serialize for DeleteLayoutRequestOwnedView {
20180            fn serialize<__S: ::serde::Serializer>(
20181                &self,
20182                __s: __S,
20183            ) -> ::core::result::Result<__S::Ok, __S::Error> {
20184                ::serde::Serialize::serialize(&self.0, __s)
20185            }
20186        }
20187        /// DeleteLayoutResponse is empty when the layout was deleted.
20188        #[derive(Clone, Debug, Default)]
20189        pub struct DeleteLayoutResponseView<'a> {
20190            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
20191        }
20192        impl<'a> ::buffa::MessageView<'a> for DeleteLayoutResponseView<'a> {
20193            type Owned = super::super::DeleteLayoutResponse;
20194            fn decode_view(
20195                buf: &'a [u8],
20196            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
20197                let __limit = ::core::cell::Cell::new(
20198                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
20199                );
20200                <Self as ::buffa::MessageView>::decode_view_ctx(
20201                    buf,
20202                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
20203                )
20204            }
20205            fn decode_view_with_ctx(
20206                buf: &'a [u8],
20207                ctx: ::buffa::DecodeContext<'_>,
20208            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
20209                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
20210            }
20211            fn merge_view_field(
20212                &mut self,
20213                tag: ::buffa::encoding::Tag,
20214                cur: &'a [u8],
20215                before_tag: &'a [u8],
20216                ctx: ::buffa::DecodeContext<'_>,
20217            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
20218                let _ = ctx;
20219                #[allow(unused_variables)]
20220                let view = self;
20221                let mut cur = cur;
20222                match tag.field_number() {
20223                    _ => {
20224                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
20225                        let span_len = before_tag.len() - cur.len();
20226                        view.__buffa_unknown_fields
20227                            .push_record(before_tag, span_len, ctx)?;
20228                    }
20229                }
20230                ::core::result::Result::Ok(cur)
20231            }
20232            fn to_owned_message(
20233                &self,
20234            ) -> ::core::result::Result<
20235                super::super::DeleteLayoutResponse,
20236                ::buffa::DecodeError,
20237            > {
20238                self.to_owned_from_source(None)
20239            }
20240            #[allow(clippy::useless_conversion, clippy::needless_update)]
20241            fn to_owned_from_source(
20242                &self,
20243                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
20244            ) -> ::core::result::Result<
20245                super::super::DeleteLayoutResponse,
20246                ::buffa::DecodeError,
20247            > {
20248                #[allow(unused_imports)]
20249                use ::buffa::alloc::string::ToString as _;
20250                let _ = __buffa_src;
20251                ::core::result::Result::Ok(super::super::DeleteLayoutResponse {
20252                    __buffa_unknown_fields: self
20253                        .__buffa_unknown_fields
20254                        .to_owned()?
20255                        .into(),
20256                    ..::core::default::Default::default()
20257                })
20258            }
20259        }
20260        impl<'a> ::buffa::ViewEncode<'a> for DeleteLayoutResponseView<'a> {
20261            #[allow(clippy::needless_borrow, clippy::let_and_return)]
20262            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
20263                #[allow(unused_imports)]
20264                use ::buffa::Enumeration as _;
20265                let mut size = 0u32;
20266                size += self.__buffa_unknown_fields.encoded_len() as u32;
20267                size
20268            }
20269            #[allow(clippy::needless_borrow)]
20270            fn write_to(
20271                &self,
20272                _cache: &mut ::buffa::SizeCache,
20273                buf: &mut impl ::buffa::bytes::BufMut,
20274            ) {
20275                #[allow(unused_imports)]
20276                use ::buffa::Enumeration as _;
20277                self.__buffa_unknown_fields.write_to(buf);
20278            }
20279        }
20280        /// Serializes this view as protobuf JSON.
20281        ///
20282        /// Implicit-presence fields with default values are omitted, `required`
20283        /// fields are always emitted, explicit-presence (`optional`) fields are
20284        /// emitted only when set, bytes fields are base64-encoded, and enum
20285        /// values are their proto name strings.
20286        ///
20287        /// This impl uses `serialize_map(None)` because the number of emitted
20288        /// fields depends on default-omission rules; serializers that require
20289        /// known map lengths (e.g. `bincode`) will return a runtime error.
20290        /// Use the owned message type for those formats.
20291        impl<'__a> ::serde::Serialize for DeleteLayoutResponseView<'__a> {
20292            fn serialize<__S: ::serde::Serializer>(
20293                &self,
20294                __s: __S,
20295            ) -> ::core::result::Result<__S::Ok, __S::Error> {
20296                use ::serde::ser::SerializeMap as _;
20297                let mut __map = __s.serialize_map(::core::option::Option::None)?;
20298                __map.end()
20299            }
20300        }
20301        impl<'a> ::buffa::MessageName for DeleteLayoutResponseView<'a> {
20302            const PACKAGE: &'static str = "layout.v1";
20303            const NAME: &'static str = "DeleteLayoutResponse";
20304            const FULL_NAME: &'static str = "layout.v1.DeleteLayoutResponse";
20305            const TYPE_URL: &'static str = "type.googleapis.com/layout.v1.DeleteLayoutResponse";
20306        }
20307        ::buffa::impl_default_view_instance!(DeleteLayoutResponseView);
20308        ::buffa::impl_view_reborrow!(DeleteLayoutResponseView);
20309        /** Self-contained, `'static` owned view of a `DeleteLayoutResponse` message.
20310
20311 Wraps [`::buffa::OwnedView`]`<`[`DeleteLayoutResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
20312
20313 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`DeleteLayoutResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
20314        #[derive(Clone, Debug)]
20315        pub struct DeleteLayoutResponseOwnedView(
20316            ::buffa::OwnedView<DeleteLayoutResponseView<'static>>,
20317        );
20318        impl DeleteLayoutResponseOwnedView {
20319            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
20320            ///
20321            /// The view borrows directly from the buffer's data; the buffer is
20322            /// retained inside the returned handle.
20323            ///
20324            /// # Errors
20325            ///
20326            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
20327            /// protobuf data.
20328            pub fn decode(
20329                bytes: ::buffa::bytes::Bytes,
20330            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
20331                ::core::result::Result::Ok(
20332                    DeleteLayoutResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
20333                )
20334            }
20335            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
20336            /// max message size).
20337            ///
20338            /// # Errors
20339            ///
20340            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
20341            /// exceeds the configured limits.
20342            pub fn decode_with_options(
20343                bytes: ::buffa::bytes::Bytes,
20344                opts: &::buffa::DecodeOptions,
20345            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
20346                ::core::result::Result::Ok(
20347                    DeleteLayoutResponseOwnedView(
20348                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
20349                    ),
20350                )
20351            }
20352            /// Build from an owned message via an encode → decode round-trip.
20353            ///
20354            /// # Errors
20355            ///
20356            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
20357            /// somehow invalid (should not happen for well-formed messages).
20358            pub fn from_owned(
20359                msg: &super::super::DeleteLayoutResponse,
20360            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
20361                ::core::result::Result::Ok(
20362                    DeleteLayoutResponseOwnedView(::buffa::OwnedView::from_owned(msg)?),
20363                )
20364            }
20365            /// Borrow the full [`DeleteLayoutResponseView`] with its lifetime tied to `&self`.
20366            #[must_use]
20367            pub fn view(&self) -> &DeleteLayoutResponseView<'_> {
20368                self.0.reborrow()
20369            }
20370            /// Convert to the owned message type.
20371            ///
20372            /// # Errors
20373            ///
20374            /// Returns an error if re-materializing preserved unknown fields
20375            /// fails (e.g. the unknown-field limit is exceeded).
20376            pub fn to_owned_message(
20377                &self,
20378            ) -> ::core::result::Result<
20379                super::super::DeleteLayoutResponse,
20380                ::buffa::DecodeError,
20381            > {
20382                self.0.to_owned_message()
20383            }
20384            /// The underlying bytes buffer.
20385            #[must_use]
20386            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
20387                self.0.bytes()
20388            }
20389            /// Consume the handle, returning the underlying bytes buffer.
20390            #[must_use]
20391            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
20392                self.0.into_bytes()
20393            }
20394        }
20395        impl ::core::convert::From<::buffa::OwnedView<DeleteLayoutResponseView<'static>>>
20396        for DeleteLayoutResponseOwnedView {
20397            fn from(
20398                inner: ::buffa::OwnedView<DeleteLayoutResponseView<'static>>,
20399            ) -> Self {
20400                DeleteLayoutResponseOwnedView(inner)
20401            }
20402        }
20403        impl ::core::convert::From<DeleteLayoutResponseOwnedView>
20404        for ::buffa::OwnedView<DeleteLayoutResponseView<'static>> {
20405            fn from(wrapper: DeleteLayoutResponseOwnedView) -> Self {
20406                wrapper.0
20407            }
20408        }
20409        impl ::core::convert::AsRef<
20410            ::buffa::OwnedView<DeleteLayoutResponseView<'static>>,
20411        > for DeleteLayoutResponseOwnedView {
20412            fn as_ref(&self) -> &::buffa::OwnedView<DeleteLayoutResponseView<'static>> {
20413                &self.0
20414            }
20415        }
20416        impl ::buffa::HasMessageView for super::super::DeleteLayoutResponse {
20417            type View<'a> = DeleteLayoutResponseView<'a>;
20418            type ViewHandle = DeleteLayoutResponseOwnedView;
20419        }
20420        impl ::serde::Serialize for DeleteLayoutResponseOwnedView {
20421            fn serialize<__S: ::serde::Serializer>(
20422                &self,
20423                __s: __S,
20424            ) -> ::core::result::Result<__S::Ok, __S::Error> {
20425                ::serde::Serialize::serialize(&self.0, __s)
20426            }
20427        }
20428    }
20429    /// Register this package's `Any` type entries and extension entries.
20430    pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
20431        reg.register_json_any(super::__LAYOUT_WIDGET_JSON_ANY);
20432        reg.register_json_any(super::__LAYOUT_JSON_ANY);
20433        reg.register_json_any(super::__CHART_WIDGET_CONFIG_JSON_ANY);
20434        reg.register_json_any(super::__CHART_INDICATOR_JSON_ANY);
20435        reg.register_json_any(super::__CHART_STYLE_JSON_ANY);
20436        reg.register_json_any(super::__LAYER_VISIBILITY_OVERRIDE_JSON_ANY);
20437        reg.register_json_any(super::__GET_LAYOUTS_REQUEST_JSON_ANY);
20438        reg.register_json_any(super::__GET_LAYOUTS_RESPONSE_JSON_ANY);
20439        reg.register_json_any(super::__GET_LAYOUT_REQUEST_JSON_ANY);
20440        reg.register_json_any(super::__GET_LAYOUT_RESPONSE_JSON_ANY);
20441        reg.register_json_any(super::__RESOLVE_LAYOUT_SHARE_TOKEN_REQUEST_JSON_ANY);
20442        reg.register_json_any(super::__RESOLVE_LAYOUT_SHARE_TOKEN_RESPONSE_JSON_ANY);
20443        reg.register_json_any(super::__CREATE_LAYOUT_SHARE_LINK_REQUEST_JSON_ANY);
20444        reg.register_json_any(super::__CREATE_LAYOUT_SHARE_LINK_RESPONSE_JSON_ANY);
20445        reg.register_json_any(super::__REVOKE_LAYOUT_SHARE_LINK_REQUEST_JSON_ANY);
20446        reg.register_json_any(super::__REVOKE_LAYOUT_SHARE_LINK_RESPONSE_JSON_ANY);
20447        reg.register_json_any(super::__LAYOUT_TEMPLATE_REF_JSON_ANY);
20448        reg.register_json_any(super::__LAYOUT_TEMPLATE_JSON_ANY);
20449        reg.register_json_any(super::__LAYOUT_TEMPLATE_VERSION_INFO_JSON_ANY);
20450        reg.register_json_any(super::__LIST_OWNER_PUBLISHED_LAYOUTS_REQUEST_JSON_ANY);
20451        reg.register_json_any(super::__LIST_OWNER_PUBLISHED_LAYOUTS_RESPONSE_JSON_ANY);
20452        reg.register_json_any(super::__LIST_LAYOUT_TEMPLATE_VERSIONS_REQUEST_JSON_ANY);
20453        reg.register_json_any(super::__LIST_LAYOUT_TEMPLATE_VERSIONS_RESPONSE_JSON_ANY);
20454        reg.register_json_any(super::__GET_LAYOUT_TEMPLATE_VERSION_REQUEST_JSON_ANY);
20455        reg.register_json_any(super::__GET_LAYOUT_TEMPLATE_VERSION_RESPONSE_JSON_ANY);
20456        reg.register_json_any(super::__PUBLISH_LAYOUT_REQUEST_JSON_ANY);
20457        reg.register_json_any(super::__PUBLISH_LAYOUT_RESPONSE_JSON_ANY);
20458        reg.register_json_any(super::__UNPUBLISH_LAYOUT_REQUEST_JSON_ANY);
20459        reg.register_json_any(super::__UNPUBLISH_LAYOUT_RESPONSE_JSON_ANY);
20460        reg.register_json_any(
20461            super::__SET_LAYOUT_TEMPLATE_SUBSCRIPTION_REQUEST_JSON_ANY,
20462        );
20463        reg.register_json_any(
20464            super::__SET_LAYOUT_TEMPLATE_SUBSCRIPTION_RESPONSE_JSON_ANY,
20465        );
20466        reg.register_json_any(
20467            super::__DELETE_LAYOUT_TEMPLATE_SUBSCRIPTION_REQUEST_JSON_ANY,
20468        );
20469        reg.register_json_any(
20470            super::__DELETE_LAYOUT_TEMPLATE_SUBSCRIPTION_RESPONSE_JSON_ANY,
20471        );
20472        reg.register_json_any(super::__LAYOUT_TEMPLATE_SUBSCRIPTION_JSON_ANY);
20473        reg.register_json_any(
20474            super::__LIST_MY_LAYOUT_TEMPLATE_SUBSCRIPTIONS_REQUEST_JSON_ANY,
20475        );
20476        reg.register_json_any(
20477            super::__LIST_MY_LAYOUT_TEMPLATE_SUBSCRIPTIONS_RESPONSE_JSON_ANY,
20478        );
20479        reg.register_json_any(super::__UPSERT_LAYOUT_REQUEST_JSON_ANY);
20480        reg.register_json_any(super::__UPSERT_LAYOUT_RESPONSE_JSON_ANY);
20481        reg.register_json_any(super::__DELETE_LAYOUT_REQUEST_JSON_ANY);
20482        reg.register_json_any(super::__DELETE_LAYOUT_RESPONSE_JSON_ANY);
20483    }
20484}
20485#[doc(inline)]
20486pub use self::__buffa::view::LayoutWidgetView;
20487#[doc(inline)]
20488pub use self::__buffa::view::LayoutWidgetOwnedView;
20489#[doc(inline)]
20490pub use self::__buffa::view::LayoutView;
20491#[doc(inline)]
20492pub use self::__buffa::view::LayoutOwnedView;
20493#[doc(inline)]
20494pub use self::__buffa::view::ChartWidgetConfigView;
20495#[doc(inline)]
20496pub use self::__buffa::view::ChartWidgetConfigOwnedView;
20497#[doc(inline)]
20498pub use self::__buffa::view::ChartIndicatorView;
20499#[doc(inline)]
20500pub use self::__buffa::view::ChartIndicatorOwnedView;
20501#[doc(inline)]
20502pub use self::__buffa::view::ChartStyleView;
20503#[doc(inline)]
20504pub use self::__buffa::view::ChartStyleOwnedView;
20505#[doc(inline)]
20506pub use self::__buffa::view::LayerVisibilityOverrideView;
20507#[doc(inline)]
20508pub use self::__buffa::view::LayerVisibilityOverrideOwnedView;
20509#[doc(inline)]
20510pub use self::__buffa::view::GetLayoutsRequestView;
20511#[doc(inline)]
20512pub use self::__buffa::view::GetLayoutsRequestOwnedView;
20513#[doc(inline)]
20514pub use self::__buffa::view::GetLayoutsResponseView;
20515#[doc(inline)]
20516pub use self::__buffa::view::GetLayoutsResponseOwnedView;
20517#[doc(inline)]
20518pub use self::__buffa::view::GetLayoutRequestView;
20519#[doc(inline)]
20520pub use self::__buffa::view::GetLayoutRequestOwnedView;
20521#[doc(inline)]
20522pub use self::__buffa::view::GetLayoutResponseView;
20523#[doc(inline)]
20524pub use self::__buffa::view::GetLayoutResponseOwnedView;
20525#[doc(inline)]
20526pub use self::__buffa::view::ResolveLayoutShareTokenRequestView;
20527#[doc(inline)]
20528pub use self::__buffa::view::ResolveLayoutShareTokenRequestOwnedView;
20529#[doc(inline)]
20530pub use self::__buffa::view::ResolveLayoutShareTokenResponseView;
20531#[doc(inline)]
20532pub use self::__buffa::view::ResolveLayoutShareTokenResponseOwnedView;
20533#[doc(inline)]
20534pub use self::__buffa::view::CreateLayoutShareLinkRequestView;
20535#[doc(inline)]
20536pub use self::__buffa::view::CreateLayoutShareLinkRequestOwnedView;
20537#[doc(inline)]
20538pub use self::__buffa::view::CreateLayoutShareLinkResponseView;
20539#[doc(inline)]
20540pub use self::__buffa::view::CreateLayoutShareLinkResponseOwnedView;
20541#[doc(inline)]
20542pub use self::__buffa::view::RevokeLayoutShareLinkRequestView;
20543#[doc(inline)]
20544pub use self::__buffa::view::RevokeLayoutShareLinkRequestOwnedView;
20545#[doc(inline)]
20546pub use self::__buffa::view::RevokeLayoutShareLinkResponseView;
20547#[doc(inline)]
20548pub use self::__buffa::view::RevokeLayoutShareLinkResponseOwnedView;
20549#[doc(inline)]
20550pub use self::__buffa::view::LayoutTemplateRefView;
20551#[doc(inline)]
20552pub use self::__buffa::view::LayoutTemplateRefOwnedView;
20553#[doc(inline)]
20554pub use self::__buffa::view::LayoutTemplateView;
20555#[doc(inline)]
20556pub use self::__buffa::view::LayoutTemplateOwnedView;
20557#[doc(inline)]
20558pub use self::__buffa::view::LayoutTemplateVersionInfoView;
20559#[doc(inline)]
20560pub use self::__buffa::view::LayoutTemplateVersionInfoOwnedView;
20561#[doc(inline)]
20562pub use self::__buffa::view::ListOwnerPublishedLayoutsRequestView;
20563#[doc(inline)]
20564pub use self::__buffa::view::ListOwnerPublishedLayoutsRequestOwnedView;
20565#[doc(inline)]
20566pub use self::__buffa::view::ListOwnerPublishedLayoutsResponseView;
20567#[doc(inline)]
20568pub use self::__buffa::view::ListOwnerPublishedLayoutsResponseOwnedView;
20569#[doc(inline)]
20570pub use self::__buffa::view::ListLayoutTemplateVersionsRequestView;
20571#[doc(inline)]
20572pub use self::__buffa::view::ListLayoutTemplateVersionsRequestOwnedView;
20573#[doc(inline)]
20574pub use self::__buffa::view::ListLayoutTemplateVersionsResponseView;
20575#[doc(inline)]
20576pub use self::__buffa::view::ListLayoutTemplateVersionsResponseOwnedView;
20577#[doc(inline)]
20578pub use self::__buffa::view::GetLayoutTemplateVersionRequestView;
20579#[doc(inline)]
20580pub use self::__buffa::view::GetLayoutTemplateVersionRequestOwnedView;
20581#[doc(inline)]
20582pub use self::__buffa::view::GetLayoutTemplateVersionResponseView;
20583#[doc(inline)]
20584pub use self::__buffa::view::GetLayoutTemplateVersionResponseOwnedView;
20585#[doc(inline)]
20586pub use self::__buffa::view::PublishLayoutRequestView;
20587#[doc(inline)]
20588pub use self::__buffa::view::PublishLayoutRequestOwnedView;
20589#[doc(inline)]
20590pub use self::__buffa::view::PublishLayoutResponseView;
20591#[doc(inline)]
20592pub use self::__buffa::view::PublishLayoutResponseOwnedView;
20593#[doc(inline)]
20594pub use self::__buffa::view::UnpublishLayoutRequestView;
20595#[doc(inline)]
20596pub use self::__buffa::view::UnpublishLayoutRequestOwnedView;
20597#[doc(inline)]
20598pub use self::__buffa::view::UnpublishLayoutResponseView;
20599#[doc(inline)]
20600pub use self::__buffa::view::UnpublishLayoutResponseOwnedView;
20601#[doc(inline)]
20602pub use self::__buffa::view::SetLayoutTemplateSubscriptionRequestView;
20603#[doc(inline)]
20604pub use self::__buffa::view::SetLayoutTemplateSubscriptionRequestOwnedView;
20605#[doc(inline)]
20606pub use self::__buffa::view::SetLayoutTemplateSubscriptionResponseView;
20607#[doc(inline)]
20608pub use self::__buffa::view::SetLayoutTemplateSubscriptionResponseOwnedView;
20609#[doc(inline)]
20610pub use self::__buffa::view::DeleteLayoutTemplateSubscriptionRequestView;
20611#[doc(inline)]
20612pub use self::__buffa::view::DeleteLayoutTemplateSubscriptionRequestOwnedView;
20613#[doc(inline)]
20614pub use self::__buffa::view::DeleteLayoutTemplateSubscriptionResponseView;
20615#[doc(inline)]
20616pub use self::__buffa::view::DeleteLayoutTemplateSubscriptionResponseOwnedView;
20617#[doc(inline)]
20618pub use self::__buffa::view::LayoutTemplateSubscriptionView;
20619#[doc(inline)]
20620pub use self::__buffa::view::LayoutTemplateSubscriptionOwnedView;
20621#[doc(inline)]
20622pub use self::__buffa::view::ListMyLayoutTemplateSubscriptionsRequestView;
20623#[doc(inline)]
20624pub use self::__buffa::view::ListMyLayoutTemplateSubscriptionsRequestOwnedView;
20625#[doc(inline)]
20626pub use self::__buffa::view::ListMyLayoutTemplateSubscriptionsResponseView;
20627#[doc(inline)]
20628pub use self::__buffa::view::ListMyLayoutTemplateSubscriptionsResponseOwnedView;
20629#[doc(inline)]
20630pub use self::__buffa::view::UpsertLayoutRequestView;
20631#[doc(inline)]
20632pub use self::__buffa::view::UpsertLayoutRequestOwnedView;
20633#[doc(inline)]
20634pub use self::__buffa::view::UpsertLayoutResponseView;
20635#[doc(inline)]
20636pub use self::__buffa::view::UpsertLayoutResponseOwnedView;
20637#[doc(inline)]
20638pub use self::__buffa::view::DeleteLayoutRequestView;
20639#[doc(inline)]
20640pub use self::__buffa::view::DeleteLayoutRequestOwnedView;
20641#[doc(inline)]
20642pub use self::__buffa::view::DeleteLayoutResponseView;
20643#[doc(inline)]
20644pub use self::__buffa::view::DeleteLayoutResponseOwnedView;
20645#[doc(inline)]
20646pub use self::__buffa::register_types;