Skip to main content

polyester/gen/buffa/
marketoverview.v1.rs

1// @generated by buffa-codegen. DO NOT EDIT.
2
3/// SparklineInterval identifies the time range and sampling resolution for a
4/// sparkline.
5#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
6#[repr(i32)]
7pub enum SparklineInterval {
8    /// Unspecified interval. When requested, server may default to 24H.
9    SPARKLINE_INTERVAL_UNSPECIFIED = 0i32,
10    /// 1 hour sparkline. Typically returns up to 60 points (1-minute buckets).
11    SPARKLINE_1H = 1i32,
12    /// 24 hour sparkline. Typically returns up to 96 points (15-minute buckets).
13    SPARKLINE_24H = 2i32,
14    /// 1 week sparkline. Typically returns up to 168 points (1-hour buckets).
15    SPARKLINE_1W = 3i32,
16    /// 1 month sparkline. Typically returns up to 180 points (4-hour buckets).
17    SPARKLINE_1M = 4i32,
18}
19impl SparklineInterval {
20    ///Idiomatic alias for [`Self::SPARKLINE_INTERVAL_UNSPECIFIED`]; `Debug` prints the variant name.
21    #[allow(non_upper_case_globals)]
22    pub const SparklineIntervalUnspecified: Self = Self::SPARKLINE_INTERVAL_UNSPECIFIED;
23    ///Idiomatic alias for [`Self::SPARKLINE_1H`]; `Debug` prints the variant name.
24    #[allow(non_upper_case_globals)]
25    pub const Sparkline1h: Self = Self::SPARKLINE_1H;
26    ///Idiomatic alias for [`Self::SPARKLINE_24H`]; `Debug` prints the variant name.
27    #[allow(non_upper_case_globals)]
28    pub const Sparkline24h: Self = Self::SPARKLINE_24H;
29    ///Idiomatic alias for [`Self::SPARKLINE_1W`]; `Debug` prints the variant name.
30    #[allow(non_upper_case_globals)]
31    pub const Sparkline1w: Self = Self::SPARKLINE_1W;
32    ///Idiomatic alias for [`Self::SPARKLINE_1M`]; `Debug` prints the variant name.
33    #[allow(non_upper_case_globals)]
34    pub const Sparkline1m: Self = Self::SPARKLINE_1M;
35}
36impl ::core::default::Default for SparklineInterval {
37    fn default() -> Self {
38        Self::SPARKLINE_INTERVAL_UNSPECIFIED
39    }
40}
41impl ::serde::Serialize for SparklineInterval {
42    fn serialize<S: ::serde::Serializer>(
43        &self,
44        s: S,
45    ) -> ::core::result::Result<S::Ok, S::Error> {
46        s.serialize_str(::buffa::Enumeration::proto_name(self))
47    }
48}
49impl<'de> ::serde::Deserialize<'de> for SparklineInterval {
50    fn deserialize<D: ::serde::Deserializer<'de>>(
51        d: D,
52    ) -> ::core::result::Result<Self, D::Error> {
53        struct _V;
54        impl ::serde::de::Visitor<'_> for _V {
55            type Value = SparklineInterval;
56            fn expecting(
57                &self,
58                f: &mut ::core::fmt::Formatter<'_>,
59            ) -> ::core::fmt::Result {
60                f.write_str(
61                    concat!(
62                        "a string, integer, or null for ", stringify!(SparklineInterval)
63                    ),
64                )
65            }
66            fn visit_str<E: ::serde::de::Error>(
67                self,
68                v: &str,
69            ) -> ::core::result::Result<SparklineInterval, E> {
70                <SparklineInterval as ::buffa::Enumeration>::from_proto_name(v)
71                    .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
72            }
73            fn visit_i64<E: ::serde::de::Error>(
74                self,
75                v: i64,
76            ) -> ::core::result::Result<SparklineInterval, E> {
77                let v32 = i32::try_from(v)
78                    .map_err(|_| {
79                        ::serde::de::Error::custom(
80                            ::buffa::alloc::format!("enum value {v} out of i32 range"),
81                        )
82                    })?;
83                <SparklineInterval as ::buffa::Enumeration>::from_i32(v32)
84                    .ok_or_else(|| {
85                        ::serde::de::Error::custom(
86                            ::buffa::alloc::format!("unknown enum value {v32}"),
87                        )
88                    })
89            }
90            fn visit_u64<E: ::serde::de::Error>(
91                self,
92                v: u64,
93            ) -> ::core::result::Result<SparklineInterval, E> {
94                let v32 = i32::try_from(v)
95                    .map_err(|_| {
96                        ::serde::de::Error::custom(
97                            ::buffa::alloc::format!("enum value {v} out of i32 range"),
98                        )
99                    })?;
100                <SparklineInterval as ::buffa::Enumeration>::from_i32(v32)
101                    .ok_or_else(|| {
102                        ::serde::de::Error::custom(
103                            ::buffa::alloc::format!("unknown enum value {v32}"),
104                        )
105                    })
106            }
107            fn visit_unit<E: ::serde::de::Error>(
108                self,
109            ) -> ::core::result::Result<SparklineInterval, E> {
110                ::core::result::Result::Ok(::core::default::Default::default())
111            }
112        }
113        d.deserialize_any(_V)
114    }
115}
116impl ::buffa::json_helpers::ProtoElemJson for SparklineInterval {
117    fn serialize_proto_json<S: ::serde::Serializer>(
118        v: &Self,
119        s: S,
120    ) -> ::core::result::Result<S::Ok, S::Error> {
121        ::serde::Serialize::serialize(v, s)
122    }
123    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
124        d: D,
125    ) -> ::core::result::Result<Self, D::Error> {
126        <Self as ::serde::Deserialize>::deserialize(d)
127    }
128}
129impl ::buffa::Enumeration for SparklineInterval {
130    fn from_i32(value: i32) -> ::core::option::Option<Self> {
131        match value {
132            0i32 => ::core::option::Option::Some(Self::SPARKLINE_INTERVAL_UNSPECIFIED),
133            1i32 => ::core::option::Option::Some(Self::SPARKLINE_1H),
134            2i32 => ::core::option::Option::Some(Self::SPARKLINE_24H),
135            3i32 => ::core::option::Option::Some(Self::SPARKLINE_1W),
136            4i32 => ::core::option::Option::Some(Self::SPARKLINE_1M),
137            _ => ::core::option::Option::None,
138        }
139    }
140    fn to_i32(&self) -> i32 {
141        *self as i32
142    }
143    fn proto_name(&self) -> &'static str {
144        match self {
145            Self::SPARKLINE_INTERVAL_UNSPECIFIED => "SPARKLINE_INTERVAL_UNSPECIFIED",
146            Self::SPARKLINE_1H => "SPARKLINE_1H",
147            Self::SPARKLINE_24H => "SPARKLINE_24H",
148            Self::SPARKLINE_1W => "SPARKLINE_1W",
149            Self::SPARKLINE_1M => "SPARKLINE_1M",
150        }
151    }
152    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
153        match name {
154            "SPARKLINE_INTERVAL_UNSPECIFIED" => {
155                ::core::option::Option::Some(Self::SPARKLINE_INTERVAL_UNSPECIFIED)
156            }
157            "SPARKLINE_1H" => ::core::option::Option::Some(Self::SPARKLINE_1H),
158            "SPARKLINE_24H" => ::core::option::Option::Some(Self::SPARKLINE_24H),
159            "SPARKLINE_1W" => ::core::option::Option::Some(Self::SPARKLINE_1W),
160            "SPARKLINE_1M" => ::core::option::Option::Some(Self::SPARKLINE_1M),
161            _ => ::core::option::Option::None,
162        }
163    }
164    fn values() -> &'static [Self] {
165        &[
166            Self::SPARKLINE_INTERVAL_UNSPECIFIED,
167            Self::SPARKLINE_1H,
168            Self::SPARKLINE_24H,
169            Self::SPARKLINE_1W,
170            Self::SPARKLINE_1M,
171        ]
172    }
173}
174#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
175#[repr(i32)]
176pub enum MarketOrderBy {
177    MARKET_ORDER_BY_UNSPECIFIED = 0i32,
178    /// Sort by absolute 24h change (basis points).
179    ORDER_BY_CHANGE_24H_BPS = 1i32,
180    /// Sort by 24h quote volume scaled by the pair's quote_quantity_scale from
181    /// GetSpotConfig.
182    ORDER_BY_VOLUME_24H_QUOTE = 2i32,
183    /// Sort by last price in quote units scaled by 1e6.
184    ORDER_BY_LAST_PRICE = 3i32,
185    /// Sort by listing time (new listings first).
186    ORDER_BY_DATE_ADDED = 4i32,
187}
188impl MarketOrderBy {
189    ///Idiomatic alias for [`Self::MARKET_ORDER_BY_UNSPECIFIED`]; `Debug` prints the variant name.
190    #[allow(non_upper_case_globals)]
191    pub const MarketOrderByUnspecified: Self = Self::MARKET_ORDER_BY_UNSPECIFIED;
192    ///Idiomatic alias for [`Self::ORDER_BY_CHANGE_24H_BPS`]; `Debug` prints the variant name.
193    #[allow(non_upper_case_globals)]
194    pub const OrderByChange24hBps: Self = Self::ORDER_BY_CHANGE_24H_BPS;
195    ///Idiomatic alias for [`Self::ORDER_BY_VOLUME_24H_QUOTE`]; `Debug` prints the variant name.
196    #[allow(non_upper_case_globals)]
197    pub const OrderByVolume24hQuote: Self = Self::ORDER_BY_VOLUME_24H_QUOTE;
198    ///Idiomatic alias for [`Self::ORDER_BY_LAST_PRICE`]; `Debug` prints the variant name.
199    #[allow(non_upper_case_globals)]
200    pub const OrderByLastPrice: Self = Self::ORDER_BY_LAST_PRICE;
201    ///Idiomatic alias for [`Self::ORDER_BY_DATE_ADDED`]; `Debug` prints the variant name.
202    #[allow(non_upper_case_globals)]
203    pub const OrderByDateAdded: Self = Self::ORDER_BY_DATE_ADDED;
204}
205impl ::core::default::Default for MarketOrderBy {
206    fn default() -> Self {
207        Self::MARKET_ORDER_BY_UNSPECIFIED
208    }
209}
210impl ::serde::Serialize for MarketOrderBy {
211    fn serialize<S: ::serde::Serializer>(
212        &self,
213        s: S,
214    ) -> ::core::result::Result<S::Ok, S::Error> {
215        s.serialize_str(::buffa::Enumeration::proto_name(self))
216    }
217}
218impl<'de> ::serde::Deserialize<'de> for MarketOrderBy {
219    fn deserialize<D: ::serde::Deserializer<'de>>(
220        d: D,
221    ) -> ::core::result::Result<Self, D::Error> {
222        struct _V;
223        impl ::serde::de::Visitor<'_> for _V {
224            type Value = MarketOrderBy;
225            fn expecting(
226                &self,
227                f: &mut ::core::fmt::Formatter<'_>,
228            ) -> ::core::fmt::Result {
229                f.write_str(
230                    concat!("a string, integer, or null for ", stringify!(MarketOrderBy)),
231                )
232            }
233            fn visit_str<E: ::serde::de::Error>(
234                self,
235                v: &str,
236            ) -> ::core::result::Result<MarketOrderBy, E> {
237                <MarketOrderBy as ::buffa::Enumeration>::from_proto_name(v)
238                    .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
239            }
240            fn visit_i64<E: ::serde::de::Error>(
241                self,
242                v: i64,
243            ) -> ::core::result::Result<MarketOrderBy, E> {
244                let v32 = i32::try_from(v)
245                    .map_err(|_| {
246                        ::serde::de::Error::custom(
247                            ::buffa::alloc::format!("enum value {v} out of i32 range"),
248                        )
249                    })?;
250                <MarketOrderBy as ::buffa::Enumeration>::from_i32(v32)
251                    .ok_or_else(|| {
252                        ::serde::de::Error::custom(
253                            ::buffa::alloc::format!("unknown enum value {v32}"),
254                        )
255                    })
256            }
257            fn visit_u64<E: ::serde::de::Error>(
258                self,
259                v: u64,
260            ) -> ::core::result::Result<MarketOrderBy, E> {
261                let v32 = i32::try_from(v)
262                    .map_err(|_| {
263                        ::serde::de::Error::custom(
264                            ::buffa::alloc::format!("enum value {v} out of i32 range"),
265                        )
266                    })?;
267                <MarketOrderBy as ::buffa::Enumeration>::from_i32(v32)
268                    .ok_or_else(|| {
269                        ::serde::de::Error::custom(
270                            ::buffa::alloc::format!("unknown enum value {v32}"),
271                        )
272                    })
273            }
274            fn visit_unit<E: ::serde::de::Error>(
275                self,
276            ) -> ::core::result::Result<MarketOrderBy, E> {
277                ::core::result::Result::Ok(::core::default::Default::default())
278            }
279        }
280        d.deserialize_any(_V)
281    }
282}
283impl ::buffa::json_helpers::ProtoElemJson for MarketOrderBy {
284    fn serialize_proto_json<S: ::serde::Serializer>(
285        v: &Self,
286        s: S,
287    ) -> ::core::result::Result<S::Ok, S::Error> {
288        ::serde::Serialize::serialize(v, s)
289    }
290    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
291        d: D,
292    ) -> ::core::result::Result<Self, D::Error> {
293        <Self as ::serde::Deserialize>::deserialize(d)
294    }
295}
296impl ::buffa::Enumeration for MarketOrderBy {
297    fn from_i32(value: i32) -> ::core::option::Option<Self> {
298        match value {
299            0i32 => ::core::option::Option::Some(Self::MARKET_ORDER_BY_UNSPECIFIED),
300            1i32 => ::core::option::Option::Some(Self::ORDER_BY_CHANGE_24H_BPS),
301            2i32 => ::core::option::Option::Some(Self::ORDER_BY_VOLUME_24H_QUOTE),
302            3i32 => ::core::option::Option::Some(Self::ORDER_BY_LAST_PRICE),
303            4i32 => ::core::option::Option::Some(Self::ORDER_BY_DATE_ADDED),
304            _ => ::core::option::Option::None,
305        }
306    }
307    fn to_i32(&self) -> i32 {
308        *self as i32
309    }
310    fn proto_name(&self) -> &'static str {
311        match self {
312            Self::MARKET_ORDER_BY_UNSPECIFIED => "MARKET_ORDER_BY_UNSPECIFIED",
313            Self::ORDER_BY_CHANGE_24H_BPS => "ORDER_BY_CHANGE_24H_BPS",
314            Self::ORDER_BY_VOLUME_24H_QUOTE => "ORDER_BY_VOLUME_24H_QUOTE",
315            Self::ORDER_BY_LAST_PRICE => "ORDER_BY_LAST_PRICE",
316            Self::ORDER_BY_DATE_ADDED => "ORDER_BY_DATE_ADDED",
317        }
318    }
319    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
320        match name {
321            "MARKET_ORDER_BY_UNSPECIFIED" => {
322                ::core::option::Option::Some(Self::MARKET_ORDER_BY_UNSPECIFIED)
323            }
324            "ORDER_BY_CHANGE_24H_BPS" => {
325                ::core::option::Option::Some(Self::ORDER_BY_CHANGE_24H_BPS)
326            }
327            "ORDER_BY_VOLUME_24H_QUOTE" => {
328                ::core::option::Option::Some(Self::ORDER_BY_VOLUME_24H_QUOTE)
329            }
330            "ORDER_BY_LAST_PRICE" => {
331                ::core::option::Option::Some(Self::ORDER_BY_LAST_PRICE)
332            }
333            "ORDER_BY_DATE_ADDED" => {
334                ::core::option::Option::Some(Self::ORDER_BY_DATE_ADDED)
335            }
336            _ => ::core::option::Option::None,
337        }
338    }
339    fn values() -> &'static [Self] {
340        &[
341            Self::MARKET_ORDER_BY_UNSPECIFIED,
342            Self::ORDER_BY_CHANGE_24H_BPS,
343            Self::ORDER_BY_VOLUME_24H_QUOTE,
344            Self::ORDER_BY_LAST_PRICE,
345            Self::ORDER_BY_DATE_ADDED,
346        ]
347    }
348}
349#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
350#[repr(i32)]
351pub enum SortDirection {
352    SORT_DIRECTION_UNSPECIFIED = 0i32,
353    /// Ascending (oldest/lowest first).
354    SORT_ASC = 1i32,
355    /// Descending (newest/highest first).
356    SORT_DESC = 2i32,
357}
358impl SortDirection {
359    ///Idiomatic alias for [`Self::SORT_DIRECTION_UNSPECIFIED`]; `Debug` prints the variant name.
360    #[allow(non_upper_case_globals)]
361    pub const SortDirectionUnspecified: Self = Self::SORT_DIRECTION_UNSPECIFIED;
362    ///Idiomatic alias for [`Self::SORT_ASC`]; `Debug` prints the variant name.
363    #[allow(non_upper_case_globals)]
364    pub const SortAsc: Self = Self::SORT_ASC;
365    ///Idiomatic alias for [`Self::SORT_DESC`]; `Debug` prints the variant name.
366    #[allow(non_upper_case_globals)]
367    pub const SortDesc: Self = Self::SORT_DESC;
368}
369impl ::core::default::Default for SortDirection {
370    fn default() -> Self {
371        Self::SORT_DIRECTION_UNSPECIFIED
372    }
373}
374impl ::serde::Serialize for SortDirection {
375    fn serialize<S: ::serde::Serializer>(
376        &self,
377        s: S,
378    ) -> ::core::result::Result<S::Ok, S::Error> {
379        s.serialize_str(::buffa::Enumeration::proto_name(self))
380    }
381}
382impl<'de> ::serde::Deserialize<'de> for SortDirection {
383    fn deserialize<D: ::serde::Deserializer<'de>>(
384        d: D,
385    ) -> ::core::result::Result<Self, D::Error> {
386        struct _V;
387        impl ::serde::de::Visitor<'_> for _V {
388            type Value = SortDirection;
389            fn expecting(
390                &self,
391                f: &mut ::core::fmt::Formatter<'_>,
392            ) -> ::core::fmt::Result {
393                f.write_str(
394                    concat!("a string, integer, or null for ", stringify!(SortDirection)),
395                )
396            }
397            fn visit_str<E: ::serde::de::Error>(
398                self,
399                v: &str,
400            ) -> ::core::result::Result<SortDirection, E> {
401                <SortDirection as ::buffa::Enumeration>::from_proto_name(v)
402                    .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
403            }
404            fn visit_i64<E: ::serde::de::Error>(
405                self,
406                v: i64,
407            ) -> ::core::result::Result<SortDirection, E> {
408                let v32 = i32::try_from(v)
409                    .map_err(|_| {
410                        ::serde::de::Error::custom(
411                            ::buffa::alloc::format!("enum value {v} out of i32 range"),
412                        )
413                    })?;
414                <SortDirection as ::buffa::Enumeration>::from_i32(v32)
415                    .ok_or_else(|| {
416                        ::serde::de::Error::custom(
417                            ::buffa::alloc::format!("unknown enum value {v32}"),
418                        )
419                    })
420            }
421            fn visit_u64<E: ::serde::de::Error>(
422                self,
423                v: u64,
424            ) -> ::core::result::Result<SortDirection, E> {
425                let v32 = i32::try_from(v)
426                    .map_err(|_| {
427                        ::serde::de::Error::custom(
428                            ::buffa::alloc::format!("enum value {v} out of i32 range"),
429                        )
430                    })?;
431                <SortDirection as ::buffa::Enumeration>::from_i32(v32)
432                    .ok_or_else(|| {
433                        ::serde::de::Error::custom(
434                            ::buffa::alloc::format!("unknown enum value {v32}"),
435                        )
436                    })
437            }
438            fn visit_unit<E: ::serde::de::Error>(
439                self,
440            ) -> ::core::result::Result<SortDirection, E> {
441                ::core::result::Result::Ok(::core::default::Default::default())
442            }
443        }
444        d.deserialize_any(_V)
445    }
446}
447impl ::buffa::json_helpers::ProtoElemJson for SortDirection {
448    fn serialize_proto_json<S: ::serde::Serializer>(
449        v: &Self,
450        s: S,
451    ) -> ::core::result::Result<S::Ok, S::Error> {
452        ::serde::Serialize::serialize(v, s)
453    }
454    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
455        d: D,
456    ) -> ::core::result::Result<Self, D::Error> {
457        <Self as ::serde::Deserialize>::deserialize(d)
458    }
459}
460impl ::buffa::Enumeration for SortDirection {
461    fn from_i32(value: i32) -> ::core::option::Option<Self> {
462        match value {
463            0i32 => ::core::option::Option::Some(Self::SORT_DIRECTION_UNSPECIFIED),
464            1i32 => ::core::option::Option::Some(Self::SORT_ASC),
465            2i32 => ::core::option::Option::Some(Self::SORT_DESC),
466            _ => ::core::option::Option::None,
467        }
468    }
469    fn to_i32(&self) -> i32 {
470        *self as i32
471    }
472    fn proto_name(&self) -> &'static str {
473        match self {
474            Self::SORT_DIRECTION_UNSPECIFIED => "SORT_DIRECTION_UNSPECIFIED",
475            Self::SORT_ASC => "SORT_ASC",
476            Self::SORT_DESC => "SORT_DESC",
477        }
478    }
479    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
480        match name {
481            "SORT_DIRECTION_UNSPECIFIED" => {
482                ::core::option::Option::Some(Self::SORT_DIRECTION_UNSPECIFIED)
483            }
484            "SORT_ASC" => ::core::option::Option::Some(Self::SORT_ASC),
485            "SORT_DESC" => ::core::option::Option::Some(Self::SORT_DESC),
486            _ => ::core::option::Option::None,
487        }
488    }
489    fn values() -> &'static [Self] {
490        &[Self::SORT_DIRECTION_UNSPECIFIED, Self::SORT_ASC, Self::SORT_DESC]
491    }
492}
493/// ErrorCode is a stable domain error code enum for Market Overview.
494/// It is used for consistent error surfaces across ConnectRPC and REST.
495#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
496#[repr(i32)]
497pub enum ErrorCode {
498    ERROR_CODE_UNSPECIFIED = 0i32,
499    ERROR_CODE_BAD_REQUEST = 1i32,
500    ERROR_CODE_INVALID_ARGUMENT = 2i32,
501    ERROR_CODE_NOT_FOUND = 3i32,
502    ERROR_CODE_UNAVAILABLE = 4i32,
503    ERROR_CODE_UPSTREAM_ERROR = 5i32,
504}
505impl ErrorCode {
506    ///Idiomatic alias for [`Self::ERROR_CODE_UNSPECIFIED`]; `Debug` prints the variant name.
507    #[allow(non_upper_case_globals)]
508    pub const Unspecified: Self = Self::ERROR_CODE_UNSPECIFIED;
509    ///Idiomatic alias for [`Self::ERROR_CODE_BAD_REQUEST`]; `Debug` prints the variant name.
510    #[allow(non_upper_case_globals)]
511    pub const BadRequest: Self = Self::ERROR_CODE_BAD_REQUEST;
512    ///Idiomatic alias for [`Self::ERROR_CODE_INVALID_ARGUMENT`]; `Debug` prints the variant name.
513    #[allow(non_upper_case_globals)]
514    pub const InvalidArgument: Self = Self::ERROR_CODE_INVALID_ARGUMENT;
515    ///Idiomatic alias for [`Self::ERROR_CODE_NOT_FOUND`]; `Debug` prints the variant name.
516    #[allow(non_upper_case_globals)]
517    pub const NotFound: Self = Self::ERROR_CODE_NOT_FOUND;
518    ///Idiomatic alias for [`Self::ERROR_CODE_UNAVAILABLE`]; `Debug` prints the variant name.
519    #[allow(non_upper_case_globals)]
520    pub const Unavailable: Self = Self::ERROR_CODE_UNAVAILABLE;
521    ///Idiomatic alias for [`Self::ERROR_CODE_UPSTREAM_ERROR`]; `Debug` prints the variant name.
522    #[allow(non_upper_case_globals)]
523    pub const UpstreamError: Self = Self::ERROR_CODE_UPSTREAM_ERROR;
524}
525impl ::core::default::Default for ErrorCode {
526    fn default() -> Self {
527        Self::ERROR_CODE_UNSPECIFIED
528    }
529}
530impl ::serde::Serialize for ErrorCode {
531    fn serialize<S: ::serde::Serializer>(
532        &self,
533        s: S,
534    ) -> ::core::result::Result<S::Ok, S::Error> {
535        s.serialize_str(::buffa::Enumeration::proto_name(self))
536    }
537}
538impl<'de> ::serde::Deserialize<'de> for ErrorCode {
539    fn deserialize<D: ::serde::Deserializer<'de>>(
540        d: D,
541    ) -> ::core::result::Result<Self, D::Error> {
542        struct _V;
543        impl ::serde::de::Visitor<'_> for _V {
544            type Value = ErrorCode;
545            fn expecting(
546                &self,
547                f: &mut ::core::fmt::Formatter<'_>,
548            ) -> ::core::fmt::Result {
549                f.write_str(
550                    concat!("a string, integer, or null for ", stringify!(ErrorCode)),
551                )
552            }
553            fn visit_str<E: ::serde::de::Error>(
554                self,
555                v: &str,
556            ) -> ::core::result::Result<ErrorCode, E> {
557                <ErrorCode as ::buffa::Enumeration>::from_proto_name(v)
558                    .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
559            }
560            fn visit_i64<E: ::serde::de::Error>(
561                self,
562                v: i64,
563            ) -> ::core::result::Result<ErrorCode, E> {
564                let v32 = i32::try_from(v)
565                    .map_err(|_| {
566                        ::serde::de::Error::custom(
567                            ::buffa::alloc::format!("enum value {v} out of i32 range"),
568                        )
569                    })?;
570                <ErrorCode as ::buffa::Enumeration>::from_i32(v32)
571                    .ok_or_else(|| {
572                        ::serde::de::Error::custom(
573                            ::buffa::alloc::format!("unknown enum value {v32}"),
574                        )
575                    })
576            }
577            fn visit_u64<E: ::serde::de::Error>(
578                self,
579                v: u64,
580            ) -> ::core::result::Result<ErrorCode, E> {
581                let v32 = i32::try_from(v)
582                    .map_err(|_| {
583                        ::serde::de::Error::custom(
584                            ::buffa::alloc::format!("enum value {v} out of i32 range"),
585                        )
586                    })?;
587                <ErrorCode as ::buffa::Enumeration>::from_i32(v32)
588                    .ok_or_else(|| {
589                        ::serde::de::Error::custom(
590                            ::buffa::alloc::format!("unknown enum value {v32}"),
591                        )
592                    })
593            }
594            fn visit_unit<E: ::serde::de::Error>(
595                self,
596            ) -> ::core::result::Result<ErrorCode, E> {
597                ::core::result::Result::Ok(::core::default::Default::default())
598            }
599        }
600        d.deserialize_any(_V)
601    }
602}
603impl ::buffa::json_helpers::ProtoElemJson for ErrorCode {
604    fn serialize_proto_json<S: ::serde::Serializer>(
605        v: &Self,
606        s: S,
607    ) -> ::core::result::Result<S::Ok, S::Error> {
608        ::serde::Serialize::serialize(v, s)
609    }
610    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
611        d: D,
612    ) -> ::core::result::Result<Self, D::Error> {
613        <Self as ::serde::Deserialize>::deserialize(d)
614    }
615}
616impl ::buffa::Enumeration for ErrorCode {
617    fn from_i32(value: i32) -> ::core::option::Option<Self> {
618        match value {
619            0i32 => ::core::option::Option::Some(Self::ERROR_CODE_UNSPECIFIED),
620            1i32 => ::core::option::Option::Some(Self::ERROR_CODE_BAD_REQUEST),
621            2i32 => ::core::option::Option::Some(Self::ERROR_CODE_INVALID_ARGUMENT),
622            3i32 => ::core::option::Option::Some(Self::ERROR_CODE_NOT_FOUND),
623            4i32 => ::core::option::Option::Some(Self::ERROR_CODE_UNAVAILABLE),
624            5i32 => ::core::option::Option::Some(Self::ERROR_CODE_UPSTREAM_ERROR),
625            _ => ::core::option::Option::None,
626        }
627    }
628    fn to_i32(&self) -> i32 {
629        *self as i32
630    }
631    fn proto_name(&self) -> &'static str {
632        match self {
633            Self::ERROR_CODE_UNSPECIFIED => "ERROR_CODE_UNSPECIFIED",
634            Self::ERROR_CODE_BAD_REQUEST => "ERROR_CODE_BAD_REQUEST",
635            Self::ERROR_CODE_INVALID_ARGUMENT => "ERROR_CODE_INVALID_ARGUMENT",
636            Self::ERROR_CODE_NOT_FOUND => "ERROR_CODE_NOT_FOUND",
637            Self::ERROR_CODE_UNAVAILABLE => "ERROR_CODE_UNAVAILABLE",
638            Self::ERROR_CODE_UPSTREAM_ERROR => "ERROR_CODE_UPSTREAM_ERROR",
639        }
640    }
641    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
642        match name {
643            "ERROR_CODE_UNSPECIFIED" => {
644                ::core::option::Option::Some(Self::ERROR_CODE_UNSPECIFIED)
645            }
646            "ERROR_CODE_BAD_REQUEST" => {
647                ::core::option::Option::Some(Self::ERROR_CODE_BAD_REQUEST)
648            }
649            "ERROR_CODE_INVALID_ARGUMENT" => {
650                ::core::option::Option::Some(Self::ERROR_CODE_INVALID_ARGUMENT)
651            }
652            "ERROR_CODE_NOT_FOUND" => {
653                ::core::option::Option::Some(Self::ERROR_CODE_NOT_FOUND)
654            }
655            "ERROR_CODE_UNAVAILABLE" => {
656                ::core::option::Option::Some(Self::ERROR_CODE_UNAVAILABLE)
657            }
658            "ERROR_CODE_UPSTREAM_ERROR" => {
659                ::core::option::Option::Some(Self::ERROR_CODE_UPSTREAM_ERROR)
660            }
661            _ => ::core::option::Option::None,
662        }
663    }
664    fn values() -> &'static [Self] {
665        &[
666            Self::ERROR_CODE_UNSPECIFIED,
667            Self::ERROR_CODE_BAD_REQUEST,
668            Self::ERROR_CODE_INVALID_ARGUMENT,
669            Self::ERROR_CODE_NOT_FOUND,
670            Self::ERROR_CODE_UNAVAILABLE,
671            Self::ERROR_CODE_UPSTREAM_ERROR,
672        ]
673    }
674}
675/// ErrorDetail carries a typed domain error code for machine-readable handling.
676#[derive(Clone, PartialEq, Default)]
677#[derive(::serde::Serialize, ::serde::Deserialize)]
678#[serde(default)]
679pub struct ErrorDetail {
680    /// Stable error code for programmatic matching.
681    ///
682    /// Field 1: `code`
683    #[serde(
684        rename = "code",
685        with = "::buffa::json_helpers::proto_enum",
686        skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
687    )]
688    pub code: ::buffa::EnumValue<ErrorCode>,
689    #[serde(skip)]
690    #[doc(hidden)]
691    pub __buffa_unknown_fields: ::buffa::UnknownFields,
692}
693impl ::core::fmt::Debug for ErrorDetail {
694    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
695        f.debug_struct("ErrorDetail").field("code", &self.code).finish()
696    }
697}
698impl ErrorDetail {
699    /// Protobuf type URL for this message, for use with `Any::pack` and
700    /// `Any::unpack_if`.
701    ///
702    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
703    pub const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.ErrorDetail";
704}
705::buffa::impl_default_instance!(ErrorDetail);
706impl ::buffa::MessageName for ErrorDetail {
707    const PACKAGE: &'static str = "marketoverview.v1";
708    const NAME: &'static str = "ErrorDetail";
709    const FULL_NAME: &'static str = "marketoverview.v1.ErrorDetail";
710    const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.ErrorDetail";
711}
712impl ::buffa::Message for ErrorDetail {
713    /// Returns the total encoded size in bytes.
714    ///
715    /// The result is a `u32`; the protobuf specification requires all
716    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
717    /// compliant message will never overflow this type.
718    #[allow(clippy::let_and_return)]
719    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
720        #[allow(unused_imports)]
721        use ::buffa::Enumeration as _;
722        let mut size = 0u32;
723        {
724            let val = self.code.to_i32();
725            if val != 0 {
726                size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
727            }
728        }
729        size += self.__buffa_unknown_fields.encoded_len() as u32;
730        size
731    }
732    fn write_to(
733        &self,
734        _cache: &mut ::buffa::SizeCache,
735        buf: &mut impl ::buffa::bytes::BufMut,
736    ) {
737        #[allow(unused_imports)]
738        use ::buffa::Enumeration as _;
739        {
740            let val = self.code.to_i32();
741            if val != 0 {
742                ::buffa::types::put_int32_field(1u32, val, buf);
743            }
744        }
745        self.__buffa_unknown_fields.write_to(buf);
746    }
747    fn merge_field(
748        &mut self,
749        tag: ::buffa::encoding::Tag,
750        buf: &mut impl ::buffa::bytes::Buf,
751        ctx: ::buffa::DecodeContext<'_>,
752    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
753        #[allow(unused_imports)]
754        use ::buffa::bytes::Buf as _;
755        #[allow(unused_imports)]
756        use ::buffa::Enumeration as _;
757        match tag.field_number() {
758            1u32 => {
759                ::buffa::encoding::check_wire_type(
760                    tag,
761                    ::buffa::encoding::WireType::Varint,
762                )?;
763                self.code = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
764            }
765            _ => {
766                self.__buffa_unknown_fields
767                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
768            }
769        }
770        ::core::result::Result::Ok(())
771    }
772    fn clear(&mut self) {
773        self.code = ::buffa::EnumValue::from(0);
774        self.__buffa_unknown_fields.clear();
775    }
776}
777impl ::buffa::ExtensionSet for ErrorDetail {
778    const PROTO_FQN: &'static str = "marketoverview.v1.ErrorDetail";
779    fn unknown_fields(&self) -> &::buffa::UnknownFields {
780        &self.__buffa_unknown_fields
781    }
782    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
783        &mut self.__buffa_unknown_fields
784    }
785}
786impl ::buffa::json_helpers::ProtoElemJson for ErrorDetail {
787    fn serialize_proto_json<S: ::serde::Serializer>(
788        v: &Self,
789        s: S,
790    ) -> ::core::result::Result<S::Ok, S::Error> {
791        ::serde::Serialize::serialize(v, s)
792    }
793    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
794        d: D,
795    ) -> ::core::result::Result<Self, D::Error> {
796        <Self as ::serde::Deserialize>::deserialize(d)
797    }
798}
799#[doc(hidden)]
800pub const __ERROR_DETAIL_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
801    type_url: "type.googleapis.com/marketoverview.v1.ErrorDetail",
802    to_json: ::buffa::type_registry::any_to_json::<ErrorDetail>,
803    from_json: ::buffa::type_registry::any_from_json::<ErrorDetail>,
804    is_wkt: false,
805};
806/// Sparkline contains newest-first close prices for one time range.
807#[derive(Clone, PartialEq, Default)]
808#[derive(::serde::Serialize, ::serde::Deserialize)]
809#[serde(default)]
810pub struct Sparkline {
811    /// Time range and sampling resolution represented by these close prices.
812    ///
813    /// Field 1: `interval`
814    #[serde(
815        rename = "interval",
816        with = "::buffa::json_helpers::proto_enum",
817        skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
818    )]
819    pub interval: ::buffa::EnumValue<SparklineInterval>,
820    /// Newest-first close prices in quote units scaled by 1e6.
821    ///
822    /// Field 2: `close_ticks`
823    #[serde(
824        rename = "closeTicks",
825        alias = "close_ticks",
826        with = "::buffa::json_helpers::proto_seq",
827        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
828    )]
829    pub close_ticks: ::buffa::alloc::vec::Vec<i64>,
830    #[serde(skip)]
831    #[doc(hidden)]
832    pub __buffa_unknown_fields: ::buffa::UnknownFields,
833}
834impl ::core::fmt::Debug for Sparkline {
835    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
836        f.debug_struct("Sparkline")
837            .field("interval", &self.interval)
838            .field("close_ticks", &self.close_ticks)
839            .finish()
840    }
841}
842impl Sparkline {
843    /// Protobuf type URL for this message, for use with `Any::pack` and
844    /// `Any::unpack_if`.
845    ///
846    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
847    pub const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.Sparkline";
848}
849::buffa::impl_default_instance!(Sparkline);
850impl ::buffa::MessageName for Sparkline {
851    const PACKAGE: &'static str = "marketoverview.v1";
852    const NAME: &'static str = "Sparkline";
853    const FULL_NAME: &'static str = "marketoverview.v1.Sparkline";
854    const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.Sparkline";
855}
856impl ::buffa::Message for Sparkline {
857    /// Returns the total encoded size in bytes.
858    ///
859    /// The result is a `u32`; the protobuf specification requires all
860    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
861    /// compliant message will never overflow this type.
862    #[allow(clippy::let_and_return)]
863    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
864        #[allow(unused_imports)]
865        use ::buffa::Enumeration as _;
866        let mut size = 0u32;
867        {
868            let val = self.interval.to_i32();
869            if val != 0 {
870                size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
871            }
872        }
873        if !self.close_ticks.is_empty() {
874            let payload: u32 = self
875                .close_ticks
876                .iter()
877                .map(|&v| ::buffa::types::int64_encoded_len(v) as u32)
878                .sum::<u32>();
879            size
880                += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32 + payload;
881        }
882        size += self.__buffa_unknown_fields.encoded_len() as u32;
883        size
884    }
885    fn write_to(
886        &self,
887        _cache: &mut ::buffa::SizeCache,
888        buf: &mut impl ::buffa::bytes::BufMut,
889    ) {
890        #[allow(unused_imports)]
891        use ::buffa::Enumeration as _;
892        {
893            let val = self.interval.to_i32();
894            if val != 0 {
895                ::buffa::types::put_int32_field(1u32, val, buf);
896            }
897        }
898        if !self.close_ticks.is_empty() {
899            let payload: u32 = self
900                .close_ticks
901                .iter()
902                .map(|&v| ::buffa::types::int64_encoded_len(v) as u32)
903                .sum::<u32>();
904            ::buffa::types::put_len_delimited_header(2u32, payload, buf);
905            for &v in &self.close_ticks {
906                ::buffa::types::encode_int64(v, buf);
907            }
908        }
909        self.__buffa_unknown_fields.write_to(buf);
910    }
911    fn merge_field(
912        &mut self,
913        tag: ::buffa::encoding::Tag,
914        buf: &mut impl ::buffa::bytes::Buf,
915        ctx: ::buffa::DecodeContext<'_>,
916    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
917        #[allow(unused_imports)]
918        use ::buffa::bytes::Buf as _;
919        #[allow(unused_imports)]
920        use ::buffa::Enumeration as _;
921        match tag.field_number() {
922            1u32 => {
923                ::buffa::encoding::check_wire_type(
924                    tag,
925                    ::buffa::encoding::WireType::Varint,
926                )?;
927                self.interval = ::buffa::EnumValue::from(
928                    ::buffa::types::decode_int32(buf)?,
929                );
930            }
931            2u32 => {
932                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
933                    let len = ::buffa::encoding::decode_varint(buf)?;
934                    let len = usize::try_from(len)
935                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
936                    if buf.remaining() < len {
937                        return ::core::result::Result::Err(
938                            ::buffa::DecodeError::UnexpectedEof,
939                        );
940                    }
941                    self.close_ticks.reserve(len);
942                    let mut limited = buf.take(len);
943                    while limited.has_remaining() {
944                        self.close_ticks
945                            .push(::buffa::types::decode_int64(&mut limited)?);
946                    }
947                    let leftover = limited.remaining();
948                    if leftover > 0 {
949                        limited.advance(leftover);
950                    }
951                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
952                    self.close_ticks.push(::buffa::types::decode_int64(buf)?);
953                } else {
954                    return ::core::result::Result::Err(
955                        ::buffa::encoding::wire_type_mismatch(
956                            tag,
957                            ::buffa::encoding::WireType::LengthDelimited,
958                        ),
959                    );
960                }
961            }
962            _ => {
963                self.__buffa_unknown_fields
964                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
965            }
966        }
967        ::core::result::Result::Ok(())
968    }
969    fn clear(&mut self) {
970        self.interval = ::buffa::EnumValue::from(0);
971        self.close_ticks.clear();
972        self.__buffa_unknown_fields.clear();
973    }
974}
975impl ::buffa::ExtensionSet for Sparkline {
976    const PROTO_FQN: &'static str = "marketoverview.v1.Sparkline";
977    fn unknown_fields(&self) -> &::buffa::UnknownFields {
978        &self.__buffa_unknown_fields
979    }
980    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
981        &mut self.__buffa_unknown_fields
982    }
983}
984impl ::buffa::json_helpers::ProtoElemJson for Sparkline {
985    fn serialize_proto_json<S: ::serde::Serializer>(
986        v: &Self,
987        s: S,
988    ) -> ::core::result::Result<S::Ok, S::Error> {
989        ::serde::Serialize::serialize(v, s)
990    }
991    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
992        d: D,
993    ) -> ::core::result::Result<Self, D::Error> {
994        <Self as ::serde::Deserialize>::deserialize(d)
995    }
996}
997#[doc(hidden)]
998pub const __SPARKLINE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
999    type_url: "type.googleapis.com/marketoverview.v1.Sparkline",
1000    to_json: ::buffa::type_registry::any_to_json::<Sparkline>,
1001    from_json: ::buffa::type_registry::any_from_json::<Sparkline>,
1002    is_wkt: false,
1003};
1004#[derive(Clone, PartialEq, Default)]
1005#[derive(::serde::Serialize, ::serde::Deserialize)]
1006#[serde(default)]
1007pub struct MarketOverview {
1008    /// Numeric spot market identifier.
1009    ///
1010    /// Field 1: `symbol_id`
1011    #[serde(
1012        rename = "symbolId",
1013        alias = "symbol_id",
1014        with = "::buffa::json_helpers::uint32",
1015        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1016    )]
1017    pub symbol_id: u32,
1018    /// Canonical pair symbol, e.g. "BTC-USDT".
1019    ///
1020    /// Field 2: `symbol`
1021    #[serde(
1022        rename = "symbol",
1023        with = "::buffa::json_helpers::proto_string",
1024        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1025    )]
1026    pub symbol: ::buffa::alloc::string::String,
1027    /// Last traded price in quote units scaled by 1e6.
1028    ///
1029    /// Field 3: `last_price_ticks`
1030    #[serde(
1031        rename = "lastPriceTicks",
1032        alias = "last_price_ticks",
1033        with = "::buffa::json_helpers::int64",
1034        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
1035    )]
1036    pub last_price_ticks: i64,
1037    /// Last trade timestamp in nanoseconds since epoch.
1038    ///
1039    /// Field 4: `last_trade_ts_ns`
1040    #[serde(
1041        rename = "lastTradeTsNs",
1042        alias = "last_trade_ts_ns",
1043        with = "::buffa::json_helpers::uint64",
1044        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
1045    )]
1046    pub last_trade_ts_ns: u64,
1047    /// Rolling 24h change expressed in basis points (bp). Example: +123 = +1.23%.
1048    ///
1049    /// Field 5: `change_24h_bps`
1050    #[serde(
1051        rename = "change24hBps",
1052        alias = "change_24h_bps",
1053        with = "::buffa::json_helpers::int32",
1054        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
1055    )]
1056    pub change_24h_bps: i32,
1057    /// Rolling 24h stats.
1058    /// Highest traded price in the 24h window, in quote units scaled by 1e6.
1059    ///
1060    /// Field 6: `high_24h_ticks`
1061    #[serde(
1062        rename = "high24hTicks",
1063        alias = "high_24h_ticks",
1064        with = "::buffa::json_helpers::int64",
1065        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
1066    )]
1067    pub high_24h_ticks: i64,
1068    /// Lowest traded price in the 24h window, in quote units scaled by 1e6.
1069    ///
1070    /// Field 7: `low_24h_ticks`
1071    #[serde(
1072        rename = "low24hTicks",
1073        alias = "low_24h_ticks",
1074        with = "::buffa::json_helpers::int64",
1075        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
1076    )]
1077    pub low_24h_ticks: i64,
1078    /// Rolling 24h base volume scaled by the pair's base_quantity_scale from
1079    /// GetSpotConfig.
1080    ///
1081    /// Field 8: `volume_24h_base_scaled`
1082    #[serde(
1083        rename = "volume24hBaseScaled",
1084        alias = "volume_24h_base_scaled",
1085        with = "::buffa::json_helpers::int64",
1086        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
1087    )]
1088    pub volume_24h_base_scaled: i64,
1089    /// Rolling 24h quote volume scaled by the pair's quote_quantity_scale from
1090    /// GetSpotConfig.
1091    ///
1092    /// Field 14: `volume_24h_quote_scaled`
1093    #[serde(
1094        rename = "volume24hQuoteScaled",
1095        alias = "volume_24h_quote_scaled",
1096        with = "::buffa::json_helpers::int64",
1097        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
1098    )]
1099    pub volume_24h_quote_scaled: i64,
1100    /// Listing timestamp in nanoseconds since epoch.
1101    ///
1102    /// Field 15: `listed_ts_ns`
1103    #[serde(
1104        rename = "listedTsNs",
1105        alias = "listed_ts_ns",
1106        with = "::buffa::json_helpers::uint64",
1107        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
1108    )]
1109    pub listed_ts_ns: u64,
1110    /// Current best bid price in quote units scaled by 1e6.
1111    ///
1112    /// Field 9: `best_bid_ticks`
1113    #[serde(
1114        rename = "bestBidTicks",
1115        alias = "best_bid_ticks",
1116        with = "::buffa::json_helpers::int64",
1117        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
1118    )]
1119    pub best_bid_ticks: i64,
1120    /// Best bid quantity scaled by the pair's base_quantity_scale from
1121    /// GetSpotConfig.
1122    ///
1123    /// Field 10: `best_bid_qty_scaled`
1124    #[serde(
1125        rename = "bestBidQtyScaled",
1126        alias = "best_bid_qty_scaled",
1127        with = "::buffa::json_helpers::int64",
1128        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
1129    )]
1130    pub best_bid_qty_scaled: i64,
1131    /// Current best ask price in quote units scaled by 1e6.
1132    ///
1133    /// Field 11: `best_ask_ticks`
1134    #[serde(
1135        rename = "bestAskTicks",
1136        alias = "best_ask_ticks",
1137        with = "::buffa::json_helpers::int64",
1138        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
1139    )]
1140    pub best_ask_ticks: i64,
1141    /// Best ask quantity scaled by the pair's base_quantity_scale from
1142    /// GetSpotConfig.
1143    ///
1144    /// Field 12: `best_ask_qty_scaled`
1145    #[serde(
1146        rename = "bestAskQtyScaled",
1147        alias = "best_ask_qty_scaled",
1148        with = "::buffa::json_helpers::int64",
1149        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
1150    )]
1151    pub best_ask_qty_scaled: i64,
1152    /// Optional sparklines (requested explicitly).
1153    ///
1154    /// Field 13: `sparklines`
1155    #[serde(
1156        rename = "sparklines",
1157        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1158        deserialize_with = "::buffa::json_helpers::null_as_default"
1159    )]
1160    pub sparklines: ::buffa::alloc::vec::Vec<Sparkline>,
1161    #[serde(skip)]
1162    #[doc(hidden)]
1163    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1164}
1165impl ::core::fmt::Debug for MarketOverview {
1166    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1167        f.debug_struct("MarketOverview")
1168            .field("symbol_id", &self.symbol_id)
1169            .field("symbol", &self.symbol)
1170            .field("last_price_ticks", &self.last_price_ticks)
1171            .field("last_trade_ts_ns", &self.last_trade_ts_ns)
1172            .field("change_24h_bps", &self.change_24h_bps)
1173            .field("high_24h_ticks", &self.high_24h_ticks)
1174            .field("low_24h_ticks", &self.low_24h_ticks)
1175            .field("volume_24h_base_scaled", &self.volume_24h_base_scaled)
1176            .field("volume_24h_quote_scaled", &self.volume_24h_quote_scaled)
1177            .field("listed_ts_ns", &self.listed_ts_ns)
1178            .field("best_bid_ticks", &self.best_bid_ticks)
1179            .field("best_bid_qty_scaled", &self.best_bid_qty_scaled)
1180            .field("best_ask_ticks", &self.best_ask_ticks)
1181            .field("best_ask_qty_scaled", &self.best_ask_qty_scaled)
1182            .field("sparklines", &self.sparklines)
1183            .finish()
1184    }
1185}
1186impl MarketOverview {
1187    /// Protobuf type URL for this message, for use with `Any::pack` and
1188    /// `Any::unpack_if`.
1189    ///
1190    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1191    pub const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.MarketOverview";
1192}
1193::buffa::impl_default_instance!(MarketOverview);
1194impl ::buffa::MessageName for MarketOverview {
1195    const PACKAGE: &'static str = "marketoverview.v1";
1196    const NAME: &'static str = "MarketOverview";
1197    const FULL_NAME: &'static str = "marketoverview.v1.MarketOverview";
1198    const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.MarketOverview";
1199}
1200impl ::buffa::Message for MarketOverview {
1201    /// Returns the total encoded size in bytes.
1202    ///
1203    /// The result is a `u32`; the protobuf specification requires all
1204    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1205    /// compliant message will never overflow this type.
1206    #[allow(clippy::let_and_return)]
1207    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1208        #[allow(unused_imports)]
1209        use ::buffa::Enumeration as _;
1210        let mut size = 0u32;
1211        if self.symbol_id != 0u32 {
1212            size += 1u32 + ::buffa::types::uint32_encoded_len(self.symbol_id) as u32;
1213        }
1214        if !self.symbol.is_empty() {
1215            size += 1u32 + ::buffa::types::string_encoded_len(&self.symbol) as u32;
1216        }
1217        if self.last_price_ticks != 0i64 {
1218            size
1219                += 1u32
1220                    + ::buffa::types::int64_encoded_len(self.last_price_ticks) as u32;
1221        }
1222        if self.last_trade_ts_ns != 0u64 {
1223            size
1224                += 1u32
1225                    + ::buffa::types::uint64_encoded_len(self.last_trade_ts_ns) as u32;
1226        }
1227        if self.change_24h_bps != 0i32 {
1228            size += 1u32 + ::buffa::types::int32_encoded_len(self.change_24h_bps) as u32;
1229        }
1230        if self.high_24h_ticks != 0i64 {
1231            size += 1u32 + ::buffa::types::int64_encoded_len(self.high_24h_ticks) as u32;
1232        }
1233        if self.low_24h_ticks != 0i64 {
1234            size += 1u32 + ::buffa::types::int64_encoded_len(self.low_24h_ticks) as u32;
1235        }
1236        if self.volume_24h_base_scaled != 0i64 {
1237            size
1238                += 1u32
1239                    + ::buffa::types::int64_encoded_len(self.volume_24h_base_scaled)
1240                        as u32;
1241        }
1242        if self.best_bid_ticks != 0i64 {
1243            size += 1u32 + ::buffa::types::int64_encoded_len(self.best_bid_ticks) as u32;
1244        }
1245        if self.best_bid_qty_scaled != 0i64 {
1246            size
1247                += 1u32
1248                    + ::buffa::types::int64_encoded_len(self.best_bid_qty_scaled) as u32;
1249        }
1250        if self.best_ask_ticks != 0i64 {
1251            size += 1u32 + ::buffa::types::int64_encoded_len(self.best_ask_ticks) as u32;
1252        }
1253        if self.best_ask_qty_scaled != 0i64 {
1254            size
1255                += 1u32
1256                    + ::buffa::types::int64_encoded_len(self.best_ask_qty_scaled) as u32;
1257        }
1258        for v in &self.sparklines {
1259            let __slot = __cache.reserve();
1260            let inner_size = v.compute_size(__cache);
1261            __cache.set(__slot, inner_size);
1262            size
1263                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1264                    + inner_size;
1265        }
1266        if self.volume_24h_quote_scaled != 0i64 {
1267            size
1268                += 1u32
1269                    + ::buffa::types::int64_encoded_len(self.volume_24h_quote_scaled)
1270                        as u32;
1271        }
1272        if self.listed_ts_ns != 0u64 {
1273            size += 1u32 + ::buffa::types::uint64_encoded_len(self.listed_ts_ns) as u32;
1274        }
1275        size += self.__buffa_unknown_fields.encoded_len() as u32;
1276        size
1277    }
1278    fn write_to(
1279        &self,
1280        __cache: &mut ::buffa::SizeCache,
1281        buf: &mut impl ::buffa::bytes::BufMut,
1282    ) {
1283        #[allow(unused_imports)]
1284        use ::buffa::Enumeration as _;
1285        if self.symbol_id != 0u32 {
1286            ::buffa::types::put_uint32_field(1u32, self.symbol_id, buf);
1287        }
1288        if !self.symbol.is_empty() {
1289            ::buffa::types::put_string_field(2u32, &self.symbol, buf);
1290        }
1291        if self.last_price_ticks != 0i64 {
1292            ::buffa::types::put_int64_field(3u32, self.last_price_ticks, buf);
1293        }
1294        if self.last_trade_ts_ns != 0u64 {
1295            ::buffa::types::put_uint64_field(4u32, self.last_trade_ts_ns, buf);
1296        }
1297        if self.change_24h_bps != 0i32 {
1298            ::buffa::types::put_int32_field(5u32, self.change_24h_bps, buf);
1299        }
1300        if self.high_24h_ticks != 0i64 {
1301            ::buffa::types::put_int64_field(6u32, self.high_24h_ticks, buf);
1302        }
1303        if self.low_24h_ticks != 0i64 {
1304            ::buffa::types::put_int64_field(7u32, self.low_24h_ticks, buf);
1305        }
1306        if self.volume_24h_base_scaled != 0i64 {
1307            ::buffa::types::put_int64_field(8u32, self.volume_24h_base_scaled, buf);
1308        }
1309        if self.best_bid_ticks != 0i64 {
1310            ::buffa::types::put_int64_field(9u32, self.best_bid_ticks, buf);
1311        }
1312        if self.best_bid_qty_scaled != 0i64 {
1313            ::buffa::types::put_int64_field(10u32, self.best_bid_qty_scaled, buf);
1314        }
1315        if self.best_ask_ticks != 0i64 {
1316            ::buffa::types::put_int64_field(11u32, self.best_ask_ticks, buf);
1317        }
1318        if self.best_ask_qty_scaled != 0i64 {
1319            ::buffa::types::put_int64_field(12u32, self.best_ask_qty_scaled, buf);
1320        }
1321        for v in &self.sparklines {
1322            ::buffa::types::put_len_delimited_header(13u32, __cache.consume_next(), buf);
1323            v.write_to(__cache, buf);
1324        }
1325        if self.volume_24h_quote_scaled != 0i64 {
1326            ::buffa::types::put_int64_field(14u32, self.volume_24h_quote_scaled, buf);
1327        }
1328        if self.listed_ts_ns != 0u64 {
1329            ::buffa::types::put_uint64_field(15u32, self.listed_ts_ns, buf);
1330        }
1331        self.__buffa_unknown_fields.write_to(buf);
1332    }
1333    fn merge_field(
1334        &mut self,
1335        tag: ::buffa::encoding::Tag,
1336        buf: &mut impl ::buffa::bytes::Buf,
1337        ctx: ::buffa::DecodeContext<'_>,
1338    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1339        #[allow(unused_imports)]
1340        use ::buffa::bytes::Buf as _;
1341        #[allow(unused_imports)]
1342        use ::buffa::Enumeration as _;
1343        match tag.field_number() {
1344            1u32 => {
1345                ::buffa::encoding::check_wire_type(
1346                    tag,
1347                    ::buffa::encoding::WireType::Varint,
1348                )?;
1349                self.symbol_id = ::buffa::types::decode_uint32(buf)?;
1350            }
1351            2u32 => {
1352                ::buffa::encoding::check_wire_type(
1353                    tag,
1354                    ::buffa::encoding::WireType::LengthDelimited,
1355                )?;
1356                ::buffa::types::merge_string(&mut self.symbol, buf)?;
1357            }
1358            3u32 => {
1359                ::buffa::encoding::check_wire_type(
1360                    tag,
1361                    ::buffa::encoding::WireType::Varint,
1362                )?;
1363                self.last_price_ticks = ::buffa::types::decode_int64(buf)?;
1364            }
1365            4u32 => {
1366                ::buffa::encoding::check_wire_type(
1367                    tag,
1368                    ::buffa::encoding::WireType::Varint,
1369                )?;
1370                self.last_trade_ts_ns = ::buffa::types::decode_uint64(buf)?;
1371            }
1372            5u32 => {
1373                ::buffa::encoding::check_wire_type(
1374                    tag,
1375                    ::buffa::encoding::WireType::Varint,
1376                )?;
1377                self.change_24h_bps = ::buffa::types::decode_int32(buf)?;
1378            }
1379            6u32 => {
1380                ::buffa::encoding::check_wire_type(
1381                    tag,
1382                    ::buffa::encoding::WireType::Varint,
1383                )?;
1384                self.high_24h_ticks = ::buffa::types::decode_int64(buf)?;
1385            }
1386            7u32 => {
1387                ::buffa::encoding::check_wire_type(
1388                    tag,
1389                    ::buffa::encoding::WireType::Varint,
1390                )?;
1391                self.low_24h_ticks = ::buffa::types::decode_int64(buf)?;
1392            }
1393            8u32 => {
1394                ::buffa::encoding::check_wire_type(
1395                    tag,
1396                    ::buffa::encoding::WireType::Varint,
1397                )?;
1398                self.volume_24h_base_scaled = ::buffa::types::decode_int64(buf)?;
1399            }
1400            9u32 => {
1401                ::buffa::encoding::check_wire_type(
1402                    tag,
1403                    ::buffa::encoding::WireType::Varint,
1404                )?;
1405                self.best_bid_ticks = ::buffa::types::decode_int64(buf)?;
1406            }
1407            10u32 => {
1408                ::buffa::encoding::check_wire_type(
1409                    tag,
1410                    ::buffa::encoding::WireType::Varint,
1411                )?;
1412                self.best_bid_qty_scaled = ::buffa::types::decode_int64(buf)?;
1413            }
1414            11u32 => {
1415                ::buffa::encoding::check_wire_type(
1416                    tag,
1417                    ::buffa::encoding::WireType::Varint,
1418                )?;
1419                self.best_ask_ticks = ::buffa::types::decode_int64(buf)?;
1420            }
1421            12u32 => {
1422                ::buffa::encoding::check_wire_type(
1423                    tag,
1424                    ::buffa::encoding::WireType::Varint,
1425                )?;
1426                self.best_ask_qty_scaled = ::buffa::types::decode_int64(buf)?;
1427            }
1428            13u32 => {
1429                ::buffa::encoding::check_wire_type(
1430                    tag,
1431                    ::buffa::encoding::WireType::LengthDelimited,
1432                )?;
1433                let mut elem = ::core::default::Default::default();
1434                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1435                self.sparklines.push(elem);
1436            }
1437            14u32 => {
1438                ::buffa::encoding::check_wire_type(
1439                    tag,
1440                    ::buffa::encoding::WireType::Varint,
1441                )?;
1442                self.volume_24h_quote_scaled = ::buffa::types::decode_int64(buf)?;
1443            }
1444            15u32 => {
1445                ::buffa::encoding::check_wire_type(
1446                    tag,
1447                    ::buffa::encoding::WireType::Varint,
1448                )?;
1449                self.listed_ts_ns = ::buffa::types::decode_uint64(buf)?;
1450            }
1451            _ => {
1452                self.__buffa_unknown_fields
1453                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1454            }
1455        }
1456        ::core::result::Result::Ok(())
1457    }
1458    fn clear(&mut self) {
1459        self.symbol_id = 0u32;
1460        self.symbol.clear();
1461        self.last_price_ticks = 0i64;
1462        self.last_trade_ts_ns = 0u64;
1463        self.change_24h_bps = 0i32;
1464        self.high_24h_ticks = 0i64;
1465        self.low_24h_ticks = 0i64;
1466        self.volume_24h_base_scaled = 0i64;
1467        self.best_bid_ticks = 0i64;
1468        self.best_bid_qty_scaled = 0i64;
1469        self.best_ask_ticks = 0i64;
1470        self.best_ask_qty_scaled = 0i64;
1471        self.sparklines.clear();
1472        self.volume_24h_quote_scaled = 0i64;
1473        self.listed_ts_ns = 0u64;
1474        self.__buffa_unknown_fields.clear();
1475    }
1476}
1477impl ::buffa::ExtensionSet for MarketOverview {
1478    const PROTO_FQN: &'static str = "marketoverview.v1.MarketOverview";
1479    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1480        &self.__buffa_unknown_fields
1481    }
1482    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1483        &mut self.__buffa_unknown_fields
1484    }
1485}
1486impl ::buffa::json_helpers::ProtoElemJson for MarketOverview {
1487    fn serialize_proto_json<S: ::serde::Serializer>(
1488        v: &Self,
1489        s: S,
1490    ) -> ::core::result::Result<S::Ok, S::Error> {
1491        ::serde::Serialize::serialize(v, s)
1492    }
1493    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1494        d: D,
1495    ) -> ::core::result::Result<Self, D::Error> {
1496        <Self as ::serde::Deserialize>::deserialize(d)
1497    }
1498}
1499#[doc(hidden)]
1500pub const __MARKET_OVERVIEW_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1501    type_url: "type.googleapis.com/marketoverview.v1.MarketOverview",
1502    to_json: ::buffa::type_registry::any_to_json::<MarketOverview>,
1503    from_json: ::buffa::type_registry::any_from_json::<MarketOverview>,
1504    is_wkt: false,
1505};
1506#[derive(Clone, PartialEq, Default)]
1507#[derive(::serde::Serialize, ::serde::Deserialize)]
1508#[serde(default)]
1509pub struct ListMarketOverviewRequest {
1510    /// Filter by specific symbols; when empty, returns all enabled markets.
1511    ///
1512    /// Field 1: `symbols`
1513    #[serde(
1514        rename = "symbols",
1515        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1516        deserialize_with = "::buffa::json_helpers::null_as_default"
1517    )]
1518    pub symbols: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
1519    /// Maximum number of markets to return. Defaults to 50 when omitted; maximum
1520    /// is 2000.
1521    ///
1522    /// Field 2: `limit`
1523    #[serde(
1524        rename = "limit",
1525        with = "::buffa::json_helpers::uint32",
1526        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1527    )]
1528    pub limit: u32,
1529    /// Opaque keyset cursor from a previous response. The cursor is exclusive and
1530    /// bound to symbols, sort key, and sort direction. Sparkline options affect
1531    /// only response enrichment and may change between pages.
1532    ///
1533    /// Field 3: `page_token`
1534    #[serde(
1535        rename = "pageToken",
1536        alias = "page_token",
1537        with = "::buffa::json_helpers::proto_string",
1538        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1539    )]
1540    pub page_token: ::buffa::alloc::string::String,
1541    /// Sort key. When unset/UNSPECIFIED, defaults to 24h quote volume.
1542    ///
1543    /// Field 4: `order_by`
1544    #[serde(
1545        rename = "orderBy",
1546        alias = "order_by",
1547        with = "::buffa::json_helpers::proto_enum",
1548        skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
1549    )]
1550    pub order_by: ::buffa::EnumValue<MarketOrderBy>,
1551    /// Sort direction (DESC=newest/highest first).
1552    ///
1553    /// Field 5: `sort`
1554    #[serde(
1555        rename = "sort",
1556        with = "::buffa::json_helpers::proto_enum",
1557        skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
1558    )]
1559    pub sort: ::buffa::EnumValue<SortDirection>,
1560    /// When true, include sparklines in each MarketOverview.
1561    ///
1562    /// Field 6: `include_sparklines`
1563    #[serde(
1564        rename = "includeSparklines",
1565        alias = "include_sparklines",
1566        with = "::buffa::json_helpers::proto_bool",
1567        skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
1568    )]
1569    pub include_sparklines: bool,
1570    /// Which sparklines to include. If empty and include_sparklines is true,
1571    /// server defaults to 24h.
1572    ///
1573    /// Field 7: `sparkline_intervals`
1574    #[serde(
1575        rename = "sparklineIntervals",
1576        alias = "sparkline_intervals",
1577        with = "::buffa::json_helpers::repeated_enum",
1578        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
1579    )]
1580    pub sparkline_intervals: ::buffa::alloc::vec::Vec<
1581        ::buffa::EnumValue<SparklineInterval>,
1582    >,
1583    #[serde(skip)]
1584    #[doc(hidden)]
1585    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1586}
1587impl ::core::fmt::Debug for ListMarketOverviewRequest {
1588    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1589        f.debug_struct("ListMarketOverviewRequest")
1590            .field("symbols", &self.symbols)
1591            .field("limit", &self.limit)
1592            .field("page_token", &self.page_token)
1593            .field("order_by", &self.order_by)
1594            .field("sort", &self.sort)
1595            .field("include_sparklines", &self.include_sparklines)
1596            .field("sparkline_intervals", &self.sparkline_intervals)
1597            .finish()
1598    }
1599}
1600impl ListMarketOverviewRequest {
1601    /// Protobuf type URL for this message, for use with `Any::pack` and
1602    /// `Any::unpack_if`.
1603    ///
1604    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1605    pub const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.ListMarketOverviewRequest";
1606}
1607::buffa::impl_default_instance!(ListMarketOverviewRequest);
1608impl ::buffa::MessageName for ListMarketOverviewRequest {
1609    const PACKAGE: &'static str = "marketoverview.v1";
1610    const NAME: &'static str = "ListMarketOverviewRequest";
1611    const FULL_NAME: &'static str = "marketoverview.v1.ListMarketOverviewRequest";
1612    const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.ListMarketOverviewRequest";
1613}
1614impl ::buffa::Message for ListMarketOverviewRequest {
1615    /// Returns the total encoded size in bytes.
1616    ///
1617    /// The result is a `u32`; the protobuf specification requires all
1618    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1619    /// compliant message will never overflow this type.
1620    #[allow(clippy::let_and_return)]
1621    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1622        #[allow(unused_imports)]
1623        use ::buffa::Enumeration as _;
1624        let mut size = 0u32;
1625        for v in &self.symbols {
1626            size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1627        }
1628        if self.limit != 0u32 {
1629            size += 1u32 + ::buffa::types::uint32_encoded_len(self.limit) as u32;
1630        }
1631        if !self.page_token.is_empty() {
1632            size += 1u32 + ::buffa::types::string_encoded_len(&self.page_token) as u32;
1633        }
1634        {
1635            let val = self.order_by.to_i32();
1636            if val != 0 {
1637                size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
1638            }
1639        }
1640        {
1641            let val = self.sort.to_i32();
1642            if val != 0 {
1643                size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
1644            }
1645        }
1646        if self.include_sparklines {
1647            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1648        }
1649        if !self.sparkline_intervals.is_empty() {
1650            let payload: u32 = self
1651                .sparkline_intervals
1652                .iter()
1653                .map(|v| ::buffa::types::int32_encoded_len(v.to_i32()) as u32)
1654                .sum::<u32>();
1655            size
1656                += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32 + payload;
1657        }
1658        size += self.__buffa_unknown_fields.encoded_len() as u32;
1659        size
1660    }
1661    fn write_to(
1662        &self,
1663        _cache: &mut ::buffa::SizeCache,
1664        buf: &mut impl ::buffa::bytes::BufMut,
1665    ) {
1666        #[allow(unused_imports)]
1667        use ::buffa::Enumeration as _;
1668        for v in &self.symbols {
1669            ::buffa::types::put_string_field(1u32, v, buf);
1670        }
1671        if self.limit != 0u32 {
1672            ::buffa::types::put_uint32_field(2u32, self.limit, buf);
1673        }
1674        if !self.page_token.is_empty() {
1675            ::buffa::types::put_string_field(3u32, &self.page_token, buf);
1676        }
1677        {
1678            let val = self.order_by.to_i32();
1679            if val != 0 {
1680                ::buffa::types::put_int32_field(4u32, val, buf);
1681            }
1682        }
1683        {
1684            let val = self.sort.to_i32();
1685            if val != 0 {
1686                ::buffa::types::put_int32_field(5u32, val, buf);
1687            }
1688        }
1689        if self.include_sparklines {
1690            ::buffa::types::put_bool_field(6u32, self.include_sparklines, buf);
1691        }
1692        if !self.sparkline_intervals.is_empty() {
1693            let payload: u32 = self
1694                .sparkline_intervals
1695                .iter()
1696                .map(|v| ::buffa::types::int32_encoded_len(v.to_i32()) as u32)
1697                .sum::<u32>();
1698            ::buffa::types::put_len_delimited_header(7u32, payload, buf);
1699            for v in &self.sparkline_intervals {
1700                ::buffa::types::encode_int32(v.to_i32(), buf);
1701            }
1702        }
1703        self.__buffa_unknown_fields.write_to(buf);
1704    }
1705    fn merge_field(
1706        &mut self,
1707        tag: ::buffa::encoding::Tag,
1708        buf: &mut impl ::buffa::bytes::Buf,
1709        ctx: ::buffa::DecodeContext<'_>,
1710    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1711        #[allow(unused_imports)]
1712        use ::buffa::bytes::Buf as _;
1713        #[allow(unused_imports)]
1714        use ::buffa::Enumeration as _;
1715        match tag.field_number() {
1716            1u32 => {
1717                ::buffa::encoding::check_wire_type(
1718                    tag,
1719                    ::buffa::encoding::WireType::LengthDelimited,
1720                )?;
1721                self.symbols.push(::buffa::types::decode_string(buf)?);
1722            }
1723            2u32 => {
1724                ::buffa::encoding::check_wire_type(
1725                    tag,
1726                    ::buffa::encoding::WireType::Varint,
1727                )?;
1728                self.limit = ::buffa::types::decode_uint32(buf)?;
1729            }
1730            3u32 => {
1731                ::buffa::encoding::check_wire_type(
1732                    tag,
1733                    ::buffa::encoding::WireType::LengthDelimited,
1734                )?;
1735                ::buffa::types::merge_string(&mut self.page_token, buf)?;
1736            }
1737            4u32 => {
1738                ::buffa::encoding::check_wire_type(
1739                    tag,
1740                    ::buffa::encoding::WireType::Varint,
1741                )?;
1742                self.order_by = ::buffa::EnumValue::from(
1743                    ::buffa::types::decode_int32(buf)?,
1744                );
1745            }
1746            5u32 => {
1747                ::buffa::encoding::check_wire_type(
1748                    tag,
1749                    ::buffa::encoding::WireType::Varint,
1750                )?;
1751                self.sort = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
1752            }
1753            6u32 => {
1754                ::buffa::encoding::check_wire_type(
1755                    tag,
1756                    ::buffa::encoding::WireType::Varint,
1757                )?;
1758                self.include_sparklines = ::buffa::types::decode_bool(buf)?;
1759            }
1760            7u32 => {
1761                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
1762                    let len = ::buffa::encoding::decode_varint(buf)?;
1763                    let len = usize::try_from(len)
1764                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1765                    if buf.remaining() < len {
1766                        return ::core::result::Result::Err(
1767                            ::buffa::DecodeError::UnexpectedEof,
1768                        );
1769                    }
1770                    self.sparkline_intervals.reserve(len);
1771                    let mut limited = buf.take(len);
1772                    while limited.has_remaining() {
1773                        self.sparkline_intervals
1774                            .push(
1775                                ::buffa::EnumValue::from(
1776                                    ::buffa::types::decode_int32(&mut limited)?,
1777                                ),
1778                            );
1779                    }
1780                    let leftover = limited.remaining();
1781                    if leftover > 0 {
1782                        limited.advance(leftover);
1783                    }
1784                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
1785                    self.sparkline_intervals
1786                        .push(
1787                            ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?),
1788                        );
1789                } else {
1790                    return ::core::result::Result::Err(
1791                        ::buffa::encoding::wire_type_mismatch(
1792                            tag,
1793                            ::buffa::encoding::WireType::LengthDelimited,
1794                        ),
1795                    );
1796                }
1797            }
1798            _ => {
1799                self.__buffa_unknown_fields
1800                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1801            }
1802        }
1803        ::core::result::Result::Ok(())
1804    }
1805    fn clear(&mut self) {
1806        self.symbols.clear();
1807        self.limit = 0u32;
1808        self.page_token.clear();
1809        self.order_by = ::buffa::EnumValue::from(0);
1810        self.sort = ::buffa::EnumValue::from(0);
1811        self.include_sparklines = false;
1812        self.sparkline_intervals.clear();
1813        self.__buffa_unknown_fields.clear();
1814    }
1815}
1816impl ::buffa::ExtensionSet for ListMarketOverviewRequest {
1817    const PROTO_FQN: &'static str = "marketoverview.v1.ListMarketOverviewRequest";
1818    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1819        &self.__buffa_unknown_fields
1820    }
1821    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1822        &mut self.__buffa_unknown_fields
1823    }
1824}
1825impl ::buffa::json_helpers::ProtoElemJson for ListMarketOverviewRequest {
1826    fn serialize_proto_json<S: ::serde::Serializer>(
1827        v: &Self,
1828        s: S,
1829    ) -> ::core::result::Result<S::Ok, S::Error> {
1830        ::serde::Serialize::serialize(v, s)
1831    }
1832    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1833        d: D,
1834    ) -> ::core::result::Result<Self, D::Error> {
1835        <Self as ::serde::Deserialize>::deserialize(d)
1836    }
1837}
1838#[doc(hidden)]
1839pub const __LIST_MARKET_OVERVIEW_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1840    type_url: "type.googleapis.com/marketoverview.v1.ListMarketOverviewRequest",
1841    to_json: ::buffa::type_registry::any_to_json::<ListMarketOverviewRequest>,
1842    from_json: ::buffa::type_registry::any_from_json::<ListMarketOverviewRequest>,
1843    is_wkt: false,
1844};
1845#[derive(Clone, PartialEq, Default)]
1846#[derive(::serde::Serialize, ::serde::Deserialize)]
1847#[serde(default)]
1848pub struct ListMarketOverviewResponse {
1849    /// Market overview rows for the requested page.
1850    ///
1851    /// Field 1: `markets`
1852    #[serde(
1853        rename = "markets",
1854        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1855        deserialize_with = "::buffa::json_helpers::null_as_default"
1856    )]
1857    pub markets: ::buffa::alloc::vec::Vec<MarketOverview>,
1858    /// Opaque cursor for the next page. Empty when no more results exist.
1859    ///
1860    /// Field 2: `next_page_token`
1861    #[serde(
1862        rename = "nextPageToken",
1863        alias = "next_page_token",
1864        with = "::buffa::json_helpers::proto_string",
1865        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1866    )]
1867    pub next_page_token: ::buffa::alloc::string::String,
1868    #[serde(skip)]
1869    #[doc(hidden)]
1870    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1871}
1872impl ::core::fmt::Debug for ListMarketOverviewResponse {
1873    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1874        f.debug_struct("ListMarketOverviewResponse")
1875            .field("markets", &self.markets)
1876            .field("next_page_token", &self.next_page_token)
1877            .finish()
1878    }
1879}
1880impl ListMarketOverviewResponse {
1881    /// Protobuf type URL for this message, for use with `Any::pack` and
1882    /// `Any::unpack_if`.
1883    ///
1884    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1885    pub const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.ListMarketOverviewResponse";
1886}
1887::buffa::impl_default_instance!(ListMarketOverviewResponse);
1888impl ::buffa::MessageName for ListMarketOverviewResponse {
1889    const PACKAGE: &'static str = "marketoverview.v1";
1890    const NAME: &'static str = "ListMarketOverviewResponse";
1891    const FULL_NAME: &'static str = "marketoverview.v1.ListMarketOverviewResponse";
1892    const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.ListMarketOverviewResponse";
1893}
1894impl ::buffa::Message for ListMarketOverviewResponse {
1895    /// Returns the total encoded size in bytes.
1896    ///
1897    /// The result is a `u32`; the protobuf specification requires all
1898    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1899    /// compliant message will never overflow this type.
1900    #[allow(clippy::let_and_return)]
1901    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1902        #[allow(unused_imports)]
1903        use ::buffa::Enumeration as _;
1904        let mut size = 0u32;
1905        for v in &self.markets {
1906            let __slot = __cache.reserve();
1907            let inner_size = v.compute_size(__cache);
1908            __cache.set(__slot, inner_size);
1909            size
1910                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1911                    + inner_size;
1912        }
1913        if !self.next_page_token.is_empty() {
1914            size
1915                += 1u32
1916                    + ::buffa::types::string_encoded_len(&self.next_page_token) as u32;
1917        }
1918        size += self.__buffa_unknown_fields.encoded_len() as u32;
1919        size
1920    }
1921    fn write_to(
1922        &self,
1923        __cache: &mut ::buffa::SizeCache,
1924        buf: &mut impl ::buffa::bytes::BufMut,
1925    ) {
1926        #[allow(unused_imports)]
1927        use ::buffa::Enumeration as _;
1928        for v in &self.markets {
1929            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
1930            v.write_to(__cache, buf);
1931        }
1932        if !self.next_page_token.is_empty() {
1933            ::buffa::types::put_string_field(2u32, &self.next_page_token, buf);
1934        }
1935        self.__buffa_unknown_fields.write_to(buf);
1936    }
1937    fn merge_field(
1938        &mut self,
1939        tag: ::buffa::encoding::Tag,
1940        buf: &mut impl ::buffa::bytes::Buf,
1941        ctx: ::buffa::DecodeContext<'_>,
1942    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1943        #[allow(unused_imports)]
1944        use ::buffa::bytes::Buf as _;
1945        #[allow(unused_imports)]
1946        use ::buffa::Enumeration as _;
1947        match tag.field_number() {
1948            1u32 => {
1949                ::buffa::encoding::check_wire_type(
1950                    tag,
1951                    ::buffa::encoding::WireType::LengthDelimited,
1952                )?;
1953                let mut elem = ::core::default::Default::default();
1954                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
1955                self.markets.push(elem);
1956            }
1957            2u32 => {
1958                ::buffa::encoding::check_wire_type(
1959                    tag,
1960                    ::buffa::encoding::WireType::LengthDelimited,
1961                )?;
1962                ::buffa::types::merge_string(&mut self.next_page_token, buf)?;
1963            }
1964            _ => {
1965                self.__buffa_unknown_fields
1966                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1967            }
1968        }
1969        ::core::result::Result::Ok(())
1970    }
1971    fn clear(&mut self) {
1972        self.markets.clear();
1973        self.next_page_token.clear();
1974        self.__buffa_unknown_fields.clear();
1975    }
1976}
1977impl ::buffa::ExtensionSet for ListMarketOverviewResponse {
1978    const PROTO_FQN: &'static str = "marketoverview.v1.ListMarketOverviewResponse";
1979    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1980        &self.__buffa_unknown_fields
1981    }
1982    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1983        &mut self.__buffa_unknown_fields
1984    }
1985}
1986impl ::buffa::json_helpers::ProtoElemJson for ListMarketOverviewResponse {
1987    fn serialize_proto_json<S: ::serde::Serializer>(
1988        v: &Self,
1989        s: S,
1990    ) -> ::core::result::Result<S::Ok, S::Error> {
1991        ::serde::Serialize::serialize(v, s)
1992    }
1993    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1994        d: D,
1995    ) -> ::core::result::Result<Self, D::Error> {
1996        <Self as ::serde::Deserialize>::deserialize(d)
1997    }
1998}
1999#[doc(hidden)]
2000pub const __LIST_MARKET_OVERVIEW_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2001    type_url: "type.googleapis.com/marketoverview.v1.ListMarketOverviewResponse",
2002    to_json: ::buffa::type_registry::any_to_json::<ListMarketOverviewResponse>,
2003    from_json: ::buffa::type_registry::any_from_json::<ListMarketOverviewResponse>,
2004    is_wkt: false,
2005};
2006/// MarketOverviewBatch is a websocket payload carrying batched market overview
2007/// updates. It is published to a single all-markets channel at a fixed cadence.
2008#[derive(Clone, PartialEq, Default)]
2009#[derive(::serde::Serialize, ::serde::Deserialize)]
2010#[serde(default)]
2011pub struct MarketOverviewBatch {
2012    /// Market overviews included in this batch.
2013    ///
2014    /// Field 1: `markets`
2015    #[serde(
2016        rename = "markets",
2017        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2018        deserialize_with = "::buffa::json_helpers::null_as_default"
2019    )]
2020    pub markets: ::buffa::alloc::vec::Vec<MarketOverview>,
2021    /// Batch publish timestamp in nanoseconds since epoch.
2022    ///
2023    /// Field 2: `ts_ns`
2024    #[serde(
2025        rename = "tsNs",
2026        alias = "ts_ns",
2027        with = "::buffa::json_helpers::uint64",
2028        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
2029    )]
2030    pub ts_ns: u64,
2031    #[serde(skip)]
2032    #[doc(hidden)]
2033    pub __buffa_unknown_fields: ::buffa::UnknownFields,
2034}
2035impl ::core::fmt::Debug for MarketOverviewBatch {
2036    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2037        f.debug_struct("MarketOverviewBatch")
2038            .field("markets", &self.markets)
2039            .field("ts_ns", &self.ts_ns)
2040            .finish()
2041    }
2042}
2043impl MarketOverviewBatch {
2044    /// Protobuf type URL for this message, for use with `Any::pack` and
2045    /// `Any::unpack_if`.
2046    ///
2047    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2048    pub const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.MarketOverviewBatch";
2049}
2050::buffa::impl_default_instance!(MarketOverviewBatch);
2051impl ::buffa::MessageName for MarketOverviewBatch {
2052    const PACKAGE: &'static str = "marketoverview.v1";
2053    const NAME: &'static str = "MarketOverviewBatch";
2054    const FULL_NAME: &'static str = "marketoverview.v1.MarketOverviewBatch";
2055    const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.MarketOverviewBatch";
2056}
2057impl ::buffa::Message for MarketOverviewBatch {
2058    /// Returns the total encoded size in bytes.
2059    ///
2060    /// The result is a `u32`; the protobuf specification requires all
2061    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2062    /// compliant message will never overflow this type.
2063    #[allow(clippy::let_and_return)]
2064    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2065        #[allow(unused_imports)]
2066        use ::buffa::Enumeration as _;
2067        let mut size = 0u32;
2068        for v in &self.markets {
2069            let __slot = __cache.reserve();
2070            let inner_size = v.compute_size(__cache);
2071            __cache.set(__slot, inner_size);
2072            size
2073                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2074                    + inner_size;
2075        }
2076        if self.ts_ns != 0u64 {
2077            size += 1u32 + ::buffa::types::uint64_encoded_len(self.ts_ns) as u32;
2078        }
2079        size += self.__buffa_unknown_fields.encoded_len() as u32;
2080        size
2081    }
2082    fn write_to(
2083        &self,
2084        __cache: &mut ::buffa::SizeCache,
2085        buf: &mut impl ::buffa::bytes::BufMut,
2086    ) {
2087        #[allow(unused_imports)]
2088        use ::buffa::Enumeration as _;
2089        for v in &self.markets {
2090            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
2091            v.write_to(__cache, buf);
2092        }
2093        if self.ts_ns != 0u64 {
2094            ::buffa::types::put_uint64_field(2u32, self.ts_ns, buf);
2095        }
2096        self.__buffa_unknown_fields.write_to(buf);
2097    }
2098    fn merge_field(
2099        &mut self,
2100        tag: ::buffa::encoding::Tag,
2101        buf: &mut impl ::buffa::bytes::Buf,
2102        ctx: ::buffa::DecodeContext<'_>,
2103    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2104        #[allow(unused_imports)]
2105        use ::buffa::bytes::Buf as _;
2106        #[allow(unused_imports)]
2107        use ::buffa::Enumeration as _;
2108        match tag.field_number() {
2109            1u32 => {
2110                ::buffa::encoding::check_wire_type(
2111                    tag,
2112                    ::buffa::encoding::WireType::LengthDelimited,
2113                )?;
2114                let mut elem = ::core::default::Default::default();
2115                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2116                self.markets.push(elem);
2117            }
2118            2u32 => {
2119                ::buffa::encoding::check_wire_type(
2120                    tag,
2121                    ::buffa::encoding::WireType::Varint,
2122                )?;
2123                self.ts_ns = ::buffa::types::decode_uint64(buf)?;
2124            }
2125            _ => {
2126                self.__buffa_unknown_fields
2127                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2128            }
2129        }
2130        ::core::result::Result::Ok(())
2131    }
2132    fn clear(&mut self) {
2133        self.markets.clear();
2134        self.ts_ns = 0u64;
2135        self.__buffa_unknown_fields.clear();
2136    }
2137}
2138impl ::buffa::ExtensionSet for MarketOverviewBatch {
2139    const PROTO_FQN: &'static str = "marketoverview.v1.MarketOverviewBatch";
2140    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2141        &self.__buffa_unknown_fields
2142    }
2143    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2144        &mut self.__buffa_unknown_fields
2145    }
2146}
2147impl ::buffa::json_helpers::ProtoElemJson for MarketOverviewBatch {
2148    fn serialize_proto_json<S: ::serde::Serializer>(
2149        v: &Self,
2150        s: S,
2151    ) -> ::core::result::Result<S::Ok, S::Error> {
2152        ::serde::Serialize::serialize(v, s)
2153    }
2154    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2155        d: D,
2156    ) -> ::core::result::Result<Self, D::Error> {
2157        <Self as ::serde::Deserialize>::deserialize(d)
2158    }
2159}
2160#[doc(hidden)]
2161pub const __MARKET_OVERVIEW_BATCH_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2162    type_url: "type.googleapis.com/marketoverview.v1.MarketOverviewBatch",
2163    to_json: ::buffa::type_registry::any_to_json::<MarketOverviewBatch>,
2164    from_json: ::buffa::type_registry::any_from_json::<MarketOverviewBatch>,
2165    is_wkt: false,
2166};
2167#[allow(
2168    non_camel_case_types,
2169    dead_code,
2170    unused_imports,
2171    unused_qualifications,
2172    clippy::derivable_impls,
2173    clippy::match_single_binding,
2174    clippy::uninlined_format_args,
2175    clippy::doc_lazy_continuation,
2176    clippy::module_inception
2177)]
2178pub mod __buffa {
2179    #[allow(unused_imports)]
2180    use super::*;
2181    pub mod view {
2182        #[allow(unused_imports)]
2183        use super::*;
2184        /// ErrorDetail carries a typed domain error code for machine-readable handling.
2185        #[derive(Clone, Debug, Default)]
2186        pub struct ErrorDetailView<'a> {
2187            /// Stable error code for programmatic matching.
2188            ///
2189            /// Field 1: `code`
2190            pub code: ::buffa::EnumValue<super::super::ErrorCode>,
2191            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2192        }
2193        impl<'a> ::buffa::MessageView<'a> for ErrorDetailView<'a> {
2194            type Owned = super::super::ErrorDetail;
2195            fn decode_view(
2196                buf: &'a [u8],
2197            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2198                let __limit = ::core::cell::Cell::new(
2199                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
2200                );
2201                <Self as ::buffa::MessageView>::decode_view_ctx(
2202                    buf,
2203                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
2204                )
2205            }
2206            fn decode_view_with_ctx(
2207                buf: &'a [u8],
2208                ctx: ::buffa::DecodeContext<'_>,
2209            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2210                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
2211            }
2212            fn merge_view_field(
2213                &mut self,
2214                tag: ::buffa::encoding::Tag,
2215                cur: &'a [u8],
2216                before_tag: &'a [u8],
2217                ctx: ::buffa::DecodeContext<'_>,
2218            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
2219                let _ = ctx;
2220                #[allow(unused_variables)]
2221                let view = self;
2222                let mut cur = cur;
2223                match tag.field_number() {
2224                    1u32 => {
2225                        ::buffa::encoding::check_wire_type(
2226                            tag,
2227                            ::buffa::encoding::WireType::Varint,
2228                        )?;
2229                        view.code = ::buffa::EnumValue::from(
2230                            ::buffa::types::decode_int32(&mut cur)?,
2231                        );
2232                    }
2233                    _ => {
2234                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
2235                        let span_len = before_tag.len() - cur.len();
2236                        view.__buffa_unknown_fields
2237                            .push_record(before_tag, span_len, ctx)?;
2238                    }
2239                }
2240                ::core::result::Result::Ok(cur)
2241            }
2242            fn to_owned_message(
2243                &self,
2244            ) -> ::core::result::Result<
2245                super::super::ErrorDetail,
2246                ::buffa::DecodeError,
2247            > {
2248                self.to_owned_from_source(None)
2249            }
2250            #[allow(clippy::useless_conversion, clippy::needless_update)]
2251            fn to_owned_from_source(
2252                &self,
2253                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
2254            ) -> ::core::result::Result<
2255                super::super::ErrorDetail,
2256                ::buffa::DecodeError,
2257            > {
2258                #[allow(unused_imports)]
2259                use ::buffa::alloc::string::ToString as _;
2260                let _ = __buffa_src;
2261                ::core::result::Result::Ok(super::super::ErrorDetail {
2262                    code: self.code,
2263                    __buffa_unknown_fields: self
2264                        .__buffa_unknown_fields
2265                        .to_owned()?
2266                        .into(),
2267                    ..::core::default::Default::default()
2268                })
2269            }
2270        }
2271        impl<'a> ::buffa::ViewEncode<'a> for ErrorDetailView<'a> {
2272            #[allow(clippy::needless_borrow, clippy::let_and_return)]
2273            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2274                #[allow(unused_imports)]
2275                use ::buffa::Enumeration as _;
2276                let mut size = 0u32;
2277                {
2278                    let val = self.code.to_i32();
2279                    if val != 0 {
2280                        size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
2281                    }
2282                }
2283                size += self.__buffa_unknown_fields.encoded_len() as u32;
2284                size
2285            }
2286            #[allow(clippy::needless_borrow)]
2287            fn write_to(
2288                &self,
2289                _cache: &mut ::buffa::SizeCache,
2290                buf: &mut impl ::buffa::bytes::BufMut,
2291            ) {
2292                #[allow(unused_imports)]
2293                use ::buffa::Enumeration as _;
2294                {
2295                    let val = self.code.to_i32();
2296                    if val != 0 {
2297                        ::buffa::types::put_int32_field(1u32, val, buf);
2298                    }
2299                }
2300                self.__buffa_unknown_fields.write_to(buf);
2301            }
2302        }
2303        /// Serializes this view as protobuf JSON.
2304        ///
2305        /// Implicit-presence fields with default values are omitted, `required`
2306        /// fields are always emitted, explicit-presence (`optional`) fields are
2307        /// emitted only when set, bytes fields are base64-encoded, and enum
2308        /// values are their proto name strings.
2309        ///
2310        /// This impl uses `serialize_map(None)` because the number of emitted
2311        /// fields depends on default-omission rules; serializers that require
2312        /// known map lengths (e.g. `bincode`) will return a runtime error.
2313        /// Use the owned message type for those formats.
2314        impl<'__a> ::serde::Serialize for ErrorDetailView<'__a> {
2315            fn serialize<__S: ::serde::Serializer>(
2316                &self,
2317                __s: __S,
2318            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2319                use ::serde::ser::SerializeMap as _;
2320                let mut __map = __s.serialize_map(::core::option::Option::None)?;
2321                if !::buffa::json_helpers::skip_if::is_default_enum_value(&self.code) {
2322                    __map.serialize_entry("code", &self.code)?;
2323                }
2324                __map.end()
2325            }
2326        }
2327        impl<'a> ::buffa::MessageName for ErrorDetailView<'a> {
2328            const PACKAGE: &'static str = "marketoverview.v1";
2329            const NAME: &'static str = "ErrorDetail";
2330            const FULL_NAME: &'static str = "marketoverview.v1.ErrorDetail";
2331            const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.ErrorDetail";
2332        }
2333        ::buffa::impl_default_view_instance!(ErrorDetailView);
2334        ::buffa::impl_view_reborrow!(ErrorDetailView);
2335        /** Self-contained, `'static` owned view of a `ErrorDetail` message.
2336
2337 Wraps [`::buffa::OwnedView`]`<`[`ErrorDetailView`]`<'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.
2338
2339 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ErrorDetailView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
2340        #[derive(Clone, Debug)]
2341        pub struct ErrorDetailOwnedView(::buffa::OwnedView<ErrorDetailView<'static>>);
2342        impl ErrorDetailOwnedView {
2343            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
2344            ///
2345            /// The view borrows directly from the buffer's data; the buffer is
2346            /// retained inside the returned handle.
2347            ///
2348            /// # Errors
2349            ///
2350            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
2351            /// protobuf data.
2352            pub fn decode(
2353                bytes: ::buffa::bytes::Bytes,
2354            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2355                ::core::result::Result::Ok(
2356                    ErrorDetailOwnedView(::buffa::OwnedView::decode(bytes)?),
2357                )
2358            }
2359            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
2360            /// max message size).
2361            ///
2362            /// # Errors
2363            ///
2364            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
2365            /// exceeds the configured limits.
2366            pub fn decode_with_options(
2367                bytes: ::buffa::bytes::Bytes,
2368                opts: &::buffa::DecodeOptions,
2369            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2370                ::core::result::Result::Ok(
2371                    ErrorDetailOwnedView(
2372                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
2373                    ),
2374                )
2375            }
2376            /// Build from an owned message via an encode → decode round-trip.
2377            ///
2378            /// # Errors
2379            ///
2380            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
2381            /// somehow invalid (should not happen for well-formed messages).
2382            pub fn from_owned(
2383                msg: &super::super::ErrorDetail,
2384            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2385                ::core::result::Result::Ok(
2386                    ErrorDetailOwnedView(::buffa::OwnedView::from_owned(msg)?),
2387                )
2388            }
2389            /// Borrow the full [`ErrorDetailView`] with its lifetime tied to `&self`.
2390            #[must_use]
2391            pub fn view(&self) -> &ErrorDetailView<'_> {
2392                self.0.reborrow()
2393            }
2394            /// Convert to the owned message type.
2395            ///
2396            /// # Errors
2397            ///
2398            /// Returns an error if re-materializing preserved unknown fields
2399            /// fails (e.g. the unknown-field limit is exceeded).
2400            pub fn to_owned_message(
2401                &self,
2402            ) -> ::core::result::Result<
2403                super::super::ErrorDetail,
2404                ::buffa::DecodeError,
2405            > {
2406                self.0.to_owned_message()
2407            }
2408            /// The underlying bytes buffer.
2409            #[must_use]
2410            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
2411                self.0.bytes()
2412            }
2413            /// Consume the handle, returning the underlying bytes buffer.
2414            #[must_use]
2415            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
2416                self.0.into_bytes()
2417            }
2418            /// Stable error code for programmatic matching.
2419            ///
2420            /// Field 1: `code`
2421            #[must_use]
2422            pub fn code(&self) -> ::buffa::EnumValue<super::super::ErrorCode> {
2423                self.0.reborrow().code
2424            }
2425        }
2426        impl ::core::convert::From<::buffa::OwnedView<ErrorDetailView<'static>>>
2427        for ErrorDetailOwnedView {
2428            fn from(inner: ::buffa::OwnedView<ErrorDetailView<'static>>) -> Self {
2429                ErrorDetailOwnedView(inner)
2430            }
2431        }
2432        impl ::core::convert::From<ErrorDetailOwnedView>
2433        for ::buffa::OwnedView<ErrorDetailView<'static>> {
2434            fn from(wrapper: ErrorDetailOwnedView) -> Self {
2435                wrapper.0
2436            }
2437        }
2438        impl ::core::convert::AsRef<::buffa::OwnedView<ErrorDetailView<'static>>>
2439        for ErrorDetailOwnedView {
2440            fn as_ref(&self) -> &::buffa::OwnedView<ErrorDetailView<'static>> {
2441                &self.0
2442            }
2443        }
2444        impl ::buffa::HasMessageView for super::super::ErrorDetail {
2445            type View<'a> = ErrorDetailView<'a>;
2446            type ViewHandle = ErrorDetailOwnedView;
2447        }
2448        impl ::serde::Serialize for ErrorDetailOwnedView {
2449            fn serialize<__S: ::serde::Serializer>(
2450                &self,
2451                __s: __S,
2452            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2453                ::serde::Serialize::serialize(&self.0, __s)
2454            }
2455        }
2456        /// Sparkline contains newest-first close prices for one time range.
2457        #[derive(Clone, Debug, Default)]
2458        pub struct SparklineView<'a> {
2459            /// Time range and sampling resolution represented by these close prices.
2460            ///
2461            /// Field 1: `interval`
2462            pub interval: ::buffa::EnumValue<super::super::SparklineInterval>,
2463            /// Newest-first close prices in quote units scaled by 1e6.
2464            ///
2465            /// Field 2: `close_ticks`
2466            pub close_ticks: ::buffa::RepeatedView<'a, i64>,
2467            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2468        }
2469        impl<'a> ::buffa::MessageView<'a> for SparklineView<'a> {
2470            type Owned = super::super::Sparkline;
2471            fn decode_view(
2472                buf: &'a [u8],
2473            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2474                let __limit = ::core::cell::Cell::new(
2475                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
2476                );
2477                <Self as ::buffa::MessageView>::decode_view_ctx(
2478                    buf,
2479                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
2480                )
2481            }
2482            fn decode_view_with_ctx(
2483                buf: &'a [u8],
2484                ctx: ::buffa::DecodeContext<'_>,
2485            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2486                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
2487            }
2488            fn merge_view_field(
2489                &mut self,
2490                tag: ::buffa::encoding::Tag,
2491                cur: &'a [u8],
2492                before_tag: &'a [u8],
2493                ctx: ::buffa::DecodeContext<'_>,
2494            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
2495                let _ = ctx;
2496                #[allow(unused_variables)]
2497                let view = self;
2498                let mut cur = cur;
2499                match tag.field_number() {
2500                    1u32 => {
2501                        ::buffa::encoding::check_wire_type(
2502                            tag,
2503                            ::buffa::encoding::WireType::Varint,
2504                        )?;
2505                        view.interval = ::buffa::EnumValue::from(
2506                            ::buffa::types::decode_int32(&mut cur)?,
2507                        );
2508                    }
2509                    2u32 => {
2510                        if tag.wire_type()
2511                            == ::buffa::encoding::WireType::LengthDelimited
2512                        {
2513                            let payload = ::buffa::types::borrow_bytes(&mut cur)?;
2514                            view.close_ticks
2515                                .reserve(::buffa::encoding::count_varints(payload));
2516                            let mut pcur: &[u8] = payload;
2517                            while !pcur.is_empty() {
2518                                view.close_ticks
2519                                    .push(::buffa::types::decode_int64(&mut pcur)?);
2520                            }
2521                        } else if tag.wire_type() == ::buffa::encoding::WireType::Varint
2522                        {
2523                            view.close_ticks
2524                                .push(::buffa::types::decode_int64(&mut cur)?);
2525                        } else {
2526                            return Err(
2527                                ::buffa::encoding::wire_type_mismatch(
2528                                    tag,
2529                                    ::buffa::encoding::WireType::LengthDelimited,
2530                                ),
2531                            );
2532                        }
2533                    }
2534                    _ => {
2535                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
2536                        let span_len = before_tag.len() - cur.len();
2537                        view.__buffa_unknown_fields
2538                            .push_record(before_tag, span_len, ctx)?;
2539                    }
2540                }
2541                ::core::result::Result::Ok(cur)
2542            }
2543            fn to_owned_message(
2544                &self,
2545            ) -> ::core::result::Result<super::super::Sparkline, ::buffa::DecodeError> {
2546                self.to_owned_from_source(None)
2547            }
2548            #[allow(clippy::useless_conversion, clippy::needless_update)]
2549            fn to_owned_from_source(
2550                &self,
2551                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
2552            ) -> ::core::result::Result<super::super::Sparkline, ::buffa::DecodeError> {
2553                #[allow(unused_imports)]
2554                use ::buffa::alloc::string::ToString as _;
2555                let _ = __buffa_src;
2556                ::core::result::Result::Ok(super::super::Sparkline {
2557                    interval: self.interval,
2558                    close_ticks: self.close_ticks.to_vec(),
2559                    __buffa_unknown_fields: self
2560                        .__buffa_unknown_fields
2561                        .to_owned()?
2562                        .into(),
2563                    ..::core::default::Default::default()
2564                })
2565            }
2566        }
2567        impl<'a> ::buffa::ViewEncode<'a> for SparklineView<'a> {
2568            #[allow(clippy::needless_borrow, clippy::let_and_return)]
2569            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2570                #[allow(unused_imports)]
2571                use ::buffa::Enumeration as _;
2572                let mut size = 0u32;
2573                {
2574                    let val = self.interval.to_i32();
2575                    if val != 0 {
2576                        size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
2577                    }
2578                }
2579                if !self.close_ticks.is_empty() {
2580                    let payload: u32 = self
2581                        .close_ticks
2582                        .iter()
2583                        .map(|&v| ::buffa::types::int64_encoded_len(v) as u32)
2584                        .sum::<u32>();
2585                    size
2586                        += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
2587                            + payload;
2588                }
2589                size += self.__buffa_unknown_fields.encoded_len() as u32;
2590                size
2591            }
2592            #[allow(clippy::needless_borrow)]
2593            fn write_to(
2594                &self,
2595                _cache: &mut ::buffa::SizeCache,
2596                buf: &mut impl ::buffa::bytes::BufMut,
2597            ) {
2598                #[allow(unused_imports)]
2599                use ::buffa::Enumeration as _;
2600                {
2601                    let val = self.interval.to_i32();
2602                    if val != 0 {
2603                        ::buffa::types::put_int32_field(1u32, val, buf);
2604                    }
2605                }
2606                if !self.close_ticks.is_empty() {
2607                    let payload: u32 = self
2608                        .close_ticks
2609                        .iter()
2610                        .map(|&v| ::buffa::types::int64_encoded_len(v) as u32)
2611                        .sum::<u32>();
2612                    ::buffa::types::put_len_delimited_header(2u32, payload, buf);
2613                    for &v in &self.close_ticks {
2614                        ::buffa::types::encode_int64(v, buf);
2615                    }
2616                }
2617                self.__buffa_unknown_fields.write_to(buf);
2618            }
2619        }
2620        /// Serializes this view as protobuf JSON.
2621        ///
2622        /// Implicit-presence fields with default values are omitted, `required`
2623        /// fields are always emitted, explicit-presence (`optional`) fields are
2624        /// emitted only when set, bytes fields are base64-encoded, and enum
2625        /// values are their proto name strings.
2626        ///
2627        /// This impl uses `serialize_map(None)` because the number of emitted
2628        /// fields depends on default-omission rules; serializers that require
2629        /// known map lengths (e.g. `bincode`) will return a runtime error.
2630        /// Use the owned message type for those formats.
2631        impl<'__a> ::serde::Serialize for SparklineView<'__a> {
2632            fn serialize<__S: ::serde::Serializer>(
2633                &self,
2634                __s: __S,
2635            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2636                use ::serde::ser::SerializeMap as _;
2637                let mut __map = __s.serialize_map(::core::option::Option::None)?;
2638                if !::buffa::json_helpers::skip_if::is_default_enum_value(
2639                    &self.interval,
2640                ) {
2641                    __map.serialize_entry("interval", &self.interval)?;
2642                }
2643                if !self.close_ticks.is_empty() {
2644                    __map
2645                        .serialize_entry(
2646                            "closeTicks",
2647                            &::buffa::json_helpers::RepeatedJson(&self.close_ticks),
2648                        )?;
2649                }
2650                __map.end()
2651            }
2652        }
2653        impl<'a> ::buffa::MessageName for SparklineView<'a> {
2654            const PACKAGE: &'static str = "marketoverview.v1";
2655            const NAME: &'static str = "Sparkline";
2656            const FULL_NAME: &'static str = "marketoverview.v1.Sparkline";
2657            const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.Sparkline";
2658        }
2659        ::buffa::impl_default_view_instance!(SparklineView);
2660        ::buffa::impl_view_reborrow!(SparklineView);
2661        /** Self-contained, `'static` owned view of a `Sparkline` message.
2662
2663 Wraps [`::buffa::OwnedView`]`<`[`SparklineView`]`<'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.
2664
2665 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`SparklineView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
2666        #[derive(Clone, Debug)]
2667        pub struct SparklineOwnedView(::buffa::OwnedView<SparklineView<'static>>);
2668        impl SparklineOwnedView {
2669            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
2670            ///
2671            /// The view borrows directly from the buffer's data; the buffer is
2672            /// retained inside the returned handle.
2673            ///
2674            /// # Errors
2675            ///
2676            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
2677            /// protobuf data.
2678            pub fn decode(
2679                bytes: ::buffa::bytes::Bytes,
2680            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2681                ::core::result::Result::Ok(
2682                    SparklineOwnedView(::buffa::OwnedView::decode(bytes)?),
2683                )
2684            }
2685            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
2686            /// max message size).
2687            ///
2688            /// # Errors
2689            ///
2690            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
2691            /// exceeds the configured limits.
2692            pub fn decode_with_options(
2693                bytes: ::buffa::bytes::Bytes,
2694                opts: &::buffa::DecodeOptions,
2695            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2696                ::core::result::Result::Ok(
2697                    SparklineOwnedView(
2698                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
2699                    ),
2700                )
2701            }
2702            /// Build from an owned message via an encode → decode round-trip.
2703            ///
2704            /// # Errors
2705            ///
2706            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
2707            /// somehow invalid (should not happen for well-formed messages).
2708            pub fn from_owned(
2709                msg: &super::super::Sparkline,
2710            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2711                ::core::result::Result::Ok(
2712                    SparklineOwnedView(::buffa::OwnedView::from_owned(msg)?),
2713                )
2714            }
2715            /// Borrow the full [`SparklineView`] with its lifetime tied to `&self`.
2716            #[must_use]
2717            pub fn view(&self) -> &SparklineView<'_> {
2718                self.0.reborrow()
2719            }
2720            /// Convert to the owned message type.
2721            ///
2722            /// # Errors
2723            ///
2724            /// Returns an error if re-materializing preserved unknown fields
2725            /// fails (e.g. the unknown-field limit is exceeded).
2726            pub fn to_owned_message(
2727                &self,
2728            ) -> ::core::result::Result<super::super::Sparkline, ::buffa::DecodeError> {
2729                self.0.to_owned_message()
2730            }
2731            /// The underlying bytes buffer.
2732            #[must_use]
2733            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
2734                self.0.bytes()
2735            }
2736            /// Consume the handle, returning the underlying bytes buffer.
2737            #[must_use]
2738            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
2739                self.0.into_bytes()
2740            }
2741            /// Time range and sampling resolution represented by these close prices.
2742            ///
2743            /// Field 1: `interval`
2744            #[must_use]
2745            pub fn interval(
2746                &self,
2747            ) -> ::buffa::EnumValue<super::super::SparklineInterval> {
2748                self.0.reborrow().interval
2749            }
2750            /// Newest-first close prices in quote units scaled by 1e6.
2751            ///
2752            /// Field 2: `close_ticks`
2753            #[must_use]
2754            pub fn close_ticks(&self) -> &::buffa::RepeatedView<'_, i64> {
2755                &self.0.reborrow().close_ticks
2756            }
2757        }
2758        impl ::core::convert::From<::buffa::OwnedView<SparklineView<'static>>>
2759        for SparklineOwnedView {
2760            fn from(inner: ::buffa::OwnedView<SparklineView<'static>>) -> Self {
2761                SparklineOwnedView(inner)
2762            }
2763        }
2764        impl ::core::convert::From<SparklineOwnedView>
2765        for ::buffa::OwnedView<SparklineView<'static>> {
2766            fn from(wrapper: SparklineOwnedView) -> Self {
2767                wrapper.0
2768            }
2769        }
2770        impl ::core::convert::AsRef<::buffa::OwnedView<SparklineView<'static>>>
2771        for SparklineOwnedView {
2772            fn as_ref(&self) -> &::buffa::OwnedView<SparklineView<'static>> {
2773                &self.0
2774            }
2775        }
2776        impl ::buffa::HasMessageView for super::super::Sparkline {
2777            type View<'a> = SparklineView<'a>;
2778            type ViewHandle = SparklineOwnedView;
2779        }
2780        impl ::serde::Serialize for SparklineOwnedView {
2781            fn serialize<__S: ::serde::Serializer>(
2782                &self,
2783                __s: __S,
2784            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2785                ::serde::Serialize::serialize(&self.0, __s)
2786            }
2787        }
2788        #[derive(Clone, Debug, Default)]
2789        pub struct MarketOverviewView<'a> {
2790            /// Numeric spot market identifier.
2791            ///
2792            /// Field 1: `symbol_id`
2793            pub symbol_id: u32,
2794            /// Canonical pair symbol, e.g. "BTC-USDT".
2795            ///
2796            /// Field 2: `symbol`
2797            pub symbol: &'a str,
2798            /// Last traded price in quote units scaled by 1e6.
2799            ///
2800            /// Field 3: `last_price_ticks`
2801            pub last_price_ticks: i64,
2802            /// Last trade timestamp in nanoseconds since epoch.
2803            ///
2804            /// Field 4: `last_trade_ts_ns`
2805            pub last_trade_ts_ns: u64,
2806            /// Rolling 24h change expressed in basis points (bp). Example: +123 = +1.23%.
2807            ///
2808            /// Field 5: `change_24h_bps`
2809            pub change_24h_bps: i32,
2810            /// Rolling 24h stats.
2811            /// Highest traded price in the 24h window, in quote units scaled by 1e6.
2812            ///
2813            /// Field 6: `high_24h_ticks`
2814            pub high_24h_ticks: i64,
2815            /// Lowest traded price in the 24h window, in quote units scaled by 1e6.
2816            ///
2817            /// Field 7: `low_24h_ticks`
2818            pub low_24h_ticks: i64,
2819            /// Rolling 24h base volume scaled by the pair's base_quantity_scale from
2820            /// GetSpotConfig.
2821            ///
2822            /// Field 8: `volume_24h_base_scaled`
2823            pub volume_24h_base_scaled: i64,
2824            /// Rolling 24h quote volume scaled by the pair's quote_quantity_scale from
2825            /// GetSpotConfig.
2826            ///
2827            /// Field 14: `volume_24h_quote_scaled`
2828            pub volume_24h_quote_scaled: i64,
2829            /// Listing timestamp in nanoseconds since epoch.
2830            ///
2831            /// Field 15: `listed_ts_ns`
2832            pub listed_ts_ns: u64,
2833            /// Current best bid price in quote units scaled by 1e6.
2834            ///
2835            /// Field 9: `best_bid_ticks`
2836            pub best_bid_ticks: i64,
2837            /// Best bid quantity scaled by the pair's base_quantity_scale from
2838            /// GetSpotConfig.
2839            ///
2840            /// Field 10: `best_bid_qty_scaled`
2841            pub best_bid_qty_scaled: i64,
2842            /// Current best ask price in quote units scaled by 1e6.
2843            ///
2844            /// Field 11: `best_ask_ticks`
2845            pub best_ask_ticks: i64,
2846            /// Best ask quantity scaled by the pair's base_quantity_scale from
2847            /// GetSpotConfig.
2848            ///
2849            /// Field 12: `best_ask_qty_scaled`
2850            pub best_ask_qty_scaled: i64,
2851            /// Optional sparklines (requested explicitly).
2852            ///
2853            /// Field 13: `sparklines`
2854            pub sparklines: ::buffa::RepeatedView<
2855                'a,
2856                super::super::__buffa::view::SparklineView<'a>,
2857            >,
2858            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2859        }
2860        impl<'a> ::buffa::MessageView<'a> for MarketOverviewView<'a> {
2861            type Owned = super::super::MarketOverview;
2862            fn decode_view(
2863                buf: &'a [u8],
2864            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2865                let __limit = ::core::cell::Cell::new(
2866                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
2867                );
2868                <Self as ::buffa::MessageView>::decode_view_ctx(
2869                    buf,
2870                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
2871                )
2872            }
2873            fn decode_view_with_ctx(
2874                buf: &'a [u8],
2875                ctx: ::buffa::DecodeContext<'_>,
2876            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2877                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
2878            }
2879            fn merge_view_field(
2880                &mut self,
2881                tag: ::buffa::encoding::Tag,
2882                cur: &'a [u8],
2883                before_tag: &'a [u8],
2884                ctx: ::buffa::DecodeContext<'_>,
2885            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
2886                let _ = ctx;
2887                #[allow(unused_variables)]
2888                let view = self;
2889                let mut cur = cur;
2890                match tag.field_number() {
2891                    1u32 => {
2892                        ::buffa::encoding::check_wire_type(
2893                            tag,
2894                            ::buffa::encoding::WireType::Varint,
2895                        )?;
2896                        view.symbol_id = ::buffa::types::decode_uint32(&mut cur)?;
2897                    }
2898                    2u32 => {
2899                        ::buffa::encoding::check_wire_type(
2900                            tag,
2901                            ::buffa::encoding::WireType::LengthDelimited,
2902                        )?;
2903                        view.symbol = ::buffa::types::borrow_str(&mut cur)?;
2904                    }
2905                    3u32 => {
2906                        ::buffa::encoding::check_wire_type(
2907                            tag,
2908                            ::buffa::encoding::WireType::Varint,
2909                        )?;
2910                        view.last_price_ticks = ::buffa::types::decode_int64(&mut cur)?;
2911                    }
2912                    4u32 => {
2913                        ::buffa::encoding::check_wire_type(
2914                            tag,
2915                            ::buffa::encoding::WireType::Varint,
2916                        )?;
2917                        view.last_trade_ts_ns = ::buffa::types::decode_uint64(&mut cur)?;
2918                    }
2919                    5u32 => {
2920                        ::buffa::encoding::check_wire_type(
2921                            tag,
2922                            ::buffa::encoding::WireType::Varint,
2923                        )?;
2924                        view.change_24h_bps = ::buffa::types::decode_int32(&mut cur)?;
2925                    }
2926                    6u32 => {
2927                        ::buffa::encoding::check_wire_type(
2928                            tag,
2929                            ::buffa::encoding::WireType::Varint,
2930                        )?;
2931                        view.high_24h_ticks = ::buffa::types::decode_int64(&mut cur)?;
2932                    }
2933                    7u32 => {
2934                        ::buffa::encoding::check_wire_type(
2935                            tag,
2936                            ::buffa::encoding::WireType::Varint,
2937                        )?;
2938                        view.low_24h_ticks = ::buffa::types::decode_int64(&mut cur)?;
2939                    }
2940                    8u32 => {
2941                        ::buffa::encoding::check_wire_type(
2942                            tag,
2943                            ::buffa::encoding::WireType::Varint,
2944                        )?;
2945                        view.volume_24h_base_scaled = ::buffa::types::decode_int64(
2946                            &mut cur,
2947                        )?;
2948                    }
2949                    14u32 => {
2950                        ::buffa::encoding::check_wire_type(
2951                            tag,
2952                            ::buffa::encoding::WireType::Varint,
2953                        )?;
2954                        view.volume_24h_quote_scaled = ::buffa::types::decode_int64(
2955                            &mut cur,
2956                        )?;
2957                    }
2958                    15u32 => {
2959                        ::buffa::encoding::check_wire_type(
2960                            tag,
2961                            ::buffa::encoding::WireType::Varint,
2962                        )?;
2963                        view.listed_ts_ns = ::buffa::types::decode_uint64(&mut cur)?;
2964                    }
2965                    9u32 => {
2966                        ::buffa::encoding::check_wire_type(
2967                            tag,
2968                            ::buffa::encoding::WireType::Varint,
2969                        )?;
2970                        view.best_bid_ticks = ::buffa::types::decode_int64(&mut cur)?;
2971                    }
2972                    10u32 => {
2973                        ::buffa::encoding::check_wire_type(
2974                            tag,
2975                            ::buffa::encoding::WireType::Varint,
2976                        )?;
2977                        view.best_bid_qty_scaled = ::buffa::types::decode_int64(
2978                            &mut cur,
2979                        )?;
2980                    }
2981                    11u32 => {
2982                        ::buffa::encoding::check_wire_type(
2983                            tag,
2984                            ::buffa::encoding::WireType::Varint,
2985                        )?;
2986                        view.best_ask_ticks = ::buffa::types::decode_int64(&mut cur)?;
2987                    }
2988                    12u32 => {
2989                        ::buffa::encoding::check_wire_type(
2990                            tag,
2991                            ::buffa::encoding::WireType::Varint,
2992                        )?;
2993                        view.best_ask_qty_scaled = ::buffa::types::decode_int64(
2994                            &mut cur,
2995                        )?;
2996                    }
2997                    13u32 => {
2998                        ::buffa::encoding::check_wire_type(
2999                            tag,
3000                            ::buffa::encoding::WireType::LengthDelimited,
3001                        )?;
3002                        let __sub_ctx = ctx.descend()?;
3003                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
3004                        view.sparklines
3005                            .push(
3006                                <super::super::__buffa::view::SparklineView as ::buffa::MessageView>::decode_view_ctx(
3007                                    sub,
3008                                    __sub_ctx,
3009                                )?,
3010                            );
3011                    }
3012                    _ => {
3013                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
3014                        let span_len = before_tag.len() - cur.len();
3015                        view.__buffa_unknown_fields
3016                            .push_record(before_tag, span_len, ctx)?;
3017                    }
3018                }
3019                ::core::result::Result::Ok(cur)
3020            }
3021            fn to_owned_message(
3022                &self,
3023            ) -> ::core::result::Result<
3024                super::super::MarketOverview,
3025                ::buffa::DecodeError,
3026            > {
3027                self.to_owned_from_source(None)
3028            }
3029            #[allow(clippy::useless_conversion, clippy::needless_update)]
3030            fn to_owned_from_source(
3031                &self,
3032                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3033            ) -> ::core::result::Result<
3034                super::super::MarketOverview,
3035                ::buffa::DecodeError,
3036            > {
3037                #[allow(unused_imports)]
3038                use ::buffa::alloc::string::ToString as _;
3039                let _ = __buffa_src;
3040                ::core::result::Result::Ok(super::super::MarketOverview {
3041                    symbol_id: self.symbol_id,
3042                    symbol: self.symbol.to_string(),
3043                    last_price_ticks: self.last_price_ticks,
3044                    last_trade_ts_ns: self.last_trade_ts_ns,
3045                    change_24h_bps: self.change_24h_bps,
3046                    high_24h_ticks: self.high_24h_ticks,
3047                    low_24h_ticks: self.low_24h_ticks,
3048                    volume_24h_base_scaled: self.volume_24h_base_scaled,
3049                    volume_24h_quote_scaled: self.volume_24h_quote_scaled,
3050                    listed_ts_ns: self.listed_ts_ns,
3051                    best_bid_ticks: self.best_bid_ticks,
3052                    best_bid_qty_scaled: self.best_bid_qty_scaled,
3053                    best_ask_ticks: self.best_ask_ticks,
3054                    best_ask_qty_scaled: self.best_ask_qty_scaled,
3055                    sparklines: self
3056                        .sparklines
3057                        .iter()
3058                        .map(|v| v.to_owned_from_source(__buffa_src))
3059                        .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
3060                    __buffa_unknown_fields: self
3061                        .__buffa_unknown_fields
3062                        .to_owned()?
3063                        .into(),
3064                    ..::core::default::Default::default()
3065                })
3066            }
3067        }
3068        impl<'a> ::buffa::ViewEncode<'a> for MarketOverviewView<'a> {
3069            #[allow(clippy::needless_borrow, clippy::let_and_return)]
3070            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
3071                #[allow(unused_imports)]
3072                use ::buffa::Enumeration as _;
3073                let mut size = 0u32;
3074                if self.symbol_id != 0u32 {
3075                    size
3076                        += 1u32
3077                            + ::buffa::types::uint32_encoded_len(self.symbol_id) as u32;
3078                }
3079                if !self.symbol.is_empty() {
3080                    size
3081                        += 1u32
3082                            + ::buffa::types::string_encoded_len(&self.symbol) as u32;
3083                }
3084                if self.last_price_ticks != 0i64 {
3085                    size
3086                        += 1u32
3087                            + ::buffa::types::int64_encoded_len(self.last_price_ticks)
3088                                as u32;
3089                }
3090                if self.last_trade_ts_ns != 0u64 {
3091                    size
3092                        += 1u32
3093                            + ::buffa::types::uint64_encoded_len(self.last_trade_ts_ns)
3094                                as u32;
3095                }
3096                if self.change_24h_bps != 0i32 {
3097                    size
3098                        += 1u32
3099                            + ::buffa::types::int32_encoded_len(self.change_24h_bps)
3100                                as u32;
3101                }
3102                if self.high_24h_ticks != 0i64 {
3103                    size
3104                        += 1u32
3105                            + ::buffa::types::int64_encoded_len(self.high_24h_ticks)
3106                                as u32;
3107                }
3108                if self.low_24h_ticks != 0i64 {
3109                    size
3110                        += 1u32
3111                            + ::buffa::types::int64_encoded_len(self.low_24h_ticks)
3112                                as u32;
3113                }
3114                if self.volume_24h_base_scaled != 0i64 {
3115                    size
3116                        += 1u32
3117                            + ::buffa::types::int64_encoded_len(
3118                                self.volume_24h_base_scaled,
3119                            ) as u32;
3120                }
3121                if self.best_bid_ticks != 0i64 {
3122                    size
3123                        += 1u32
3124                            + ::buffa::types::int64_encoded_len(self.best_bid_ticks)
3125                                as u32;
3126                }
3127                if self.best_bid_qty_scaled != 0i64 {
3128                    size
3129                        += 1u32
3130                            + ::buffa::types::int64_encoded_len(self.best_bid_qty_scaled)
3131                                as u32;
3132                }
3133                if self.best_ask_ticks != 0i64 {
3134                    size
3135                        += 1u32
3136                            + ::buffa::types::int64_encoded_len(self.best_ask_ticks)
3137                                as u32;
3138                }
3139                if self.best_ask_qty_scaled != 0i64 {
3140                    size
3141                        += 1u32
3142                            + ::buffa::types::int64_encoded_len(self.best_ask_qty_scaled)
3143                                as u32;
3144                }
3145                for v in &self.sparklines {
3146                    let __slot = __cache.reserve();
3147                    let inner_size = v.compute_size(__cache);
3148                    __cache.set(__slot, inner_size);
3149                    size
3150                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
3151                            + inner_size;
3152                }
3153                if self.volume_24h_quote_scaled != 0i64 {
3154                    size
3155                        += 1u32
3156                            + ::buffa::types::int64_encoded_len(
3157                                self.volume_24h_quote_scaled,
3158                            ) as u32;
3159                }
3160                if self.listed_ts_ns != 0u64 {
3161                    size
3162                        += 1u32
3163                            + ::buffa::types::uint64_encoded_len(self.listed_ts_ns)
3164                                as u32;
3165                }
3166                size += self.__buffa_unknown_fields.encoded_len() as u32;
3167                size
3168            }
3169            #[allow(clippy::needless_borrow)]
3170            fn write_to(
3171                &self,
3172                __cache: &mut ::buffa::SizeCache,
3173                buf: &mut impl ::buffa::bytes::BufMut,
3174            ) {
3175                #[allow(unused_imports)]
3176                use ::buffa::Enumeration as _;
3177                if self.symbol_id != 0u32 {
3178                    ::buffa::types::put_uint32_field(1u32, self.symbol_id, buf);
3179                }
3180                if !self.symbol.is_empty() {
3181                    ::buffa::types::put_string_field(2u32, &self.symbol, buf);
3182                }
3183                if self.last_price_ticks != 0i64 {
3184                    ::buffa::types::put_int64_field(3u32, self.last_price_ticks, buf);
3185                }
3186                if self.last_trade_ts_ns != 0u64 {
3187                    ::buffa::types::put_uint64_field(4u32, self.last_trade_ts_ns, buf);
3188                }
3189                if self.change_24h_bps != 0i32 {
3190                    ::buffa::types::put_int32_field(5u32, self.change_24h_bps, buf);
3191                }
3192                if self.high_24h_ticks != 0i64 {
3193                    ::buffa::types::put_int64_field(6u32, self.high_24h_ticks, buf);
3194                }
3195                if self.low_24h_ticks != 0i64 {
3196                    ::buffa::types::put_int64_field(7u32, self.low_24h_ticks, buf);
3197                }
3198                if self.volume_24h_base_scaled != 0i64 {
3199                    ::buffa::types::put_int64_field(
3200                        8u32,
3201                        self.volume_24h_base_scaled,
3202                        buf,
3203                    );
3204                }
3205                if self.best_bid_ticks != 0i64 {
3206                    ::buffa::types::put_int64_field(9u32, self.best_bid_ticks, buf);
3207                }
3208                if self.best_bid_qty_scaled != 0i64 {
3209                    ::buffa::types::put_int64_field(
3210                        10u32,
3211                        self.best_bid_qty_scaled,
3212                        buf,
3213                    );
3214                }
3215                if self.best_ask_ticks != 0i64 {
3216                    ::buffa::types::put_int64_field(11u32, self.best_ask_ticks, buf);
3217                }
3218                if self.best_ask_qty_scaled != 0i64 {
3219                    ::buffa::types::put_int64_field(
3220                        12u32,
3221                        self.best_ask_qty_scaled,
3222                        buf,
3223                    );
3224                }
3225                for v in &self.sparklines {
3226                    ::buffa::types::put_len_delimited_header(
3227                        13u32,
3228                        __cache.consume_next(),
3229                        buf,
3230                    );
3231                    v.write_to(__cache, buf);
3232                }
3233                if self.volume_24h_quote_scaled != 0i64 {
3234                    ::buffa::types::put_int64_field(
3235                        14u32,
3236                        self.volume_24h_quote_scaled,
3237                        buf,
3238                    );
3239                }
3240                if self.listed_ts_ns != 0u64 {
3241                    ::buffa::types::put_uint64_field(15u32, self.listed_ts_ns, buf);
3242                }
3243                self.__buffa_unknown_fields.write_to(buf);
3244            }
3245        }
3246        /// Serializes this view as protobuf JSON.
3247        ///
3248        /// Implicit-presence fields with default values are omitted, `required`
3249        /// fields are always emitted, explicit-presence (`optional`) fields are
3250        /// emitted only when set, bytes fields are base64-encoded, and enum
3251        /// values are their proto name strings.
3252        ///
3253        /// This impl uses `serialize_map(None)` because the number of emitted
3254        /// fields depends on default-omission rules; serializers that require
3255        /// known map lengths (e.g. `bincode`) will return a runtime error.
3256        /// Use the owned message type for those formats.
3257        impl<'__a> ::serde::Serialize for MarketOverviewView<'__a> {
3258            fn serialize<__S: ::serde::Serializer>(
3259                &self,
3260                __s: __S,
3261            ) -> ::core::result::Result<__S::Ok, __S::Error> {
3262                use ::serde::ser::SerializeMap as _;
3263                let mut __map = __s.serialize_map(::core::option::Option::None)?;
3264                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.symbol_id) {
3265                    __map
3266                        .serialize_entry(
3267                            "symbolId",
3268                            &::buffa::json_helpers::ProtoJson(&self.symbol_id),
3269                        )?;
3270                }
3271                if !::buffa::json_helpers::skip_if::is_empty_str(self.symbol) {
3272                    __map.serialize_entry("symbol", self.symbol)?;
3273                }
3274                if !::buffa::json_helpers::skip_if::is_zero_i64(&self.last_price_ticks) {
3275                    __map
3276                        .serialize_entry(
3277                            "lastPriceTicks",
3278                            &::buffa::json_helpers::ProtoJson(&self.last_price_ticks),
3279                        )?;
3280                }
3281                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.last_trade_ts_ns) {
3282                    __map
3283                        .serialize_entry(
3284                            "lastTradeTsNs",
3285                            &::buffa::json_helpers::ProtoJson(&self.last_trade_ts_ns),
3286                        )?;
3287                }
3288                if !::buffa::json_helpers::skip_if::is_zero_i32(&self.change_24h_bps) {
3289                    __map
3290                        .serialize_entry(
3291                            "change24hBps",
3292                            &::buffa::json_helpers::ProtoJson(&self.change_24h_bps),
3293                        )?;
3294                }
3295                if !::buffa::json_helpers::skip_if::is_zero_i64(&self.high_24h_ticks) {
3296                    __map
3297                        .serialize_entry(
3298                            "high24hTicks",
3299                            &::buffa::json_helpers::ProtoJson(&self.high_24h_ticks),
3300                        )?;
3301                }
3302                if !::buffa::json_helpers::skip_if::is_zero_i64(&self.low_24h_ticks) {
3303                    __map
3304                        .serialize_entry(
3305                            "low24hTicks",
3306                            &::buffa::json_helpers::ProtoJson(&self.low_24h_ticks),
3307                        )?;
3308                }
3309                if !::buffa::json_helpers::skip_if::is_zero_i64(
3310                    &self.volume_24h_base_scaled,
3311                ) {
3312                    __map
3313                        .serialize_entry(
3314                            "volume24hBaseScaled",
3315                            &::buffa::json_helpers::ProtoJson(
3316                                &self.volume_24h_base_scaled,
3317                            ),
3318                        )?;
3319                }
3320                if !::buffa::json_helpers::skip_if::is_zero_i64(
3321                    &self.volume_24h_quote_scaled,
3322                ) {
3323                    __map
3324                        .serialize_entry(
3325                            "volume24hQuoteScaled",
3326                            &::buffa::json_helpers::ProtoJson(
3327                                &self.volume_24h_quote_scaled,
3328                            ),
3329                        )?;
3330                }
3331                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.listed_ts_ns) {
3332                    __map
3333                        .serialize_entry(
3334                            "listedTsNs",
3335                            &::buffa::json_helpers::ProtoJson(&self.listed_ts_ns),
3336                        )?;
3337                }
3338                if !::buffa::json_helpers::skip_if::is_zero_i64(&self.best_bid_ticks) {
3339                    __map
3340                        .serialize_entry(
3341                            "bestBidTicks",
3342                            &::buffa::json_helpers::ProtoJson(&self.best_bid_ticks),
3343                        )?;
3344                }
3345                if !::buffa::json_helpers::skip_if::is_zero_i64(
3346                    &self.best_bid_qty_scaled,
3347                ) {
3348                    __map
3349                        .serialize_entry(
3350                            "bestBidQtyScaled",
3351                            &::buffa::json_helpers::ProtoJson(&self.best_bid_qty_scaled),
3352                        )?;
3353                }
3354                if !::buffa::json_helpers::skip_if::is_zero_i64(&self.best_ask_ticks) {
3355                    __map
3356                        .serialize_entry(
3357                            "bestAskTicks",
3358                            &::buffa::json_helpers::ProtoJson(&self.best_ask_ticks),
3359                        )?;
3360                }
3361                if !::buffa::json_helpers::skip_if::is_zero_i64(
3362                    &self.best_ask_qty_scaled,
3363                ) {
3364                    __map
3365                        .serialize_entry(
3366                            "bestAskQtyScaled",
3367                            &::buffa::json_helpers::ProtoJson(&self.best_ask_qty_scaled),
3368                        )?;
3369                }
3370                if !self.sparklines.is_empty() {
3371                    __map.serialize_entry("sparklines", &*self.sparklines)?;
3372                }
3373                __map.end()
3374            }
3375        }
3376        impl<'a> ::buffa::MessageName for MarketOverviewView<'a> {
3377            const PACKAGE: &'static str = "marketoverview.v1";
3378            const NAME: &'static str = "MarketOverview";
3379            const FULL_NAME: &'static str = "marketoverview.v1.MarketOverview";
3380            const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.MarketOverview";
3381        }
3382        ::buffa::impl_default_view_instance!(MarketOverviewView);
3383        ::buffa::impl_view_reborrow!(MarketOverviewView);
3384        /** Self-contained, `'static` owned view of a `MarketOverview` message.
3385
3386 Wraps [`::buffa::OwnedView`]`<`[`MarketOverviewView`]`<'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.
3387
3388 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`MarketOverviewView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
3389        #[derive(Clone, Debug)]
3390        pub struct MarketOverviewOwnedView(
3391            ::buffa::OwnedView<MarketOverviewView<'static>>,
3392        );
3393        impl MarketOverviewOwnedView {
3394            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
3395            ///
3396            /// The view borrows directly from the buffer's data; the buffer is
3397            /// retained inside the returned handle.
3398            ///
3399            /// # Errors
3400            ///
3401            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
3402            /// protobuf data.
3403            pub fn decode(
3404                bytes: ::buffa::bytes::Bytes,
3405            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3406                ::core::result::Result::Ok(
3407                    MarketOverviewOwnedView(::buffa::OwnedView::decode(bytes)?),
3408                )
3409            }
3410            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
3411            /// max message size).
3412            ///
3413            /// # Errors
3414            ///
3415            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
3416            /// exceeds the configured limits.
3417            pub fn decode_with_options(
3418                bytes: ::buffa::bytes::Bytes,
3419                opts: &::buffa::DecodeOptions,
3420            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3421                ::core::result::Result::Ok(
3422                    MarketOverviewOwnedView(
3423                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
3424                    ),
3425                )
3426            }
3427            /// Build from an owned message via an encode → decode round-trip.
3428            ///
3429            /// # Errors
3430            ///
3431            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
3432            /// somehow invalid (should not happen for well-formed messages).
3433            pub fn from_owned(
3434                msg: &super::super::MarketOverview,
3435            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3436                ::core::result::Result::Ok(
3437                    MarketOverviewOwnedView(::buffa::OwnedView::from_owned(msg)?),
3438                )
3439            }
3440            /// Borrow the full [`MarketOverviewView`] with its lifetime tied to `&self`.
3441            #[must_use]
3442            pub fn view(&self) -> &MarketOverviewView<'_> {
3443                self.0.reborrow()
3444            }
3445            /// Convert to the owned message type.
3446            ///
3447            /// # Errors
3448            ///
3449            /// Returns an error if re-materializing preserved unknown fields
3450            /// fails (e.g. the unknown-field limit is exceeded).
3451            pub fn to_owned_message(
3452                &self,
3453            ) -> ::core::result::Result<
3454                super::super::MarketOverview,
3455                ::buffa::DecodeError,
3456            > {
3457                self.0.to_owned_message()
3458            }
3459            /// The underlying bytes buffer.
3460            #[must_use]
3461            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3462                self.0.bytes()
3463            }
3464            /// Consume the handle, returning the underlying bytes buffer.
3465            #[must_use]
3466            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3467                self.0.into_bytes()
3468            }
3469            /// Numeric spot market identifier.
3470            ///
3471            /// Field 1: `symbol_id`
3472            #[must_use]
3473            pub fn symbol_id(&self) -> u32 {
3474                self.0.reborrow().symbol_id
3475            }
3476            /// Canonical pair symbol, e.g. "BTC-USDT".
3477            ///
3478            /// Field 2: `symbol`
3479            #[must_use]
3480            pub fn symbol(&self) -> &'_ str {
3481                self.0.reborrow().symbol
3482            }
3483            /// Last traded price in quote units scaled by 1e6.
3484            ///
3485            /// Field 3: `last_price_ticks`
3486            #[must_use]
3487            pub fn last_price_ticks(&self) -> i64 {
3488                self.0.reborrow().last_price_ticks
3489            }
3490            /// Last trade timestamp in nanoseconds since epoch.
3491            ///
3492            /// Field 4: `last_trade_ts_ns`
3493            #[must_use]
3494            pub fn last_trade_ts_ns(&self) -> u64 {
3495                self.0.reborrow().last_trade_ts_ns
3496            }
3497            /// Rolling 24h change expressed in basis points (bp). Example: +123 = +1.23%.
3498            ///
3499            /// Field 5: `change_24h_bps`
3500            #[must_use]
3501            pub fn change_24h_bps(&self) -> i32 {
3502                self.0.reborrow().change_24h_bps
3503            }
3504            /// Rolling 24h stats.
3505            /// Highest traded price in the 24h window, in quote units scaled by 1e6.
3506            ///
3507            /// Field 6: `high_24h_ticks`
3508            #[must_use]
3509            pub fn high_24h_ticks(&self) -> i64 {
3510                self.0.reborrow().high_24h_ticks
3511            }
3512            /// Lowest traded price in the 24h window, in quote units scaled by 1e6.
3513            ///
3514            /// Field 7: `low_24h_ticks`
3515            #[must_use]
3516            pub fn low_24h_ticks(&self) -> i64 {
3517                self.0.reborrow().low_24h_ticks
3518            }
3519            /// Rolling 24h base volume scaled by the pair's base_quantity_scale from
3520            /// GetSpotConfig.
3521            ///
3522            /// Field 8: `volume_24h_base_scaled`
3523            #[must_use]
3524            pub fn volume_24h_base_scaled(&self) -> i64 {
3525                self.0.reborrow().volume_24h_base_scaled
3526            }
3527            /// Rolling 24h quote volume scaled by the pair's quote_quantity_scale from
3528            /// GetSpotConfig.
3529            ///
3530            /// Field 14: `volume_24h_quote_scaled`
3531            #[must_use]
3532            pub fn volume_24h_quote_scaled(&self) -> i64 {
3533                self.0.reborrow().volume_24h_quote_scaled
3534            }
3535            /// Listing timestamp in nanoseconds since epoch.
3536            ///
3537            /// Field 15: `listed_ts_ns`
3538            #[must_use]
3539            pub fn listed_ts_ns(&self) -> u64 {
3540                self.0.reborrow().listed_ts_ns
3541            }
3542            /// Current best bid price in quote units scaled by 1e6.
3543            ///
3544            /// Field 9: `best_bid_ticks`
3545            #[must_use]
3546            pub fn best_bid_ticks(&self) -> i64 {
3547                self.0.reborrow().best_bid_ticks
3548            }
3549            /// Best bid quantity scaled by the pair's base_quantity_scale from
3550            /// GetSpotConfig.
3551            ///
3552            /// Field 10: `best_bid_qty_scaled`
3553            #[must_use]
3554            pub fn best_bid_qty_scaled(&self) -> i64 {
3555                self.0.reborrow().best_bid_qty_scaled
3556            }
3557            /// Current best ask price in quote units scaled by 1e6.
3558            ///
3559            /// Field 11: `best_ask_ticks`
3560            #[must_use]
3561            pub fn best_ask_ticks(&self) -> i64 {
3562                self.0.reborrow().best_ask_ticks
3563            }
3564            /// Best ask quantity scaled by the pair's base_quantity_scale from
3565            /// GetSpotConfig.
3566            ///
3567            /// Field 12: `best_ask_qty_scaled`
3568            #[must_use]
3569            pub fn best_ask_qty_scaled(&self) -> i64 {
3570                self.0.reborrow().best_ask_qty_scaled
3571            }
3572            /// Optional sparklines (requested explicitly).
3573            ///
3574            /// Field 13: `sparklines`
3575            #[must_use]
3576            pub fn sparklines(
3577                &self,
3578            ) -> &::buffa::RepeatedView<
3579                '_,
3580                super::super::__buffa::view::SparklineView<'_>,
3581            > {
3582                &self.0.reborrow().sparklines
3583            }
3584        }
3585        impl ::core::convert::From<::buffa::OwnedView<MarketOverviewView<'static>>>
3586        for MarketOverviewOwnedView {
3587            fn from(inner: ::buffa::OwnedView<MarketOverviewView<'static>>) -> Self {
3588                MarketOverviewOwnedView(inner)
3589            }
3590        }
3591        impl ::core::convert::From<MarketOverviewOwnedView>
3592        for ::buffa::OwnedView<MarketOverviewView<'static>> {
3593            fn from(wrapper: MarketOverviewOwnedView) -> Self {
3594                wrapper.0
3595            }
3596        }
3597        impl ::core::convert::AsRef<::buffa::OwnedView<MarketOverviewView<'static>>>
3598        for MarketOverviewOwnedView {
3599            fn as_ref(&self) -> &::buffa::OwnedView<MarketOverviewView<'static>> {
3600                &self.0
3601            }
3602        }
3603        impl ::buffa::HasMessageView for super::super::MarketOverview {
3604            type View<'a> = MarketOverviewView<'a>;
3605            type ViewHandle = MarketOverviewOwnedView;
3606        }
3607        impl ::serde::Serialize for MarketOverviewOwnedView {
3608            fn serialize<__S: ::serde::Serializer>(
3609                &self,
3610                __s: __S,
3611            ) -> ::core::result::Result<__S::Ok, __S::Error> {
3612                ::serde::Serialize::serialize(&self.0, __s)
3613            }
3614        }
3615        #[derive(Clone, Debug, Default)]
3616        pub struct ListMarketOverviewRequestView<'a> {
3617            /// Filter by specific symbols; when empty, returns all enabled markets.
3618            ///
3619            /// Field 1: `symbols`
3620            pub symbols: ::buffa::RepeatedView<'a, &'a str>,
3621            /// Maximum number of markets to return. Defaults to 50 when omitted; maximum
3622            /// is 2000.
3623            ///
3624            /// Field 2: `limit`
3625            pub limit: u32,
3626            /// Opaque keyset cursor from a previous response. The cursor is exclusive and
3627            /// bound to symbols, sort key, and sort direction. Sparkline options affect
3628            /// only response enrichment and may change between pages.
3629            ///
3630            /// Field 3: `page_token`
3631            pub page_token: &'a str,
3632            /// Sort key. When unset/UNSPECIFIED, defaults to 24h quote volume.
3633            ///
3634            /// Field 4: `order_by`
3635            pub order_by: ::buffa::EnumValue<super::super::MarketOrderBy>,
3636            /// Sort direction (DESC=newest/highest first).
3637            ///
3638            /// Field 5: `sort`
3639            pub sort: ::buffa::EnumValue<super::super::SortDirection>,
3640            /// When true, include sparklines in each MarketOverview.
3641            ///
3642            /// Field 6: `include_sparklines`
3643            pub include_sparklines: bool,
3644            /// Which sparklines to include. If empty and include_sparklines is true,
3645            /// server defaults to 24h.
3646            ///
3647            /// Field 7: `sparkline_intervals`
3648            pub sparkline_intervals: ::buffa::RepeatedView<
3649                'a,
3650                ::buffa::EnumValue<super::super::SparklineInterval>,
3651            >,
3652            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3653        }
3654        impl<'a> ::buffa::MessageView<'a> for ListMarketOverviewRequestView<'a> {
3655            type Owned = super::super::ListMarketOverviewRequest;
3656            fn decode_view(
3657                buf: &'a [u8],
3658            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3659                let __limit = ::core::cell::Cell::new(
3660                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
3661                );
3662                <Self as ::buffa::MessageView>::decode_view_ctx(
3663                    buf,
3664                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
3665                )
3666            }
3667            fn decode_view_with_ctx(
3668                buf: &'a [u8],
3669                ctx: ::buffa::DecodeContext<'_>,
3670            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3671                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
3672            }
3673            fn merge_view_field(
3674                &mut self,
3675                tag: ::buffa::encoding::Tag,
3676                cur: &'a [u8],
3677                before_tag: &'a [u8],
3678                ctx: ::buffa::DecodeContext<'_>,
3679            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
3680                let _ = ctx;
3681                #[allow(unused_variables)]
3682                let view = self;
3683                let mut cur = cur;
3684                match tag.field_number() {
3685                    2u32 => {
3686                        ::buffa::encoding::check_wire_type(
3687                            tag,
3688                            ::buffa::encoding::WireType::Varint,
3689                        )?;
3690                        view.limit = ::buffa::types::decode_uint32(&mut cur)?;
3691                    }
3692                    3u32 => {
3693                        ::buffa::encoding::check_wire_type(
3694                            tag,
3695                            ::buffa::encoding::WireType::LengthDelimited,
3696                        )?;
3697                        view.page_token = ::buffa::types::borrow_str(&mut cur)?;
3698                    }
3699                    4u32 => {
3700                        ::buffa::encoding::check_wire_type(
3701                            tag,
3702                            ::buffa::encoding::WireType::Varint,
3703                        )?;
3704                        view.order_by = ::buffa::EnumValue::from(
3705                            ::buffa::types::decode_int32(&mut cur)?,
3706                        );
3707                    }
3708                    5u32 => {
3709                        ::buffa::encoding::check_wire_type(
3710                            tag,
3711                            ::buffa::encoding::WireType::Varint,
3712                        )?;
3713                        view.sort = ::buffa::EnumValue::from(
3714                            ::buffa::types::decode_int32(&mut cur)?,
3715                        );
3716                    }
3717                    6u32 => {
3718                        ::buffa::encoding::check_wire_type(
3719                            tag,
3720                            ::buffa::encoding::WireType::Varint,
3721                        )?;
3722                        view.include_sparklines = ::buffa::types::decode_bool(&mut cur)?;
3723                    }
3724                    1u32 => {
3725                        ::buffa::encoding::check_wire_type(
3726                            tag,
3727                            ::buffa::encoding::WireType::LengthDelimited,
3728                        )?;
3729                        view.symbols.push(::buffa::types::borrow_str(&mut cur)?);
3730                    }
3731                    7u32 => {
3732                        if tag.wire_type()
3733                            == ::buffa::encoding::WireType::LengthDelimited
3734                        {
3735                            let payload = ::buffa::types::borrow_bytes(&mut cur)?;
3736                            view.sparkline_intervals
3737                                .reserve(::buffa::encoding::count_varints(payload));
3738                            let mut pcur: &[u8] = payload;
3739                            while !pcur.is_empty() {
3740                                view.sparkline_intervals
3741                                    .push(
3742                                        ::buffa::EnumValue::from(
3743                                            ::buffa::types::decode_int32(&mut pcur)?,
3744                                        ),
3745                                    );
3746                            }
3747                        } else if tag.wire_type() == ::buffa::encoding::WireType::Varint
3748                        {
3749                            view.sparkline_intervals
3750                                .push(
3751                                    ::buffa::EnumValue::from(
3752                                        ::buffa::types::decode_int32(&mut cur)?,
3753                                    ),
3754                                );
3755                        } else {
3756                            return Err(
3757                                ::buffa::encoding::wire_type_mismatch(
3758                                    tag,
3759                                    ::buffa::encoding::WireType::LengthDelimited,
3760                                ),
3761                            );
3762                        }
3763                    }
3764                    _ => {
3765                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
3766                        let span_len = before_tag.len() - cur.len();
3767                        view.__buffa_unknown_fields
3768                            .push_record(before_tag, span_len, ctx)?;
3769                    }
3770                }
3771                ::core::result::Result::Ok(cur)
3772            }
3773            fn to_owned_message(
3774                &self,
3775            ) -> ::core::result::Result<
3776                super::super::ListMarketOverviewRequest,
3777                ::buffa::DecodeError,
3778            > {
3779                self.to_owned_from_source(None)
3780            }
3781            #[allow(clippy::useless_conversion, clippy::needless_update)]
3782            fn to_owned_from_source(
3783                &self,
3784                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3785            ) -> ::core::result::Result<
3786                super::super::ListMarketOverviewRequest,
3787                ::buffa::DecodeError,
3788            > {
3789                #[allow(unused_imports)]
3790                use ::buffa::alloc::string::ToString as _;
3791                let _ = __buffa_src;
3792                ::core::result::Result::Ok(super::super::ListMarketOverviewRequest {
3793                    symbols: self.symbols.iter().map(|s| s.to_string()).collect(),
3794                    limit: self.limit,
3795                    page_token: self.page_token.to_string(),
3796                    order_by: self.order_by,
3797                    sort: self.sort,
3798                    include_sparklines: self.include_sparklines,
3799                    sparkline_intervals: self.sparkline_intervals.to_vec(),
3800                    __buffa_unknown_fields: self
3801                        .__buffa_unknown_fields
3802                        .to_owned()?
3803                        .into(),
3804                    ..::core::default::Default::default()
3805                })
3806            }
3807        }
3808        impl<'a> ::buffa::ViewEncode<'a> for ListMarketOverviewRequestView<'a> {
3809            #[allow(clippy::needless_borrow, clippy::let_and_return)]
3810            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3811                #[allow(unused_imports)]
3812                use ::buffa::Enumeration as _;
3813                let mut size = 0u32;
3814                for v in &self.symbols {
3815                    size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3816                }
3817                if self.limit != 0u32 {
3818                    size += 1u32 + ::buffa::types::uint32_encoded_len(self.limit) as u32;
3819                }
3820                if !self.page_token.is_empty() {
3821                    size
3822                        += 1u32
3823                            + ::buffa::types::string_encoded_len(&self.page_token)
3824                                as u32;
3825                }
3826                {
3827                    let val = self.order_by.to_i32();
3828                    if val != 0 {
3829                        size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
3830                    }
3831                }
3832                {
3833                    let val = self.sort.to_i32();
3834                    if val != 0 {
3835                        size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
3836                    }
3837                }
3838                if self.include_sparklines {
3839                    size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
3840                }
3841                if !self.sparkline_intervals.is_empty() {
3842                    let payload: u32 = self
3843                        .sparkline_intervals
3844                        .iter()
3845                        .map(|v| ::buffa::types::int32_encoded_len(v.to_i32()) as u32)
3846                        .sum::<u32>();
3847                    size
3848                        += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
3849                            + payload;
3850                }
3851                size += self.__buffa_unknown_fields.encoded_len() as u32;
3852                size
3853            }
3854            #[allow(clippy::needless_borrow)]
3855            fn write_to(
3856                &self,
3857                _cache: &mut ::buffa::SizeCache,
3858                buf: &mut impl ::buffa::bytes::BufMut,
3859            ) {
3860                #[allow(unused_imports)]
3861                use ::buffa::Enumeration as _;
3862                for v in &self.symbols {
3863                    ::buffa::types::put_string_field(1u32, v, buf);
3864                }
3865                if self.limit != 0u32 {
3866                    ::buffa::types::put_uint32_field(2u32, self.limit, buf);
3867                }
3868                if !self.page_token.is_empty() {
3869                    ::buffa::types::put_string_field(3u32, &self.page_token, buf);
3870                }
3871                {
3872                    let val = self.order_by.to_i32();
3873                    if val != 0 {
3874                        ::buffa::types::put_int32_field(4u32, val, buf);
3875                    }
3876                }
3877                {
3878                    let val = self.sort.to_i32();
3879                    if val != 0 {
3880                        ::buffa::types::put_int32_field(5u32, val, buf);
3881                    }
3882                }
3883                if self.include_sparklines {
3884                    ::buffa::types::put_bool_field(6u32, self.include_sparklines, buf);
3885                }
3886                if !self.sparkline_intervals.is_empty() {
3887                    let payload: u32 = self
3888                        .sparkline_intervals
3889                        .iter()
3890                        .map(|v| ::buffa::types::int32_encoded_len(v.to_i32()) as u32)
3891                        .sum::<u32>();
3892                    ::buffa::types::put_len_delimited_header(7u32, payload, buf);
3893                    for v in &self.sparkline_intervals {
3894                        ::buffa::types::encode_int32(v.to_i32(), buf);
3895                    }
3896                }
3897                self.__buffa_unknown_fields.write_to(buf);
3898            }
3899        }
3900        /// Serializes this view as protobuf JSON.
3901        ///
3902        /// Implicit-presence fields with default values are omitted, `required`
3903        /// fields are always emitted, explicit-presence (`optional`) fields are
3904        /// emitted only when set, bytes fields are base64-encoded, and enum
3905        /// values are their proto name strings.
3906        ///
3907        /// This impl uses `serialize_map(None)` because the number of emitted
3908        /// fields depends on default-omission rules; serializers that require
3909        /// known map lengths (e.g. `bincode`) will return a runtime error.
3910        /// Use the owned message type for those formats.
3911        impl<'__a> ::serde::Serialize for ListMarketOverviewRequestView<'__a> {
3912            fn serialize<__S: ::serde::Serializer>(
3913                &self,
3914                __s: __S,
3915            ) -> ::core::result::Result<__S::Ok, __S::Error> {
3916                use ::serde::ser::SerializeMap as _;
3917                let mut __map = __s.serialize_map(::core::option::Option::None)?;
3918                if !self.symbols.is_empty() {
3919                    __map.serialize_entry("symbols", &*self.symbols)?;
3920                }
3921                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.limit) {
3922                    __map
3923                        .serialize_entry(
3924                            "limit",
3925                            &::buffa::json_helpers::ProtoJson(&self.limit),
3926                        )?;
3927                }
3928                if !::buffa::json_helpers::skip_if::is_empty_str(self.page_token) {
3929                    __map.serialize_entry("pageToken", self.page_token)?;
3930                }
3931                if !::buffa::json_helpers::skip_if::is_default_enum_value(
3932                    &self.order_by,
3933                ) {
3934                    __map.serialize_entry("orderBy", &self.order_by)?;
3935                }
3936                if !::buffa::json_helpers::skip_if::is_default_enum_value(&self.sort) {
3937                    __map.serialize_entry("sort", &self.sort)?;
3938                }
3939                if self.include_sparklines {
3940                    __map
3941                        .serialize_entry("includeSparklines", &self.include_sparklines)?;
3942                }
3943                if !self.sparkline_intervals.is_empty() {
3944                    __map
3945                        .serialize_entry(
3946                            "sparklineIntervals",
3947                            &::buffa::json_helpers::EnumSeqJson(
3948                                &self.sparkline_intervals,
3949                            ),
3950                        )?;
3951                }
3952                __map.end()
3953            }
3954        }
3955        impl<'a> ::buffa::MessageName for ListMarketOverviewRequestView<'a> {
3956            const PACKAGE: &'static str = "marketoverview.v1";
3957            const NAME: &'static str = "ListMarketOverviewRequest";
3958            const FULL_NAME: &'static str = "marketoverview.v1.ListMarketOverviewRequest";
3959            const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.ListMarketOverviewRequest";
3960        }
3961        ::buffa::impl_default_view_instance!(ListMarketOverviewRequestView);
3962        ::buffa::impl_view_reborrow!(ListMarketOverviewRequestView);
3963        /** Self-contained, `'static` owned view of a `ListMarketOverviewRequest` message.
3964
3965 Wraps [`::buffa::OwnedView`]`<`[`ListMarketOverviewRequestView`]`<'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.
3966
3967 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ListMarketOverviewRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
3968        #[derive(Clone, Debug)]
3969        pub struct ListMarketOverviewRequestOwnedView(
3970            ::buffa::OwnedView<ListMarketOverviewRequestView<'static>>,
3971        );
3972        impl ListMarketOverviewRequestOwnedView {
3973            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
3974            ///
3975            /// The view borrows directly from the buffer's data; the buffer is
3976            /// retained inside the returned handle.
3977            ///
3978            /// # Errors
3979            ///
3980            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
3981            /// protobuf data.
3982            pub fn decode(
3983                bytes: ::buffa::bytes::Bytes,
3984            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3985                ::core::result::Result::Ok(
3986                    ListMarketOverviewRequestOwnedView(
3987                        ::buffa::OwnedView::decode(bytes)?,
3988                    ),
3989                )
3990            }
3991            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
3992            /// max message size).
3993            ///
3994            /// # Errors
3995            ///
3996            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
3997            /// exceeds the configured limits.
3998            pub fn decode_with_options(
3999                bytes: ::buffa::bytes::Bytes,
4000                opts: &::buffa::DecodeOptions,
4001            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4002                ::core::result::Result::Ok(
4003                    ListMarketOverviewRequestOwnedView(
4004                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4005                    ),
4006                )
4007            }
4008            /// Build from an owned message via an encode → decode round-trip.
4009            ///
4010            /// # Errors
4011            ///
4012            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
4013            /// somehow invalid (should not happen for well-formed messages).
4014            pub fn from_owned(
4015                msg: &super::super::ListMarketOverviewRequest,
4016            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4017                ::core::result::Result::Ok(
4018                    ListMarketOverviewRequestOwnedView(
4019                        ::buffa::OwnedView::from_owned(msg)?,
4020                    ),
4021                )
4022            }
4023            /// Borrow the full [`ListMarketOverviewRequestView`] with its lifetime tied to `&self`.
4024            #[must_use]
4025            pub fn view(&self) -> &ListMarketOverviewRequestView<'_> {
4026                self.0.reborrow()
4027            }
4028            /// Convert to the owned message type.
4029            ///
4030            /// # Errors
4031            ///
4032            /// Returns an error if re-materializing preserved unknown fields
4033            /// fails (e.g. the unknown-field limit is exceeded).
4034            pub fn to_owned_message(
4035                &self,
4036            ) -> ::core::result::Result<
4037                super::super::ListMarketOverviewRequest,
4038                ::buffa::DecodeError,
4039            > {
4040                self.0.to_owned_message()
4041            }
4042            /// The underlying bytes buffer.
4043            #[must_use]
4044            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4045                self.0.bytes()
4046            }
4047            /// Consume the handle, returning the underlying bytes buffer.
4048            #[must_use]
4049            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4050                self.0.into_bytes()
4051            }
4052            /// Filter by specific symbols; when empty, returns all enabled markets.
4053            ///
4054            /// Field 1: `symbols`
4055            #[must_use]
4056            pub fn symbols(&self) -> &::buffa::RepeatedView<'_, &'_ str> {
4057                &self.0.reborrow().symbols
4058            }
4059            /// Maximum number of markets to return. Defaults to 50 when omitted; maximum
4060            /// is 2000.
4061            ///
4062            /// Field 2: `limit`
4063            #[must_use]
4064            pub fn limit(&self) -> u32 {
4065                self.0.reborrow().limit
4066            }
4067            /// Opaque keyset cursor from a previous response. The cursor is exclusive and
4068            /// bound to symbols, sort key, and sort direction. Sparkline options affect
4069            /// only response enrichment and may change between pages.
4070            ///
4071            /// Field 3: `page_token`
4072            #[must_use]
4073            pub fn page_token(&self) -> &'_ str {
4074                self.0.reborrow().page_token
4075            }
4076            /// Sort key. When unset/UNSPECIFIED, defaults to 24h quote volume.
4077            ///
4078            /// Field 4: `order_by`
4079            #[must_use]
4080            pub fn order_by(&self) -> ::buffa::EnumValue<super::super::MarketOrderBy> {
4081                self.0.reborrow().order_by
4082            }
4083            /// Sort direction (DESC=newest/highest first).
4084            ///
4085            /// Field 5: `sort`
4086            #[must_use]
4087            pub fn sort(&self) -> ::buffa::EnumValue<super::super::SortDirection> {
4088                self.0.reborrow().sort
4089            }
4090            /// When true, include sparklines in each MarketOverview.
4091            ///
4092            /// Field 6: `include_sparklines`
4093            #[must_use]
4094            pub fn include_sparklines(&self) -> bool {
4095                self.0.reborrow().include_sparklines
4096            }
4097            /// Which sparklines to include. If empty and include_sparklines is true,
4098            /// server defaults to 24h.
4099            ///
4100            /// Field 7: `sparkline_intervals`
4101            #[must_use]
4102            pub fn sparkline_intervals(
4103                &self,
4104            ) -> &::buffa::RepeatedView<
4105                '_,
4106                ::buffa::EnumValue<super::super::SparklineInterval>,
4107            > {
4108                &self.0.reborrow().sparkline_intervals
4109            }
4110        }
4111        impl ::core::convert::From<
4112            ::buffa::OwnedView<ListMarketOverviewRequestView<'static>>,
4113        > for ListMarketOverviewRequestOwnedView {
4114            fn from(
4115                inner: ::buffa::OwnedView<ListMarketOverviewRequestView<'static>>,
4116            ) -> Self {
4117                ListMarketOverviewRequestOwnedView(inner)
4118            }
4119        }
4120        impl ::core::convert::From<ListMarketOverviewRequestOwnedView>
4121        for ::buffa::OwnedView<ListMarketOverviewRequestView<'static>> {
4122            fn from(wrapper: ListMarketOverviewRequestOwnedView) -> Self {
4123                wrapper.0
4124            }
4125        }
4126        impl ::core::convert::AsRef<
4127            ::buffa::OwnedView<ListMarketOverviewRequestView<'static>>,
4128        > for ListMarketOverviewRequestOwnedView {
4129            fn as_ref(
4130                &self,
4131            ) -> &::buffa::OwnedView<ListMarketOverviewRequestView<'static>> {
4132                &self.0
4133            }
4134        }
4135        impl ::buffa::HasMessageView for super::super::ListMarketOverviewRequest {
4136            type View<'a> = ListMarketOverviewRequestView<'a>;
4137            type ViewHandle = ListMarketOverviewRequestOwnedView;
4138        }
4139        impl ::serde::Serialize for ListMarketOverviewRequestOwnedView {
4140            fn serialize<__S: ::serde::Serializer>(
4141                &self,
4142                __s: __S,
4143            ) -> ::core::result::Result<__S::Ok, __S::Error> {
4144                ::serde::Serialize::serialize(&self.0, __s)
4145            }
4146        }
4147        #[derive(Clone, Debug, Default)]
4148        pub struct ListMarketOverviewResponseView<'a> {
4149            /// Market overview rows for the requested page.
4150            ///
4151            /// Field 1: `markets`
4152            pub markets: ::buffa::RepeatedView<
4153                'a,
4154                super::super::__buffa::view::MarketOverviewView<'a>,
4155            >,
4156            /// Opaque cursor for the next page. Empty when no more results exist.
4157            ///
4158            /// Field 2: `next_page_token`
4159            pub next_page_token: &'a str,
4160            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4161        }
4162        impl<'a> ::buffa::MessageView<'a> for ListMarketOverviewResponseView<'a> {
4163            type Owned = super::super::ListMarketOverviewResponse;
4164            fn decode_view(
4165                buf: &'a [u8],
4166            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4167                let __limit = ::core::cell::Cell::new(
4168                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
4169                );
4170                <Self as ::buffa::MessageView>::decode_view_ctx(
4171                    buf,
4172                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
4173                )
4174            }
4175            fn decode_view_with_ctx(
4176                buf: &'a [u8],
4177                ctx: ::buffa::DecodeContext<'_>,
4178            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4179                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
4180            }
4181            fn merge_view_field(
4182                &mut self,
4183                tag: ::buffa::encoding::Tag,
4184                cur: &'a [u8],
4185                before_tag: &'a [u8],
4186                ctx: ::buffa::DecodeContext<'_>,
4187            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
4188                let _ = ctx;
4189                #[allow(unused_variables)]
4190                let view = self;
4191                let mut cur = cur;
4192                match tag.field_number() {
4193                    2u32 => {
4194                        ::buffa::encoding::check_wire_type(
4195                            tag,
4196                            ::buffa::encoding::WireType::LengthDelimited,
4197                        )?;
4198                        view.next_page_token = ::buffa::types::borrow_str(&mut cur)?;
4199                    }
4200                    1u32 => {
4201                        ::buffa::encoding::check_wire_type(
4202                            tag,
4203                            ::buffa::encoding::WireType::LengthDelimited,
4204                        )?;
4205                        let __sub_ctx = ctx.descend()?;
4206                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4207                        view.markets
4208                            .push(
4209                                <super::super::__buffa::view::MarketOverviewView as ::buffa::MessageView>::decode_view_ctx(
4210                                    sub,
4211                                    __sub_ctx,
4212                                )?,
4213                            );
4214                    }
4215                    _ => {
4216                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
4217                        let span_len = before_tag.len() - cur.len();
4218                        view.__buffa_unknown_fields
4219                            .push_record(before_tag, span_len, ctx)?;
4220                    }
4221                }
4222                ::core::result::Result::Ok(cur)
4223            }
4224            fn to_owned_message(
4225                &self,
4226            ) -> ::core::result::Result<
4227                super::super::ListMarketOverviewResponse,
4228                ::buffa::DecodeError,
4229            > {
4230                self.to_owned_from_source(None)
4231            }
4232            #[allow(clippy::useless_conversion, clippy::needless_update)]
4233            fn to_owned_from_source(
4234                &self,
4235                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4236            ) -> ::core::result::Result<
4237                super::super::ListMarketOverviewResponse,
4238                ::buffa::DecodeError,
4239            > {
4240                #[allow(unused_imports)]
4241                use ::buffa::alloc::string::ToString as _;
4242                let _ = __buffa_src;
4243                ::core::result::Result::Ok(super::super::ListMarketOverviewResponse {
4244                    markets: self
4245                        .markets
4246                        .iter()
4247                        .map(|v| v.to_owned_from_source(__buffa_src))
4248                        .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
4249                    next_page_token: self.next_page_token.to_string(),
4250                    __buffa_unknown_fields: self
4251                        .__buffa_unknown_fields
4252                        .to_owned()?
4253                        .into(),
4254                    ..::core::default::Default::default()
4255                })
4256            }
4257        }
4258        impl<'a> ::buffa::ViewEncode<'a> for ListMarketOverviewResponseView<'a> {
4259            #[allow(clippy::needless_borrow, clippy::let_and_return)]
4260            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4261                #[allow(unused_imports)]
4262                use ::buffa::Enumeration as _;
4263                let mut size = 0u32;
4264                for v in &self.markets {
4265                    let __slot = __cache.reserve();
4266                    let inner_size = v.compute_size(__cache);
4267                    __cache.set(__slot, inner_size);
4268                    size
4269                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4270                            + inner_size;
4271                }
4272                if !self.next_page_token.is_empty() {
4273                    size
4274                        += 1u32
4275                            + ::buffa::types::string_encoded_len(&self.next_page_token)
4276                                as u32;
4277                }
4278                size += self.__buffa_unknown_fields.encoded_len() as u32;
4279                size
4280            }
4281            #[allow(clippy::needless_borrow)]
4282            fn write_to(
4283                &self,
4284                __cache: &mut ::buffa::SizeCache,
4285                buf: &mut impl ::buffa::bytes::BufMut,
4286            ) {
4287                #[allow(unused_imports)]
4288                use ::buffa::Enumeration as _;
4289                for v in &self.markets {
4290                    ::buffa::types::put_len_delimited_header(
4291                        1u32,
4292                        __cache.consume_next(),
4293                        buf,
4294                    );
4295                    v.write_to(__cache, buf);
4296                }
4297                if !self.next_page_token.is_empty() {
4298                    ::buffa::types::put_string_field(2u32, &self.next_page_token, buf);
4299                }
4300                self.__buffa_unknown_fields.write_to(buf);
4301            }
4302        }
4303        /// Serializes this view as protobuf JSON.
4304        ///
4305        /// Implicit-presence fields with default values are omitted, `required`
4306        /// fields are always emitted, explicit-presence (`optional`) fields are
4307        /// emitted only when set, bytes fields are base64-encoded, and enum
4308        /// values are their proto name strings.
4309        ///
4310        /// This impl uses `serialize_map(None)` because the number of emitted
4311        /// fields depends on default-omission rules; serializers that require
4312        /// known map lengths (e.g. `bincode`) will return a runtime error.
4313        /// Use the owned message type for those formats.
4314        impl<'__a> ::serde::Serialize for ListMarketOverviewResponseView<'__a> {
4315            fn serialize<__S: ::serde::Serializer>(
4316                &self,
4317                __s: __S,
4318            ) -> ::core::result::Result<__S::Ok, __S::Error> {
4319                use ::serde::ser::SerializeMap as _;
4320                let mut __map = __s.serialize_map(::core::option::Option::None)?;
4321                if !self.markets.is_empty() {
4322                    __map.serialize_entry("markets", &*self.markets)?;
4323                }
4324                if !::buffa::json_helpers::skip_if::is_empty_str(self.next_page_token) {
4325                    __map.serialize_entry("nextPageToken", self.next_page_token)?;
4326                }
4327                __map.end()
4328            }
4329        }
4330        impl<'a> ::buffa::MessageName for ListMarketOverviewResponseView<'a> {
4331            const PACKAGE: &'static str = "marketoverview.v1";
4332            const NAME: &'static str = "ListMarketOverviewResponse";
4333            const FULL_NAME: &'static str = "marketoverview.v1.ListMarketOverviewResponse";
4334            const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.ListMarketOverviewResponse";
4335        }
4336        ::buffa::impl_default_view_instance!(ListMarketOverviewResponseView);
4337        ::buffa::impl_view_reborrow!(ListMarketOverviewResponseView);
4338        /** Self-contained, `'static` owned view of a `ListMarketOverviewResponse` message.
4339
4340 Wraps [`::buffa::OwnedView`]`<`[`ListMarketOverviewResponseView`]`<'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.
4341
4342 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ListMarketOverviewResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
4343        #[derive(Clone, Debug)]
4344        pub struct ListMarketOverviewResponseOwnedView(
4345            ::buffa::OwnedView<ListMarketOverviewResponseView<'static>>,
4346        );
4347        impl ListMarketOverviewResponseOwnedView {
4348            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
4349            ///
4350            /// The view borrows directly from the buffer's data; the buffer is
4351            /// retained inside the returned handle.
4352            ///
4353            /// # Errors
4354            ///
4355            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
4356            /// protobuf data.
4357            pub fn decode(
4358                bytes: ::buffa::bytes::Bytes,
4359            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4360                ::core::result::Result::Ok(
4361                    ListMarketOverviewResponseOwnedView(
4362                        ::buffa::OwnedView::decode(bytes)?,
4363                    ),
4364                )
4365            }
4366            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
4367            /// max message size).
4368            ///
4369            /// # Errors
4370            ///
4371            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
4372            /// exceeds the configured limits.
4373            pub fn decode_with_options(
4374                bytes: ::buffa::bytes::Bytes,
4375                opts: &::buffa::DecodeOptions,
4376            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4377                ::core::result::Result::Ok(
4378                    ListMarketOverviewResponseOwnedView(
4379                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4380                    ),
4381                )
4382            }
4383            /// Build from an owned message via an encode → decode round-trip.
4384            ///
4385            /// # Errors
4386            ///
4387            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
4388            /// somehow invalid (should not happen for well-formed messages).
4389            pub fn from_owned(
4390                msg: &super::super::ListMarketOverviewResponse,
4391            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4392                ::core::result::Result::Ok(
4393                    ListMarketOverviewResponseOwnedView(
4394                        ::buffa::OwnedView::from_owned(msg)?,
4395                    ),
4396                )
4397            }
4398            /// Borrow the full [`ListMarketOverviewResponseView`] with its lifetime tied to `&self`.
4399            #[must_use]
4400            pub fn view(&self) -> &ListMarketOverviewResponseView<'_> {
4401                self.0.reborrow()
4402            }
4403            /// Convert to the owned message type.
4404            ///
4405            /// # Errors
4406            ///
4407            /// Returns an error if re-materializing preserved unknown fields
4408            /// fails (e.g. the unknown-field limit is exceeded).
4409            pub fn to_owned_message(
4410                &self,
4411            ) -> ::core::result::Result<
4412                super::super::ListMarketOverviewResponse,
4413                ::buffa::DecodeError,
4414            > {
4415                self.0.to_owned_message()
4416            }
4417            /// The underlying bytes buffer.
4418            #[must_use]
4419            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4420                self.0.bytes()
4421            }
4422            /// Consume the handle, returning the underlying bytes buffer.
4423            #[must_use]
4424            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4425                self.0.into_bytes()
4426            }
4427            /// Market overview rows for the requested page.
4428            ///
4429            /// Field 1: `markets`
4430            #[must_use]
4431            pub fn markets(
4432                &self,
4433            ) -> &::buffa::RepeatedView<
4434                '_,
4435                super::super::__buffa::view::MarketOverviewView<'_>,
4436            > {
4437                &self.0.reborrow().markets
4438            }
4439            /// Opaque cursor for the next page. Empty when no more results exist.
4440            ///
4441            /// Field 2: `next_page_token`
4442            #[must_use]
4443            pub fn next_page_token(&self) -> &'_ str {
4444                self.0.reborrow().next_page_token
4445            }
4446        }
4447        impl ::core::convert::From<
4448            ::buffa::OwnedView<ListMarketOverviewResponseView<'static>>,
4449        > for ListMarketOverviewResponseOwnedView {
4450            fn from(
4451                inner: ::buffa::OwnedView<ListMarketOverviewResponseView<'static>>,
4452            ) -> Self {
4453                ListMarketOverviewResponseOwnedView(inner)
4454            }
4455        }
4456        impl ::core::convert::From<ListMarketOverviewResponseOwnedView>
4457        for ::buffa::OwnedView<ListMarketOverviewResponseView<'static>> {
4458            fn from(wrapper: ListMarketOverviewResponseOwnedView) -> Self {
4459                wrapper.0
4460            }
4461        }
4462        impl ::core::convert::AsRef<
4463            ::buffa::OwnedView<ListMarketOverviewResponseView<'static>>,
4464        > for ListMarketOverviewResponseOwnedView {
4465            fn as_ref(
4466                &self,
4467            ) -> &::buffa::OwnedView<ListMarketOverviewResponseView<'static>> {
4468                &self.0
4469            }
4470        }
4471        impl ::buffa::HasMessageView for super::super::ListMarketOverviewResponse {
4472            type View<'a> = ListMarketOverviewResponseView<'a>;
4473            type ViewHandle = ListMarketOverviewResponseOwnedView;
4474        }
4475        impl ::serde::Serialize for ListMarketOverviewResponseOwnedView {
4476            fn serialize<__S: ::serde::Serializer>(
4477                &self,
4478                __s: __S,
4479            ) -> ::core::result::Result<__S::Ok, __S::Error> {
4480                ::serde::Serialize::serialize(&self.0, __s)
4481            }
4482        }
4483        /// MarketOverviewBatch is a websocket payload carrying batched market overview
4484        /// updates. It is published to a single all-markets channel at a fixed cadence.
4485        #[derive(Clone, Debug, Default)]
4486        pub struct MarketOverviewBatchView<'a> {
4487            /// Market overviews included in this batch.
4488            ///
4489            /// Field 1: `markets`
4490            pub markets: ::buffa::RepeatedView<
4491                'a,
4492                super::super::__buffa::view::MarketOverviewView<'a>,
4493            >,
4494            /// Batch publish timestamp in nanoseconds since epoch.
4495            ///
4496            /// Field 2: `ts_ns`
4497            pub ts_ns: u64,
4498            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4499        }
4500        impl<'a> ::buffa::MessageView<'a> for MarketOverviewBatchView<'a> {
4501            type Owned = super::super::MarketOverviewBatch;
4502            fn decode_view(
4503                buf: &'a [u8],
4504            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4505                let __limit = ::core::cell::Cell::new(
4506                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
4507                );
4508                <Self as ::buffa::MessageView>::decode_view_ctx(
4509                    buf,
4510                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
4511                )
4512            }
4513            fn decode_view_with_ctx(
4514                buf: &'a [u8],
4515                ctx: ::buffa::DecodeContext<'_>,
4516            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4517                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
4518            }
4519            fn merge_view_field(
4520                &mut self,
4521                tag: ::buffa::encoding::Tag,
4522                cur: &'a [u8],
4523                before_tag: &'a [u8],
4524                ctx: ::buffa::DecodeContext<'_>,
4525            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
4526                let _ = ctx;
4527                #[allow(unused_variables)]
4528                let view = self;
4529                let mut cur = cur;
4530                match tag.field_number() {
4531                    2u32 => {
4532                        ::buffa::encoding::check_wire_type(
4533                            tag,
4534                            ::buffa::encoding::WireType::Varint,
4535                        )?;
4536                        view.ts_ns = ::buffa::types::decode_uint64(&mut cur)?;
4537                    }
4538                    1u32 => {
4539                        ::buffa::encoding::check_wire_type(
4540                            tag,
4541                            ::buffa::encoding::WireType::LengthDelimited,
4542                        )?;
4543                        let __sub_ctx = ctx.descend()?;
4544                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4545                        view.markets
4546                            .push(
4547                                <super::super::__buffa::view::MarketOverviewView as ::buffa::MessageView>::decode_view_ctx(
4548                                    sub,
4549                                    __sub_ctx,
4550                                )?,
4551                            );
4552                    }
4553                    _ => {
4554                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
4555                        let span_len = before_tag.len() - cur.len();
4556                        view.__buffa_unknown_fields
4557                            .push_record(before_tag, span_len, ctx)?;
4558                    }
4559                }
4560                ::core::result::Result::Ok(cur)
4561            }
4562            fn to_owned_message(
4563                &self,
4564            ) -> ::core::result::Result<
4565                super::super::MarketOverviewBatch,
4566                ::buffa::DecodeError,
4567            > {
4568                self.to_owned_from_source(None)
4569            }
4570            #[allow(clippy::useless_conversion, clippy::needless_update)]
4571            fn to_owned_from_source(
4572                &self,
4573                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4574            ) -> ::core::result::Result<
4575                super::super::MarketOverviewBatch,
4576                ::buffa::DecodeError,
4577            > {
4578                #[allow(unused_imports)]
4579                use ::buffa::alloc::string::ToString as _;
4580                let _ = __buffa_src;
4581                ::core::result::Result::Ok(super::super::MarketOverviewBatch {
4582                    markets: self
4583                        .markets
4584                        .iter()
4585                        .map(|v| v.to_owned_from_source(__buffa_src))
4586                        .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
4587                    ts_ns: self.ts_ns,
4588                    __buffa_unknown_fields: self
4589                        .__buffa_unknown_fields
4590                        .to_owned()?
4591                        .into(),
4592                    ..::core::default::Default::default()
4593                })
4594            }
4595        }
4596        impl<'a> ::buffa::ViewEncode<'a> for MarketOverviewBatchView<'a> {
4597            #[allow(clippy::needless_borrow, clippy::let_and_return)]
4598            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4599                #[allow(unused_imports)]
4600                use ::buffa::Enumeration as _;
4601                let mut size = 0u32;
4602                for v in &self.markets {
4603                    let __slot = __cache.reserve();
4604                    let inner_size = v.compute_size(__cache);
4605                    __cache.set(__slot, inner_size);
4606                    size
4607                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4608                            + inner_size;
4609                }
4610                if self.ts_ns != 0u64 {
4611                    size += 1u32 + ::buffa::types::uint64_encoded_len(self.ts_ns) as u32;
4612                }
4613                size += self.__buffa_unknown_fields.encoded_len() as u32;
4614                size
4615            }
4616            #[allow(clippy::needless_borrow)]
4617            fn write_to(
4618                &self,
4619                __cache: &mut ::buffa::SizeCache,
4620                buf: &mut impl ::buffa::bytes::BufMut,
4621            ) {
4622                #[allow(unused_imports)]
4623                use ::buffa::Enumeration as _;
4624                for v in &self.markets {
4625                    ::buffa::types::put_len_delimited_header(
4626                        1u32,
4627                        __cache.consume_next(),
4628                        buf,
4629                    );
4630                    v.write_to(__cache, buf);
4631                }
4632                if self.ts_ns != 0u64 {
4633                    ::buffa::types::put_uint64_field(2u32, self.ts_ns, buf);
4634                }
4635                self.__buffa_unknown_fields.write_to(buf);
4636            }
4637        }
4638        /// Serializes this view as protobuf JSON.
4639        ///
4640        /// Implicit-presence fields with default values are omitted, `required`
4641        /// fields are always emitted, explicit-presence (`optional`) fields are
4642        /// emitted only when set, bytes fields are base64-encoded, and enum
4643        /// values are their proto name strings.
4644        ///
4645        /// This impl uses `serialize_map(None)` because the number of emitted
4646        /// fields depends on default-omission rules; serializers that require
4647        /// known map lengths (e.g. `bincode`) will return a runtime error.
4648        /// Use the owned message type for those formats.
4649        impl<'__a> ::serde::Serialize for MarketOverviewBatchView<'__a> {
4650            fn serialize<__S: ::serde::Serializer>(
4651                &self,
4652                __s: __S,
4653            ) -> ::core::result::Result<__S::Ok, __S::Error> {
4654                use ::serde::ser::SerializeMap as _;
4655                let mut __map = __s.serialize_map(::core::option::Option::None)?;
4656                if !self.markets.is_empty() {
4657                    __map.serialize_entry("markets", &*self.markets)?;
4658                }
4659                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.ts_ns) {
4660                    __map
4661                        .serialize_entry(
4662                            "tsNs",
4663                            &::buffa::json_helpers::ProtoJson(&self.ts_ns),
4664                        )?;
4665                }
4666                __map.end()
4667            }
4668        }
4669        impl<'a> ::buffa::MessageName for MarketOverviewBatchView<'a> {
4670            const PACKAGE: &'static str = "marketoverview.v1";
4671            const NAME: &'static str = "MarketOverviewBatch";
4672            const FULL_NAME: &'static str = "marketoverview.v1.MarketOverviewBatch";
4673            const TYPE_URL: &'static str = "type.googleapis.com/marketoverview.v1.MarketOverviewBatch";
4674        }
4675        ::buffa::impl_default_view_instance!(MarketOverviewBatchView);
4676        ::buffa::impl_view_reborrow!(MarketOverviewBatchView);
4677        /** Self-contained, `'static` owned view of a `MarketOverviewBatch` message.
4678
4679 Wraps [`::buffa::OwnedView`]`<`[`MarketOverviewBatchView`]`<'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.
4680
4681 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`MarketOverviewBatchView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
4682        #[derive(Clone, Debug)]
4683        pub struct MarketOverviewBatchOwnedView(
4684            ::buffa::OwnedView<MarketOverviewBatchView<'static>>,
4685        );
4686        impl MarketOverviewBatchOwnedView {
4687            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
4688            ///
4689            /// The view borrows directly from the buffer's data; the buffer is
4690            /// retained inside the returned handle.
4691            ///
4692            /// # Errors
4693            ///
4694            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
4695            /// protobuf data.
4696            pub fn decode(
4697                bytes: ::buffa::bytes::Bytes,
4698            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4699                ::core::result::Result::Ok(
4700                    MarketOverviewBatchOwnedView(::buffa::OwnedView::decode(bytes)?),
4701                )
4702            }
4703            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
4704            /// max message size).
4705            ///
4706            /// # Errors
4707            ///
4708            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
4709            /// exceeds the configured limits.
4710            pub fn decode_with_options(
4711                bytes: ::buffa::bytes::Bytes,
4712                opts: &::buffa::DecodeOptions,
4713            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4714                ::core::result::Result::Ok(
4715                    MarketOverviewBatchOwnedView(
4716                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4717                    ),
4718                )
4719            }
4720            /// Build from an owned message via an encode → decode round-trip.
4721            ///
4722            /// # Errors
4723            ///
4724            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
4725            /// somehow invalid (should not happen for well-formed messages).
4726            pub fn from_owned(
4727                msg: &super::super::MarketOverviewBatch,
4728            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4729                ::core::result::Result::Ok(
4730                    MarketOverviewBatchOwnedView(::buffa::OwnedView::from_owned(msg)?),
4731                )
4732            }
4733            /// Borrow the full [`MarketOverviewBatchView`] with its lifetime tied to `&self`.
4734            #[must_use]
4735            pub fn view(&self) -> &MarketOverviewBatchView<'_> {
4736                self.0.reborrow()
4737            }
4738            /// Convert to the owned message type.
4739            ///
4740            /// # Errors
4741            ///
4742            /// Returns an error if re-materializing preserved unknown fields
4743            /// fails (e.g. the unknown-field limit is exceeded).
4744            pub fn to_owned_message(
4745                &self,
4746            ) -> ::core::result::Result<
4747                super::super::MarketOverviewBatch,
4748                ::buffa::DecodeError,
4749            > {
4750                self.0.to_owned_message()
4751            }
4752            /// The underlying bytes buffer.
4753            #[must_use]
4754            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4755                self.0.bytes()
4756            }
4757            /// Consume the handle, returning the underlying bytes buffer.
4758            #[must_use]
4759            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4760                self.0.into_bytes()
4761            }
4762            /// Market overviews included in this batch.
4763            ///
4764            /// Field 1: `markets`
4765            #[must_use]
4766            pub fn markets(
4767                &self,
4768            ) -> &::buffa::RepeatedView<
4769                '_,
4770                super::super::__buffa::view::MarketOverviewView<'_>,
4771            > {
4772                &self.0.reborrow().markets
4773            }
4774            /// Batch publish timestamp in nanoseconds since epoch.
4775            ///
4776            /// Field 2: `ts_ns`
4777            #[must_use]
4778            pub fn ts_ns(&self) -> u64 {
4779                self.0.reborrow().ts_ns
4780            }
4781        }
4782        impl ::core::convert::From<::buffa::OwnedView<MarketOverviewBatchView<'static>>>
4783        for MarketOverviewBatchOwnedView {
4784            fn from(
4785                inner: ::buffa::OwnedView<MarketOverviewBatchView<'static>>,
4786            ) -> Self {
4787                MarketOverviewBatchOwnedView(inner)
4788            }
4789        }
4790        impl ::core::convert::From<MarketOverviewBatchOwnedView>
4791        for ::buffa::OwnedView<MarketOverviewBatchView<'static>> {
4792            fn from(wrapper: MarketOverviewBatchOwnedView) -> Self {
4793                wrapper.0
4794            }
4795        }
4796        impl ::core::convert::AsRef<::buffa::OwnedView<MarketOverviewBatchView<'static>>>
4797        for MarketOverviewBatchOwnedView {
4798            fn as_ref(&self) -> &::buffa::OwnedView<MarketOverviewBatchView<'static>> {
4799                &self.0
4800            }
4801        }
4802        impl ::buffa::HasMessageView for super::super::MarketOverviewBatch {
4803            type View<'a> = MarketOverviewBatchView<'a>;
4804            type ViewHandle = MarketOverviewBatchOwnedView;
4805        }
4806        impl ::serde::Serialize for MarketOverviewBatchOwnedView {
4807            fn serialize<__S: ::serde::Serializer>(
4808                &self,
4809                __s: __S,
4810            ) -> ::core::result::Result<__S::Ok, __S::Error> {
4811                ::serde::Serialize::serialize(&self.0, __s)
4812            }
4813        }
4814    }
4815    /// Register this package's `Any` type entries and extension entries.
4816    pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
4817        reg.register_json_any(super::__ERROR_DETAIL_JSON_ANY);
4818        reg.register_json_any(super::__SPARKLINE_JSON_ANY);
4819        reg.register_json_any(super::__MARKET_OVERVIEW_JSON_ANY);
4820        reg.register_json_any(super::__LIST_MARKET_OVERVIEW_REQUEST_JSON_ANY);
4821        reg.register_json_any(super::__LIST_MARKET_OVERVIEW_RESPONSE_JSON_ANY);
4822        reg.register_json_any(super::__MARKET_OVERVIEW_BATCH_JSON_ANY);
4823    }
4824}
4825#[doc(inline)]
4826pub use self::__buffa::view::ErrorDetailView;
4827#[doc(inline)]
4828pub use self::__buffa::view::ErrorDetailOwnedView;
4829#[doc(inline)]
4830pub use self::__buffa::view::SparklineView;
4831#[doc(inline)]
4832pub use self::__buffa::view::SparklineOwnedView;
4833#[doc(inline)]
4834pub use self::__buffa::view::MarketOverviewView;
4835#[doc(inline)]
4836pub use self::__buffa::view::MarketOverviewOwnedView;
4837#[doc(inline)]
4838pub use self::__buffa::view::ListMarketOverviewRequestView;
4839#[doc(inline)]
4840pub use self::__buffa::view::ListMarketOverviewRequestOwnedView;
4841#[doc(inline)]
4842pub use self::__buffa::view::ListMarketOverviewResponseView;
4843#[doc(inline)]
4844pub use self::__buffa::view::ListMarketOverviewResponseOwnedView;
4845#[doc(inline)]
4846pub use self::__buffa::view::MarketOverviewBatchView;
4847#[doc(inline)]
4848pub use self::__buffa::view::MarketOverviewBatchOwnedView;
4849#[doc(inline)]
4850pub use self::__buffa::register_types;