Skip to main content

exoware_sdk/gen/
store.v1.query.rs

1// @generated by protoc-gen-buffa. DO NOT EDIT.
2// source: store/v1/query.proto
3
4/// Default when `RangeRequest.mode` is unset (proto3 implicit enum).
5#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
6#[repr(i32)]
7pub enum TraversalMode {
8    TRAVERSAL_MODE_FORWARD = 0i32,
9    TRAVERSAL_MODE_REVERSE = 1i32,
10}
11impl ::core::default::Default for TraversalMode {
12    fn default() -> Self {
13        Self::TRAVERSAL_MODE_FORWARD
14    }
15}
16impl ::serde::Serialize for TraversalMode {
17    fn serialize<S: ::serde::Serializer>(
18        &self,
19        s: S,
20    ) -> ::core::result::Result<S::Ok, S::Error> {
21        s.serialize_str(::buffa::Enumeration::proto_name(self))
22    }
23}
24impl<'de> ::serde::Deserialize<'de> for TraversalMode {
25    fn deserialize<D: ::serde::Deserializer<'de>>(
26        d: D,
27    ) -> ::core::result::Result<Self, D::Error> {
28        struct _V;
29        impl ::serde::de::Visitor<'_> for _V {
30            type Value = TraversalMode;
31            fn expecting(
32                &self,
33                f: &mut ::core::fmt::Formatter<'_>,
34            ) -> ::core::fmt::Result {
35                f.write_str(
36                    concat!("a string, integer, or null for ", stringify!(TraversalMode)),
37                )
38            }
39            fn visit_str<E: ::serde::de::Error>(
40                self,
41                v: &str,
42            ) -> ::core::result::Result<TraversalMode, E> {
43                <TraversalMode as ::buffa::Enumeration>::from_proto_name(v)
44                    .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
45            }
46            fn visit_i64<E: ::serde::de::Error>(
47                self,
48                v: i64,
49            ) -> ::core::result::Result<TraversalMode, E> {
50                let v32 = i32::try_from(v)
51                    .map_err(|_| {
52                        ::serde::de::Error::custom(
53                            ::buffa::alloc::format!("enum value {} out of i32 range", v),
54                        )
55                    })?;
56                <TraversalMode as ::buffa::Enumeration>::from_i32(v32)
57                    .ok_or_else(|| {
58                        ::serde::de::Error::custom(
59                            ::buffa::alloc::format!("unknown enum value {}", v32),
60                        )
61                    })
62            }
63            fn visit_u64<E: ::serde::de::Error>(
64                self,
65                v: u64,
66            ) -> ::core::result::Result<TraversalMode, E> {
67                let v32 = i32::try_from(v)
68                    .map_err(|_| {
69                        ::serde::de::Error::custom(
70                            ::buffa::alloc::format!("enum value {} out of i32 range", v),
71                        )
72                    })?;
73                <TraversalMode as ::buffa::Enumeration>::from_i32(v32)
74                    .ok_or_else(|| {
75                        ::serde::de::Error::custom(
76                            ::buffa::alloc::format!("unknown enum value {}", v32),
77                        )
78                    })
79            }
80            fn visit_unit<E: ::serde::de::Error>(
81                self,
82            ) -> ::core::result::Result<TraversalMode, E> {
83                ::core::result::Result::Ok(::core::default::Default::default())
84            }
85        }
86        d.deserialize_any(_V)
87    }
88}
89impl ::buffa::json_helpers::ProtoElemJson for TraversalMode {
90    fn serialize_proto_json<S: ::serde::Serializer>(
91        v: &Self,
92        s: S,
93    ) -> ::core::result::Result<S::Ok, S::Error> {
94        ::serde::Serialize::serialize(v, s)
95    }
96    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
97        d: D,
98    ) -> ::core::result::Result<Self, D::Error> {
99        <Self as ::serde::Deserialize>::deserialize(d)
100    }
101}
102impl ::buffa::Enumeration for TraversalMode {
103    fn from_i32(value: i32) -> ::core::option::Option<Self> {
104        match value {
105            0i32 => ::core::option::Option::Some(Self::TRAVERSAL_MODE_FORWARD),
106            1i32 => ::core::option::Option::Some(Self::TRAVERSAL_MODE_REVERSE),
107            _ => ::core::option::Option::None,
108        }
109    }
110    fn to_i32(&self) -> i32 {
111        *self as i32
112    }
113    fn proto_name(&self) -> &'static str {
114        match self {
115            Self::TRAVERSAL_MODE_FORWARD => "TRAVERSAL_MODE_FORWARD",
116            Self::TRAVERSAL_MODE_REVERSE => "TRAVERSAL_MODE_REVERSE",
117        }
118    }
119    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
120        match name {
121            "TRAVERSAL_MODE_FORWARD" => {
122                ::core::option::Option::Some(Self::TRAVERSAL_MODE_FORWARD)
123            }
124            "TRAVERSAL_MODE_REVERSE" => {
125                ::core::option::Option::Some(Self::TRAVERSAL_MODE_REVERSE)
126            }
127            _ => ::core::option::Option::None,
128        }
129    }
130}
131/// --- Range-reduction DSL (`Reduce`); mirrors `exoware_sdk::kv_codec` ---
132///
133/// Scalar type of a field extracted from a stored key or value.
134#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
135#[repr(i32)]
136pub enum KvFieldKind {
137    KV_FIELD_KIND_INT64 = 0i32,
138    KV_FIELD_KIND_UINT64 = 1i32,
139    KV_FIELD_KIND_FLOAT64 = 2i32,
140    KV_FIELD_KIND_BOOLEAN = 3i32,
141    KV_FIELD_KIND_UTF8 = 4i32,
142    /// Days since Unix epoch.
143    KV_FIELD_KIND_DATE32 = 5i32,
144    /// Milliseconds since Unix epoch.
145    KV_FIELD_KIND_DATE64 = 6i32,
146    /// Microseconds since Unix epoch.
147    KV_FIELD_KIND_TIMESTAMP = 7i32,
148    /// 16-byte little-endian decimal (Arrow Decimal128).
149    KV_FIELD_KIND_DECIMAL128 = 8i32,
150    /// Fixed-width binary; length given by `fixed_size_binary_len`.
151    KV_FIELD_KIND_FIXED_SIZE_BINARY = 9i32,
152    /// 32-byte little-endian decimal (Arrow Decimal256).
153    KV_FIELD_KIND_DECIMAL256 = 10i32,
154}
155impl ::core::default::Default for KvFieldKind {
156    fn default() -> Self {
157        Self::KV_FIELD_KIND_INT64
158    }
159}
160impl ::serde::Serialize for KvFieldKind {
161    fn serialize<S: ::serde::Serializer>(
162        &self,
163        s: S,
164    ) -> ::core::result::Result<S::Ok, S::Error> {
165        s.serialize_str(::buffa::Enumeration::proto_name(self))
166    }
167}
168impl<'de> ::serde::Deserialize<'de> for KvFieldKind {
169    fn deserialize<D: ::serde::Deserializer<'de>>(
170        d: D,
171    ) -> ::core::result::Result<Self, D::Error> {
172        struct _V;
173        impl ::serde::de::Visitor<'_> for _V {
174            type Value = KvFieldKind;
175            fn expecting(
176                &self,
177                f: &mut ::core::fmt::Formatter<'_>,
178            ) -> ::core::fmt::Result {
179                f.write_str(
180                    concat!("a string, integer, or null for ", stringify!(KvFieldKind)),
181                )
182            }
183            fn visit_str<E: ::serde::de::Error>(
184                self,
185                v: &str,
186            ) -> ::core::result::Result<KvFieldKind, E> {
187                <KvFieldKind as ::buffa::Enumeration>::from_proto_name(v)
188                    .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
189            }
190            fn visit_i64<E: ::serde::de::Error>(
191                self,
192                v: i64,
193            ) -> ::core::result::Result<KvFieldKind, E> {
194                let v32 = i32::try_from(v)
195                    .map_err(|_| {
196                        ::serde::de::Error::custom(
197                            ::buffa::alloc::format!("enum value {} out of i32 range", v),
198                        )
199                    })?;
200                <KvFieldKind as ::buffa::Enumeration>::from_i32(v32)
201                    .ok_or_else(|| {
202                        ::serde::de::Error::custom(
203                            ::buffa::alloc::format!("unknown enum value {}", v32),
204                        )
205                    })
206            }
207            fn visit_u64<E: ::serde::de::Error>(
208                self,
209                v: u64,
210            ) -> ::core::result::Result<KvFieldKind, E> {
211                let v32 = i32::try_from(v)
212                    .map_err(|_| {
213                        ::serde::de::Error::custom(
214                            ::buffa::alloc::format!("enum value {} out of i32 range", v),
215                        )
216                    })?;
217                <KvFieldKind as ::buffa::Enumeration>::from_i32(v32)
218                    .ok_or_else(|| {
219                        ::serde::de::Error::custom(
220                            ::buffa::alloc::format!("unknown enum value {}", v32),
221                        )
222                    })
223            }
224            fn visit_unit<E: ::serde::de::Error>(
225                self,
226            ) -> ::core::result::Result<KvFieldKind, E> {
227                ::core::result::Result::Ok(::core::default::Default::default())
228            }
229        }
230        d.deserialize_any(_V)
231    }
232}
233impl ::buffa::json_helpers::ProtoElemJson for KvFieldKind {
234    fn serialize_proto_json<S: ::serde::Serializer>(
235        v: &Self,
236        s: S,
237    ) -> ::core::result::Result<S::Ok, S::Error> {
238        ::serde::Serialize::serialize(v, s)
239    }
240    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
241        d: D,
242    ) -> ::core::result::Result<Self, D::Error> {
243        <Self as ::serde::Deserialize>::deserialize(d)
244    }
245}
246impl ::buffa::Enumeration for KvFieldKind {
247    fn from_i32(value: i32) -> ::core::option::Option<Self> {
248        match value {
249            0i32 => ::core::option::Option::Some(Self::KV_FIELD_KIND_INT64),
250            1i32 => ::core::option::Option::Some(Self::KV_FIELD_KIND_UINT64),
251            2i32 => ::core::option::Option::Some(Self::KV_FIELD_KIND_FLOAT64),
252            3i32 => ::core::option::Option::Some(Self::KV_FIELD_KIND_BOOLEAN),
253            4i32 => ::core::option::Option::Some(Self::KV_FIELD_KIND_UTF8),
254            5i32 => ::core::option::Option::Some(Self::KV_FIELD_KIND_DATE32),
255            6i32 => ::core::option::Option::Some(Self::KV_FIELD_KIND_DATE64),
256            7i32 => ::core::option::Option::Some(Self::KV_FIELD_KIND_TIMESTAMP),
257            8i32 => ::core::option::Option::Some(Self::KV_FIELD_KIND_DECIMAL128),
258            9i32 => ::core::option::Option::Some(Self::KV_FIELD_KIND_FIXED_SIZE_BINARY),
259            10i32 => ::core::option::Option::Some(Self::KV_FIELD_KIND_DECIMAL256),
260            _ => ::core::option::Option::None,
261        }
262    }
263    fn to_i32(&self) -> i32 {
264        *self as i32
265    }
266    fn proto_name(&self) -> &'static str {
267        match self {
268            Self::KV_FIELD_KIND_INT64 => "KV_FIELD_KIND_INT64",
269            Self::KV_FIELD_KIND_UINT64 => "KV_FIELD_KIND_UINT64",
270            Self::KV_FIELD_KIND_FLOAT64 => "KV_FIELD_KIND_FLOAT64",
271            Self::KV_FIELD_KIND_BOOLEAN => "KV_FIELD_KIND_BOOLEAN",
272            Self::KV_FIELD_KIND_UTF8 => "KV_FIELD_KIND_UTF8",
273            Self::KV_FIELD_KIND_DATE32 => "KV_FIELD_KIND_DATE32",
274            Self::KV_FIELD_KIND_DATE64 => "KV_FIELD_KIND_DATE64",
275            Self::KV_FIELD_KIND_TIMESTAMP => "KV_FIELD_KIND_TIMESTAMP",
276            Self::KV_FIELD_KIND_DECIMAL128 => "KV_FIELD_KIND_DECIMAL128",
277            Self::KV_FIELD_KIND_FIXED_SIZE_BINARY => "KV_FIELD_KIND_FIXED_SIZE_BINARY",
278            Self::KV_FIELD_KIND_DECIMAL256 => "KV_FIELD_KIND_DECIMAL256",
279        }
280    }
281    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
282        match name {
283            "KV_FIELD_KIND_INT64" => {
284                ::core::option::Option::Some(Self::KV_FIELD_KIND_INT64)
285            }
286            "KV_FIELD_KIND_UINT64" => {
287                ::core::option::Option::Some(Self::KV_FIELD_KIND_UINT64)
288            }
289            "KV_FIELD_KIND_FLOAT64" => {
290                ::core::option::Option::Some(Self::KV_FIELD_KIND_FLOAT64)
291            }
292            "KV_FIELD_KIND_BOOLEAN" => {
293                ::core::option::Option::Some(Self::KV_FIELD_KIND_BOOLEAN)
294            }
295            "KV_FIELD_KIND_UTF8" => {
296                ::core::option::Option::Some(Self::KV_FIELD_KIND_UTF8)
297            }
298            "KV_FIELD_KIND_DATE32" => {
299                ::core::option::Option::Some(Self::KV_FIELD_KIND_DATE32)
300            }
301            "KV_FIELD_KIND_DATE64" => {
302                ::core::option::Option::Some(Self::KV_FIELD_KIND_DATE64)
303            }
304            "KV_FIELD_KIND_TIMESTAMP" => {
305                ::core::option::Option::Some(Self::KV_FIELD_KIND_TIMESTAMP)
306            }
307            "KV_FIELD_KIND_DECIMAL128" => {
308                ::core::option::Option::Some(Self::KV_FIELD_KIND_DECIMAL128)
309            }
310            "KV_FIELD_KIND_FIXED_SIZE_BINARY" => {
311                ::core::option::Option::Some(Self::KV_FIELD_KIND_FIXED_SIZE_BINARY)
312            }
313            "KV_FIELD_KIND_DECIMAL256" => {
314                ::core::option::Option::Some(Self::KV_FIELD_KIND_DECIMAL256)
315            }
316            _ => ::core::option::Option::None,
317        }
318    }
319}
320/// Aggregation operation applied by a reducer.
321#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
322#[repr(i32)]
323pub enum RangeReduceOp {
324    /// Count every row (ignores `expr`; `expr` must not be set).
325    RANGE_REDUCE_OP_COUNT_ALL = 0i32,
326    /// Count rows where `expr` evaluates to a non-NULL value.
327    RANGE_REDUCE_OP_COUNT_FIELD = 1i32,
328    /// Sum of `expr` across rows (numeric types only).
329    RANGE_REDUCE_OP_SUM_FIELD = 2i32,
330    /// Minimum value of `expr` across rows.
331    RANGE_REDUCE_OP_MIN_FIELD = 3i32,
332    /// Maximum value of `expr` across rows.
333    RANGE_REDUCE_OP_MAX_FIELD = 4i32,
334}
335impl ::core::default::Default for RangeReduceOp {
336    fn default() -> Self {
337        Self::RANGE_REDUCE_OP_COUNT_ALL
338    }
339}
340impl ::serde::Serialize for RangeReduceOp {
341    fn serialize<S: ::serde::Serializer>(
342        &self,
343        s: S,
344    ) -> ::core::result::Result<S::Ok, S::Error> {
345        s.serialize_str(::buffa::Enumeration::proto_name(self))
346    }
347}
348impl<'de> ::serde::Deserialize<'de> for RangeReduceOp {
349    fn deserialize<D: ::serde::Deserializer<'de>>(
350        d: D,
351    ) -> ::core::result::Result<Self, D::Error> {
352        struct _V;
353        impl ::serde::de::Visitor<'_> for _V {
354            type Value = RangeReduceOp;
355            fn expecting(
356                &self,
357                f: &mut ::core::fmt::Formatter<'_>,
358            ) -> ::core::fmt::Result {
359                f.write_str(
360                    concat!("a string, integer, or null for ", stringify!(RangeReduceOp)),
361                )
362            }
363            fn visit_str<E: ::serde::de::Error>(
364                self,
365                v: &str,
366            ) -> ::core::result::Result<RangeReduceOp, E> {
367                <RangeReduceOp as ::buffa::Enumeration>::from_proto_name(v)
368                    .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
369            }
370            fn visit_i64<E: ::serde::de::Error>(
371                self,
372                v: i64,
373            ) -> ::core::result::Result<RangeReduceOp, E> {
374                let v32 = i32::try_from(v)
375                    .map_err(|_| {
376                        ::serde::de::Error::custom(
377                            ::buffa::alloc::format!("enum value {} out of i32 range", v),
378                        )
379                    })?;
380                <RangeReduceOp as ::buffa::Enumeration>::from_i32(v32)
381                    .ok_or_else(|| {
382                        ::serde::de::Error::custom(
383                            ::buffa::alloc::format!("unknown enum value {}", v32),
384                        )
385                    })
386            }
387            fn visit_u64<E: ::serde::de::Error>(
388                self,
389                v: u64,
390            ) -> ::core::result::Result<RangeReduceOp, E> {
391                let v32 = i32::try_from(v)
392                    .map_err(|_| {
393                        ::serde::de::Error::custom(
394                            ::buffa::alloc::format!("enum value {} out of i32 range", v),
395                        )
396                    })?;
397                <RangeReduceOp as ::buffa::Enumeration>::from_i32(v32)
398                    .ok_or_else(|| {
399                        ::serde::de::Error::custom(
400                            ::buffa::alloc::format!("unknown enum value {}", v32),
401                        )
402                    })
403            }
404            fn visit_unit<E: ::serde::de::Error>(
405                self,
406            ) -> ::core::result::Result<RangeReduceOp, E> {
407                ::core::result::Result::Ok(::core::default::Default::default())
408            }
409        }
410        d.deserialize_any(_V)
411    }
412}
413impl ::buffa::json_helpers::ProtoElemJson for RangeReduceOp {
414    fn serialize_proto_json<S: ::serde::Serializer>(
415        v: &Self,
416        s: S,
417    ) -> ::core::result::Result<S::Ok, S::Error> {
418        ::serde::Serialize::serialize(v, s)
419    }
420    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
421        d: D,
422    ) -> ::core::result::Result<Self, D::Error> {
423        <Self as ::serde::Deserialize>::deserialize(d)
424    }
425}
426impl ::buffa::Enumeration for RangeReduceOp {
427    fn from_i32(value: i32) -> ::core::option::Option<Self> {
428        match value {
429            0i32 => ::core::option::Option::Some(Self::RANGE_REDUCE_OP_COUNT_ALL),
430            1i32 => ::core::option::Option::Some(Self::RANGE_REDUCE_OP_COUNT_FIELD),
431            2i32 => ::core::option::Option::Some(Self::RANGE_REDUCE_OP_SUM_FIELD),
432            3i32 => ::core::option::Option::Some(Self::RANGE_REDUCE_OP_MIN_FIELD),
433            4i32 => ::core::option::Option::Some(Self::RANGE_REDUCE_OP_MAX_FIELD),
434            _ => ::core::option::Option::None,
435        }
436    }
437    fn to_i32(&self) -> i32 {
438        *self as i32
439    }
440    fn proto_name(&self) -> &'static str {
441        match self {
442            Self::RANGE_REDUCE_OP_COUNT_ALL => "RANGE_REDUCE_OP_COUNT_ALL",
443            Self::RANGE_REDUCE_OP_COUNT_FIELD => "RANGE_REDUCE_OP_COUNT_FIELD",
444            Self::RANGE_REDUCE_OP_SUM_FIELD => "RANGE_REDUCE_OP_SUM_FIELD",
445            Self::RANGE_REDUCE_OP_MIN_FIELD => "RANGE_REDUCE_OP_MIN_FIELD",
446            Self::RANGE_REDUCE_OP_MAX_FIELD => "RANGE_REDUCE_OP_MAX_FIELD",
447        }
448    }
449    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
450        match name {
451            "RANGE_REDUCE_OP_COUNT_ALL" => {
452                ::core::option::Option::Some(Self::RANGE_REDUCE_OP_COUNT_ALL)
453            }
454            "RANGE_REDUCE_OP_COUNT_FIELD" => {
455                ::core::option::Option::Some(Self::RANGE_REDUCE_OP_COUNT_FIELD)
456            }
457            "RANGE_REDUCE_OP_SUM_FIELD" => {
458                ::core::option::Option::Some(Self::RANGE_REDUCE_OP_SUM_FIELD)
459            }
460            "RANGE_REDUCE_OP_MIN_FIELD" => {
461                ::core::option::Option::Some(Self::RANGE_REDUCE_OP_MIN_FIELD)
462            }
463            "RANGE_REDUCE_OP_MAX_FIELD" => {
464                ::core::option::Option::Some(Self::RANGE_REDUCE_OP_MAX_FIELD)
465            }
466            _ => ::core::option::Option::None,
467        }
468    }
469}
470/// --- Query wire types ---
471///
472/// Visible store sequence number plus read counters for query RPCs. On success, carried in unary
473/// response metadata (`Get` / `Reduce`) or streaming trailers (`Range` / `GetMany`); also attached as a `google.rpc` error
474/// detail when the RPC fails (same message shape in both cases).
475///
476/// The reference RocksDB engine reports `read_bytes`: the sum of key length plus value length for
477/// each entry read by the RPC (for `Get`, the looked-up key plus returned value if any).
478#[derive(Clone, PartialEq, Default)]
479#[derive(::serde::Serialize, ::serde::Deserialize)]
480#[serde(default)]
481pub struct Detail {
482    /// Field 1: `sequence_number`
483    #[serde(
484        rename = "sequenceNumber",
485        alias = "sequence_number",
486        with = "::buffa::json_helpers::uint64",
487        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
488    )]
489    pub sequence_number: u64,
490    /// Field 2: `read_stats`
491    #[serde(
492        rename = "readStats",
493        alias = "read_stats",
494        with = "::buffa::json_helpers::proto_map",
495        skip_serializing_if = "::buffa::__private::HashMap::is_empty"
496    )]
497    pub read_stats: ::buffa::__private::HashMap<::buffa::alloc::string::String, u64>,
498    #[serde(skip)]
499    #[doc(hidden)]
500    pub __buffa_unknown_fields: ::buffa::UnknownFields,
501    #[doc(hidden)]
502    #[serde(skip)]
503    pub __buffa_cached_size: ::buffa::__private::CachedSize,
504}
505impl ::core::fmt::Debug for Detail {
506    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
507        f.debug_struct("Detail")
508            .field("sequence_number", &self.sequence_number)
509            .field("read_stats", &self.read_stats)
510            .finish()
511    }
512}
513impl Detail {
514    /// Protobuf type URL for this message, for use with `Any::pack` and
515    /// `Any::unpack_if`.
516    ///
517    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
518    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.Detail";
519}
520unsafe impl ::buffa::DefaultInstance for Detail {
521    fn default_instance() -> &'static Self {
522        static VALUE: ::buffa::__private::OnceBox<Detail> = ::buffa::__private::OnceBox::new();
523        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
524    }
525}
526impl ::buffa::Message for Detail {
527    /// Returns the total encoded size in bytes.
528    ///
529    /// The result is a `u32`; the protobuf specification requires all
530    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
531    /// compliant message will never overflow this type.
532    fn compute_size(&self) -> u32 {
533        #[allow(unused_imports)]
534        use ::buffa::Enumeration as _;
535        let mut size = 0u32;
536        if self.sequence_number != 0u64 {
537            size
538                += 1u32
539                    + ::buffa::types::uint64_encoded_len(self.sequence_number) as u32;
540        }
541        for (k, v) in &self.read_stats {
542            let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
543                + 1u32 + ::buffa::types::uint64_encoded_len(*v) as u32;
544            size
545                += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
546                    + entry_size;
547        }
548        size += self.__buffa_unknown_fields.encoded_len() as u32;
549        self.__buffa_cached_size.set(size);
550        size
551    }
552    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
553        #[allow(unused_imports)]
554        use ::buffa::Enumeration as _;
555        if self.sequence_number != 0u64 {
556            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
557                .encode(buf);
558            ::buffa::types::encode_uint64(self.sequence_number, buf);
559        }
560        for (k, v) in &self.read_stats {
561            let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
562                + 1u32 + ::buffa::types::uint64_encoded_len(*v) as u32;
563            ::buffa::encoding::Tag::new(
564                    2u32,
565                    ::buffa::encoding::WireType::LengthDelimited,
566                )
567                .encode(buf);
568            ::buffa::encoding::encode_varint(entry_size as u64, buf);
569            ::buffa::encoding::Tag::new(
570                    1u32,
571                    ::buffa::encoding::WireType::LengthDelimited,
572                )
573                .encode(buf);
574            ::buffa::types::encode_string(k, buf);
575            ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
576                .encode(buf);
577            ::buffa::types::encode_uint64(*v, buf);
578        }
579        self.__buffa_unknown_fields.write_to(buf);
580    }
581    fn merge_field(
582        &mut self,
583        tag: ::buffa::encoding::Tag,
584        buf: &mut impl ::buffa::bytes::Buf,
585        depth: u32,
586    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
587        #[allow(unused_imports)]
588        use ::buffa::bytes::Buf as _;
589        #[allow(unused_imports)]
590        use ::buffa::Enumeration as _;
591        match tag.field_number() {
592            1u32 => {
593                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
594                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
595                        field_number: 1u32,
596                        expected: 0u8,
597                        actual: tag.wire_type() as u8,
598                    });
599                }
600                self.sequence_number = ::buffa::types::decode_uint64(buf)?;
601            }
602            2u32 => {
603                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
604                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
605                        field_number: 2u32,
606                        expected: 2u8,
607                        actual: tag.wire_type() as u8,
608                    });
609                }
610                let entry_len = ::buffa::encoding::decode_varint(buf)?;
611                let entry_len = usize::try_from(entry_len)
612                    .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
613                if buf.remaining() < entry_len {
614                    return ::core::result::Result::Err(
615                        ::buffa::DecodeError::UnexpectedEof,
616                    );
617                }
618                let entry_limit = buf.remaining() - entry_len;
619                let mut key = ::core::default::Default::default();
620                let mut val = ::core::default::Default::default();
621                while buf.remaining() > entry_limit {
622                    let entry_tag = ::buffa::encoding::Tag::decode(buf)?;
623                    match entry_tag.field_number() {
624                        1 => {
625                            if entry_tag.wire_type()
626                                != ::buffa::encoding::WireType::LengthDelimited
627                            {
628                                return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
629                                    field_number: entry_tag.field_number(),
630                                    expected: 2u8,
631                                    actual: entry_tag.wire_type() as u8,
632                                });
633                            }
634                            key = ::buffa::types::decode_string(buf)?;
635                        }
636                        2 => {
637                            if entry_tag.wire_type()
638                                != ::buffa::encoding::WireType::Varint
639                            {
640                                return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
641                                    field_number: entry_tag.field_number(),
642                                    expected: 0u8,
643                                    actual: entry_tag.wire_type() as u8,
644                                });
645                            }
646                            val = ::buffa::types::decode_uint64(buf)?;
647                        }
648                        _ => {
649                            ::buffa::encoding::skip_field_depth(entry_tag, buf, depth)?;
650                        }
651                    }
652                }
653                if buf.remaining() != entry_limit {
654                    let remaining = buf.remaining();
655                    if remaining > entry_limit {
656                        buf.advance(remaining - entry_limit);
657                    } else {
658                        return ::core::result::Result::Err(
659                            ::buffa::DecodeError::UnexpectedEof,
660                        );
661                    }
662                }
663                self.read_stats.insert(key, val);
664            }
665            _ => {
666                self.__buffa_unknown_fields
667                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
668            }
669        }
670        ::core::result::Result::Ok(())
671    }
672    fn cached_size(&self) -> u32 {
673        self.__buffa_cached_size.get()
674    }
675    fn clear(&mut self) {
676        self.sequence_number = 0u64;
677        self.read_stats.clear();
678        self.__buffa_unknown_fields.clear();
679        self.__buffa_cached_size.set(0);
680    }
681}
682impl ::buffa::ExtensionSet for Detail {
683    const PROTO_FQN: &'static str = "store.query.v1.Detail";
684    fn unknown_fields(&self) -> &::buffa::UnknownFields {
685        &self.__buffa_unknown_fields
686    }
687    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
688        &mut self.__buffa_unknown_fields
689    }
690}
691impl ::buffa::json_helpers::ProtoElemJson for Detail {
692    fn serialize_proto_json<S: ::serde::Serializer>(
693        v: &Self,
694        s: S,
695    ) -> ::core::result::Result<S::Ok, S::Error> {
696        ::serde::Serialize::serialize(v, s)
697    }
698    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
699        d: D,
700    ) -> ::core::result::Result<Self, D::Error> {
701        <Self as ::serde::Deserialize>::deserialize(d)
702    }
703}
704#[doc(hidden)]
705pub const __DETAIL_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
706    type_url: "type.googleapis.com/store.query.v1.Detail",
707    to_json: ::buffa::type_registry::any_to_json::<Detail>,
708    from_json: ::buffa::type_registry::any_from_json::<Detail>,
709    is_wkt: false,
710};
711/// --- Query wire types ---
712///
713/// Visible store sequence number plus read counters for query RPCs. On success, carried in unary
714/// response metadata (`Get` / `Reduce`) or streaming trailers (`Range` / `GetMany`); also attached as a `google.rpc` error
715/// detail when the RPC fails (same message shape in both cases).
716///
717/// The reference RocksDB engine reports `read_bytes`: the sum of key length plus value length for
718/// each entry read by the RPC (for `Get`, the looked-up key plus returned value if any).
719#[derive(Clone, Debug, Default)]
720pub struct DetailView<'a> {
721    /// Field 1: `sequence_number`
722    pub sequence_number: u64,
723    /// Field 2: `read_stats` (map)
724    pub read_stats: ::buffa::MapView<'a, &'a str, u64>,
725    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
726}
727impl<'a> DetailView<'a> {
728    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
729    ///
730    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
731    /// and by generated sub-message decode arms with `depth - 1`.
732    ///
733    /// **Not part of the public API.** Named with a leading underscore to
734    /// signal that it is for generated-code use only.
735    #[doc(hidden)]
736    pub fn _decode_depth(
737        buf: &'a [u8],
738        depth: u32,
739    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
740        let mut view = Self::default();
741        view._merge_into_view(buf, depth)?;
742        ::core::result::Result::Ok(view)
743    }
744    /// Merge fields from `buf` into this view (proto merge semantics).
745    ///
746    /// Repeated fields append; singular fields last-wins; singular
747    /// MESSAGE fields merge recursively. Used by sub-message decode
748    /// arms when the same field appears multiple times on the wire.
749    ///
750    /// **Not part of the public API.**
751    #[doc(hidden)]
752    pub fn _merge_into_view(
753        &mut self,
754        buf: &'a [u8],
755        depth: u32,
756    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
757        let _ = depth;
758        #[allow(unused_variables)]
759        let view = self;
760        let mut cur: &'a [u8] = buf;
761        while !cur.is_empty() {
762            let before_tag = cur;
763            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
764            match tag.field_number() {
765                1u32 => {
766                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
767                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
768                            field_number: 1u32,
769                            expected: 0u8,
770                            actual: tag.wire_type() as u8,
771                        });
772                    }
773                    view.sequence_number = ::buffa::types::decode_uint64(&mut cur)?;
774                }
775                2u32 => {
776                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
777                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
778                            field_number: 2u32,
779                            expected: 2u8,
780                            actual: tag.wire_type() as u8,
781                        });
782                    }
783                    let entry_bytes = ::buffa::types::borrow_bytes(&mut cur)?;
784                    let mut entry_cur: &'a [u8] = entry_bytes;
785                    let mut key = "";
786                    let mut val = ::core::default::Default::default();
787                    while !entry_cur.is_empty() {
788                        let entry_tag = ::buffa::encoding::Tag::decode(&mut entry_cur)?;
789                        match entry_tag.field_number() {
790                            1 => {
791                                if entry_tag.wire_type()
792                                    != ::buffa::encoding::WireType::LengthDelimited
793                                {
794                                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
795                                        field_number: entry_tag.field_number(),
796                                        expected: 2u8,
797                                        actual: entry_tag.wire_type() as u8,
798                                    });
799                                }
800                                key = ::buffa::types::borrow_str(&mut entry_cur)?;
801                            }
802                            2 => {
803                                if entry_tag.wire_type()
804                                    != ::buffa::encoding::WireType::Varint
805                                {
806                                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
807                                        field_number: entry_tag.field_number(),
808                                        expected: 0u8,
809                                        actual: entry_tag.wire_type() as u8,
810                                    });
811                                }
812                                val = ::buffa::types::decode_uint64(&mut entry_cur)?;
813                            }
814                            _ => {
815                                ::buffa::encoding::skip_field_depth(
816                                    entry_tag,
817                                    &mut entry_cur,
818                                    depth,
819                                )?;
820                            }
821                        }
822                    }
823                    view.read_stats.push(key, val);
824                }
825                _ => {
826                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
827                    let span_len = before_tag.len() - cur.len();
828                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
829                }
830            }
831        }
832        ::core::result::Result::Ok(())
833    }
834}
835impl<'a> ::buffa::MessageView<'a> for DetailView<'a> {
836    type Owned = Detail;
837    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
838        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
839    }
840    fn decode_view_with_limit(
841        buf: &'a [u8],
842        depth: u32,
843    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
844        Self::_decode_depth(buf, depth)
845    }
846    /// Convert this view to the owned message type.
847    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
848    fn to_owned_message(&self) -> Detail {
849        #[allow(unused_imports)]
850        use ::buffa::alloc::string::ToString as _;
851        Detail {
852            sequence_number: self.sequence_number,
853            read_stats: self
854                .read_stats
855                .iter()
856                .map(|(k, v)| (k.to_string(), *v))
857                .collect(),
858            __buffa_unknown_fields: self
859                .__buffa_unknown_fields
860                .to_owned()
861                .unwrap_or_default()
862                .into(),
863            ..::core::default::Default::default()
864        }
865    }
866}
867unsafe impl ::buffa::DefaultViewInstance for DetailView<'static> {
868    fn default_view_instance() -> &'static Self {
869        static VALUE: ::buffa::__private::OnceBox<DetailView<'static>> = ::buffa::__private::OnceBox::new();
870        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
871    }
872}
873unsafe impl<'a> ::buffa::HasDefaultViewInstance for DetailView<'a> {
874    type Static = DetailView<'static>;
875}
876/// Reference to a typed field inside a stored key or value. Used by KvExpr
877/// and KvPredicateCheck to locate the data to evaluate.
878#[derive(Clone, PartialEq, Default)]
879#[derive(::serde::Serialize)]
880#[serde(default)]
881pub struct KvFieldRef {
882    #[serde(flatten)]
883    pub field: Option<kv_field_ref::Field>,
884    #[serde(skip)]
885    #[doc(hidden)]
886    pub __buffa_unknown_fields: ::buffa::UnknownFields,
887    #[doc(hidden)]
888    #[serde(skip)]
889    pub __buffa_cached_size: ::buffa::__private::CachedSize,
890}
891impl ::core::fmt::Debug for KvFieldRef {
892    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
893        f.debug_struct("KvFieldRef").field("field", &self.field).finish()
894    }
895}
896impl KvFieldRef {
897    /// Protobuf type URL for this message, for use with `Any::pack` and
898    /// `Any::unpack_if`.
899    ///
900    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
901    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvFieldRef";
902}
903unsafe impl ::buffa::DefaultInstance for KvFieldRef {
904    fn default_instance() -> &'static Self {
905        static VALUE: ::buffa::__private::OnceBox<KvFieldRef> = ::buffa::__private::OnceBox::new();
906        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
907    }
908}
909impl ::buffa::Message for KvFieldRef {
910    /// Returns the total encoded size in bytes.
911    ///
912    /// The result is a `u32`; the protobuf specification requires all
913    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
914    /// compliant message will never overflow this type.
915    fn compute_size(&self) -> u32 {
916        #[allow(unused_imports)]
917        use ::buffa::Enumeration as _;
918        let mut size = 0u32;
919        if let ::core::option::Option::Some(ref v) = self.field {
920            match v {
921                kv_field_ref::Field::Key(x) => {
922                    let inner = x.compute_size();
923                    size
924                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
925                            + inner;
926                }
927                kv_field_ref::Field::ZOrderKey(x) => {
928                    let inner = x.compute_size();
929                    size
930                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
931                            + inner;
932                }
933                kv_field_ref::Field::Value(x) => {
934                    let inner = x.compute_size();
935                    size
936                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
937                            + inner;
938                }
939            }
940        }
941        size += self.__buffa_unknown_fields.encoded_len() as u32;
942        self.__buffa_cached_size.set(size);
943        size
944    }
945    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
946        #[allow(unused_imports)]
947        use ::buffa::Enumeration as _;
948        if let ::core::option::Option::Some(ref v) = self.field {
949            match v {
950                kv_field_ref::Field::Key(x) => {
951                    ::buffa::encoding::Tag::new(
952                            1u32,
953                            ::buffa::encoding::WireType::LengthDelimited,
954                        )
955                        .encode(buf);
956                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
957                    x.write_to(buf);
958                }
959                kv_field_ref::Field::ZOrderKey(x) => {
960                    ::buffa::encoding::Tag::new(
961                            2u32,
962                            ::buffa::encoding::WireType::LengthDelimited,
963                        )
964                        .encode(buf);
965                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
966                    x.write_to(buf);
967                }
968                kv_field_ref::Field::Value(x) => {
969                    ::buffa::encoding::Tag::new(
970                            3u32,
971                            ::buffa::encoding::WireType::LengthDelimited,
972                        )
973                        .encode(buf);
974                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
975                    x.write_to(buf);
976                }
977            }
978        }
979        self.__buffa_unknown_fields.write_to(buf);
980    }
981    fn merge_field(
982        &mut self,
983        tag: ::buffa::encoding::Tag,
984        buf: &mut impl ::buffa::bytes::Buf,
985        depth: u32,
986    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
987        #[allow(unused_imports)]
988        use ::buffa::bytes::Buf as _;
989        #[allow(unused_imports)]
990        use ::buffa::Enumeration as _;
991        match tag.field_number() {
992            1u32 => {
993                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
994                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
995                        field_number: 1u32,
996                        expected: 2u8,
997                        actual: tag.wire_type() as u8,
998                    });
999                }
1000                if let ::core::option::Option::Some(
1001                    kv_field_ref::Field::Key(ref mut existing),
1002                ) = self.field
1003                {
1004                    ::buffa::Message::merge_length_delimited(
1005                        &mut **existing,
1006                        buf,
1007                        depth,
1008                    )?;
1009                } else {
1010                    let mut val = ::core::default::Default::default();
1011                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
1012                    self.field = ::core::option::Option::Some(
1013                        kv_field_ref::Field::Key(::buffa::alloc::boxed::Box::new(val)),
1014                    );
1015                }
1016            }
1017            2u32 => {
1018                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1019                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1020                        field_number: 2u32,
1021                        expected: 2u8,
1022                        actual: tag.wire_type() as u8,
1023                    });
1024                }
1025                if let ::core::option::Option::Some(
1026                    kv_field_ref::Field::ZOrderKey(ref mut existing),
1027                ) = self.field
1028                {
1029                    ::buffa::Message::merge_length_delimited(
1030                        &mut **existing,
1031                        buf,
1032                        depth,
1033                    )?;
1034                } else {
1035                    let mut val = ::core::default::Default::default();
1036                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
1037                    self.field = ::core::option::Option::Some(
1038                        kv_field_ref::Field::ZOrderKey(
1039                            ::buffa::alloc::boxed::Box::new(val),
1040                        ),
1041                    );
1042                }
1043            }
1044            3u32 => {
1045                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1046                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1047                        field_number: 3u32,
1048                        expected: 2u8,
1049                        actual: tag.wire_type() as u8,
1050                    });
1051                }
1052                if let ::core::option::Option::Some(
1053                    kv_field_ref::Field::Value(ref mut existing),
1054                ) = self.field
1055                {
1056                    ::buffa::Message::merge_length_delimited(
1057                        &mut **existing,
1058                        buf,
1059                        depth,
1060                    )?;
1061                } else {
1062                    let mut val = ::core::default::Default::default();
1063                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
1064                    self.field = ::core::option::Option::Some(
1065                        kv_field_ref::Field::Value(::buffa::alloc::boxed::Box::new(val)),
1066                    );
1067                }
1068            }
1069            _ => {
1070                self.__buffa_unknown_fields
1071                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1072            }
1073        }
1074        ::core::result::Result::Ok(())
1075    }
1076    fn cached_size(&self) -> u32 {
1077        self.__buffa_cached_size.get()
1078    }
1079    fn clear(&mut self) {
1080        self.field = ::core::option::Option::None;
1081        self.__buffa_unknown_fields.clear();
1082        self.__buffa_cached_size.set(0);
1083    }
1084}
1085impl ::buffa::ExtensionSet for KvFieldRef {
1086    const PROTO_FQN: &'static str = "store.query.v1.KvFieldRef";
1087    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1088        &self.__buffa_unknown_fields
1089    }
1090    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1091        &mut self.__buffa_unknown_fields
1092    }
1093}
1094impl<'de> serde::Deserialize<'de> for KvFieldRef {
1095    fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
1096        struct _V;
1097        impl<'de> serde::de::Visitor<'de> for _V {
1098            type Value = KvFieldRef;
1099            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1100                f.write_str("struct KvFieldRef")
1101            }
1102            #[allow(clippy::field_reassign_with_default)]
1103            fn visit_map<A: serde::de::MapAccess<'de>>(
1104                self,
1105                mut map: A,
1106            ) -> Result<KvFieldRef, A::Error> {
1107                let mut __oneof_field: Option<kv_field_ref::Field> = None;
1108                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
1109                    match key.as_str() {
1110                        "key" => {
1111                            let v: Option<kv_field_ref::KeyField> = map
1112                                .next_value_seed(
1113                                    ::buffa::json_helpers::NullableDeserializeSeed(
1114                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
1115                                            kv_field_ref::KeyField,
1116                                        >::new(),
1117                                    ),
1118                                )?;
1119                            if let Some(v) = v {
1120                                if __oneof_field.is_some() {
1121                                    return Err(
1122                                        serde::de::Error::custom(
1123                                            "multiple oneof fields set for 'field'",
1124                                        ),
1125                                    );
1126                                }
1127                                __oneof_field = Some(
1128                                    kv_field_ref::Field::Key(::buffa::alloc::boxed::Box::new(v)),
1129                                );
1130                            }
1131                        }
1132                        "zOrderKey" | "z_order_key" => {
1133                            let v: Option<kv_field_ref::ZOrderKeyField> = map
1134                                .next_value_seed(
1135                                    ::buffa::json_helpers::NullableDeserializeSeed(
1136                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
1137                                            kv_field_ref::ZOrderKeyField,
1138                                        >::new(),
1139                                    ),
1140                                )?;
1141                            if let Some(v) = v {
1142                                if __oneof_field.is_some() {
1143                                    return Err(
1144                                        serde::de::Error::custom(
1145                                            "multiple oneof fields set for 'field'",
1146                                        ),
1147                                    );
1148                                }
1149                                __oneof_field = Some(
1150                                    kv_field_ref::Field::ZOrderKey(
1151                                        ::buffa::alloc::boxed::Box::new(v),
1152                                    ),
1153                                );
1154                            }
1155                        }
1156                        "value" => {
1157                            let v: Option<kv_field_ref::ValueField> = map
1158                                .next_value_seed(
1159                                    ::buffa::json_helpers::NullableDeserializeSeed(
1160                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
1161                                            kv_field_ref::ValueField,
1162                                        >::new(),
1163                                    ),
1164                                )?;
1165                            if let Some(v) = v {
1166                                if __oneof_field.is_some() {
1167                                    return Err(
1168                                        serde::de::Error::custom(
1169                                            "multiple oneof fields set for 'field'",
1170                                        ),
1171                                    );
1172                                }
1173                                __oneof_field = Some(
1174                                    kv_field_ref::Field::Value(
1175                                        ::buffa::alloc::boxed::Box::new(v),
1176                                    ),
1177                                );
1178                            }
1179                        }
1180                        _ => {
1181                            map.next_value::<serde::de::IgnoredAny>()?;
1182                        }
1183                    }
1184                }
1185                let mut __r = <KvFieldRef as ::core::default::Default>::default();
1186                __r.field = __oneof_field;
1187                Ok(__r)
1188            }
1189        }
1190        d.deserialize_map(_V)
1191    }
1192}
1193impl ::buffa::json_helpers::ProtoElemJson for KvFieldRef {
1194    fn serialize_proto_json<S: ::serde::Serializer>(
1195        v: &Self,
1196        s: S,
1197    ) -> ::core::result::Result<S::Ok, S::Error> {
1198        ::serde::Serialize::serialize(v, s)
1199    }
1200    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1201        d: D,
1202    ) -> ::core::result::Result<Self, D::Error> {
1203        <Self as ::serde::Deserialize>::deserialize(d)
1204    }
1205}
1206#[doc(hidden)]
1207pub const __KV_FIELD_REF_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1208    type_url: "type.googleapis.com/store.query.v1.KvFieldRef",
1209    to_json: ::buffa::type_registry::any_to_json::<KvFieldRef>,
1210    from_json: ::buffa::type_registry::any_from_json::<KvFieldRef>,
1211    is_wkt: false,
1212};
1213/// Reference to a typed field inside a stored key or value. Used by KvExpr
1214/// and KvPredicateCheck to locate the data to evaluate.
1215#[derive(Clone, Debug, Default)]
1216pub struct KvFieldRefView<'a> {
1217    pub field: ::core::option::Option<kv_field_ref::FieldView<'a>>,
1218    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1219}
1220impl<'a> KvFieldRefView<'a> {
1221    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
1222    ///
1223    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
1224    /// and by generated sub-message decode arms with `depth - 1`.
1225    ///
1226    /// **Not part of the public API.** Named with a leading underscore to
1227    /// signal that it is for generated-code use only.
1228    #[doc(hidden)]
1229    pub fn _decode_depth(
1230        buf: &'a [u8],
1231        depth: u32,
1232    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1233        let mut view = Self::default();
1234        view._merge_into_view(buf, depth)?;
1235        ::core::result::Result::Ok(view)
1236    }
1237    /// Merge fields from `buf` into this view (proto merge semantics).
1238    ///
1239    /// Repeated fields append; singular fields last-wins; singular
1240    /// MESSAGE fields merge recursively. Used by sub-message decode
1241    /// arms when the same field appears multiple times on the wire.
1242    ///
1243    /// **Not part of the public API.**
1244    #[doc(hidden)]
1245    pub fn _merge_into_view(
1246        &mut self,
1247        buf: &'a [u8],
1248        depth: u32,
1249    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1250        let _ = depth;
1251        #[allow(unused_variables)]
1252        let view = self;
1253        let mut cur: &'a [u8] = buf;
1254        while !cur.is_empty() {
1255            let before_tag = cur;
1256            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
1257            match tag.field_number() {
1258                1u32 => {
1259                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1260                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1261                            field_number: 1u32,
1262                            expected: 2u8,
1263                            actual: tag.wire_type() as u8,
1264                        });
1265                    }
1266                    if depth == 0 {
1267                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
1268                    }
1269                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
1270                    if let Some(kv_field_ref::FieldView::Key(ref mut existing)) = view
1271                        .field
1272                    {
1273                        existing._merge_into_view(sub, depth - 1)?;
1274                    } else {
1275                        view.field = Some(
1276                            kv_field_ref::FieldView::Key(
1277                                ::buffa::alloc::boxed::Box::new(
1278                                    kv_field_ref::KeyFieldView::_decode_depth(sub, depth - 1)?,
1279                                ),
1280                            ),
1281                        );
1282                    }
1283                }
1284                2u32 => {
1285                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1286                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1287                            field_number: 2u32,
1288                            expected: 2u8,
1289                            actual: tag.wire_type() as u8,
1290                        });
1291                    }
1292                    if depth == 0 {
1293                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
1294                    }
1295                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
1296                    if let Some(kv_field_ref::FieldView::ZOrderKey(ref mut existing)) = view
1297                        .field
1298                    {
1299                        existing._merge_into_view(sub, depth - 1)?;
1300                    } else {
1301                        view.field = Some(
1302                            kv_field_ref::FieldView::ZOrderKey(
1303                                ::buffa::alloc::boxed::Box::new(
1304                                    kv_field_ref::ZOrderKeyFieldView::_decode_depth(
1305                                        sub,
1306                                        depth - 1,
1307                                    )?,
1308                                ),
1309                            ),
1310                        );
1311                    }
1312                }
1313                3u32 => {
1314                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1315                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1316                            field_number: 3u32,
1317                            expected: 2u8,
1318                            actual: tag.wire_type() as u8,
1319                        });
1320                    }
1321                    if depth == 0 {
1322                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
1323                    }
1324                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
1325                    if let Some(kv_field_ref::FieldView::Value(ref mut existing)) = view
1326                        .field
1327                    {
1328                        existing._merge_into_view(sub, depth - 1)?;
1329                    } else {
1330                        view.field = Some(
1331                            kv_field_ref::FieldView::Value(
1332                                ::buffa::alloc::boxed::Box::new(
1333                                    kv_field_ref::ValueFieldView::_decode_depth(sub, depth - 1)?,
1334                                ),
1335                            ),
1336                        );
1337                    }
1338                }
1339                _ => {
1340                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
1341                    let span_len = before_tag.len() - cur.len();
1342                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
1343                }
1344            }
1345        }
1346        ::core::result::Result::Ok(())
1347    }
1348}
1349impl<'a> ::buffa::MessageView<'a> for KvFieldRefView<'a> {
1350    type Owned = KvFieldRef;
1351    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1352        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
1353    }
1354    fn decode_view_with_limit(
1355        buf: &'a [u8],
1356        depth: u32,
1357    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1358        Self::_decode_depth(buf, depth)
1359    }
1360    /// Convert this view to the owned message type.
1361    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
1362    fn to_owned_message(&self) -> KvFieldRef {
1363        #[allow(unused_imports)]
1364        use ::buffa::alloc::string::ToString as _;
1365        KvFieldRef {
1366            field: self
1367                .field
1368                .as_ref()
1369                .map(|v| match v {
1370                    kv_field_ref::FieldView::Key(v) => {
1371                        kv_field_ref::Field::Key(
1372                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
1373                        )
1374                    }
1375                    kv_field_ref::FieldView::ZOrderKey(v) => {
1376                        kv_field_ref::Field::ZOrderKey(
1377                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
1378                        )
1379                    }
1380                    kv_field_ref::FieldView::Value(v) => {
1381                        kv_field_ref::Field::Value(
1382                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
1383                        )
1384                    }
1385                }),
1386            __buffa_unknown_fields: self
1387                .__buffa_unknown_fields
1388                .to_owned()
1389                .unwrap_or_default()
1390                .into(),
1391            ..::core::default::Default::default()
1392        }
1393    }
1394}
1395unsafe impl ::buffa::DefaultViewInstance for KvFieldRefView<'static> {
1396    fn default_view_instance() -> &'static Self {
1397        static VALUE: ::buffa::__private::OnceBox<KvFieldRefView<'static>> = ::buffa::__private::OnceBox::new();
1398        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1399    }
1400}
1401unsafe impl<'a> ::buffa::HasDefaultViewInstance for KvFieldRefView<'a> {
1402    type Static = KvFieldRefView<'static>;
1403}
1404pub mod kv_field_ref {
1405    #[allow(unused_imports)]
1406    use super::*;
1407    /// A field extracted from the key bytes at a fixed bit offset.
1408    #[derive(Clone, PartialEq, Default)]
1409    #[derive(::serde::Serialize, ::serde::Deserialize)]
1410    #[serde(default)]
1411    pub struct KeyField {
1412        /// Bit offset into the key payload where this field starts.
1413        ///
1414        /// Field 1: `bit_offset`
1415        #[serde(
1416            rename = "bitOffset",
1417            alias = "bit_offset",
1418            with = "::buffa::json_helpers::uint32",
1419            skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1420        )]
1421        pub bit_offset: u32,
1422        /// Scalar type used to decode the field bytes.
1423        ///
1424        /// Field 2: `kind`
1425        #[serde(
1426            rename = "kind",
1427            with = "::buffa::json_helpers::proto_enum",
1428            skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
1429        )]
1430        pub kind: ::buffa::EnumValue<KvFieldKind>,
1431        /// Length in bytes when `kind` is `FIXED_SIZE_BINARY`; ignored otherwise.
1432        ///
1433        /// Field 3: `fixed_size_binary_len`
1434        #[serde(
1435            rename = "fixedSizeBinaryLen",
1436            alias = "fixed_size_binary_len",
1437            with = "::buffa::json_helpers::uint32",
1438            skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1439        )]
1440        pub fixed_size_binary_len: u32,
1441        #[serde(skip)]
1442        #[doc(hidden)]
1443        pub __buffa_unknown_fields: ::buffa::UnknownFields,
1444        #[doc(hidden)]
1445        #[serde(skip)]
1446        pub __buffa_cached_size: ::buffa::__private::CachedSize,
1447    }
1448    impl ::core::fmt::Debug for KeyField {
1449        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1450            f.debug_struct("KeyField")
1451                .field("bit_offset", &self.bit_offset)
1452                .field("kind", &self.kind)
1453                .field("fixed_size_binary_len", &self.fixed_size_binary_len)
1454                .finish()
1455        }
1456    }
1457    impl KeyField {
1458        /// Protobuf type URL for this message, for use with `Any::pack` and
1459        /// `Any::unpack_if`.
1460        ///
1461        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1462        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvFieldRef.KeyField";
1463    }
1464    unsafe impl ::buffa::DefaultInstance for KeyField {
1465        fn default_instance() -> &'static Self {
1466            static VALUE: ::buffa::__private::OnceBox<KeyField> = ::buffa::__private::OnceBox::new();
1467            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1468        }
1469    }
1470    impl ::buffa::Message for KeyField {
1471        /// Returns the total encoded size in bytes.
1472        ///
1473        /// The result is a `u32`; the protobuf specification requires all
1474        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1475        /// compliant message will never overflow this type.
1476        fn compute_size(&self) -> u32 {
1477            #[allow(unused_imports)]
1478            use ::buffa::Enumeration as _;
1479            let mut size = 0u32;
1480            if self.bit_offset != 0u32 {
1481                size
1482                    += 1u32 + ::buffa::types::uint32_encoded_len(self.bit_offset) as u32;
1483            }
1484            {
1485                let val = self.kind.to_i32();
1486                if val != 0 {
1487                    size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
1488                }
1489            }
1490            if self.fixed_size_binary_len != 0u32 {
1491                size
1492                    += 1u32
1493                        + ::buffa::types::uint32_encoded_len(self.fixed_size_binary_len)
1494                            as u32;
1495            }
1496            size += self.__buffa_unknown_fields.encoded_len() as u32;
1497            self.__buffa_cached_size.set(size);
1498            size
1499        }
1500        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
1501            #[allow(unused_imports)]
1502            use ::buffa::Enumeration as _;
1503            if self.bit_offset != 0u32 {
1504                ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
1505                    .encode(buf);
1506                ::buffa::types::encode_uint32(self.bit_offset, buf);
1507            }
1508            {
1509                let val = self.kind.to_i32();
1510                if val != 0 {
1511                    ::buffa::encoding::Tag::new(
1512                            2u32,
1513                            ::buffa::encoding::WireType::Varint,
1514                        )
1515                        .encode(buf);
1516                    ::buffa::types::encode_int32(val, buf);
1517                }
1518            }
1519            if self.fixed_size_binary_len != 0u32 {
1520                ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
1521                    .encode(buf);
1522                ::buffa::types::encode_uint32(self.fixed_size_binary_len, buf);
1523            }
1524            self.__buffa_unknown_fields.write_to(buf);
1525        }
1526        fn merge_field(
1527            &mut self,
1528            tag: ::buffa::encoding::Tag,
1529            buf: &mut impl ::buffa::bytes::Buf,
1530            depth: u32,
1531        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1532            #[allow(unused_imports)]
1533            use ::buffa::bytes::Buf as _;
1534            #[allow(unused_imports)]
1535            use ::buffa::Enumeration as _;
1536            match tag.field_number() {
1537                1u32 => {
1538                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1539                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1540                            field_number: 1u32,
1541                            expected: 0u8,
1542                            actual: tag.wire_type() as u8,
1543                        });
1544                    }
1545                    self.bit_offset = ::buffa::types::decode_uint32(buf)?;
1546                }
1547                2u32 => {
1548                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1549                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1550                            field_number: 2u32,
1551                            expected: 0u8,
1552                            actual: tag.wire_type() as u8,
1553                        });
1554                    }
1555                    self.kind = ::buffa::EnumValue::from(
1556                        ::buffa::types::decode_int32(buf)?,
1557                    );
1558                }
1559                3u32 => {
1560                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1561                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1562                            field_number: 3u32,
1563                            expected: 0u8,
1564                            actual: tag.wire_type() as u8,
1565                        });
1566                    }
1567                    self.fixed_size_binary_len = ::buffa::types::decode_uint32(buf)?;
1568                }
1569                _ => {
1570                    self.__buffa_unknown_fields
1571                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1572                }
1573            }
1574            ::core::result::Result::Ok(())
1575        }
1576        fn cached_size(&self) -> u32 {
1577            self.__buffa_cached_size.get()
1578        }
1579        fn clear(&mut self) {
1580            self.bit_offset = 0u32;
1581            self.kind = ::buffa::EnumValue::from(0);
1582            self.fixed_size_binary_len = 0u32;
1583            self.__buffa_unknown_fields.clear();
1584            self.__buffa_cached_size.set(0);
1585        }
1586    }
1587    impl ::buffa::ExtensionSet for KeyField {
1588        const PROTO_FQN: &'static str = "store.query.v1.KvFieldRef.KeyField";
1589        fn unknown_fields(&self) -> &::buffa::UnknownFields {
1590            &self.__buffa_unknown_fields
1591        }
1592        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1593            &mut self.__buffa_unknown_fields
1594        }
1595    }
1596    impl ::buffa::json_helpers::ProtoElemJson for KeyField {
1597        fn serialize_proto_json<S: ::serde::Serializer>(
1598            v: &Self,
1599            s: S,
1600        ) -> ::core::result::Result<S::Ok, S::Error> {
1601            ::serde::Serialize::serialize(v, s)
1602        }
1603        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1604            d: D,
1605        ) -> ::core::result::Result<Self, D::Error> {
1606            <Self as ::serde::Deserialize>::deserialize(d)
1607        }
1608    }
1609    #[doc(hidden)]
1610    pub const __KEY_FIELD_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1611        type_url: "type.googleapis.com/store.query.v1.KvFieldRef.KeyField",
1612        to_json: ::buffa::type_registry::any_to_json::<KeyField>,
1613        from_json: ::buffa::type_registry::any_from_json::<KeyField>,
1614        is_wkt: false,
1615    };
1616    /// A field extracted from the key bytes at a fixed bit offset.
1617    #[derive(Clone, Debug, Default)]
1618    pub struct KeyFieldView<'a> {
1619        /// Bit offset into the key payload where this field starts.
1620        ///
1621        /// Field 1: `bit_offset`
1622        pub bit_offset: u32,
1623        /// Scalar type used to decode the field bytes.
1624        ///
1625        /// Field 2: `kind`
1626        pub kind: ::buffa::EnumValue<KvFieldKind>,
1627        /// Length in bytes when `kind` is `FIXED_SIZE_BINARY`; ignored otherwise.
1628        ///
1629        /// Field 3: `fixed_size_binary_len`
1630        pub fixed_size_binary_len: u32,
1631        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1632    }
1633    impl<'a> KeyFieldView<'a> {
1634        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
1635        ///
1636        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
1637        /// and by generated sub-message decode arms with `depth - 1`.
1638        ///
1639        /// **Not part of the public API.** Named with a leading underscore to
1640        /// signal that it is for generated-code use only.
1641        #[doc(hidden)]
1642        pub fn _decode_depth(
1643            buf: &'a [u8],
1644            depth: u32,
1645        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1646            let mut view = Self::default();
1647            view._merge_into_view(buf, depth)?;
1648            ::core::result::Result::Ok(view)
1649        }
1650        /// Merge fields from `buf` into this view (proto merge semantics).
1651        ///
1652        /// Repeated fields append; singular fields last-wins; singular
1653        /// MESSAGE fields merge recursively. Used by sub-message decode
1654        /// arms when the same field appears multiple times on the wire.
1655        ///
1656        /// **Not part of the public API.**
1657        #[doc(hidden)]
1658        pub fn _merge_into_view(
1659            &mut self,
1660            buf: &'a [u8],
1661            depth: u32,
1662        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1663            let _ = depth;
1664            #[allow(unused_variables)]
1665            let view = self;
1666            let mut cur: &'a [u8] = buf;
1667            while !cur.is_empty() {
1668                let before_tag = cur;
1669                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
1670                match tag.field_number() {
1671                    1u32 => {
1672                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1673                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1674                                field_number: 1u32,
1675                                expected: 0u8,
1676                                actual: tag.wire_type() as u8,
1677                            });
1678                        }
1679                        view.bit_offset = ::buffa::types::decode_uint32(&mut cur)?;
1680                    }
1681                    2u32 => {
1682                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1683                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1684                                field_number: 2u32,
1685                                expected: 0u8,
1686                                actual: tag.wire_type() as u8,
1687                            });
1688                        }
1689                        view.kind = ::buffa::EnumValue::from(
1690                            ::buffa::types::decode_int32(&mut cur)?,
1691                        );
1692                    }
1693                    3u32 => {
1694                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1695                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1696                                field_number: 3u32,
1697                                expected: 0u8,
1698                                actual: tag.wire_type() as u8,
1699                            });
1700                        }
1701                        view.fixed_size_binary_len = ::buffa::types::decode_uint32(
1702                            &mut cur,
1703                        )?;
1704                    }
1705                    _ => {
1706                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
1707                        let span_len = before_tag.len() - cur.len();
1708                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
1709                    }
1710                }
1711            }
1712            ::core::result::Result::Ok(())
1713        }
1714    }
1715    impl<'a> ::buffa::MessageView<'a> for KeyFieldView<'a> {
1716        type Owned = KeyField;
1717        fn decode_view(
1718            buf: &'a [u8],
1719        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1720            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
1721        }
1722        fn decode_view_with_limit(
1723            buf: &'a [u8],
1724            depth: u32,
1725        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1726            Self::_decode_depth(buf, depth)
1727        }
1728        /// Convert this view to the owned message type.
1729        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
1730        fn to_owned_message(&self) -> KeyField {
1731            #[allow(unused_imports)]
1732            use ::buffa::alloc::string::ToString as _;
1733            KeyField {
1734                bit_offset: self.bit_offset,
1735                kind: self.kind,
1736                fixed_size_binary_len: self.fixed_size_binary_len,
1737                __buffa_unknown_fields: self
1738                    .__buffa_unknown_fields
1739                    .to_owned()
1740                    .unwrap_or_default()
1741                    .into(),
1742                ..::core::default::Default::default()
1743            }
1744        }
1745    }
1746    unsafe impl ::buffa::DefaultViewInstance for KeyFieldView<'static> {
1747        fn default_view_instance() -> &'static Self {
1748            static VALUE: ::buffa::__private::OnceBox<KeyFieldView<'static>> = ::buffa::__private::OnceBox::new();
1749            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1750        }
1751    }
1752    unsafe impl<'a> ::buffa::HasDefaultViewInstance for KeyFieldView<'a> {
1753        type Static = KeyFieldView<'static>;
1754    }
1755    /// A field extracted from a Z-order (Morton) interleaved key. The field
1756    /// is de-interleaved from the composite key using the position and widths.
1757    #[derive(Clone, PartialEq, Default)]
1758    #[derive(::serde::Serialize, ::serde::Deserialize)]
1759    #[serde(default)]
1760    pub struct ZOrderKeyField {
1761        /// Bit offset into the key payload where the Z-order block starts.
1762        ///
1763        /// Field 1: `bit_offset`
1764        #[serde(
1765            rename = "bitOffset",
1766            alias = "bit_offset",
1767            with = "::buffa::json_helpers::uint32",
1768            skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1769        )]
1770        pub bit_offset: u32,
1771        /// Zero-based position of this dimension within the Z-order interleaving.
1772        ///
1773        /// Field 2: `field_position`
1774        #[serde(
1775            rename = "fieldPosition",
1776            alias = "field_position",
1777            with = "::buffa::json_helpers::uint32",
1778            skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1779        )]
1780        pub field_position: u32,
1781        /// Bit widths of each dimension in the Z-order curve, in order.
1782        ///
1783        /// Field 3: `field_widths`
1784        #[serde(
1785            rename = "fieldWidths",
1786            alias = "field_widths",
1787            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1788            deserialize_with = "::buffa::json_helpers::null_as_default"
1789        )]
1790        pub field_widths: ::buffa::alloc::vec::Vec<u32>,
1791        /// Scalar type used to decode the de-interleaved value.
1792        ///
1793        /// Field 4: `kind`
1794        #[serde(
1795            rename = "kind",
1796            with = "::buffa::json_helpers::proto_enum",
1797            skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
1798        )]
1799        pub kind: ::buffa::EnumValue<KvFieldKind>,
1800        /// Length in bytes when `kind` is `FIXED_SIZE_BINARY`; ignored otherwise.
1801        ///
1802        /// Field 5: `fixed_size_binary_len`
1803        #[serde(
1804            rename = "fixedSizeBinaryLen",
1805            alias = "fixed_size_binary_len",
1806            with = "::buffa::json_helpers::uint32",
1807            skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1808        )]
1809        pub fixed_size_binary_len: u32,
1810        #[serde(skip)]
1811        #[doc(hidden)]
1812        pub __buffa_unknown_fields: ::buffa::UnknownFields,
1813        #[doc(hidden)]
1814        #[serde(skip)]
1815        pub __buffa_cached_size: ::buffa::__private::CachedSize,
1816    }
1817    impl ::core::fmt::Debug for ZOrderKeyField {
1818        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1819            f.debug_struct("ZOrderKeyField")
1820                .field("bit_offset", &self.bit_offset)
1821                .field("field_position", &self.field_position)
1822                .field("field_widths", &self.field_widths)
1823                .field("kind", &self.kind)
1824                .field("fixed_size_binary_len", &self.fixed_size_binary_len)
1825                .finish()
1826        }
1827    }
1828    impl ZOrderKeyField {
1829        /// Protobuf type URL for this message, for use with `Any::pack` and
1830        /// `Any::unpack_if`.
1831        ///
1832        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1833        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvFieldRef.ZOrderKeyField";
1834    }
1835    unsafe impl ::buffa::DefaultInstance for ZOrderKeyField {
1836        fn default_instance() -> &'static Self {
1837            static VALUE: ::buffa::__private::OnceBox<ZOrderKeyField> = ::buffa::__private::OnceBox::new();
1838            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1839        }
1840    }
1841    impl ::buffa::Message for ZOrderKeyField {
1842        /// Returns the total encoded size in bytes.
1843        ///
1844        /// The result is a `u32`; the protobuf specification requires all
1845        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1846        /// compliant message will never overflow this type.
1847        fn compute_size(&self) -> u32 {
1848            #[allow(unused_imports)]
1849            use ::buffa::Enumeration as _;
1850            let mut size = 0u32;
1851            if self.bit_offset != 0u32 {
1852                size
1853                    += 1u32 + ::buffa::types::uint32_encoded_len(self.bit_offset) as u32;
1854            }
1855            if self.field_position != 0u32 {
1856                size
1857                    += 1u32
1858                        + ::buffa::types::uint32_encoded_len(self.field_position) as u32;
1859            }
1860            {
1861                let val = self.kind.to_i32();
1862                if val != 0 {
1863                    size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
1864                }
1865            }
1866            if self.fixed_size_binary_len != 0u32 {
1867                size
1868                    += 1u32
1869                        + ::buffa::types::uint32_encoded_len(self.fixed_size_binary_len)
1870                            as u32;
1871            }
1872            if !self.field_widths.is_empty() {
1873                let payload: u32 = self
1874                    .field_widths
1875                    .iter()
1876                    .map(|&v| ::buffa::types::uint32_encoded_len(v) as u32)
1877                    .sum::<u32>();
1878                size
1879                    += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
1880                        + payload;
1881            }
1882            size += self.__buffa_unknown_fields.encoded_len() as u32;
1883            self.__buffa_cached_size.set(size);
1884            size
1885        }
1886        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
1887            #[allow(unused_imports)]
1888            use ::buffa::Enumeration as _;
1889            if self.bit_offset != 0u32 {
1890                ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
1891                    .encode(buf);
1892                ::buffa::types::encode_uint32(self.bit_offset, buf);
1893            }
1894            if self.field_position != 0u32 {
1895                ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
1896                    .encode(buf);
1897                ::buffa::types::encode_uint32(self.field_position, buf);
1898            }
1899            {
1900                let val = self.kind.to_i32();
1901                if val != 0 {
1902                    ::buffa::encoding::Tag::new(
1903                            4u32,
1904                            ::buffa::encoding::WireType::Varint,
1905                        )
1906                        .encode(buf);
1907                    ::buffa::types::encode_int32(val, buf);
1908                }
1909            }
1910            if self.fixed_size_binary_len != 0u32 {
1911                ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
1912                    .encode(buf);
1913                ::buffa::types::encode_uint32(self.fixed_size_binary_len, buf);
1914            }
1915            if !self.field_widths.is_empty() {
1916                let payload: u32 = self
1917                    .field_widths
1918                    .iter()
1919                    .map(|&v| ::buffa::types::uint32_encoded_len(v) as u32)
1920                    .sum::<u32>();
1921                ::buffa::encoding::Tag::new(
1922                        3u32,
1923                        ::buffa::encoding::WireType::LengthDelimited,
1924                    )
1925                    .encode(buf);
1926                ::buffa::encoding::encode_varint(payload as u64, buf);
1927                for &v in &self.field_widths {
1928                    ::buffa::types::encode_uint32(v, buf);
1929                }
1930            }
1931            self.__buffa_unknown_fields.write_to(buf);
1932        }
1933        fn merge_field(
1934            &mut self,
1935            tag: ::buffa::encoding::Tag,
1936            buf: &mut impl ::buffa::bytes::Buf,
1937            depth: u32,
1938        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1939            #[allow(unused_imports)]
1940            use ::buffa::bytes::Buf as _;
1941            #[allow(unused_imports)]
1942            use ::buffa::Enumeration as _;
1943            match tag.field_number() {
1944                1u32 => {
1945                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1946                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1947                            field_number: 1u32,
1948                            expected: 0u8,
1949                            actual: tag.wire_type() as u8,
1950                        });
1951                    }
1952                    self.bit_offset = ::buffa::types::decode_uint32(buf)?;
1953                }
1954                2u32 => {
1955                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1956                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1957                            field_number: 2u32,
1958                            expected: 0u8,
1959                            actual: tag.wire_type() as u8,
1960                        });
1961                    }
1962                    self.field_position = ::buffa::types::decode_uint32(buf)?;
1963                }
1964                4u32 => {
1965                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1966                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1967                            field_number: 4u32,
1968                            expected: 0u8,
1969                            actual: tag.wire_type() as u8,
1970                        });
1971                    }
1972                    self.kind = ::buffa::EnumValue::from(
1973                        ::buffa::types::decode_int32(buf)?,
1974                    );
1975                }
1976                5u32 => {
1977                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1978                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1979                            field_number: 5u32,
1980                            expected: 0u8,
1981                            actual: tag.wire_type() as u8,
1982                        });
1983                    }
1984                    self.fixed_size_binary_len = ::buffa::types::decode_uint32(buf)?;
1985                }
1986                3u32 => {
1987                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
1988                        let len = ::buffa::encoding::decode_varint(buf)?;
1989                        let len = usize::try_from(len)
1990                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1991                        if buf.remaining() < len {
1992                            return ::core::result::Result::Err(
1993                                ::buffa::DecodeError::UnexpectedEof,
1994                            );
1995                        }
1996                        self.field_widths.reserve(len);
1997                        let mut limited = buf.take(len);
1998                        while limited.has_remaining() {
1999                            self.field_widths
2000                                .push(::buffa::types::decode_uint32(&mut limited)?);
2001                        }
2002                        let leftover = limited.remaining();
2003                        if leftover > 0 {
2004                            limited.advance(leftover);
2005                        }
2006                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
2007                        self.field_widths.push(::buffa::types::decode_uint32(buf)?);
2008                    } else {
2009                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2010                            field_number: 3u32,
2011                            expected: 2u8,
2012                            actual: tag.wire_type() as u8,
2013                        });
2014                    }
2015                }
2016                _ => {
2017                    self.__buffa_unknown_fields
2018                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2019                }
2020            }
2021            ::core::result::Result::Ok(())
2022        }
2023        fn cached_size(&self) -> u32 {
2024            self.__buffa_cached_size.get()
2025        }
2026        fn clear(&mut self) {
2027            self.bit_offset = 0u32;
2028            self.field_position = 0u32;
2029            self.kind = ::buffa::EnumValue::from(0);
2030            self.fixed_size_binary_len = 0u32;
2031            self.field_widths.clear();
2032            self.__buffa_unknown_fields.clear();
2033            self.__buffa_cached_size.set(0);
2034        }
2035    }
2036    impl ::buffa::ExtensionSet for ZOrderKeyField {
2037        const PROTO_FQN: &'static str = "store.query.v1.KvFieldRef.ZOrderKeyField";
2038        fn unknown_fields(&self) -> &::buffa::UnknownFields {
2039            &self.__buffa_unknown_fields
2040        }
2041        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2042            &mut self.__buffa_unknown_fields
2043        }
2044    }
2045    impl ::buffa::json_helpers::ProtoElemJson for ZOrderKeyField {
2046        fn serialize_proto_json<S: ::serde::Serializer>(
2047            v: &Self,
2048            s: S,
2049        ) -> ::core::result::Result<S::Ok, S::Error> {
2050            ::serde::Serialize::serialize(v, s)
2051        }
2052        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2053            d: D,
2054        ) -> ::core::result::Result<Self, D::Error> {
2055            <Self as ::serde::Deserialize>::deserialize(d)
2056        }
2057    }
2058    #[doc(hidden)]
2059    pub const __Z_ORDER_KEY_FIELD_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2060        type_url: "type.googleapis.com/store.query.v1.KvFieldRef.ZOrderKeyField",
2061        to_json: ::buffa::type_registry::any_to_json::<ZOrderKeyField>,
2062        from_json: ::buffa::type_registry::any_from_json::<ZOrderKeyField>,
2063        is_wkt: false,
2064    };
2065    /// A field extracted from a Z-order (Morton) interleaved key. The field
2066    /// is de-interleaved from the composite key using the position and widths.
2067    #[derive(Clone, Debug, Default)]
2068    pub struct ZOrderKeyFieldView<'a> {
2069        /// Bit offset into the key payload where the Z-order block starts.
2070        ///
2071        /// Field 1: `bit_offset`
2072        pub bit_offset: u32,
2073        /// Zero-based position of this dimension within the Z-order interleaving.
2074        ///
2075        /// Field 2: `field_position`
2076        pub field_position: u32,
2077        /// Bit widths of each dimension in the Z-order curve, in order.
2078        ///
2079        /// Field 3: `field_widths`
2080        pub field_widths: ::buffa::RepeatedView<'a, u32>,
2081        /// Scalar type used to decode the de-interleaved value.
2082        ///
2083        /// Field 4: `kind`
2084        pub kind: ::buffa::EnumValue<KvFieldKind>,
2085        /// Length in bytes when `kind` is `FIXED_SIZE_BINARY`; ignored otherwise.
2086        ///
2087        /// Field 5: `fixed_size_binary_len`
2088        pub fixed_size_binary_len: u32,
2089        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2090    }
2091    impl<'a> ZOrderKeyFieldView<'a> {
2092        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
2093        ///
2094        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
2095        /// and by generated sub-message decode arms with `depth - 1`.
2096        ///
2097        /// **Not part of the public API.** Named with a leading underscore to
2098        /// signal that it is for generated-code use only.
2099        #[doc(hidden)]
2100        pub fn _decode_depth(
2101            buf: &'a [u8],
2102            depth: u32,
2103        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2104            let mut view = Self::default();
2105            view._merge_into_view(buf, depth)?;
2106            ::core::result::Result::Ok(view)
2107        }
2108        /// Merge fields from `buf` into this view (proto merge semantics).
2109        ///
2110        /// Repeated fields append; singular fields last-wins; singular
2111        /// MESSAGE fields merge recursively. Used by sub-message decode
2112        /// arms when the same field appears multiple times on the wire.
2113        ///
2114        /// **Not part of the public API.**
2115        #[doc(hidden)]
2116        pub fn _merge_into_view(
2117            &mut self,
2118            buf: &'a [u8],
2119            depth: u32,
2120        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2121            let _ = depth;
2122            #[allow(unused_variables)]
2123            let view = self;
2124            let mut cur: &'a [u8] = buf;
2125            while !cur.is_empty() {
2126                let before_tag = cur;
2127                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
2128                match tag.field_number() {
2129                    1u32 => {
2130                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2131                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2132                                field_number: 1u32,
2133                                expected: 0u8,
2134                                actual: tag.wire_type() as u8,
2135                            });
2136                        }
2137                        view.bit_offset = ::buffa::types::decode_uint32(&mut cur)?;
2138                    }
2139                    2u32 => {
2140                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2141                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2142                                field_number: 2u32,
2143                                expected: 0u8,
2144                                actual: tag.wire_type() as u8,
2145                            });
2146                        }
2147                        view.field_position = ::buffa::types::decode_uint32(&mut cur)?;
2148                    }
2149                    4u32 => {
2150                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2151                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2152                                field_number: 4u32,
2153                                expected: 0u8,
2154                                actual: tag.wire_type() as u8,
2155                            });
2156                        }
2157                        view.kind = ::buffa::EnumValue::from(
2158                            ::buffa::types::decode_int32(&mut cur)?,
2159                        );
2160                    }
2161                    5u32 => {
2162                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2163                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2164                                field_number: 5u32,
2165                                expected: 0u8,
2166                                actual: tag.wire_type() as u8,
2167                            });
2168                        }
2169                        view.fixed_size_binary_len = ::buffa::types::decode_uint32(
2170                            &mut cur,
2171                        )?;
2172                    }
2173                    3u32 => {
2174                        if tag.wire_type()
2175                            == ::buffa::encoding::WireType::LengthDelimited
2176                        {
2177                            let payload = ::buffa::types::borrow_bytes(&mut cur)?;
2178                            let mut pcur: &[u8] = payload;
2179                            while !pcur.is_empty() {
2180                                view.field_widths
2181                                    .push(::buffa::types::decode_uint32(&mut pcur)?);
2182                            }
2183                        } else if tag.wire_type() == ::buffa::encoding::WireType::Varint
2184                        {
2185                            view.field_widths
2186                                .push(::buffa::types::decode_uint32(&mut cur)?);
2187                        } else {
2188                            return Err(::buffa::DecodeError::WireTypeMismatch {
2189                                field_number: 3u32,
2190                                expected: 2u8,
2191                                actual: tag.wire_type() as u8,
2192                            });
2193                        }
2194                    }
2195                    _ => {
2196                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
2197                        let span_len = before_tag.len() - cur.len();
2198                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
2199                    }
2200                }
2201            }
2202            ::core::result::Result::Ok(())
2203        }
2204    }
2205    impl<'a> ::buffa::MessageView<'a> for ZOrderKeyFieldView<'a> {
2206        type Owned = ZOrderKeyField;
2207        fn decode_view(
2208            buf: &'a [u8],
2209        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2210            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
2211        }
2212        fn decode_view_with_limit(
2213            buf: &'a [u8],
2214            depth: u32,
2215        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2216            Self::_decode_depth(buf, depth)
2217        }
2218        /// Convert this view to the owned message type.
2219        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
2220        fn to_owned_message(&self) -> ZOrderKeyField {
2221            #[allow(unused_imports)]
2222            use ::buffa::alloc::string::ToString as _;
2223            ZOrderKeyField {
2224                bit_offset: self.bit_offset,
2225                field_position: self.field_position,
2226                field_widths: self.field_widths.to_vec(),
2227                kind: self.kind,
2228                fixed_size_binary_len: self.fixed_size_binary_len,
2229                __buffa_unknown_fields: self
2230                    .__buffa_unknown_fields
2231                    .to_owned()
2232                    .unwrap_or_default()
2233                    .into(),
2234                ..::core::default::Default::default()
2235            }
2236        }
2237    }
2238    unsafe impl ::buffa::DefaultViewInstance for ZOrderKeyFieldView<'static> {
2239        fn default_view_instance() -> &'static Self {
2240            static VALUE: ::buffa::__private::OnceBox<ZOrderKeyFieldView<'static>> = ::buffa::__private::OnceBox::new();
2241            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2242        }
2243    }
2244    unsafe impl<'a> ::buffa::HasDefaultViewInstance for ZOrderKeyFieldView<'a> {
2245        type Static = ZOrderKeyFieldView<'static>;
2246    }
2247    /// A field extracted from the stored value (the encoded `StoredRow`).
2248    #[derive(Clone, PartialEq, Default)]
2249    #[derive(::serde::Serialize, ::serde::Deserialize)]
2250    #[serde(default)]
2251    pub struct ValueField {
2252        /// Zero-based column index within the `StoredRow`.
2253        ///
2254        /// Field 1: `index`
2255        #[serde(
2256            rename = "index",
2257            with = "::buffa::json_helpers::uint32",
2258            skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
2259        )]
2260        pub index: u32,
2261        /// Scalar type of this column.
2262        ///
2263        /// Field 2: `kind`
2264        #[serde(
2265            rename = "kind",
2266            with = "::buffa::json_helpers::proto_enum",
2267            skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
2268        )]
2269        pub kind: ::buffa::EnumValue<KvFieldKind>,
2270        /// Whether the column is nullable. When true, a missing value yields NULL
2271        /// rather than an error.
2272        ///
2273        /// Field 3: `nullable`
2274        #[serde(
2275            rename = "nullable",
2276            with = "::buffa::json_helpers::proto_bool",
2277            skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
2278        )]
2279        pub nullable: bool,
2280        /// Length in bytes when `kind` is `FIXED_SIZE_BINARY`; ignored otherwise.
2281        ///
2282        /// Field 4: `fixed_size_binary_len`
2283        #[serde(
2284            rename = "fixedSizeBinaryLen",
2285            alias = "fixed_size_binary_len",
2286            with = "::buffa::json_helpers::uint32",
2287            skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
2288        )]
2289        pub fixed_size_binary_len: u32,
2290        #[serde(skip)]
2291        #[doc(hidden)]
2292        pub __buffa_unknown_fields: ::buffa::UnknownFields,
2293        #[doc(hidden)]
2294        #[serde(skip)]
2295        pub __buffa_cached_size: ::buffa::__private::CachedSize,
2296    }
2297    impl ::core::fmt::Debug for ValueField {
2298        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2299            f.debug_struct("ValueField")
2300                .field("index", &self.index)
2301                .field("kind", &self.kind)
2302                .field("nullable", &self.nullable)
2303                .field("fixed_size_binary_len", &self.fixed_size_binary_len)
2304                .finish()
2305        }
2306    }
2307    impl ValueField {
2308        /// Protobuf type URL for this message, for use with `Any::pack` and
2309        /// `Any::unpack_if`.
2310        ///
2311        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2312        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvFieldRef.ValueField";
2313    }
2314    unsafe impl ::buffa::DefaultInstance for ValueField {
2315        fn default_instance() -> &'static Self {
2316            static VALUE: ::buffa::__private::OnceBox<ValueField> = ::buffa::__private::OnceBox::new();
2317            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2318        }
2319    }
2320    impl ::buffa::Message for ValueField {
2321        /// Returns the total encoded size in bytes.
2322        ///
2323        /// The result is a `u32`; the protobuf specification requires all
2324        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2325        /// compliant message will never overflow this type.
2326        fn compute_size(&self) -> u32 {
2327            #[allow(unused_imports)]
2328            use ::buffa::Enumeration as _;
2329            let mut size = 0u32;
2330            if self.index != 0u32 {
2331                size += 1u32 + ::buffa::types::uint32_encoded_len(self.index) as u32;
2332            }
2333            {
2334                let val = self.kind.to_i32();
2335                if val != 0 {
2336                    size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
2337                }
2338            }
2339            if self.nullable {
2340                size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
2341            }
2342            if self.fixed_size_binary_len != 0u32 {
2343                size
2344                    += 1u32
2345                        + ::buffa::types::uint32_encoded_len(self.fixed_size_binary_len)
2346                            as u32;
2347            }
2348            size += self.__buffa_unknown_fields.encoded_len() as u32;
2349            self.__buffa_cached_size.set(size);
2350            size
2351        }
2352        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
2353            #[allow(unused_imports)]
2354            use ::buffa::Enumeration as _;
2355            if self.index != 0u32 {
2356                ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
2357                    .encode(buf);
2358                ::buffa::types::encode_uint32(self.index, buf);
2359            }
2360            {
2361                let val = self.kind.to_i32();
2362                if val != 0 {
2363                    ::buffa::encoding::Tag::new(
2364                            2u32,
2365                            ::buffa::encoding::WireType::Varint,
2366                        )
2367                        .encode(buf);
2368                    ::buffa::types::encode_int32(val, buf);
2369                }
2370            }
2371            if self.nullable {
2372                ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
2373                    .encode(buf);
2374                ::buffa::types::encode_bool(self.nullable, buf);
2375            }
2376            if self.fixed_size_binary_len != 0u32 {
2377                ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
2378                    .encode(buf);
2379                ::buffa::types::encode_uint32(self.fixed_size_binary_len, buf);
2380            }
2381            self.__buffa_unknown_fields.write_to(buf);
2382        }
2383        fn merge_field(
2384            &mut self,
2385            tag: ::buffa::encoding::Tag,
2386            buf: &mut impl ::buffa::bytes::Buf,
2387            depth: u32,
2388        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2389            #[allow(unused_imports)]
2390            use ::buffa::bytes::Buf as _;
2391            #[allow(unused_imports)]
2392            use ::buffa::Enumeration as _;
2393            match tag.field_number() {
2394                1u32 => {
2395                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2396                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2397                            field_number: 1u32,
2398                            expected: 0u8,
2399                            actual: tag.wire_type() as u8,
2400                        });
2401                    }
2402                    self.index = ::buffa::types::decode_uint32(buf)?;
2403                }
2404                2u32 => {
2405                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2406                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2407                            field_number: 2u32,
2408                            expected: 0u8,
2409                            actual: tag.wire_type() as u8,
2410                        });
2411                    }
2412                    self.kind = ::buffa::EnumValue::from(
2413                        ::buffa::types::decode_int32(buf)?,
2414                    );
2415                }
2416                3u32 => {
2417                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2418                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2419                            field_number: 3u32,
2420                            expected: 0u8,
2421                            actual: tag.wire_type() as u8,
2422                        });
2423                    }
2424                    self.nullable = ::buffa::types::decode_bool(buf)?;
2425                }
2426                4u32 => {
2427                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2428                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2429                            field_number: 4u32,
2430                            expected: 0u8,
2431                            actual: tag.wire_type() as u8,
2432                        });
2433                    }
2434                    self.fixed_size_binary_len = ::buffa::types::decode_uint32(buf)?;
2435                }
2436                _ => {
2437                    self.__buffa_unknown_fields
2438                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2439                }
2440            }
2441            ::core::result::Result::Ok(())
2442        }
2443        fn cached_size(&self) -> u32 {
2444            self.__buffa_cached_size.get()
2445        }
2446        fn clear(&mut self) {
2447            self.index = 0u32;
2448            self.kind = ::buffa::EnumValue::from(0);
2449            self.nullable = false;
2450            self.fixed_size_binary_len = 0u32;
2451            self.__buffa_unknown_fields.clear();
2452            self.__buffa_cached_size.set(0);
2453        }
2454    }
2455    impl ::buffa::ExtensionSet for ValueField {
2456        const PROTO_FQN: &'static str = "store.query.v1.KvFieldRef.ValueField";
2457        fn unknown_fields(&self) -> &::buffa::UnknownFields {
2458            &self.__buffa_unknown_fields
2459        }
2460        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2461            &mut self.__buffa_unknown_fields
2462        }
2463    }
2464    impl ::buffa::json_helpers::ProtoElemJson for ValueField {
2465        fn serialize_proto_json<S: ::serde::Serializer>(
2466            v: &Self,
2467            s: S,
2468        ) -> ::core::result::Result<S::Ok, S::Error> {
2469            ::serde::Serialize::serialize(v, s)
2470        }
2471        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2472            d: D,
2473        ) -> ::core::result::Result<Self, D::Error> {
2474            <Self as ::serde::Deserialize>::deserialize(d)
2475        }
2476    }
2477    #[doc(hidden)]
2478    pub const __VALUE_FIELD_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2479        type_url: "type.googleapis.com/store.query.v1.KvFieldRef.ValueField",
2480        to_json: ::buffa::type_registry::any_to_json::<ValueField>,
2481        from_json: ::buffa::type_registry::any_from_json::<ValueField>,
2482        is_wkt: false,
2483    };
2484    /// A field extracted from the stored value (the encoded `StoredRow`).
2485    #[derive(Clone, Debug, Default)]
2486    pub struct ValueFieldView<'a> {
2487        /// Zero-based column index within the `StoredRow`.
2488        ///
2489        /// Field 1: `index`
2490        pub index: u32,
2491        /// Scalar type of this column.
2492        ///
2493        /// Field 2: `kind`
2494        pub kind: ::buffa::EnumValue<KvFieldKind>,
2495        /// Whether the column is nullable. When true, a missing value yields NULL
2496        /// rather than an error.
2497        ///
2498        /// Field 3: `nullable`
2499        pub nullable: bool,
2500        /// Length in bytes when `kind` is `FIXED_SIZE_BINARY`; ignored otherwise.
2501        ///
2502        /// Field 4: `fixed_size_binary_len`
2503        pub fixed_size_binary_len: u32,
2504        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2505    }
2506    impl<'a> ValueFieldView<'a> {
2507        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
2508        ///
2509        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
2510        /// and by generated sub-message decode arms with `depth - 1`.
2511        ///
2512        /// **Not part of the public API.** Named with a leading underscore to
2513        /// signal that it is for generated-code use only.
2514        #[doc(hidden)]
2515        pub fn _decode_depth(
2516            buf: &'a [u8],
2517            depth: u32,
2518        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2519            let mut view = Self::default();
2520            view._merge_into_view(buf, depth)?;
2521            ::core::result::Result::Ok(view)
2522        }
2523        /// Merge fields from `buf` into this view (proto merge semantics).
2524        ///
2525        /// Repeated fields append; singular fields last-wins; singular
2526        /// MESSAGE fields merge recursively. Used by sub-message decode
2527        /// arms when the same field appears multiple times on the wire.
2528        ///
2529        /// **Not part of the public API.**
2530        #[doc(hidden)]
2531        pub fn _merge_into_view(
2532            &mut self,
2533            buf: &'a [u8],
2534            depth: u32,
2535        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2536            let _ = depth;
2537            #[allow(unused_variables)]
2538            let view = self;
2539            let mut cur: &'a [u8] = buf;
2540            while !cur.is_empty() {
2541                let before_tag = cur;
2542                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
2543                match tag.field_number() {
2544                    1u32 => {
2545                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2546                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2547                                field_number: 1u32,
2548                                expected: 0u8,
2549                                actual: tag.wire_type() as u8,
2550                            });
2551                        }
2552                        view.index = ::buffa::types::decode_uint32(&mut cur)?;
2553                    }
2554                    2u32 => {
2555                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2556                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2557                                field_number: 2u32,
2558                                expected: 0u8,
2559                                actual: tag.wire_type() as u8,
2560                            });
2561                        }
2562                        view.kind = ::buffa::EnumValue::from(
2563                            ::buffa::types::decode_int32(&mut cur)?,
2564                        );
2565                    }
2566                    3u32 => {
2567                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2568                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2569                                field_number: 3u32,
2570                                expected: 0u8,
2571                                actual: tag.wire_type() as u8,
2572                            });
2573                        }
2574                        view.nullable = ::buffa::types::decode_bool(&mut cur)?;
2575                    }
2576                    4u32 => {
2577                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2578                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2579                                field_number: 4u32,
2580                                expected: 0u8,
2581                                actual: tag.wire_type() as u8,
2582                            });
2583                        }
2584                        view.fixed_size_binary_len = ::buffa::types::decode_uint32(
2585                            &mut cur,
2586                        )?;
2587                    }
2588                    _ => {
2589                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
2590                        let span_len = before_tag.len() - cur.len();
2591                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
2592                    }
2593                }
2594            }
2595            ::core::result::Result::Ok(())
2596        }
2597    }
2598    impl<'a> ::buffa::MessageView<'a> for ValueFieldView<'a> {
2599        type Owned = ValueField;
2600        fn decode_view(
2601            buf: &'a [u8],
2602        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2603            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
2604        }
2605        fn decode_view_with_limit(
2606            buf: &'a [u8],
2607            depth: u32,
2608        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2609            Self::_decode_depth(buf, depth)
2610        }
2611        /// Convert this view to the owned message type.
2612        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
2613        fn to_owned_message(&self) -> ValueField {
2614            #[allow(unused_imports)]
2615            use ::buffa::alloc::string::ToString as _;
2616            ValueField {
2617                index: self.index,
2618                kind: self.kind,
2619                nullable: self.nullable,
2620                fixed_size_binary_len: self.fixed_size_binary_len,
2621                __buffa_unknown_fields: self
2622                    .__buffa_unknown_fields
2623                    .to_owned()
2624                    .unwrap_or_default()
2625                    .into(),
2626                ..::core::default::Default::default()
2627            }
2628        }
2629    }
2630    unsafe impl ::buffa::DefaultViewInstance for ValueFieldView<'static> {
2631        fn default_view_instance() -> &'static Self {
2632            static VALUE: ::buffa::__private::OnceBox<ValueFieldView<'static>> = ::buffa::__private::OnceBox::new();
2633            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2634        }
2635    }
2636    unsafe impl<'a> ::buffa::HasDefaultViewInstance for ValueFieldView<'a> {
2637        type Static = ValueFieldView<'static>;
2638    }
2639    #[derive(Clone, PartialEq, Debug)]
2640    pub enum Field {
2641        Key(::buffa::alloc::boxed::Box<super::kv_field_ref::KeyField>),
2642        ZOrderKey(::buffa::alloc::boxed::Box<super::kv_field_ref::ZOrderKeyField>),
2643        Value(::buffa::alloc::boxed::Box<super::kv_field_ref::ValueField>),
2644    }
2645    impl ::buffa::Oneof for Field {}
2646    impl From<super::kv_field_ref::KeyField> for Field {
2647        fn from(v: super::kv_field_ref::KeyField) -> Self {
2648            Self::Key(::buffa::alloc::boxed::Box::new(v))
2649        }
2650    }
2651    impl From<super::kv_field_ref::KeyField> for ::core::option::Option<Field> {
2652        fn from(v: super::kv_field_ref::KeyField) -> Self {
2653            Self::Some(Field::from(v))
2654        }
2655    }
2656    impl From<super::kv_field_ref::ZOrderKeyField> for Field {
2657        fn from(v: super::kv_field_ref::ZOrderKeyField) -> Self {
2658            Self::ZOrderKey(::buffa::alloc::boxed::Box::new(v))
2659        }
2660    }
2661    impl From<super::kv_field_ref::ZOrderKeyField> for ::core::option::Option<Field> {
2662        fn from(v: super::kv_field_ref::ZOrderKeyField) -> Self {
2663            Self::Some(Field::from(v))
2664        }
2665    }
2666    impl From<super::kv_field_ref::ValueField> for Field {
2667        fn from(v: super::kv_field_ref::ValueField) -> Self {
2668            Self::Value(::buffa::alloc::boxed::Box::new(v))
2669        }
2670    }
2671    impl From<super::kv_field_ref::ValueField> for ::core::option::Option<Field> {
2672        fn from(v: super::kv_field_ref::ValueField) -> Self {
2673            Self::Some(Field::from(v))
2674        }
2675    }
2676    impl serde::Serialize for Field {
2677        fn serialize<S: serde::Serializer>(
2678            &self,
2679            s: S,
2680        ) -> ::core::result::Result<S::Ok, S::Error> {
2681            use serde::ser::SerializeMap;
2682            let mut map = s.serialize_map(Some(1))?;
2683            match self {
2684                Field::Key(v) => {
2685                    map.serialize_entry("key", v)?;
2686                }
2687                Field::ZOrderKey(v) => {
2688                    map.serialize_entry("zOrderKey", v)?;
2689                }
2690                Field::Value(v) => {
2691                    map.serialize_entry("value", v)?;
2692                }
2693            }
2694            map.end()
2695        }
2696    }
2697    #[derive(Clone, Debug)]
2698    pub enum FieldView<'a> {
2699        Key(::buffa::alloc::boxed::Box<super::kv_field_ref::KeyFieldView<'a>>),
2700        ZOrderKey(
2701            ::buffa::alloc::boxed::Box<super::kv_field_ref::ZOrderKeyFieldView<'a>>,
2702        ),
2703        Value(::buffa::alloc::boxed::Box<super::kv_field_ref::ValueFieldView<'a>>),
2704    }
2705}
2706/// A single scalar value produced by reduction or used as a literal in
2707/// expressions. The variant must match the `KvFieldKind` of the expression
2708/// it participates in.
2709#[derive(Clone, PartialEq, Default)]
2710#[derive(::serde::Serialize)]
2711#[serde(default)]
2712pub struct KvReducedValue {
2713    #[serde(flatten)]
2714    pub value: Option<kv_reduced_value::Value>,
2715    #[serde(skip)]
2716    #[doc(hidden)]
2717    pub __buffa_unknown_fields: ::buffa::UnknownFields,
2718    #[doc(hidden)]
2719    #[serde(skip)]
2720    pub __buffa_cached_size: ::buffa::__private::CachedSize,
2721}
2722impl ::core::fmt::Debug for KvReducedValue {
2723    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2724        f.debug_struct("KvReducedValue").field("value", &self.value).finish()
2725    }
2726}
2727impl KvReducedValue {
2728    /// Protobuf type URL for this message, for use with `Any::pack` and
2729    /// `Any::unpack_if`.
2730    ///
2731    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2732    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvReducedValue";
2733}
2734unsafe impl ::buffa::DefaultInstance for KvReducedValue {
2735    fn default_instance() -> &'static Self {
2736        static VALUE: ::buffa::__private::OnceBox<KvReducedValue> = ::buffa::__private::OnceBox::new();
2737        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2738    }
2739}
2740impl ::buffa::Message for KvReducedValue {
2741    /// Returns the total encoded size in bytes.
2742    ///
2743    /// The result is a `u32`; the protobuf specification requires all
2744    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2745    /// compliant message will never overflow this type.
2746    fn compute_size(&self) -> u32 {
2747        #[allow(unused_imports)]
2748        use ::buffa::Enumeration as _;
2749        let mut size = 0u32;
2750        if let ::core::option::Option::Some(ref v) = self.value {
2751            match v {
2752                kv_reduced_value::Value::Int64Value(v) => {
2753                    size += 1u32 + ::buffa::types::int64_encoded_len(*v) as u32;
2754                }
2755                kv_reduced_value::Value::Uint64Value(v) => {
2756                    size += 1u32 + ::buffa::types::uint64_encoded_len(*v) as u32;
2757                }
2758                kv_reduced_value::Value::Float64Value(_x) => {
2759                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
2760                }
2761                kv_reduced_value::Value::BooleanValue(_x) => {
2762                    size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
2763                }
2764                kv_reduced_value::Value::Utf8Value(x) => {
2765                    size += 1u32 + ::buffa::types::string_encoded_len(x) as u32;
2766                }
2767                kv_reduced_value::Value::Date32Value(v) => {
2768                    size += 1u32 + ::buffa::types::int32_encoded_len(*v) as u32;
2769                }
2770                kv_reduced_value::Value::Date64Value(v) => {
2771                    size += 1u32 + ::buffa::types::int64_encoded_len(*v) as u32;
2772                }
2773                kv_reduced_value::Value::TimestampValue(v) => {
2774                    size += 1u32 + ::buffa::types::int64_encoded_len(*v) as u32;
2775                }
2776                kv_reduced_value::Value::Decimal128Value(x) => {
2777                    size += 1u32 + ::buffa::types::bytes_encoded_len(x) as u32;
2778                }
2779                kv_reduced_value::Value::FixedSizeBinaryValue(x) => {
2780                    size += 1u32 + ::buffa::types::bytes_encoded_len(x) as u32;
2781                }
2782                kv_reduced_value::Value::Decimal256Value(x) => {
2783                    size += 1u32 + ::buffa::types::bytes_encoded_len(x) as u32;
2784                }
2785            }
2786        }
2787        size += self.__buffa_unknown_fields.encoded_len() as u32;
2788        self.__buffa_cached_size.set(size);
2789        size
2790    }
2791    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
2792        #[allow(unused_imports)]
2793        use ::buffa::Enumeration as _;
2794        if let ::core::option::Option::Some(ref v) = self.value {
2795            match v {
2796                kv_reduced_value::Value::Int64Value(x) => {
2797                    ::buffa::encoding::Tag::new(
2798                            1u32,
2799                            ::buffa::encoding::WireType::Varint,
2800                        )
2801                        .encode(buf);
2802                    ::buffa::types::encode_int64(*x, buf);
2803                }
2804                kv_reduced_value::Value::Uint64Value(x) => {
2805                    ::buffa::encoding::Tag::new(
2806                            2u32,
2807                            ::buffa::encoding::WireType::Varint,
2808                        )
2809                        .encode(buf);
2810                    ::buffa::types::encode_uint64(*x, buf);
2811                }
2812                kv_reduced_value::Value::Float64Value(x) => {
2813                    ::buffa::encoding::Tag::new(
2814                            3u32,
2815                            ::buffa::encoding::WireType::Fixed64,
2816                        )
2817                        .encode(buf);
2818                    ::buffa::types::encode_double(*x, buf);
2819                }
2820                kv_reduced_value::Value::BooleanValue(x) => {
2821                    ::buffa::encoding::Tag::new(
2822                            4u32,
2823                            ::buffa::encoding::WireType::Varint,
2824                        )
2825                        .encode(buf);
2826                    ::buffa::types::encode_bool(*x, buf);
2827                }
2828                kv_reduced_value::Value::Utf8Value(x) => {
2829                    ::buffa::encoding::Tag::new(
2830                            5u32,
2831                            ::buffa::encoding::WireType::LengthDelimited,
2832                        )
2833                        .encode(buf);
2834                    ::buffa::types::encode_string(x, buf);
2835                }
2836                kv_reduced_value::Value::Date32Value(x) => {
2837                    ::buffa::encoding::Tag::new(
2838                            6u32,
2839                            ::buffa::encoding::WireType::Varint,
2840                        )
2841                        .encode(buf);
2842                    ::buffa::types::encode_int32(*x, buf);
2843                }
2844                kv_reduced_value::Value::Date64Value(x) => {
2845                    ::buffa::encoding::Tag::new(
2846                            7u32,
2847                            ::buffa::encoding::WireType::Varint,
2848                        )
2849                        .encode(buf);
2850                    ::buffa::types::encode_int64(*x, buf);
2851                }
2852                kv_reduced_value::Value::TimestampValue(x) => {
2853                    ::buffa::encoding::Tag::new(
2854                            8u32,
2855                            ::buffa::encoding::WireType::Varint,
2856                        )
2857                        .encode(buf);
2858                    ::buffa::types::encode_int64(*x, buf);
2859                }
2860                kv_reduced_value::Value::Decimal128Value(x) => {
2861                    ::buffa::encoding::Tag::new(
2862                            9u32,
2863                            ::buffa::encoding::WireType::LengthDelimited,
2864                        )
2865                        .encode(buf);
2866                    ::buffa::types::encode_bytes(x, buf);
2867                }
2868                kv_reduced_value::Value::FixedSizeBinaryValue(x) => {
2869                    ::buffa::encoding::Tag::new(
2870                            10u32,
2871                            ::buffa::encoding::WireType::LengthDelimited,
2872                        )
2873                        .encode(buf);
2874                    ::buffa::types::encode_bytes(x, buf);
2875                }
2876                kv_reduced_value::Value::Decimal256Value(x) => {
2877                    ::buffa::encoding::Tag::new(
2878                            11u32,
2879                            ::buffa::encoding::WireType::LengthDelimited,
2880                        )
2881                        .encode(buf);
2882                    ::buffa::types::encode_bytes(x, buf);
2883                }
2884            }
2885        }
2886        self.__buffa_unknown_fields.write_to(buf);
2887    }
2888    fn merge_field(
2889        &mut self,
2890        tag: ::buffa::encoding::Tag,
2891        buf: &mut impl ::buffa::bytes::Buf,
2892        depth: u32,
2893    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2894        #[allow(unused_imports)]
2895        use ::buffa::bytes::Buf as _;
2896        #[allow(unused_imports)]
2897        use ::buffa::Enumeration as _;
2898        match tag.field_number() {
2899            1u32 => {
2900                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2901                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2902                        field_number: 1u32,
2903                        expected: 0u8,
2904                        actual: tag.wire_type() as u8,
2905                    });
2906                }
2907                self.value = ::core::option::Option::Some(
2908                    kv_reduced_value::Value::Int64Value(
2909                        ::buffa::types::decode_int64(buf)?,
2910                    ),
2911                );
2912            }
2913            2u32 => {
2914                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2915                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2916                        field_number: 2u32,
2917                        expected: 0u8,
2918                        actual: tag.wire_type() as u8,
2919                    });
2920                }
2921                self.value = ::core::option::Option::Some(
2922                    kv_reduced_value::Value::Uint64Value(
2923                        ::buffa::types::decode_uint64(buf)?,
2924                    ),
2925                );
2926            }
2927            3u32 => {
2928                if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
2929                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2930                        field_number: 3u32,
2931                        expected: 1u8,
2932                        actual: tag.wire_type() as u8,
2933                    });
2934                }
2935                self.value = ::core::option::Option::Some(
2936                    kv_reduced_value::Value::Float64Value(
2937                        ::buffa::types::decode_double(buf)?,
2938                    ),
2939                );
2940            }
2941            4u32 => {
2942                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2943                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2944                        field_number: 4u32,
2945                        expected: 0u8,
2946                        actual: tag.wire_type() as u8,
2947                    });
2948                }
2949                self.value = ::core::option::Option::Some(
2950                    kv_reduced_value::Value::BooleanValue(
2951                        ::buffa::types::decode_bool(buf)?,
2952                    ),
2953                );
2954            }
2955            5u32 => {
2956                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2957                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2958                        field_number: 5u32,
2959                        expected: 2u8,
2960                        actual: tag.wire_type() as u8,
2961                    });
2962                }
2963                self.value = ::core::option::Option::Some(
2964                    kv_reduced_value::Value::Utf8Value(
2965                        ::buffa::types::decode_string(buf)?,
2966                    ),
2967                );
2968            }
2969            6u32 => {
2970                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2971                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2972                        field_number: 6u32,
2973                        expected: 0u8,
2974                        actual: tag.wire_type() as u8,
2975                    });
2976                }
2977                self.value = ::core::option::Option::Some(
2978                    kv_reduced_value::Value::Date32Value(
2979                        ::buffa::types::decode_int32(buf)?,
2980                    ),
2981                );
2982            }
2983            7u32 => {
2984                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2985                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2986                        field_number: 7u32,
2987                        expected: 0u8,
2988                        actual: tag.wire_type() as u8,
2989                    });
2990                }
2991                self.value = ::core::option::Option::Some(
2992                    kv_reduced_value::Value::Date64Value(
2993                        ::buffa::types::decode_int64(buf)?,
2994                    ),
2995                );
2996            }
2997            8u32 => {
2998                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2999                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3000                        field_number: 8u32,
3001                        expected: 0u8,
3002                        actual: tag.wire_type() as u8,
3003                    });
3004                }
3005                self.value = ::core::option::Option::Some(
3006                    kv_reduced_value::Value::TimestampValue(
3007                        ::buffa::types::decode_int64(buf)?,
3008                    ),
3009                );
3010            }
3011            9u32 => {
3012                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
3013                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3014                        field_number: 9u32,
3015                        expected: 2u8,
3016                        actual: tag.wire_type() as u8,
3017                    });
3018                }
3019                self.value = ::core::option::Option::Some(
3020                    kv_reduced_value::Value::Decimal128Value(
3021                        ::buffa::types::decode_bytes(buf)?,
3022                    ),
3023                );
3024            }
3025            10u32 => {
3026                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
3027                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3028                        field_number: 10u32,
3029                        expected: 2u8,
3030                        actual: tag.wire_type() as u8,
3031                    });
3032                }
3033                self.value = ::core::option::Option::Some(
3034                    kv_reduced_value::Value::FixedSizeBinaryValue(
3035                        ::buffa::types::decode_bytes(buf)?,
3036                    ),
3037                );
3038            }
3039            11u32 => {
3040                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
3041                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3042                        field_number: 11u32,
3043                        expected: 2u8,
3044                        actual: tag.wire_type() as u8,
3045                    });
3046                }
3047                self.value = ::core::option::Option::Some(
3048                    kv_reduced_value::Value::Decimal256Value(
3049                        ::buffa::types::decode_bytes(buf)?,
3050                    ),
3051                );
3052            }
3053            _ => {
3054                self.__buffa_unknown_fields
3055                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
3056            }
3057        }
3058        ::core::result::Result::Ok(())
3059    }
3060    fn cached_size(&self) -> u32 {
3061        self.__buffa_cached_size.get()
3062    }
3063    fn clear(&mut self) {
3064        self.value = ::core::option::Option::None;
3065        self.__buffa_unknown_fields.clear();
3066        self.__buffa_cached_size.set(0);
3067    }
3068}
3069impl ::buffa::ExtensionSet for KvReducedValue {
3070    const PROTO_FQN: &'static str = "store.query.v1.KvReducedValue";
3071    fn unknown_fields(&self) -> &::buffa::UnknownFields {
3072        &self.__buffa_unknown_fields
3073    }
3074    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
3075        &mut self.__buffa_unknown_fields
3076    }
3077}
3078impl<'de> serde::Deserialize<'de> for KvReducedValue {
3079    fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
3080        struct _V;
3081        impl<'de> serde::de::Visitor<'de> for _V {
3082            type Value = KvReducedValue;
3083            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3084                f.write_str("struct KvReducedValue")
3085            }
3086            #[allow(clippy::field_reassign_with_default)]
3087            fn visit_map<A: serde::de::MapAccess<'de>>(
3088                self,
3089                mut map: A,
3090            ) -> Result<KvReducedValue, A::Error> {
3091                let mut __oneof_value: Option<kv_reduced_value::Value> = None;
3092                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
3093                    match key.as_str() {
3094                        "int64Value" | "int64_value" => {
3095                            struct _DeserSeed;
3096                            impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
3097                                type Value = i64;
3098                                fn deserialize<D: serde::Deserializer<'de>>(
3099                                    self,
3100                                    d: D,
3101                                ) -> ::core::result::Result<i64, D::Error> {
3102                                    ::buffa::json_helpers::int64::deserialize(d)
3103                                }
3104                            }
3105                            let v: Option<i64> = map
3106                                .next_value_seed(
3107                                    ::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
3108                                )?;
3109                            if let Some(v) = v {
3110                                if __oneof_value.is_some() {
3111                                    return Err(
3112                                        serde::de::Error::custom(
3113                                            "multiple oneof fields set for 'value'",
3114                                        ),
3115                                    );
3116                                }
3117                                __oneof_value = Some(
3118                                    kv_reduced_value::Value::Int64Value(v),
3119                                );
3120                            }
3121                        }
3122                        "uint64Value" | "uint64_value" => {
3123                            struct _DeserSeed;
3124                            impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
3125                                type Value = u64;
3126                                fn deserialize<D: serde::Deserializer<'de>>(
3127                                    self,
3128                                    d: D,
3129                                ) -> ::core::result::Result<u64, D::Error> {
3130                                    ::buffa::json_helpers::uint64::deserialize(d)
3131                                }
3132                            }
3133                            let v: Option<u64> = map
3134                                .next_value_seed(
3135                                    ::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
3136                                )?;
3137                            if let Some(v) = v {
3138                                if __oneof_value.is_some() {
3139                                    return Err(
3140                                        serde::de::Error::custom(
3141                                            "multiple oneof fields set for 'value'",
3142                                        ),
3143                                    );
3144                                }
3145                                __oneof_value = Some(
3146                                    kv_reduced_value::Value::Uint64Value(v),
3147                                );
3148                            }
3149                        }
3150                        "float64Value" | "float64_value" => {
3151                            struct _DeserSeed;
3152                            impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
3153                                type Value = f64;
3154                                fn deserialize<D: serde::Deserializer<'de>>(
3155                                    self,
3156                                    d: D,
3157                                ) -> ::core::result::Result<f64, D::Error> {
3158                                    ::buffa::json_helpers::double::deserialize(d)
3159                                }
3160                            }
3161                            let v: Option<f64> = map
3162                                .next_value_seed(
3163                                    ::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
3164                                )?;
3165                            if let Some(v) = v {
3166                                if __oneof_value.is_some() {
3167                                    return Err(
3168                                        serde::de::Error::custom(
3169                                            "multiple oneof fields set for 'value'",
3170                                        ),
3171                                    );
3172                                }
3173                                __oneof_value = Some(
3174                                    kv_reduced_value::Value::Float64Value(v),
3175                                );
3176                            }
3177                        }
3178                        "booleanValue" | "boolean_value" => {
3179                            let v: Option<bool> = map
3180                                .next_value_seed(
3181                                    ::buffa::json_helpers::NullableDeserializeSeed(
3182                                        ::buffa::json_helpers::DefaultDeserializeSeed::<bool>::new(),
3183                                    ),
3184                                )?;
3185                            if let Some(v) = v {
3186                                if __oneof_value.is_some() {
3187                                    return Err(
3188                                        serde::de::Error::custom(
3189                                            "multiple oneof fields set for 'value'",
3190                                        ),
3191                                    );
3192                                }
3193                                __oneof_value = Some(
3194                                    kv_reduced_value::Value::BooleanValue(v),
3195                                );
3196                            }
3197                        }
3198                        "utf8Value" | "utf8_value" => {
3199                            let v: Option<::buffa::alloc::string::String> = map
3200                                .next_value_seed(
3201                                    ::buffa::json_helpers::NullableDeserializeSeed(
3202                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
3203                                            ::buffa::alloc::string::String,
3204                                        >::new(),
3205                                    ),
3206                                )?;
3207                            if let Some(v) = v {
3208                                if __oneof_value.is_some() {
3209                                    return Err(
3210                                        serde::de::Error::custom(
3211                                            "multiple oneof fields set for 'value'",
3212                                        ),
3213                                    );
3214                                }
3215                                __oneof_value = Some(kv_reduced_value::Value::Utf8Value(v));
3216                            }
3217                        }
3218                        "date32Value" | "date32_value" => {
3219                            struct _DeserSeed;
3220                            impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
3221                                type Value = i32;
3222                                fn deserialize<D: serde::Deserializer<'de>>(
3223                                    self,
3224                                    d: D,
3225                                ) -> ::core::result::Result<i32, D::Error> {
3226                                    ::buffa::json_helpers::int32::deserialize(d)
3227                                }
3228                            }
3229                            let v: Option<i32> = map
3230                                .next_value_seed(
3231                                    ::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
3232                                )?;
3233                            if let Some(v) = v {
3234                                if __oneof_value.is_some() {
3235                                    return Err(
3236                                        serde::de::Error::custom(
3237                                            "multiple oneof fields set for 'value'",
3238                                        ),
3239                                    );
3240                                }
3241                                __oneof_value = Some(
3242                                    kv_reduced_value::Value::Date32Value(v),
3243                                );
3244                            }
3245                        }
3246                        "date64Value" | "date64_value" => {
3247                            struct _DeserSeed;
3248                            impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
3249                                type Value = i64;
3250                                fn deserialize<D: serde::Deserializer<'de>>(
3251                                    self,
3252                                    d: D,
3253                                ) -> ::core::result::Result<i64, D::Error> {
3254                                    ::buffa::json_helpers::int64::deserialize(d)
3255                                }
3256                            }
3257                            let v: Option<i64> = map
3258                                .next_value_seed(
3259                                    ::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
3260                                )?;
3261                            if let Some(v) = v {
3262                                if __oneof_value.is_some() {
3263                                    return Err(
3264                                        serde::de::Error::custom(
3265                                            "multiple oneof fields set for 'value'",
3266                                        ),
3267                                    );
3268                                }
3269                                __oneof_value = Some(
3270                                    kv_reduced_value::Value::Date64Value(v),
3271                                );
3272                            }
3273                        }
3274                        "timestampValue" | "timestamp_value" => {
3275                            struct _DeserSeed;
3276                            impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
3277                                type Value = i64;
3278                                fn deserialize<D: serde::Deserializer<'de>>(
3279                                    self,
3280                                    d: D,
3281                                ) -> ::core::result::Result<i64, D::Error> {
3282                                    ::buffa::json_helpers::int64::deserialize(d)
3283                                }
3284                            }
3285                            let v: Option<i64> = map
3286                                .next_value_seed(
3287                                    ::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
3288                                )?;
3289                            if let Some(v) = v {
3290                                if __oneof_value.is_some() {
3291                                    return Err(
3292                                        serde::de::Error::custom(
3293                                            "multiple oneof fields set for 'value'",
3294                                        ),
3295                                    );
3296                                }
3297                                __oneof_value = Some(
3298                                    kv_reduced_value::Value::TimestampValue(v),
3299                                );
3300                            }
3301                        }
3302                        "decimal128Value" | "decimal128_value" => {
3303                            struct _DeserSeed;
3304                            impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
3305                                type Value = ::buffa::alloc::vec::Vec<u8>;
3306                                fn deserialize<D: serde::Deserializer<'de>>(
3307                                    self,
3308                                    d: D,
3309                                ) -> ::core::result::Result<
3310                                    ::buffa::alloc::vec::Vec<u8>,
3311                                    D::Error,
3312                                > {
3313                                    ::buffa::json_helpers::bytes::deserialize(d)
3314                                }
3315                            }
3316                            let v: Option<::buffa::alloc::vec::Vec<u8>> = map
3317                                .next_value_seed(
3318                                    ::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
3319                                )?;
3320                            if let Some(v) = v {
3321                                if __oneof_value.is_some() {
3322                                    return Err(
3323                                        serde::de::Error::custom(
3324                                            "multiple oneof fields set for 'value'",
3325                                        ),
3326                                    );
3327                                }
3328                                __oneof_value = Some(
3329                                    kv_reduced_value::Value::Decimal128Value(v),
3330                                );
3331                            }
3332                        }
3333                        "fixedSizeBinaryValue" | "fixed_size_binary_value" => {
3334                            struct _DeserSeed;
3335                            impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
3336                                type Value = ::buffa::alloc::vec::Vec<u8>;
3337                                fn deserialize<D: serde::Deserializer<'de>>(
3338                                    self,
3339                                    d: D,
3340                                ) -> ::core::result::Result<
3341                                    ::buffa::alloc::vec::Vec<u8>,
3342                                    D::Error,
3343                                > {
3344                                    ::buffa::json_helpers::bytes::deserialize(d)
3345                                }
3346                            }
3347                            let v: Option<::buffa::alloc::vec::Vec<u8>> = map
3348                                .next_value_seed(
3349                                    ::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
3350                                )?;
3351                            if let Some(v) = v {
3352                                if __oneof_value.is_some() {
3353                                    return Err(
3354                                        serde::de::Error::custom(
3355                                            "multiple oneof fields set for 'value'",
3356                                        ),
3357                                    );
3358                                }
3359                                __oneof_value = Some(
3360                                    kv_reduced_value::Value::FixedSizeBinaryValue(v),
3361                                );
3362                            }
3363                        }
3364                        "decimal256Value" | "decimal256_value" => {
3365                            struct _DeserSeed;
3366                            impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
3367                                type Value = ::buffa::alloc::vec::Vec<u8>;
3368                                fn deserialize<D: serde::Deserializer<'de>>(
3369                                    self,
3370                                    d: D,
3371                                ) -> ::core::result::Result<
3372                                    ::buffa::alloc::vec::Vec<u8>,
3373                                    D::Error,
3374                                > {
3375                                    ::buffa::json_helpers::bytes::deserialize(d)
3376                                }
3377                            }
3378                            let v: Option<::buffa::alloc::vec::Vec<u8>> = map
3379                                .next_value_seed(
3380                                    ::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
3381                                )?;
3382                            if let Some(v) = v {
3383                                if __oneof_value.is_some() {
3384                                    return Err(
3385                                        serde::de::Error::custom(
3386                                            "multiple oneof fields set for 'value'",
3387                                        ),
3388                                    );
3389                                }
3390                                __oneof_value = Some(
3391                                    kv_reduced_value::Value::Decimal256Value(v),
3392                                );
3393                            }
3394                        }
3395                        _ => {
3396                            map.next_value::<serde::de::IgnoredAny>()?;
3397                        }
3398                    }
3399                }
3400                let mut __r = <KvReducedValue as ::core::default::Default>::default();
3401                __r.value = __oneof_value;
3402                Ok(__r)
3403            }
3404        }
3405        d.deserialize_map(_V)
3406    }
3407}
3408impl ::buffa::json_helpers::ProtoElemJson for KvReducedValue {
3409    fn serialize_proto_json<S: ::serde::Serializer>(
3410        v: &Self,
3411        s: S,
3412    ) -> ::core::result::Result<S::Ok, S::Error> {
3413        ::serde::Serialize::serialize(v, s)
3414    }
3415    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
3416        d: D,
3417    ) -> ::core::result::Result<Self, D::Error> {
3418        <Self as ::serde::Deserialize>::deserialize(d)
3419    }
3420}
3421#[doc(hidden)]
3422pub const __KV_REDUCED_VALUE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
3423    type_url: "type.googleapis.com/store.query.v1.KvReducedValue",
3424    to_json: ::buffa::type_registry::any_to_json::<KvReducedValue>,
3425    from_json: ::buffa::type_registry::any_from_json::<KvReducedValue>,
3426    is_wkt: false,
3427};
3428/// A single scalar value produced by reduction or used as a literal in
3429/// expressions. The variant must match the `KvFieldKind` of the expression
3430/// it participates in.
3431#[derive(Clone, Debug, Default)]
3432pub struct KvReducedValueView<'a> {
3433    pub value: ::core::option::Option<kv_reduced_value::ValueView<'a>>,
3434    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3435}
3436impl<'a> KvReducedValueView<'a> {
3437    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
3438    ///
3439    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
3440    /// and by generated sub-message decode arms with `depth - 1`.
3441    ///
3442    /// **Not part of the public API.** Named with a leading underscore to
3443    /// signal that it is for generated-code use only.
3444    #[doc(hidden)]
3445    pub fn _decode_depth(
3446        buf: &'a [u8],
3447        depth: u32,
3448    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3449        let mut view = Self::default();
3450        view._merge_into_view(buf, depth)?;
3451        ::core::result::Result::Ok(view)
3452    }
3453    /// Merge fields from `buf` into this view (proto merge semantics).
3454    ///
3455    /// Repeated fields append; singular fields last-wins; singular
3456    /// MESSAGE fields merge recursively. Used by sub-message decode
3457    /// arms when the same field appears multiple times on the wire.
3458    ///
3459    /// **Not part of the public API.**
3460    #[doc(hidden)]
3461    pub fn _merge_into_view(
3462        &mut self,
3463        buf: &'a [u8],
3464        depth: u32,
3465    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3466        let _ = depth;
3467        #[allow(unused_variables)]
3468        let view = self;
3469        let mut cur: &'a [u8] = buf;
3470        while !cur.is_empty() {
3471            let before_tag = cur;
3472            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
3473            match tag.field_number() {
3474                1u32 => {
3475                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3476                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3477                            field_number: 1u32,
3478                            expected: 0u8,
3479                            actual: tag.wire_type() as u8,
3480                        });
3481                    }
3482                    view.value = Some(
3483                        kv_reduced_value::ValueView::Int64Value(
3484                            ::buffa::types::decode_int64(&mut cur)?,
3485                        ),
3486                    );
3487                }
3488                2u32 => {
3489                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3490                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3491                            field_number: 2u32,
3492                            expected: 0u8,
3493                            actual: tag.wire_type() as u8,
3494                        });
3495                    }
3496                    view.value = Some(
3497                        kv_reduced_value::ValueView::Uint64Value(
3498                            ::buffa::types::decode_uint64(&mut cur)?,
3499                        ),
3500                    );
3501                }
3502                3u32 => {
3503                    if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
3504                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3505                            field_number: 3u32,
3506                            expected: 1u8,
3507                            actual: tag.wire_type() as u8,
3508                        });
3509                    }
3510                    view.value = Some(
3511                        kv_reduced_value::ValueView::Float64Value(
3512                            ::buffa::types::decode_double(&mut cur)?,
3513                        ),
3514                    );
3515                }
3516                4u32 => {
3517                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3518                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3519                            field_number: 4u32,
3520                            expected: 0u8,
3521                            actual: tag.wire_type() as u8,
3522                        });
3523                    }
3524                    view.value = Some(
3525                        kv_reduced_value::ValueView::BooleanValue(
3526                            ::buffa::types::decode_bool(&mut cur)?,
3527                        ),
3528                    );
3529                }
3530                5u32 => {
3531                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
3532                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3533                            field_number: 5u32,
3534                            expected: 2u8,
3535                            actual: tag.wire_type() as u8,
3536                        });
3537                    }
3538                    view.value = Some(
3539                        kv_reduced_value::ValueView::Utf8Value(
3540                            ::buffa::types::borrow_str(&mut cur)?,
3541                        ),
3542                    );
3543                }
3544                6u32 => {
3545                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3546                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3547                            field_number: 6u32,
3548                            expected: 0u8,
3549                            actual: tag.wire_type() as u8,
3550                        });
3551                    }
3552                    view.value = Some(
3553                        kv_reduced_value::ValueView::Date32Value(
3554                            ::buffa::types::decode_int32(&mut cur)?,
3555                        ),
3556                    );
3557                }
3558                7u32 => {
3559                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3560                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3561                            field_number: 7u32,
3562                            expected: 0u8,
3563                            actual: tag.wire_type() as u8,
3564                        });
3565                    }
3566                    view.value = Some(
3567                        kv_reduced_value::ValueView::Date64Value(
3568                            ::buffa::types::decode_int64(&mut cur)?,
3569                        ),
3570                    );
3571                }
3572                8u32 => {
3573                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3574                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3575                            field_number: 8u32,
3576                            expected: 0u8,
3577                            actual: tag.wire_type() as u8,
3578                        });
3579                    }
3580                    view.value = Some(
3581                        kv_reduced_value::ValueView::TimestampValue(
3582                            ::buffa::types::decode_int64(&mut cur)?,
3583                        ),
3584                    );
3585                }
3586                9u32 => {
3587                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
3588                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3589                            field_number: 9u32,
3590                            expected: 2u8,
3591                            actual: tag.wire_type() as u8,
3592                        });
3593                    }
3594                    view.value = Some(
3595                        kv_reduced_value::ValueView::Decimal128Value(
3596                            ::buffa::types::borrow_bytes(&mut cur)?,
3597                        ),
3598                    );
3599                }
3600                10u32 => {
3601                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
3602                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3603                            field_number: 10u32,
3604                            expected: 2u8,
3605                            actual: tag.wire_type() as u8,
3606                        });
3607                    }
3608                    view.value = Some(
3609                        kv_reduced_value::ValueView::FixedSizeBinaryValue(
3610                            ::buffa::types::borrow_bytes(&mut cur)?,
3611                        ),
3612                    );
3613                }
3614                11u32 => {
3615                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
3616                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3617                            field_number: 11u32,
3618                            expected: 2u8,
3619                            actual: tag.wire_type() as u8,
3620                        });
3621                    }
3622                    view.value = Some(
3623                        kv_reduced_value::ValueView::Decimal256Value(
3624                            ::buffa::types::borrow_bytes(&mut cur)?,
3625                        ),
3626                    );
3627                }
3628                _ => {
3629                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
3630                    let span_len = before_tag.len() - cur.len();
3631                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
3632                }
3633            }
3634        }
3635        ::core::result::Result::Ok(())
3636    }
3637}
3638impl<'a> ::buffa::MessageView<'a> for KvReducedValueView<'a> {
3639    type Owned = KvReducedValue;
3640    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3641        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
3642    }
3643    fn decode_view_with_limit(
3644        buf: &'a [u8],
3645        depth: u32,
3646    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3647        Self::_decode_depth(buf, depth)
3648    }
3649    /// Convert this view to the owned message type.
3650    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
3651    fn to_owned_message(&self) -> KvReducedValue {
3652        #[allow(unused_imports)]
3653        use ::buffa::alloc::string::ToString as _;
3654        KvReducedValue {
3655            value: self
3656                .value
3657                .as_ref()
3658                .map(|v| match v {
3659                    kv_reduced_value::ValueView::Int64Value(v) => {
3660                        kv_reduced_value::Value::Int64Value(*v)
3661                    }
3662                    kv_reduced_value::ValueView::Uint64Value(v) => {
3663                        kv_reduced_value::Value::Uint64Value(*v)
3664                    }
3665                    kv_reduced_value::ValueView::Float64Value(v) => {
3666                        kv_reduced_value::Value::Float64Value(*v)
3667                    }
3668                    kv_reduced_value::ValueView::BooleanValue(v) => {
3669                        kv_reduced_value::Value::BooleanValue(*v)
3670                    }
3671                    kv_reduced_value::ValueView::Utf8Value(v) => {
3672                        kv_reduced_value::Value::Utf8Value(v.to_string())
3673                    }
3674                    kv_reduced_value::ValueView::Date32Value(v) => {
3675                        kv_reduced_value::Value::Date32Value(*v)
3676                    }
3677                    kv_reduced_value::ValueView::Date64Value(v) => {
3678                        kv_reduced_value::Value::Date64Value(*v)
3679                    }
3680                    kv_reduced_value::ValueView::TimestampValue(v) => {
3681                        kv_reduced_value::Value::TimestampValue(*v)
3682                    }
3683                    kv_reduced_value::ValueView::Decimal128Value(v) => {
3684                        kv_reduced_value::Value::Decimal128Value((v).to_vec())
3685                    }
3686                    kv_reduced_value::ValueView::FixedSizeBinaryValue(v) => {
3687                        kv_reduced_value::Value::FixedSizeBinaryValue((v).to_vec())
3688                    }
3689                    kv_reduced_value::ValueView::Decimal256Value(v) => {
3690                        kv_reduced_value::Value::Decimal256Value((v).to_vec())
3691                    }
3692                }),
3693            __buffa_unknown_fields: self
3694                .__buffa_unknown_fields
3695                .to_owned()
3696                .unwrap_or_default()
3697                .into(),
3698            ..::core::default::Default::default()
3699        }
3700    }
3701}
3702unsafe impl ::buffa::DefaultViewInstance for KvReducedValueView<'static> {
3703    fn default_view_instance() -> &'static Self {
3704        static VALUE: ::buffa::__private::OnceBox<KvReducedValueView<'static>> = ::buffa::__private::OnceBox::new();
3705        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
3706    }
3707}
3708unsafe impl<'a> ::buffa::HasDefaultViewInstance for KvReducedValueView<'a> {
3709    type Static = KvReducedValueView<'static>;
3710}
3711pub mod kv_reduced_value {
3712    #[allow(unused_imports)]
3713    use super::*;
3714    #[derive(Clone, PartialEq, Debug)]
3715    pub enum Value {
3716        Int64Value(i64),
3717        Uint64Value(u64),
3718        Float64Value(f64),
3719        BooleanValue(bool),
3720        Utf8Value(::buffa::alloc::string::String),
3721        Date32Value(i32),
3722        Date64Value(i64),
3723        TimestampValue(i64),
3724        Decimal128Value(::buffa::alloc::vec::Vec<u8>),
3725        FixedSizeBinaryValue(::buffa::alloc::vec::Vec<u8>),
3726        Decimal256Value(::buffa::alloc::vec::Vec<u8>),
3727    }
3728    impl ::buffa::Oneof for Value {}
3729    impl serde::Serialize for Value {
3730        fn serialize<S: serde::Serializer>(
3731            &self,
3732            s: S,
3733        ) -> ::core::result::Result<S::Ok, S::Error> {
3734            use serde::ser::SerializeMap;
3735            let mut map = s.serialize_map(Some(1))?;
3736            match self {
3737                Value::Int64Value(v) => {
3738                    struct _W<'a>(&'a i64);
3739                    impl serde::Serialize for _W<'_> {
3740                        fn serialize<S2: serde::Serializer>(
3741                            &self,
3742                            s: S2,
3743                        ) -> ::core::result::Result<S2::Ok, S2::Error> {
3744                            ::buffa::json_helpers::int64::serialize(self.0, s)
3745                        }
3746                    }
3747                    map.serialize_entry("int64Value", &_W(v))?;
3748                }
3749                Value::Uint64Value(v) => {
3750                    struct _W<'a>(&'a u64);
3751                    impl serde::Serialize for _W<'_> {
3752                        fn serialize<S2: serde::Serializer>(
3753                            &self,
3754                            s: S2,
3755                        ) -> ::core::result::Result<S2::Ok, S2::Error> {
3756                            ::buffa::json_helpers::uint64::serialize(self.0, s)
3757                        }
3758                    }
3759                    map.serialize_entry("uint64Value", &_W(v))?;
3760                }
3761                Value::Float64Value(v) => {
3762                    struct _W<'a>(&'a f64);
3763                    impl serde::Serialize for _W<'_> {
3764                        fn serialize<S2: serde::Serializer>(
3765                            &self,
3766                            s: S2,
3767                        ) -> ::core::result::Result<S2::Ok, S2::Error> {
3768                            ::buffa::json_helpers::double::serialize(self.0, s)
3769                        }
3770                    }
3771                    map.serialize_entry("float64Value", &_W(v))?;
3772                }
3773                Value::BooleanValue(v) => {
3774                    map.serialize_entry("booleanValue", v)?;
3775                }
3776                Value::Utf8Value(v) => {
3777                    map.serialize_entry("utf8Value", v)?;
3778                }
3779                Value::Date32Value(v) => {
3780                    struct _W<'a>(&'a i32);
3781                    impl serde::Serialize for _W<'_> {
3782                        fn serialize<S2: serde::Serializer>(
3783                            &self,
3784                            s: S2,
3785                        ) -> ::core::result::Result<S2::Ok, S2::Error> {
3786                            ::buffa::json_helpers::int32::serialize(self.0, s)
3787                        }
3788                    }
3789                    map.serialize_entry("date32Value", &_W(v))?;
3790                }
3791                Value::Date64Value(v) => {
3792                    struct _W<'a>(&'a i64);
3793                    impl serde::Serialize for _W<'_> {
3794                        fn serialize<S2: serde::Serializer>(
3795                            &self,
3796                            s: S2,
3797                        ) -> ::core::result::Result<S2::Ok, S2::Error> {
3798                            ::buffa::json_helpers::int64::serialize(self.0, s)
3799                        }
3800                    }
3801                    map.serialize_entry("date64Value", &_W(v))?;
3802                }
3803                Value::TimestampValue(v) => {
3804                    struct _W<'a>(&'a i64);
3805                    impl serde::Serialize for _W<'_> {
3806                        fn serialize<S2: serde::Serializer>(
3807                            &self,
3808                            s: S2,
3809                        ) -> ::core::result::Result<S2::Ok, S2::Error> {
3810                            ::buffa::json_helpers::int64::serialize(self.0, s)
3811                        }
3812                    }
3813                    map.serialize_entry("timestampValue", &_W(v))?;
3814                }
3815                Value::Decimal128Value(v) => {
3816                    struct _W<'a>(&'a ::buffa::alloc::vec::Vec<u8>);
3817                    impl serde::Serialize for _W<'_> {
3818                        fn serialize<S2: serde::Serializer>(
3819                            &self,
3820                            s: S2,
3821                        ) -> ::core::result::Result<S2::Ok, S2::Error> {
3822                            ::buffa::json_helpers::bytes::serialize(self.0, s)
3823                        }
3824                    }
3825                    map.serialize_entry("decimal128Value", &_W(v))?;
3826                }
3827                Value::FixedSizeBinaryValue(v) => {
3828                    struct _W<'a>(&'a ::buffa::alloc::vec::Vec<u8>);
3829                    impl serde::Serialize for _W<'_> {
3830                        fn serialize<S2: serde::Serializer>(
3831                            &self,
3832                            s: S2,
3833                        ) -> ::core::result::Result<S2::Ok, S2::Error> {
3834                            ::buffa::json_helpers::bytes::serialize(self.0, s)
3835                        }
3836                    }
3837                    map.serialize_entry("fixedSizeBinaryValue", &_W(v))?;
3838                }
3839                Value::Decimal256Value(v) => {
3840                    struct _W<'a>(&'a ::buffa::alloc::vec::Vec<u8>);
3841                    impl serde::Serialize for _W<'_> {
3842                        fn serialize<S2: serde::Serializer>(
3843                            &self,
3844                            s: S2,
3845                        ) -> ::core::result::Result<S2::Ok, S2::Error> {
3846                            ::buffa::json_helpers::bytes::serialize(self.0, s)
3847                        }
3848                    }
3849                    map.serialize_entry("decimal256Value", &_W(v))?;
3850                }
3851            }
3852            map.end()
3853        }
3854    }
3855    #[derive(Clone, Debug)]
3856    pub enum ValueView<'a> {
3857        Int64Value(i64),
3858        Uint64Value(u64),
3859        Float64Value(f64),
3860        BooleanValue(bool),
3861        Utf8Value(&'a str),
3862        Date32Value(i32),
3863        Date64Value(i64),
3864        TimestampValue(i64),
3865        Decimal128Value(&'a [u8]),
3866        FixedSizeBinaryValue(&'a [u8]),
3867        Decimal256Value(&'a [u8]),
3868    }
3869}
3870/// An expression tree evaluated per row during reduction. Leaf nodes are field
3871/// references or literal values; interior nodes are arithmetic or transform
3872/// operations.
3873#[derive(Clone, PartialEq, Default)]
3874#[derive(::serde::Serialize)]
3875#[serde(default)]
3876pub struct KvExpr {
3877    #[serde(flatten)]
3878    pub expr: Option<kv_expr::Expr>,
3879    #[serde(skip)]
3880    #[doc(hidden)]
3881    pub __buffa_unknown_fields: ::buffa::UnknownFields,
3882    #[doc(hidden)]
3883    #[serde(skip)]
3884    pub __buffa_cached_size: ::buffa::__private::CachedSize,
3885}
3886impl ::core::fmt::Debug for KvExpr {
3887    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3888        f.debug_struct("KvExpr").field("expr", &self.expr).finish()
3889    }
3890}
3891impl KvExpr {
3892    /// Protobuf type URL for this message, for use with `Any::pack` and
3893    /// `Any::unpack_if`.
3894    ///
3895    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
3896    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvExpr";
3897}
3898unsafe impl ::buffa::DefaultInstance for KvExpr {
3899    fn default_instance() -> &'static Self {
3900        static VALUE: ::buffa::__private::OnceBox<KvExpr> = ::buffa::__private::OnceBox::new();
3901        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
3902    }
3903}
3904impl ::buffa::Message for KvExpr {
3905    /// Returns the total encoded size in bytes.
3906    ///
3907    /// The result is a `u32`; the protobuf specification requires all
3908    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
3909    /// compliant message will never overflow this type.
3910    fn compute_size(&self) -> u32 {
3911        #[allow(unused_imports)]
3912        use ::buffa::Enumeration as _;
3913        let mut size = 0u32;
3914        if let ::core::option::Option::Some(ref v) = self.expr {
3915            match v {
3916                kv_expr::Expr::Field(x) => {
3917                    let inner = x.compute_size();
3918                    size
3919                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3920                            + inner;
3921                }
3922                kv_expr::Expr::Literal(x) => {
3923                    let inner = x.compute_size();
3924                    size
3925                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3926                            + inner;
3927                }
3928                kv_expr::Expr::Add(x) => {
3929                    let inner = x.compute_size();
3930                    size
3931                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3932                            + inner;
3933                }
3934                kv_expr::Expr::Sub(x) => {
3935                    let inner = x.compute_size();
3936                    size
3937                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3938                            + inner;
3939                }
3940                kv_expr::Expr::Mul(x) => {
3941                    let inner = x.compute_size();
3942                    size
3943                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3944                            + inner;
3945                }
3946                kv_expr::Expr::Div(x) => {
3947                    let inner = x.compute_size();
3948                    size
3949                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3950                            + inner;
3951                }
3952                kv_expr::Expr::Lower(x) => {
3953                    let inner = x.compute_size();
3954                    size
3955                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3956                            + inner;
3957                }
3958                kv_expr::Expr::DateTruncDay(x) => {
3959                    let inner = x.compute_size();
3960                    size
3961                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3962                            + inner;
3963                }
3964            }
3965        }
3966        size += self.__buffa_unknown_fields.encoded_len() as u32;
3967        self.__buffa_cached_size.set(size);
3968        size
3969    }
3970    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
3971        #[allow(unused_imports)]
3972        use ::buffa::Enumeration as _;
3973        if let ::core::option::Option::Some(ref v) = self.expr {
3974            match v {
3975                kv_expr::Expr::Field(x) => {
3976                    ::buffa::encoding::Tag::new(
3977                            1u32,
3978                            ::buffa::encoding::WireType::LengthDelimited,
3979                        )
3980                        .encode(buf);
3981                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
3982                    x.write_to(buf);
3983                }
3984                kv_expr::Expr::Literal(x) => {
3985                    ::buffa::encoding::Tag::new(
3986                            2u32,
3987                            ::buffa::encoding::WireType::LengthDelimited,
3988                        )
3989                        .encode(buf);
3990                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
3991                    x.write_to(buf);
3992                }
3993                kv_expr::Expr::Add(x) => {
3994                    ::buffa::encoding::Tag::new(
3995                            3u32,
3996                            ::buffa::encoding::WireType::LengthDelimited,
3997                        )
3998                        .encode(buf);
3999                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
4000                    x.write_to(buf);
4001                }
4002                kv_expr::Expr::Sub(x) => {
4003                    ::buffa::encoding::Tag::new(
4004                            4u32,
4005                            ::buffa::encoding::WireType::LengthDelimited,
4006                        )
4007                        .encode(buf);
4008                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
4009                    x.write_to(buf);
4010                }
4011                kv_expr::Expr::Mul(x) => {
4012                    ::buffa::encoding::Tag::new(
4013                            5u32,
4014                            ::buffa::encoding::WireType::LengthDelimited,
4015                        )
4016                        .encode(buf);
4017                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
4018                    x.write_to(buf);
4019                }
4020                kv_expr::Expr::Div(x) => {
4021                    ::buffa::encoding::Tag::new(
4022                            6u32,
4023                            ::buffa::encoding::WireType::LengthDelimited,
4024                        )
4025                        .encode(buf);
4026                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
4027                    x.write_to(buf);
4028                }
4029                kv_expr::Expr::Lower(x) => {
4030                    ::buffa::encoding::Tag::new(
4031                            7u32,
4032                            ::buffa::encoding::WireType::LengthDelimited,
4033                        )
4034                        .encode(buf);
4035                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
4036                    x.write_to(buf);
4037                }
4038                kv_expr::Expr::DateTruncDay(x) => {
4039                    ::buffa::encoding::Tag::new(
4040                            8u32,
4041                            ::buffa::encoding::WireType::LengthDelimited,
4042                        )
4043                        .encode(buf);
4044                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
4045                    x.write_to(buf);
4046                }
4047            }
4048        }
4049        self.__buffa_unknown_fields.write_to(buf);
4050    }
4051    fn merge_field(
4052        &mut self,
4053        tag: ::buffa::encoding::Tag,
4054        buf: &mut impl ::buffa::bytes::Buf,
4055        depth: u32,
4056    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4057        #[allow(unused_imports)]
4058        use ::buffa::bytes::Buf as _;
4059        #[allow(unused_imports)]
4060        use ::buffa::Enumeration as _;
4061        match tag.field_number() {
4062            1u32 => {
4063                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4064                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4065                        field_number: 1u32,
4066                        expected: 2u8,
4067                        actual: tag.wire_type() as u8,
4068                    });
4069                }
4070                if let ::core::option::Option::Some(
4071                    kv_expr::Expr::Field(ref mut existing),
4072                ) = self.expr
4073                {
4074                    ::buffa::Message::merge_length_delimited(
4075                        &mut **existing,
4076                        buf,
4077                        depth,
4078                    )?;
4079                } else {
4080                    let mut val = ::core::default::Default::default();
4081                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
4082                    self.expr = ::core::option::Option::Some(
4083                        kv_expr::Expr::Field(::buffa::alloc::boxed::Box::new(val)),
4084                    );
4085                }
4086            }
4087            2u32 => {
4088                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4089                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4090                        field_number: 2u32,
4091                        expected: 2u8,
4092                        actual: tag.wire_type() as u8,
4093                    });
4094                }
4095                if let ::core::option::Option::Some(
4096                    kv_expr::Expr::Literal(ref mut existing),
4097                ) = self.expr
4098                {
4099                    ::buffa::Message::merge_length_delimited(
4100                        &mut **existing,
4101                        buf,
4102                        depth,
4103                    )?;
4104                } else {
4105                    let mut val = ::core::default::Default::default();
4106                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
4107                    self.expr = ::core::option::Option::Some(
4108                        kv_expr::Expr::Literal(::buffa::alloc::boxed::Box::new(val)),
4109                    );
4110                }
4111            }
4112            3u32 => {
4113                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4114                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4115                        field_number: 3u32,
4116                        expected: 2u8,
4117                        actual: tag.wire_type() as u8,
4118                    });
4119                }
4120                if let ::core::option::Option::Some(
4121                    kv_expr::Expr::Add(ref mut existing),
4122                ) = self.expr
4123                {
4124                    ::buffa::Message::merge_length_delimited(
4125                        &mut **existing,
4126                        buf,
4127                        depth,
4128                    )?;
4129                } else {
4130                    let mut val = ::core::default::Default::default();
4131                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
4132                    self.expr = ::core::option::Option::Some(
4133                        kv_expr::Expr::Add(::buffa::alloc::boxed::Box::new(val)),
4134                    );
4135                }
4136            }
4137            4u32 => {
4138                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4139                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4140                        field_number: 4u32,
4141                        expected: 2u8,
4142                        actual: tag.wire_type() as u8,
4143                    });
4144                }
4145                if let ::core::option::Option::Some(
4146                    kv_expr::Expr::Sub(ref mut existing),
4147                ) = self.expr
4148                {
4149                    ::buffa::Message::merge_length_delimited(
4150                        &mut **existing,
4151                        buf,
4152                        depth,
4153                    )?;
4154                } else {
4155                    let mut val = ::core::default::Default::default();
4156                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
4157                    self.expr = ::core::option::Option::Some(
4158                        kv_expr::Expr::Sub(::buffa::alloc::boxed::Box::new(val)),
4159                    );
4160                }
4161            }
4162            5u32 => {
4163                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4164                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4165                        field_number: 5u32,
4166                        expected: 2u8,
4167                        actual: tag.wire_type() as u8,
4168                    });
4169                }
4170                if let ::core::option::Option::Some(
4171                    kv_expr::Expr::Mul(ref mut existing),
4172                ) = self.expr
4173                {
4174                    ::buffa::Message::merge_length_delimited(
4175                        &mut **existing,
4176                        buf,
4177                        depth,
4178                    )?;
4179                } else {
4180                    let mut val = ::core::default::Default::default();
4181                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
4182                    self.expr = ::core::option::Option::Some(
4183                        kv_expr::Expr::Mul(::buffa::alloc::boxed::Box::new(val)),
4184                    );
4185                }
4186            }
4187            6u32 => {
4188                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4189                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4190                        field_number: 6u32,
4191                        expected: 2u8,
4192                        actual: tag.wire_type() as u8,
4193                    });
4194                }
4195                if let ::core::option::Option::Some(
4196                    kv_expr::Expr::Div(ref mut existing),
4197                ) = self.expr
4198                {
4199                    ::buffa::Message::merge_length_delimited(
4200                        &mut **existing,
4201                        buf,
4202                        depth,
4203                    )?;
4204                } else {
4205                    let mut val = ::core::default::Default::default();
4206                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
4207                    self.expr = ::core::option::Option::Some(
4208                        kv_expr::Expr::Div(::buffa::alloc::boxed::Box::new(val)),
4209                    );
4210                }
4211            }
4212            7u32 => {
4213                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4214                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4215                        field_number: 7u32,
4216                        expected: 2u8,
4217                        actual: tag.wire_type() as u8,
4218                    });
4219                }
4220                if let ::core::option::Option::Some(
4221                    kv_expr::Expr::Lower(ref mut existing),
4222                ) = self.expr
4223                {
4224                    ::buffa::Message::merge_length_delimited(
4225                        &mut **existing,
4226                        buf,
4227                        depth,
4228                    )?;
4229                } else {
4230                    let mut val = ::core::default::Default::default();
4231                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
4232                    self.expr = ::core::option::Option::Some(
4233                        kv_expr::Expr::Lower(::buffa::alloc::boxed::Box::new(val)),
4234                    );
4235                }
4236            }
4237            8u32 => {
4238                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4239                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4240                        field_number: 8u32,
4241                        expected: 2u8,
4242                        actual: tag.wire_type() as u8,
4243                    });
4244                }
4245                if let ::core::option::Option::Some(
4246                    kv_expr::Expr::DateTruncDay(ref mut existing),
4247                ) = self.expr
4248                {
4249                    ::buffa::Message::merge_length_delimited(
4250                        &mut **existing,
4251                        buf,
4252                        depth,
4253                    )?;
4254                } else {
4255                    let mut val = ::core::default::Default::default();
4256                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
4257                    self.expr = ::core::option::Option::Some(
4258                        kv_expr::Expr::DateTruncDay(::buffa::alloc::boxed::Box::new(val)),
4259                    );
4260                }
4261            }
4262            _ => {
4263                self.__buffa_unknown_fields
4264                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
4265            }
4266        }
4267        ::core::result::Result::Ok(())
4268    }
4269    fn cached_size(&self) -> u32 {
4270        self.__buffa_cached_size.get()
4271    }
4272    fn clear(&mut self) {
4273        self.expr = ::core::option::Option::None;
4274        self.__buffa_unknown_fields.clear();
4275        self.__buffa_cached_size.set(0);
4276    }
4277}
4278impl ::buffa::ExtensionSet for KvExpr {
4279    const PROTO_FQN: &'static str = "store.query.v1.KvExpr";
4280    fn unknown_fields(&self) -> &::buffa::UnknownFields {
4281        &self.__buffa_unknown_fields
4282    }
4283    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
4284        &mut self.__buffa_unknown_fields
4285    }
4286}
4287impl<'de> serde::Deserialize<'de> for KvExpr {
4288    fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
4289        struct _V;
4290        impl<'de> serde::de::Visitor<'de> for _V {
4291            type Value = KvExpr;
4292            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4293                f.write_str("struct KvExpr")
4294            }
4295            #[allow(clippy::field_reassign_with_default)]
4296            fn visit_map<A: serde::de::MapAccess<'de>>(
4297                self,
4298                mut map: A,
4299            ) -> Result<KvExpr, A::Error> {
4300                let mut __oneof_expr: Option<kv_expr::Expr> = None;
4301                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
4302                    match key.as_str() {
4303                        "field" => {
4304                            let v: Option<KvFieldRef> = map
4305                                .next_value_seed(
4306                                    ::buffa::json_helpers::NullableDeserializeSeed(
4307                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
4308                                            KvFieldRef,
4309                                        >::new(),
4310                                    ),
4311                                )?;
4312                            if let Some(v) = v {
4313                                if __oneof_expr.is_some() {
4314                                    return Err(
4315                                        serde::de::Error::custom(
4316                                            "multiple oneof fields set for 'expr'",
4317                                        ),
4318                                    );
4319                                }
4320                                __oneof_expr = Some(
4321                                    kv_expr::Expr::Field(::buffa::alloc::boxed::Box::new(v)),
4322                                );
4323                            }
4324                        }
4325                        "literal" => {
4326                            let v: Option<KvReducedValue> = map
4327                                .next_value_seed(
4328                                    ::buffa::json_helpers::NullableDeserializeSeed(
4329                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
4330                                            KvReducedValue,
4331                                        >::new(),
4332                                    ),
4333                                )?;
4334                            if let Some(v) = v {
4335                                if __oneof_expr.is_some() {
4336                                    return Err(
4337                                        serde::de::Error::custom(
4338                                            "multiple oneof fields set for 'expr'",
4339                                        ),
4340                                    );
4341                                }
4342                                __oneof_expr = Some(
4343                                    kv_expr::Expr::Literal(::buffa::alloc::boxed::Box::new(v)),
4344                                );
4345                            }
4346                        }
4347                        "add" => {
4348                            let v: Option<kv_expr::BinaryExpr> = map
4349                                .next_value_seed(
4350                                    ::buffa::json_helpers::NullableDeserializeSeed(
4351                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
4352                                            kv_expr::BinaryExpr,
4353                                        >::new(),
4354                                    ),
4355                                )?;
4356                            if let Some(v) = v {
4357                                if __oneof_expr.is_some() {
4358                                    return Err(
4359                                        serde::de::Error::custom(
4360                                            "multiple oneof fields set for 'expr'",
4361                                        ),
4362                                    );
4363                                }
4364                                __oneof_expr = Some(
4365                                    kv_expr::Expr::Add(::buffa::alloc::boxed::Box::new(v)),
4366                                );
4367                            }
4368                        }
4369                        "sub" => {
4370                            let v: Option<kv_expr::BinaryExpr> = map
4371                                .next_value_seed(
4372                                    ::buffa::json_helpers::NullableDeserializeSeed(
4373                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
4374                                            kv_expr::BinaryExpr,
4375                                        >::new(),
4376                                    ),
4377                                )?;
4378                            if let Some(v) = v {
4379                                if __oneof_expr.is_some() {
4380                                    return Err(
4381                                        serde::de::Error::custom(
4382                                            "multiple oneof fields set for 'expr'",
4383                                        ),
4384                                    );
4385                                }
4386                                __oneof_expr = Some(
4387                                    kv_expr::Expr::Sub(::buffa::alloc::boxed::Box::new(v)),
4388                                );
4389                            }
4390                        }
4391                        "mul" => {
4392                            let v: Option<kv_expr::BinaryExpr> = map
4393                                .next_value_seed(
4394                                    ::buffa::json_helpers::NullableDeserializeSeed(
4395                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
4396                                            kv_expr::BinaryExpr,
4397                                        >::new(),
4398                                    ),
4399                                )?;
4400                            if let Some(v) = v {
4401                                if __oneof_expr.is_some() {
4402                                    return Err(
4403                                        serde::de::Error::custom(
4404                                            "multiple oneof fields set for 'expr'",
4405                                        ),
4406                                    );
4407                                }
4408                                __oneof_expr = Some(
4409                                    kv_expr::Expr::Mul(::buffa::alloc::boxed::Box::new(v)),
4410                                );
4411                            }
4412                        }
4413                        "div" => {
4414                            let v: Option<kv_expr::BinaryExpr> = map
4415                                .next_value_seed(
4416                                    ::buffa::json_helpers::NullableDeserializeSeed(
4417                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
4418                                            kv_expr::BinaryExpr,
4419                                        >::new(),
4420                                    ),
4421                                )?;
4422                            if let Some(v) = v {
4423                                if __oneof_expr.is_some() {
4424                                    return Err(
4425                                        serde::de::Error::custom(
4426                                            "multiple oneof fields set for 'expr'",
4427                                        ),
4428                                    );
4429                                }
4430                                __oneof_expr = Some(
4431                                    kv_expr::Expr::Div(::buffa::alloc::boxed::Box::new(v)),
4432                                );
4433                            }
4434                        }
4435                        "lower" => {
4436                            let v: Option<KvExpr> = map
4437                                .next_value_seed(
4438                                    ::buffa::json_helpers::NullableDeserializeSeed(
4439                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
4440                                            KvExpr,
4441                                        >::new(),
4442                                    ),
4443                                )?;
4444                            if let Some(v) = v {
4445                                if __oneof_expr.is_some() {
4446                                    return Err(
4447                                        serde::de::Error::custom(
4448                                            "multiple oneof fields set for 'expr'",
4449                                        ),
4450                                    );
4451                                }
4452                                __oneof_expr = Some(
4453                                    kv_expr::Expr::Lower(::buffa::alloc::boxed::Box::new(v)),
4454                                );
4455                            }
4456                        }
4457                        "dateTruncDay" | "date_trunc_day" => {
4458                            let v: Option<KvExpr> = map
4459                                .next_value_seed(
4460                                    ::buffa::json_helpers::NullableDeserializeSeed(
4461                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
4462                                            KvExpr,
4463                                        >::new(),
4464                                    ),
4465                                )?;
4466                            if let Some(v) = v {
4467                                if __oneof_expr.is_some() {
4468                                    return Err(
4469                                        serde::de::Error::custom(
4470                                            "multiple oneof fields set for 'expr'",
4471                                        ),
4472                                    );
4473                                }
4474                                __oneof_expr = Some(
4475                                    kv_expr::Expr::DateTruncDay(
4476                                        ::buffa::alloc::boxed::Box::new(v),
4477                                    ),
4478                                );
4479                            }
4480                        }
4481                        _ => {
4482                            map.next_value::<serde::de::IgnoredAny>()?;
4483                        }
4484                    }
4485                }
4486                let mut __r = <KvExpr as ::core::default::Default>::default();
4487                __r.expr = __oneof_expr;
4488                Ok(__r)
4489            }
4490        }
4491        d.deserialize_map(_V)
4492    }
4493}
4494impl ::buffa::json_helpers::ProtoElemJson for KvExpr {
4495    fn serialize_proto_json<S: ::serde::Serializer>(
4496        v: &Self,
4497        s: S,
4498    ) -> ::core::result::Result<S::Ok, S::Error> {
4499        ::serde::Serialize::serialize(v, s)
4500    }
4501    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
4502        d: D,
4503    ) -> ::core::result::Result<Self, D::Error> {
4504        <Self as ::serde::Deserialize>::deserialize(d)
4505    }
4506}
4507#[doc(hidden)]
4508pub const __KV_EXPR_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
4509    type_url: "type.googleapis.com/store.query.v1.KvExpr",
4510    to_json: ::buffa::type_registry::any_to_json::<KvExpr>,
4511    from_json: ::buffa::type_registry::any_from_json::<KvExpr>,
4512    is_wkt: false,
4513};
4514/// An expression tree evaluated per row during reduction. Leaf nodes are field
4515/// references or literal values; interior nodes are arithmetic or transform
4516/// operations.
4517#[derive(Clone, Debug, Default)]
4518pub struct KvExprView<'a> {
4519    pub expr: ::core::option::Option<kv_expr::ExprView<'a>>,
4520    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4521}
4522impl<'a> KvExprView<'a> {
4523    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
4524    ///
4525    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
4526    /// and by generated sub-message decode arms with `depth - 1`.
4527    ///
4528    /// **Not part of the public API.** Named with a leading underscore to
4529    /// signal that it is for generated-code use only.
4530    #[doc(hidden)]
4531    pub fn _decode_depth(
4532        buf: &'a [u8],
4533        depth: u32,
4534    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4535        let mut view = Self::default();
4536        view._merge_into_view(buf, depth)?;
4537        ::core::result::Result::Ok(view)
4538    }
4539    /// Merge fields from `buf` into this view (proto merge semantics).
4540    ///
4541    /// Repeated fields append; singular fields last-wins; singular
4542    /// MESSAGE fields merge recursively. Used by sub-message decode
4543    /// arms when the same field appears multiple times on the wire.
4544    ///
4545    /// **Not part of the public API.**
4546    #[doc(hidden)]
4547    pub fn _merge_into_view(
4548        &mut self,
4549        buf: &'a [u8],
4550        depth: u32,
4551    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4552        let _ = depth;
4553        #[allow(unused_variables)]
4554        let view = self;
4555        let mut cur: &'a [u8] = buf;
4556        while !cur.is_empty() {
4557            let before_tag = cur;
4558            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
4559            match tag.field_number() {
4560                1u32 => {
4561                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4562                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4563                            field_number: 1u32,
4564                            expected: 2u8,
4565                            actual: tag.wire_type() as u8,
4566                        });
4567                    }
4568                    if depth == 0 {
4569                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
4570                    }
4571                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4572                    if let Some(kv_expr::ExprView::Field(ref mut existing)) = view.expr {
4573                        existing._merge_into_view(sub, depth - 1)?;
4574                    } else {
4575                        view.expr = Some(
4576                            kv_expr::ExprView::Field(
4577                                ::buffa::alloc::boxed::Box::new(
4578                                    KvFieldRefView::_decode_depth(sub, depth - 1)?,
4579                                ),
4580                            ),
4581                        );
4582                    }
4583                }
4584                2u32 => {
4585                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4586                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4587                            field_number: 2u32,
4588                            expected: 2u8,
4589                            actual: tag.wire_type() as u8,
4590                        });
4591                    }
4592                    if depth == 0 {
4593                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
4594                    }
4595                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4596                    if let Some(kv_expr::ExprView::Literal(ref mut existing)) = view.expr
4597                    {
4598                        existing._merge_into_view(sub, depth - 1)?;
4599                    } else {
4600                        view.expr = Some(
4601                            kv_expr::ExprView::Literal(
4602                                ::buffa::alloc::boxed::Box::new(
4603                                    KvReducedValueView::_decode_depth(sub, depth - 1)?,
4604                                ),
4605                            ),
4606                        );
4607                    }
4608                }
4609                3u32 => {
4610                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4611                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4612                            field_number: 3u32,
4613                            expected: 2u8,
4614                            actual: tag.wire_type() as u8,
4615                        });
4616                    }
4617                    if depth == 0 {
4618                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
4619                    }
4620                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4621                    if let Some(kv_expr::ExprView::Add(ref mut existing)) = view.expr {
4622                        existing._merge_into_view(sub, depth - 1)?;
4623                    } else {
4624                        view.expr = Some(
4625                            kv_expr::ExprView::Add(
4626                                ::buffa::alloc::boxed::Box::new(
4627                                    kv_expr::BinaryExprView::_decode_depth(sub, depth - 1)?,
4628                                ),
4629                            ),
4630                        );
4631                    }
4632                }
4633                4u32 => {
4634                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4635                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4636                            field_number: 4u32,
4637                            expected: 2u8,
4638                            actual: tag.wire_type() as u8,
4639                        });
4640                    }
4641                    if depth == 0 {
4642                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
4643                    }
4644                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4645                    if let Some(kv_expr::ExprView::Sub(ref mut existing)) = view.expr {
4646                        existing._merge_into_view(sub, depth - 1)?;
4647                    } else {
4648                        view.expr = Some(
4649                            kv_expr::ExprView::Sub(
4650                                ::buffa::alloc::boxed::Box::new(
4651                                    kv_expr::BinaryExprView::_decode_depth(sub, depth - 1)?,
4652                                ),
4653                            ),
4654                        );
4655                    }
4656                }
4657                5u32 => {
4658                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4659                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4660                            field_number: 5u32,
4661                            expected: 2u8,
4662                            actual: tag.wire_type() as u8,
4663                        });
4664                    }
4665                    if depth == 0 {
4666                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
4667                    }
4668                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4669                    if let Some(kv_expr::ExprView::Mul(ref mut existing)) = view.expr {
4670                        existing._merge_into_view(sub, depth - 1)?;
4671                    } else {
4672                        view.expr = Some(
4673                            kv_expr::ExprView::Mul(
4674                                ::buffa::alloc::boxed::Box::new(
4675                                    kv_expr::BinaryExprView::_decode_depth(sub, depth - 1)?,
4676                                ),
4677                            ),
4678                        );
4679                    }
4680                }
4681                6u32 => {
4682                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4683                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4684                            field_number: 6u32,
4685                            expected: 2u8,
4686                            actual: tag.wire_type() as u8,
4687                        });
4688                    }
4689                    if depth == 0 {
4690                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
4691                    }
4692                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4693                    if let Some(kv_expr::ExprView::Div(ref mut existing)) = view.expr {
4694                        existing._merge_into_view(sub, depth - 1)?;
4695                    } else {
4696                        view.expr = Some(
4697                            kv_expr::ExprView::Div(
4698                                ::buffa::alloc::boxed::Box::new(
4699                                    kv_expr::BinaryExprView::_decode_depth(sub, depth - 1)?,
4700                                ),
4701                            ),
4702                        );
4703                    }
4704                }
4705                7u32 => {
4706                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4707                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4708                            field_number: 7u32,
4709                            expected: 2u8,
4710                            actual: tag.wire_type() as u8,
4711                        });
4712                    }
4713                    if depth == 0 {
4714                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
4715                    }
4716                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4717                    if let Some(kv_expr::ExprView::Lower(ref mut existing)) = view.expr {
4718                        existing._merge_into_view(sub, depth - 1)?;
4719                    } else {
4720                        view.expr = Some(
4721                            kv_expr::ExprView::Lower(
4722                                ::buffa::alloc::boxed::Box::new(
4723                                    KvExprView::_decode_depth(sub, depth - 1)?,
4724                                ),
4725                            ),
4726                        );
4727                    }
4728                }
4729                8u32 => {
4730                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4731                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4732                            field_number: 8u32,
4733                            expected: 2u8,
4734                            actual: tag.wire_type() as u8,
4735                        });
4736                    }
4737                    if depth == 0 {
4738                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
4739                    }
4740                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4741                    if let Some(kv_expr::ExprView::DateTruncDay(ref mut existing)) = view
4742                        .expr
4743                    {
4744                        existing._merge_into_view(sub, depth - 1)?;
4745                    } else {
4746                        view.expr = Some(
4747                            kv_expr::ExprView::DateTruncDay(
4748                                ::buffa::alloc::boxed::Box::new(
4749                                    KvExprView::_decode_depth(sub, depth - 1)?,
4750                                ),
4751                            ),
4752                        );
4753                    }
4754                }
4755                _ => {
4756                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4757                    let span_len = before_tag.len() - cur.len();
4758                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
4759                }
4760            }
4761        }
4762        ::core::result::Result::Ok(())
4763    }
4764}
4765impl<'a> ::buffa::MessageView<'a> for KvExprView<'a> {
4766    type Owned = KvExpr;
4767    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4768        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4769    }
4770    fn decode_view_with_limit(
4771        buf: &'a [u8],
4772        depth: u32,
4773    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4774        Self::_decode_depth(buf, depth)
4775    }
4776    /// Convert this view to the owned message type.
4777    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
4778    fn to_owned_message(&self) -> KvExpr {
4779        #[allow(unused_imports)]
4780        use ::buffa::alloc::string::ToString as _;
4781        KvExpr {
4782            expr: self
4783                .expr
4784                .as_ref()
4785                .map(|v| match v {
4786                    kv_expr::ExprView::Field(v) => {
4787                        kv_expr::Expr::Field(
4788                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
4789                        )
4790                    }
4791                    kv_expr::ExprView::Literal(v) => {
4792                        kv_expr::Expr::Literal(
4793                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
4794                        )
4795                    }
4796                    kv_expr::ExprView::Add(v) => {
4797                        kv_expr::Expr::Add(
4798                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
4799                        )
4800                    }
4801                    kv_expr::ExprView::Sub(v) => {
4802                        kv_expr::Expr::Sub(
4803                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
4804                        )
4805                    }
4806                    kv_expr::ExprView::Mul(v) => {
4807                        kv_expr::Expr::Mul(
4808                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
4809                        )
4810                    }
4811                    kv_expr::ExprView::Div(v) => {
4812                        kv_expr::Expr::Div(
4813                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
4814                        )
4815                    }
4816                    kv_expr::ExprView::Lower(v) => {
4817                        kv_expr::Expr::Lower(
4818                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
4819                        )
4820                    }
4821                    kv_expr::ExprView::DateTruncDay(v) => {
4822                        kv_expr::Expr::DateTruncDay(
4823                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
4824                        )
4825                    }
4826                }),
4827            __buffa_unknown_fields: self
4828                .__buffa_unknown_fields
4829                .to_owned()
4830                .unwrap_or_default()
4831                .into(),
4832            ..::core::default::Default::default()
4833        }
4834    }
4835}
4836unsafe impl ::buffa::DefaultViewInstance for KvExprView<'static> {
4837    fn default_view_instance() -> &'static Self {
4838        static VALUE: ::buffa::__private::OnceBox<KvExprView<'static>> = ::buffa::__private::OnceBox::new();
4839        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
4840    }
4841}
4842unsafe impl<'a> ::buffa::HasDefaultViewInstance for KvExprView<'a> {
4843    type Static = KvExprView<'static>;
4844}
4845pub mod kv_expr {
4846    #[allow(unused_imports)]
4847    use super::*;
4848    /// Binary arithmetic operation on two sub-expressions.
4849    #[derive(Clone, PartialEq, Default)]
4850    #[derive(::serde::Serialize, ::serde::Deserialize)]
4851    #[serde(default)]
4852    pub struct BinaryExpr {
4853        /// Field 1: `left`
4854        #[serde(
4855            rename = "left",
4856            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
4857        )]
4858        pub left: ::buffa::MessageField<KvExpr>,
4859        /// Field 2: `right`
4860        #[serde(
4861            rename = "right",
4862            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
4863        )]
4864        pub right: ::buffa::MessageField<KvExpr>,
4865        #[serde(skip)]
4866        #[doc(hidden)]
4867        pub __buffa_unknown_fields: ::buffa::UnknownFields,
4868        #[doc(hidden)]
4869        #[serde(skip)]
4870        pub __buffa_cached_size: ::buffa::__private::CachedSize,
4871    }
4872    impl ::core::fmt::Debug for BinaryExpr {
4873        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4874            f.debug_struct("BinaryExpr")
4875                .field("left", &self.left)
4876                .field("right", &self.right)
4877                .finish()
4878        }
4879    }
4880    impl BinaryExpr {
4881        /// Protobuf type URL for this message, for use with `Any::pack` and
4882        /// `Any::unpack_if`.
4883        ///
4884        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
4885        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvExpr.BinaryExpr";
4886    }
4887    unsafe impl ::buffa::DefaultInstance for BinaryExpr {
4888        fn default_instance() -> &'static Self {
4889            static VALUE: ::buffa::__private::OnceBox<BinaryExpr> = ::buffa::__private::OnceBox::new();
4890            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
4891        }
4892    }
4893    impl ::buffa::Message for BinaryExpr {
4894        /// Returns the total encoded size in bytes.
4895        ///
4896        /// The result is a `u32`; the protobuf specification requires all
4897        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
4898        /// compliant message will never overflow this type.
4899        fn compute_size(&self) -> u32 {
4900            #[allow(unused_imports)]
4901            use ::buffa::Enumeration as _;
4902            let mut size = 0u32;
4903            if self.left.is_set() {
4904                let inner_size = self.left.compute_size();
4905                size
4906                    += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4907                        + inner_size;
4908            }
4909            if self.right.is_set() {
4910                let inner_size = self.right.compute_size();
4911                size
4912                    += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4913                        + inner_size;
4914            }
4915            size += self.__buffa_unknown_fields.encoded_len() as u32;
4916            self.__buffa_cached_size.set(size);
4917            size
4918        }
4919        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
4920            #[allow(unused_imports)]
4921            use ::buffa::Enumeration as _;
4922            if self.left.is_set() {
4923                ::buffa::encoding::Tag::new(
4924                        1u32,
4925                        ::buffa::encoding::WireType::LengthDelimited,
4926                    )
4927                    .encode(buf);
4928                ::buffa::encoding::encode_varint(self.left.cached_size() as u64, buf);
4929                self.left.write_to(buf);
4930            }
4931            if self.right.is_set() {
4932                ::buffa::encoding::Tag::new(
4933                        2u32,
4934                        ::buffa::encoding::WireType::LengthDelimited,
4935                    )
4936                    .encode(buf);
4937                ::buffa::encoding::encode_varint(self.right.cached_size() as u64, buf);
4938                self.right.write_to(buf);
4939            }
4940            self.__buffa_unknown_fields.write_to(buf);
4941        }
4942        fn merge_field(
4943            &mut self,
4944            tag: ::buffa::encoding::Tag,
4945            buf: &mut impl ::buffa::bytes::Buf,
4946            depth: u32,
4947        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4948            #[allow(unused_imports)]
4949            use ::buffa::bytes::Buf as _;
4950            #[allow(unused_imports)]
4951            use ::buffa::Enumeration as _;
4952            match tag.field_number() {
4953                1u32 => {
4954                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4955                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4956                            field_number: 1u32,
4957                            expected: 2u8,
4958                            actual: tag.wire_type() as u8,
4959                        });
4960                    }
4961                    ::buffa::Message::merge_length_delimited(
4962                        self.left.get_or_insert_default(),
4963                        buf,
4964                        depth,
4965                    )?;
4966                }
4967                2u32 => {
4968                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
4969                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4970                            field_number: 2u32,
4971                            expected: 2u8,
4972                            actual: tag.wire_type() as u8,
4973                        });
4974                    }
4975                    ::buffa::Message::merge_length_delimited(
4976                        self.right.get_or_insert_default(),
4977                        buf,
4978                        depth,
4979                    )?;
4980                }
4981                _ => {
4982                    self.__buffa_unknown_fields
4983                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
4984                }
4985            }
4986            ::core::result::Result::Ok(())
4987        }
4988        fn cached_size(&self) -> u32 {
4989            self.__buffa_cached_size.get()
4990        }
4991        fn clear(&mut self) {
4992            self.left = ::buffa::MessageField::none();
4993            self.right = ::buffa::MessageField::none();
4994            self.__buffa_unknown_fields.clear();
4995            self.__buffa_cached_size.set(0);
4996        }
4997    }
4998    impl ::buffa::ExtensionSet for BinaryExpr {
4999        const PROTO_FQN: &'static str = "store.query.v1.KvExpr.BinaryExpr";
5000        fn unknown_fields(&self) -> &::buffa::UnknownFields {
5001            &self.__buffa_unknown_fields
5002        }
5003        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5004            &mut self.__buffa_unknown_fields
5005        }
5006    }
5007    impl ::buffa::json_helpers::ProtoElemJson for BinaryExpr {
5008        fn serialize_proto_json<S: ::serde::Serializer>(
5009            v: &Self,
5010            s: S,
5011        ) -> ::core::result::Result<S::Ok, S::Error> {
5012            ::serde::Serialize::serialize(v, s)
5013        }
5014        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
5015            d: D,
5016        ) -> ::core::result::Result<Self, D::Error> {
5017            <Self as ::serde::Deserialize>::deserialize(d)
5018        }
5019    }
5020    #[doc(hidden)]
5021    pub const __BINARY_EXPR_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
5022        type_url: "type.googleapis.com/store.query.v1.KvExpr.BinaryExpr",
5023        to_json: ::buffa::type_registry::any_to_json::<BinaryExpr>,
5024        from_json: ::buffa::type_registry::any_from_json::<BinaryExpr>,
5025        is_wkt: false,
5026    };
5027    /// Binary arithmetic operation on two sub-expressions.
5028    #[derive(Clone, Debug, Default)]
5029    pub struct BinaryExprView<'a> {
5030        /// Field 1: `left`
5031        pub left: ::buffa::MessageFieldView<KvExprView<'a>>,
5032        /// Field 2: `right`
5033        pub right: ::buffa::MessageFieldView<KvExprView<'a>>,
5034        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5035    }
5036    impl<'a> BinaryExprView<'a> {
5037        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
5038        ///
5039        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
5040        /// and by generated sub-message decode arms with `depth - 1`.
5041        ///
5042        /// **Not part of the public API.** Named with a leading underscore to
5043        /// signal that it is for generated-code use only.
5044        #[doc(hidden)]
5045        pub fn _decode_depth(
5046            buf: &'a [u8],
5047            depth: u32,
5048        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5049            let mut view = Self::default();
5050            view._merge_into_view(buf, depth)?;
5051            ::core::result::Result::Ok(view)
5052        }
5053        /// Merge fields from `buf` into this view (proto merge semantics).
5054        ///
5055        /// Repeated fields append; singular fields last-wins; singular
5056        /// MESSAGE fields merge recursively. Used by sub-message decode
5057        /// arms when the same field appears multiple times on the wire.
5058        ///
5059        /// **Not part of the public API.**
5060        #[doc(hidden)]
5061        pub fn _merge_into_view(
5062            &mut self,
5063            buf: &'a [u8],
5064            depth: u32,
5065        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5066            let _ = depth;
5067            #[allow(unused_variables)]
5068            let view = self;
5069            let mut cur: &'a [u8] = buf;
5070            while !cur.is_empty() {
5071                let before_tag = cur;
5072                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
5073                match tag.field_number() {
5074                    1u32 => {
5075                        if tag.wire_type()
5076                            != ::buffa::encoding::WireType::LengthDelimited
5077                        {
5078                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5079                                field_number: 1u32,
5080                                expected: 2u8,
5081                                actual: tag.wire_type() as u8,
5082                            });
5083                        }
5084                        if depth == 0 {
5085                            return Err(::buffa::DecodeError::RecursionLimitExceeded);
5086                        }
5087                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
5088                        match view.left.as_mut() {
5089                            Some(existing) => existing._merge_into_view(sub, depth - 1)?,
5090                            None => {
5091                                view.left = ::buffa::MessageFieldView::set(
5092                                    KvExprView::_decode_depth(sub, depth - 1)?,
5093                                );
5094                            }
5095                        }
5096                    }
5097                    2u32 => {
5098                        if tag.wire_type()
5099                            != ::buffa::encoding::WireType::LengthDelimited
5100                        {
5101                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5102                                field_number: 2u32,
5103                                expected: 2u8,
5104                                actual: tag.wire_type() as u8,
5105                            });
5106                        }
5107                        if depth == 0 {
5108                            return Err(::buffa::DecodeError::RecursionLimitExceeded);
5109                        }
5110                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
5111                        match view.right.as_mut() {
5112                            Some(existing) => existing._merge_into_view(sub, depth - 1)?,
5113                            None => {
5114                                view.right = ::buffa::MessageFieldView::set(
5115                                    KvExprView::_decode_depth(sub, depth - 1)?,
5116                                );
5117                            }
5118                        }
5119                    }
5120                    _ => {
5121                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
5122                        let span_len = before_tag.len() - cur.len();
5123                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
5124                    }
5125                }
5126            }
5127            ::core::result::Result::Ok(())
5128        }
5129    }
5130    impl<'a> ::buffa::MessageView<'a> for BinaryExprView<'a> {
5131        type Owned = BinaryExpr;
5132        fn decode_view(
5133            buf: &'a [u8],
5134        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5135            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
5136        }
5137        fn decode_view_with_limit(
5138            buf: &'a [u8],
5139            depth: u32,
5140        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5141            Self::_decode_depth(buf, depth)
5142        }
5143        /// Convert this view to the owned message type.
5144        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
5145        fn to_owned_message(&self) -> BinaryExpr {
5146            #[allow(unused_imports)]
5147            use ::buffa::alloc::string::ToString as _;
5148            BinaryExpr {
5149                left: match self.left.as_option() {
5150                    Some(v) => {
5151                        ::buffa::MessageField::<KvExpr>::some(v.to_owned_message())
5152                    }
5153                    None => ::buffa::MessageField::none(),
5154                },
5155                right: match self.right.as_option() {
5156                    Some(v) => {
5157                        ::buffa::MessageField::<KvExpr>::some(v.to_owned_message())
5158                    }
5159                    None => ::buffa::MessageField::none(),
5160                },
5161                __buffa_unknown_fields: self
5162                    .__buffa_unknown_fields
5163                    .to_owned()
5164                    .unwrap_or_default()
5165                    .into(),
5166                ..::core::default::Default::default()
5167            }
5168        }
5169    }
5170    unsafe impl ::buffa::DefaultViewInstance for BinaryExprView<'static> {
5171        fn default_view_instance() -> &'static Self {
5172            static VALUE: ::buffa::__private::OnceBox<BinaryExprView<'static>> = ::buffa::__private::OnceBox::new();
5173            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
5174        }
5175    }
5176    unsafe impl<'a> ::buffa::HasDefaultViewInstance for BinaryExprView<'a> {
5177        type Static = BinaryExprView<'static>;
5178    }
5179    #[derive(Clone, PartialEq, Debug)]
5180    pub enum Expr {
5181        Field(::buffa::alloc::boxed::Box<super::KvFieldRef>),
5182        Literal(::buffa::alloc::boxed::Box<super::KvReducedValue>),
5183        Add(::buffa::alloc::boxed::Box<super::kv_expr::BinaryExpr>),
5184        Sub(::buffa::alloc::boxed::Box<super::kv_expr::BinaryExpr>),
5185        Mul(::buffa::alloc::boxed::Box<super::kv_expr::BinaryExpr>),
5186        Div(::buffa::alloc::boxed::Box<super::kv_expr::BinaryExpr>),
5187        Lower(::buffa::alloc::boxed::Box<super::KvExpr>),
5188        DateTruncDay(::buffa::alloc::boxed::Box<super::KvExpr>),
5189    }
5190    impl ::buffa::Oneof for Expr {}
5191    impl From<super::KvFieldRef> for Expr {
5192        fn from(v: super::KvFieldRef) -> Self {
5193            Self::Field(::buffa::alloc::boxed::Box::new(v))
5194        }
5195    }
5196    impl From<super::KvFieldRef> for ::core::option::Option<Expr> {
5197        fn from(v: super::KvFieldRef) -> Self {
5198            Self::Some(Expr::from(v))
5199        }
5200    }
5201    impl From<super::KvReducedValue> for Expr {
5202        fn from(v: super::KvReducedValue) -> Self {
5203            Self::Literal(::buffa::alloc::boxed::Box::new(v))
5204        }
5205    }
5206    impl From<super::KvReducedValue> for ::core::option::Option<Expr> {
5207        fn from(v: super::KvReducedValue) -> Self {
5208            Self::Some(Expr::from(v))
5209        }
5210    }
5211    impl serde::Serialize for Expr {
5212        fn serialize<S: serde::Serializer>(
5213            &self,
5214            s: S,
5215        ) -> ::core::result::Result<S::Ok, S::Error> {
5216            use serde::ser::SerializeMap;
5217            let mut map = s.serialize_map(Some(1))?;
5218            match self {
5219                Expr::Field(v) => {
5220                    map.serialize_entry("field", v)?;
5221                }
5222                Expr::Literal(v) => {
5223                    map.serialize_entry("literal", v)?;
5224                }
5225                Expr::Add(v) => {
5226                    map.serialize_entry("add", v)?;
5227                }
5228                Expr::Sub(v) => {
5229                    map.serialize_entry("sub", v)?;
5230                }
5231                Expr::Mul(v) => {
5232                    map.serialize_entry("mul", v)?;
5233                }
5234                Expr::Div(v) => {
5235                    map.serialize_entry("div", v)?;
5236                }
5237                Expr::Lower(v) => {
5238                    map.serialize_entry("lower", v)?;
5239                }
5240                Expr::DateTruncDay(v) => {
5241                    map.serialize_entry("dateTruncDay", v)?;
5242                }
5243            }
5244            map.end()
5245        }
5246    }
5247    #[derive(Clone, Debug)]
5248    pub enum ExprView<'a> {
5249        Field(::buffa::alloc::boxed::Box<super::KvFieldRefView<'a>>),
5250        Literal(::buffa::alloc::boxed::Box<super::KvReducedValueView<'a>>),
5251        Add(::buffa::alloc::boxed::Box<super::kv_expr::BinaryExprView<'a>>),
5252        Sub(::buffa::alloc::boxed::Box<super::kv_expr::BinaryExprView<'a>>),
5253        Mul(::buffa::alloc::boxed::Box<super::kv_expr::BinaryExprView<'a>>),
5254        Div(::buffa::alloc::boxed::Box<super::kv_expr::BinaryExprView<'a>>),
5255        Lower(::buffa::alloc::boxed::Box<super::KvExprView<'a>>),
5256        DateTruncDay(::buffa::alloc::boxed::Box<super::KvExprView<'a>>),
5257    }
5258}
5259/// A constraint applied to a single field value during predicate evaluation.
5260/// Exactly one variant must be set.
5261#[derive(Clone, PartialEq, Default)]
5262#[derive(::serde::Serialize)]
5263#[serde(default)]
5264pub struct KvPredicateConstraint {
5265    #[serde(flatten)]
5266    pub constraint: Option<kv_predicate_constraint::Constraint>,
5267    #[serde(skip)]
5268    #[doc(hidden)]
5269    pub __buffa_unknown_fields: ::buffa::UnknownFields,
5270    #[doc(hidden)]
5271    #[serde(skip)]
5272    pub __buffa_cached_size: ::buffa::__private::CachedSize,
5273}
5274impl ::core::fmt::Debug for KvPredicateConstraint {
5275    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5276        f.debug_struct("KvPredicateConstraint")
5277            .field("constraint", &self.constraint)
5278            .finish()
5279    }
5280}
5281impl KvPredicateConstraint {
5282    /// Protobuf type URL for this message, for use with `Any::pack` and
5283    /// `Any::unpack_if`.
5284    ///
5285    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
5286    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicateConstraint";
5287}
5288unsafe impl ::buffa::DefaultInstance for KvPredicateConstraint {
5289    fn default_instance() -> &'static Self {
5290        static VALUE: ::buffa::__private::OnceBox<KvPredicateConstraint> = ::buffa::__private::OnceBox::new();
5291        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
5292    }
5293}
5294impl ::buffa::Message for KvPredicateConstraint {
5295    /// Returns the total encoded size in bytes.
5296    ///
5297    /// The result is a `u32`; the protobuf specification requires all
5298    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
5299    /// compliant message will never overflow this type.
5300    fn compute_size(&self) -> u32 {
5301        #[allow(unused_imports)]
5302        use ::buffa::Enumeration as _;
5303        let mut size = 0u32;
5304        if let ::core::option::Option::Some(ref v) = self.constraint {
5305            match v {
5306                kv_predicate_constraint::Constraint::StringEq(x) => {
5307                    size += 1u32 + ::buffa::types::string_encoded_len(x) as u32;
5308                }
5309                kv_predicate_constraint::Constraint::BoolEq(_x) => {
5310                    size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
5311                }
5312                kv_predicate_constraint::Constraint::FixedSizeBinaryEq(x) => {
5313                    size += 1u32 + ::buffa::types::bytes_encoded_len(x) as u32;
5314                }
5315                kv_predicate_constraint::Constraint::IntRange(x) => {
5316                    let inner = x.compute_size();
5317                    size
5318                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
5319                            + inner;
5320                }
5321                kv_predicate_constraint::Constraint::Uint64Range(x) => {
5322                    let inner = x.compute_size();
5323                    size
5324                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
5325                            + inner;
5326                }
5327                kv_predicate_constraint::Constraint::FloatRange(x) => {
5328                    let inner = x.compute_size();
5329                    size
5330                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
5331                            + inner;
5332                }
5333                kv_predicate_constraint::Constraint::Decimal128Range(x) => {
5334                    let inner = x.compute_size();
5335                    size
5336                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
5337                            + inner;
5338                }
5339                kv_predicate_constraint::Constraint::IsNull(_x) => {
5340                    size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
5341                }
5342                kv_predicate_constraint::Constraint::IsNotNull(_x) => {
5343                    size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
5344                }
5345                kv_predicate_constraint::Constraint::StringIn(x) => {
5346                    let inner = x.compute_size();
5347                    size
5348                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
5349                            + inner;
5350                }
5351                kv_predicate_constraint::Constraint::IntIn(x) => {
5352                    let inner = x.compute_size();
5353                    size
5354                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
5355                            + inner;
5356                }
5357                kv_predicate_constraint::Constraint::Uint64In(x) => {
5358                    let inner = x.compute_size();
5359                    size
5360                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
5361                            + inner;
5362                }
5363                kv_predicate_constraint::Constraint::FixedSizeBinaryIn(x) => {
5364                    let inner = x.compute_size();
5365                    size
5366                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
5367                            + inner;
5368                }
5369                kv_predicate_constraint::Constraint::Decimal256Range(x) => {
5370                    let inner = x.compute_size();
5371                    size
5372                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
5373                            + inner;
5374                }
5375            }
5376        }
5377        size += self.__buffa_unknown_fields.encoded_len() as u32;
5378        self.__buffa_cached_size.set(size);
5379        size
5380    }
5381    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
5382        #[allow(unused_imports)]
5383        use ::buffa::Enumeration as _;
5384        if let ::core::option::Option::Some(ref v) = self.constraint {
5385            match v {
5386                kv_predicate_constraint::Constraint::StringEq(x) => {
5387                    ::buffa::encoding::Tag::new(
5388                            1u32,
5389                            ::buffa::encoding::WireType::LengthDelimited,
5390                        )
5391                        .encode(buf);
5392                    ::buffa::types::encode_string(x, buf);
5393                }
5394                kv_predicate_constraint::Constraint::BoolEq(x) => {
5395                    ::buffa::encoding::Tag::new(
5396                            2u32,
5397                            ::buffa::encoding::WireType::Varint,
5398                        )
5399                        .encode(buf);
5400                    ::buffa::types::encode_bool(*x, buf);
5401                }
5402                kv_predicate_constraint::Constraint::FixedSizeBinaryEq(x) => {
5403                    ::buffa::encoding::Tag::new(
5404                            3u32,
5405                            ::buffa::encoding::WireType::LengthDelimited,
5406                        )
5407                        .encode(buf);
5408                    ::buffa::types::encode_bytes(x, buf);
5409                }
5410                kv_predicate_constraint::Constraint::IntRange(x) => {
5411                    ::buffa::encoding::Tag::new(
5412                            4u32,
5413                            ::buffa::encoding::WireType::LengthDelimited,
5414                        )
5415                        .encode(buf);
5416                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
5417                    x.write_to(buf);
5418                }
5419                kv_predicate_constraint::Constraint::Uint64Range(x) => {
5420                    ::buffa::encoding::Tag::new(
5421                            5u32,
5422                            ::buffa::encoding::WireType::LengthDelimited,
5423                        )
5424                        .encode(buf);
5425                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
5426                    x.write_to(buf);
5427                }
5428                kv_predicate_constraint::Constraint::FloatRange(x) => {
5429                    ::buffa::encoding::Tag::new(
5430                            6u32,
5431                            ::buffa::encoding::WireType::LengthDelimited,
5432                        )
5433                        .encode(buf);
5434                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
5435                    x.write_to(buf);
5436                }
5437                kv_predicate_constraint::Constraint::Decimal128Range(x) => {
5438                    ::buffa::encoding::Tag::new(
5439                            7u32,
5440                            ::buffa::encoding::WireType::LengthDelimited,
5441                        )
5442                        .encode(buf);
5443                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
5444                    x.write_to(buf);
5445                }
5446                kv_predicate_constraint::Constraint::IsNull(x) => {
5447                    ::buffa::encoding::Tag::new(
5448                            8u32,
5449                            ::buffa::encoding::WireType::Varint,
5450                        )
5451                        .encode(buf);
5452                    ::buffa::types::encode_bool(*x, buf);
5453                }
5454                kv_predicate_constraint::Constraint::IsNotNull(x) => {
5455                    ::buffa::encoding::Tag::new(
5456                            9u32,
5457                            ::buffa::encoding::WireType::Varint,
5458                        )
5459                        .encode(buf);
5460                    ::buffa::types::encode_bool(*x, buf);
5461                }
5462                kv_predicate_constraint::Constraint::StringIn(x) => {
5463                    ::buffa::encoding::Tag::new(
5464                            10u32,
5465                            ::buffa::encoding::WireType::LengthDelimited,
5466                        )
5467                        .encode(buf);
5468                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
5469                    x.write_to(buf);
5470                }
5471                kv_predicate_constraint::Constraint::IntIn(x) => {
5472                    ::buffa::encoding::Tag::new(
5473                            11u32,
5474                            ::buffa::encoding::WireType::LengthDelimited,
5475                        )
5476                        .encode(buf);
5477                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
5478                    x.write_to(buf);
5479                }
5480                kv_predicate_constraint::Constraint::Uint64In(x) => {
5481                    ::buffa::encoding::Tag::new(
5482                            12u32,
5483                            ::buffa::encoding::WireType::LengthDelimited,
5484                        )
5485                        .encode(buf);
5486                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
5487                    x.write_to(buf);
5488                }
5489                kv_predicate_constraint::Constraint::FixedSizeBinaryIn(x) => {
5490                    ::buffa::encoding::Tag::new(
5491                            13u32,
5492                            ::buffa::encoding::WireType::LengthDelimited,
5493                        )
5494                        .encode(buf);
5495                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
5496                    x.write_to(buf);
5497                }
5498                kv_predicate_constraint::Constraint::Decimal256Range(x) => {
5499                    ::buffa::encoding::Tag::new(
5500                            14u32,
5501                            ::buffa::encoding::WireType::LengthDelimited,
5502                        )
5503                        .encode(buf);
5504                    ::buffa::encoding::encode_varint(x.cached_size() as u64, buf);
5505                    x.write_to(buf);
5506                }
5507            }
5508        }
5509        self.__buffa_unknown_fields.write_to(buf);
5510    }
5511    fn merge_field(
5512        &mut self,
5513        tag: ::buffa::encoding::Tag,
5514        buf: &mut impl ::buffa::bytes::Buf,
5515        depth: u32,
5516    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5517        #[allow(unused_imports)]
5518        use ::buffa::bytes::Buf as _;
5519        #[allow(unused_imports)]
5520        use ::buffa::Enumeration as _;
5521        match tag.field_number() {
5522            1u32 => {
5523                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5524                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5525                        field_number: 1u32,
5526                        expected: 2u8,
5527                        actual: tag.wire_type() as u8,
5528                    });
5529                }
5530                self.constraint = ::core::option::Option::Some(
5531                    kv_predicate_constraint::Constraint::StringEq(
5532                        ::buffa::types::decode_string(buf)?,
5533                    ),
5534                );
5535            }
5536            2u32 => {
5537                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
5538                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5539                        field_number: 2u32,
5540                        expected: 0u8,
5541                        actual: tag.wire_type() as u8,
5542                    });
5543                }
5544                self.constraint = ::core::option::Option::Some(
5545                    kv_predicate_constraint::Constraint::BoolEq(
5546                        ::buffa::types::decode_bool(buf)?,
5547                    ),
5548                );
5549            }
5550            3u32 => {
5551                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5552                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5553                        field_number: 3u32,
5554                        expected: 2u8,
5555                        actual: tag.wire_type() as u8,
5556                    });
5557                }
5558                self.constraint = ::core::option::Option::Some(
5559                    kv_predicate_constraint::Constraint::FixedSizeBinaryEq(
5560                        ::buffa::types::decode_bytes(buf)?,
5561                    ),
5562                );
5563            }
5564            4u32 => {
5565                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5566                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5567                        field_number: 4u32,
5568                        expected: 2u8,
5569                        actual: tag.wire_type() as u8,
5570                    });
5571                }
5572                if let ::core::option::Option::Some(
5573                    kv_predicate_constraint::Constraint::IntRange(ref mut existing),
5574                ) = self.constraint
5575                {
5576                    ::buffa::Message::merge_length_delimited(
5577                        &mut **existing,
5578                        buf,
5579                        depth,
5580                    )?;
5581                } else {
5582                    let mut val = ::core::default::Default::default();
5583                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
5584                    self.constraint = ::core::option::Option::Some(
5585                        kv_predicate_constraint::Constraint::IntRange(
5586                            ::buffa::alloc::boxed::Box::new(val),
5587                        ),
5588                    );
5589                }
5590            }
5591            5u32 => {
5592                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5593                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5594                        field_number: 5u32,
5595                        expected: 2u8,
5596                        actual: tag.wire_type() as u8,
5597                    });
5598                }
5599                if let ::core::option::Option::Some(
5600                    kv_predicate_constraint::Constraint::Uint64Range(ref mut existing),
5601                ) = self.constraint
5602                {
5603                    ::buffa::Message::merge_length_delimited(
5604                        &mut **existing,
5605                        buf,
5606                        depth,
5607                    )?;
5608                } else {
5609                    let mut val = ::core::default::Default::default();
5610                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
5611                    self.constraint = ::core::option::Option::Some(
5612                        kv_predicate_constraint::Constraint::Uint64Range(
5613                            ::buffa::alloc::boxed::Box::new(val),
5614                        ),
5615                    );
5616                }
5617            }
5618            6u32 => {
5619                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5620                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5621                        field_number: 6u32,
5622                        expected: 2u8,
5623                        actual: tag.wire_type() as u8,
5624                    });
5625                }
5626                if let ::core::option::Option::Some(
5627                    kv_predicate_constraint::Constraint::FloatRange(ref mut existing),
5628                ) = self.constraint
5629                {
5630                    ::buffa::Message::merge_length_delimited(
5631                        &mut **existing,
5632                        buf,
5633                        depth,
5634                    )?;
5635                } else {
5636                    let mut val = ::core::default::Default::default();
5637                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
5638                    self.constraint = ::core::option::Option::Some(
5639                        kv_predicate_constraint::Constraint::FloatRange(
5640                            ::buffa::alloc::boxed::Box::new(val),
5641                        ),
5642                    );
5643                }
5644            }
5645            7u32 => {
5646                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5647                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5648                        field_number: 7u32,
5649                        expected: 2u8,
5650                        actual: tag.wire_type() as u8,
5651                    });
5652                }
5653                if let ::core::option::Option::Some(
5654                    kv_predicate_constraint::Constraint::Decimal128Range(
5655                        ref mut existing,
5656                    ),
5657                ) = self.constraint
5658                {
5659                    ::buffa::Message::merge_length_delimited(
5660                        &mut **existing,
5661                        buf,
5662                        depth,
5663                    )?;
5664                } else {
5665                    let mut val = ::core::default::Default::default();
5666                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
5667                    self.constraint = ::core::option::Option::Some(
5668                        kv_predicate_constraint::Constraint::Decimal128Range(
5669                            ::buffa::alloc::boxed::Box::new(val),
5670                        ),
5671                    );
5672                }
5673            }
5674            8u32 => {
5675                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
5676                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5677                        field_number: 8u32,
5678                        expected: 0u8,
5679                        actual: tag.wire_type() as u8,
5680                    });
5681                }
5682                self.constraint = ::core::option::Option::Some(
5683                    kv_predicate_constraint::Constraint::IsNull(
5684                        ::buffa::types::decode_bool(buf)?,
5685                    ),
5686                );
5687            }
5688            9u32 => {
5689                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
5690                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5691                        field_number: 9u32,
5692                        expected: 0u8,
5693                        actual: tag.wire_type() as u8,
5694                    });
5695                }
5696                self.constraint = ::core::option::Option::Some(
5697                    kv_predicate_constraint::Constraint::IsNotNull(
5698                        ::buffa::types::decode_bool(buf)?,
5699                    ),
5700                );
5701            }
5702            10u32 => {
5703                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5704                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5705                        field_number: 10u32,
5706                        expected: 2u8,
5707                        actual: tag.wire_type() as u8,
5708                    });
5709                }
5710                if let ::core::option::Option::Some(
5711                    kv_predicate_constraint::Constraint::StringIn(ref mut existing),
5712                ) = self.constraint
5713                {
5714                    ::buffa::Message::merge_length_delimited(
5715                        &mut **existing,
5716                        buf,
5717                        depth,
5718                    )?;
5719                } else {
5720                    let mut val = ::core::default::Default::default();
5721                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
5722                    self.constraint = ::core::option::Option::Some(
5723                        kv_predicate_constraint::Constraint::StringIn(
5724                            ::buffa::alloc::boxed::Box::new(val),
5725                        ),
5726                    );
5727                }
5728            }
5729            11u32 => {
5730                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5731                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5732                        field_number: 11u32,
5733                        expected: 2u8,
5734                        actual: tag.wire_type() as u8,
5735                    });
5736                }
5737                if let ::core::option::Option::Some(
5738                    kv_predicate_constraint::Constraint::IntIn(ref mut existing),
5739                ) = self.constraint
5740                {
5741                    ::buffa::Message::merge_length_delimited(
5742                        &mut **existing,
5743                        buf,
5744                        depth,
5745                    )?;
5746                } else {
5747                    let mut val = ::core::default::Default::default();
5748                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
5749                    self.constraint = ::core::option::Option::Some(
5750                        kv_predicate_constraint::Constraint::IntIn(
5751                            ::buffa::alloc::boxed::Box::new(val),
5752                        ),
5753                    );
5754                }
5755            }
5756            12u32 => {
5757                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5758                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5759                        field_number: 12u32,
5760                        expected: 2u8,
5761                        actual: tag.wire_type() as u8,
5762                    });
5763                }
5764                if let ::core::option::Option::Some(
5765                    kv_predicate_constraint::Constraint::Uint64In(ref mut existing),
5766                ) = self.constraint
5767                {
5768                    ::buffa::Message::merge_length_delimited(
5769                        &mut **existing,
5770                        buf,
5771                        depth,
5772                    )?;
5773                } else {
5774                    let mut val = ::core::default::Default::default();
5775                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
5776                    self.constraint = ::core::option::Option::Some(
5777                        kv_predicate_constraint::Constraint::Uint64In(
5778                            ::buffa::alloc::boxed::Box::new(val),
5779                        ),
5780                    );
5781                }
5782            }
5783            13u32 => {
5784                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5785                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5786                        field_number: 13u32,
5787                        expected: 2u8,
5788                        actual: tag.wire_type() as u8,
5789                    });
5790                }
5791                if let ::core::option::Option::Some(
5792                    kv_predicate_constraint::Constraint::FixedSizeBinaryIn(
5793                        ref mut existing,
5794                    ),
5795                ) = self.constraint
5796                {
5797                    ::buffa::Message::merge_length_delimited(
5798                        &mut **existing,
5799                        buf,
5800                        depth,
5801                    )?;
5802                } else {
5803                    let mut val = ::core::default::Default::default();
5804                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
5805                    self.constraint = ::core::option::Option::Some(
5806                        kv_predicate_constraint::Constraint::FixedSizeBinaryIn(
5807                            ::buffa::alloc::boxed::Box::new(val),
5808                        ),
5809                    );
5810                }
5811            }
5812            14u32 => {
5813                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
5814                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5815                        field_number: 14u32,
5816                        expected: 2u8,
5817                        actual: tag.wire_type() as u8,
5818                    });
5819                }
5820                if let ::core::option::Option::Some(
5821                    kv_predicate_constraint::Constraint::Decimal256Range(
5822                        ref mut existing,
5823                    ),
5824                ) = self.constraint
5825                {
5826                    ::buffa::Message::merge_length_delimited(
5827                        &mut **existing,
5828                        buf,
5829                        depth,
5830                    )?;
5831                } else {
5832                    let mut val = ::core::default::Default::default();
5833                    ::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
5834                    self.constraint = ::core::option::Option::Some(
5835                        kv_predicate_constraint::Constraint::Decimal256Range(
5836                            ::buffa::alloc::boxed::Box::new(val),
5837                        ),
5838                    );
5839                }
5840            }
5841            _ => {
5842                self.__buffa_unknown_fields
5843                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
5844            }
5845        }
5846        ::core::result::Result::Ok(())
5847    }
5848    fn cached_size(&self) -> u32 {
5849        self.__buffa_cached_size.get()
5850    }
5851    fn clear(&mut self) {
5852        self.constraint = ::core::option::Option::None;
5853        self.__buffa_unknown_fields.clear();
5854        self.__buffa_cached_size.set(0);
5855    }
5856}
5857impl ::buffa::ExtensionSet for KvPredicateConstraint {
5858    const PROTO_FQN: &'static str = "store.query.v1.KvPredicateConstraint";
5859    fn unknown_fields(&self) -> &::buffa::UnknownFields {
5860        &self.__buffa_unknown_fields
5861    }
5862    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
5863        &mut self.__buffa_unknown_fields
5864    }
5865}
5866impl<'de> serde::Deserialize<'de> for KvPredicateConstraint {
5867    fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
5868        struct _V;
5869        impl<'de> serde::de::Visitor<'de> for _V {
5870            type Value = KvPredicateConstraint;
5871            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5872                f.write_str("struct KvPredicateConstraint")
5873            }
5874            #[allow(clippy::field_reassign_with_default)]
5875            fn visit_map<A: serde::de::MapAccess<'de>>(
5876                self,
5877                mut map: A,
5878            ) -> Result<KvPredicateConstraint, A::Error> {
5879                let mut __oneof_constraint: Option<
5880                    kv_predicate_constraint::Constraint,
5881                > = None;
5882                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
5883                    match key.as_str() {
5884                        "stringEq" | "string_eq" => {
5885                            let v: Option<::buffa::alloc::string::String> = map
5886                                .next_value_seed(
5887                                    ::buffa::json_helpers::NullableDeserializeSeed(
5888                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
5889                                            ::buffa::alloc::string::String,
5890                                        >::new(),
5891                                    ),
5892                                )?;
5893                            if let Some(v) = v {
5894                                if __oneof_constraint.is_some() {
5895                                    return Err(
5896                                        serde::de::Error::custom(
5897                                            "multiple oneof fields set for 'constraint'",
5898                                        ),
5899                                    );
5900                                }
5901                                __oneof_constraint = Some(
5902                                    kv_predicate_constraint::Constraint::StringEq(v),
5903                                );
5904                            }
5905                        }
5906                        "boolEq" | "bool_eq" => {
5907                            let v: Option<bool> = map
5908                                .next_value_seed(
5909                                    ::buffa::json_helpers::NullableDeserializeSeed(
5910                                        ::buffa::json_helpers::DefaultDeserializeSeed::<bool>::new(),
5911                                    ),
5912                                )?;
5913                            if let Some(v) = v {
5914                                if __oneof_constraint.is_some() {
5915                                    return Err(
5916                                        serde::de::Error::custom(
5917                                            "multiple oneof fields set for 'constraint'",
5918                                        ),
5919                                    );
5920                                }
5921                                __oneof_constraint = Some(
5922                                    kv_predicate_constraint::Constraint::BoolEq(v),
5923                                );
5924                            }
5925                        }
5926                        "fixedSizeBinaryEq" | "fixed_size_binary_eq" => {
5927                            struct _DeserSeed;
5928                            impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
5929                                type Value = ::buffa::alloc::vec::Vec<u8>;
5930                                fn deserialize<D: serde::Deserializer<'de>>(
5931                                    self,
5932                                    d: D,
5933                                ) -> ::core::result::Result<
5934                                    ::buffa::alloc::vec::Vec<u8>,
5935                                    D::Error,
5936                                > {
5937                                    ::buffa::json_helpers::bytes::deserialize(d)
5938                                }
5939                            }
5940                            let v: Option<::buffa::alloc::vec::Vec<u8>> = map
5941                                .next_value_seed(
5942                                    ::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
5943                                )?;
5944                            if let Some(v) = v {
5945                                if __oneof_constraint.is_some() {
5946                                    return Err(
5947                                        serde::de::Error::custom(
5948                                            "multiple oneof fields set for 'constraint'",
5949                                        ),
5950                                    );
5951                                }
5952                                __oneof_constraint = Some(
5953                                    kv_predicate_constraint::Constraint::FixedSizeBinaryEq(v),
5954                                );
5955                            }
5956                        }
5957                        "intRange" | "int_range" => {
5958                            let v: Option<kv_predicate_constraint::IntRange> = map
5959                                .next_value_seed(
5960                                    ::buffa::json_helpers::NullableDeserializeSeed(
5961                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
5962                                            kv_predicate_constraint::IntRange,
5963                                        >::new(),
5964                                    ),
5965                                )?;
5966                            if let Some(v) = v {
5967                                if __oneof_constraint.is_some() {
5968                                    return Err(
5969                                        serde::de::Error::custom(
5970                                            "multiple oneof fields set for 'constraint'",
5971                                        ),
5972                                    );
5973                                }
5974                                __oneof_constraint = Some(
5975                                    kv_predicate_constraint::Constraint::IntRange(
5976                                        ::buffa::alloc::boxed::Box::new(v),
5977                                    ),
5978                                );
5979                            }
5980                        }
5981                        "uint64Range" | "uint64_range" => {
5982                            let v: Option<kv_predicate_constraint::UInt64Range> = map
5983                                .next_value_seed(
5984                                    ::buffa::json_helpers::NullableDeserializeSeed(
5985                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
5986                                            kv_predicate_constraint::UInt64Range,
5987                                        >::new(),
5988                                    ),
5989                                )?;
5990                            if let Some(v) = v {
5991                                if __oneof_constraint.is_some() {
5992                                    return Err(
5993                                        serde::de::Error::custom(
5994                                            "multiple oneof fields set for 'constraint'",
5995                                        ),
5996                                    );
5997                                }
5998                                __oneof_constraint = Some(
5999                                    kv_predicate_constraint::Constraint::Uint64Range(
6000                                        ::buffa::alloc::boxed::Box::new(v),
6001                                    ),
6002                                );
6003                            }
6004                        }
6005                        "floatRange" | "float_range" => {
6006                            let v: Option<kv_predicate_constraint::FloatRange> = map
6007                                .next_value_seed(
6008                                    ::buffa::json_helpers::NullableDeserializeSeed(
6009                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
6010                                            kv_predicate_constraint::FloatRange,
6011                                        >::new(),
6012                                    ),
6013                                )?;
6014                            if let Some(v) = v {
6015                                if __oneof_constraint.is_some() {
6016                                    return Err(
6017                                        serde::de::Error::custom(
6018                                            "multiple oneof fields set for 'constraint'",
6019                                        ),
6020                                    );
6021                                }
6022                                __oneof_constraint = Some(
6023                                    kv_predicate_constraint::Constraint::FloatRange(
6024                                        ::buffa::alloc::boxed::Box::new(v),
6025                                    ),
6026                                );
6027                            }
6028                        }
6029                        "decimal128Range" | "decimal128_range" => {
6030                            let v: Option<kv_predicate_constraint::Decimal128Range> = map
6031                                .next_value_seed(
6032                                    ::buffa::json_helpers::NullableDeserializeSeed(
6033                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
6034                                            kv_predicate_constraint::Decimal128Range,
6035                                        >::new(),
6036                                    ),
6037                                )?;
6038                            if let Some(v) = v {
6039                                if __oneof_constraint.is_some() {
6040                                    return Err(
6041                                        serde::de::Error::custom(
6042                                            "multiple oneof fields set for 'constraint'",
6043                                        ),
6044                                    );
6045                                }
6046                                __oneof_constraint = Some(
6047                                    kv_predicate_constraint::Constraint::Decimal128Range(
6048                                        ::buffa::alloc::boxed::Box::new(v),
6049                                    ),
6050                                );
6051                            }
6052                        }
6053                        "isNull" | "is_null" => {
6054                            let v: Option<bool> = map
6055                                .next_value_seed(
6056                                    ::buffa::json_helpers::NullableDeserializeSeed(
6057                                        ::buffa::json_helpers::DefaultDeserializeSeed::<bool>::new(),
6058                                    ),
6059                                )?;
6060                            if let Some(v) = v {
6061                                if __oneof_constraint.is_some() {
6062                                    return Err(
6063                                        serde::de::Error::custom(
6064                                            "multiple oneof fields set for 'constraint'",
6065                                        ),
6066                                    );
6067                                }
6068                                __oneof_constraint = Some(
6069                                    kv_predicate_constraint::Constraint::IsNull(v),
6070                                );
6071                            }
6072                        }
6073                        "isNotNull" | "is_not_null" => {
6074                            let v: Option<bool> = map
6075                                .next_value_seed(
6076                                    ::buffa::json_helpers::NullableDeserializeSeed(
6077                                        ::buffa::json_helpers::DefaultDeserializeSeed::<bool>::new(),
6078                                    ),
6079                                )?;
6080                            if let Some(v) = v {
6081                                if __oneof_constraint.is_some() {
6082                                    return Err(
6083                                        serde::de::Error::custom(
6084                                            "multiple oneof fields set for 'constraint'",
6085                                        ),
6086                                    );
6087                                }
6088                                __oneof_constraint = Some(
6089                                    kv_predicate_constraint::Constraint::IsNotNull(v),
6090                                );
6091                            }
6092                        }
6093                        "stringIn" | "string_in" => {
6094                            let v: Option<kv_predicate_constraint::StringIn> = map
6095                                .next_value_seed(
6096                                    ::buffa::json_helpers::NullableDeserializeSeed(
6097                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
6098                                            kv_predicate_constraint::StringIn,
6099                                        >::new(),
6100                                    ),
6101                                )?;
6102                            if let Some(v) = v {
6103                                if __oneof_constraint.is_some() {
6104                                    return Err(
6105                                        serde::de::Error::custom(
6106                                            "multiple oneof fields set for 'constraint'",
6107                                        ),
6108                                    );
6109                                }
6110                                __oneof_constraint = Some(
6111                                    kv_predicate_constraint::Constraint::StringIn(
6112                                        ::buffa::alloc::boxed::Box::new(v),
6113                                    ),
6114                                );
6115                            }
6116                        }
6117                        "intIn" | "int_in" => {
6118                            let v: Option<kv_predicate_constraint::IntIn> = map
6119                                .next_value_seed(
6120                                    ::buffa::json_helpers::NullableDeserializeSeed(
6121                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
6122                                            kv_predicate_constraint::IntIn,
6123                                        >::new(),
6124                                    ),
6125                                )?;
6126                            if let Some(v) = v {
6127                                if __oneof_constraint.is_some() {
6128                                    return Err(
6129                                        serde::de::Error::custom(
6130                                            "multiple oneof fields set for 'constraint'",
6131                                        ),
6132                                    );
6133                                }
6134                                __oneof_constraint = Some(
6135                                    kv_predicate_constraint::Constraint::IntIn(
6136                                        ::buffa::alloc::boxed::Box::new(v),
6137                                    ),
6138                                );
6139                            }
6140                        }
6141                        "uint64In" | "uint64_in" => {
6142                            let v: Option<kv_predicate_constraint::UInt64In> = map
6143                                .next_value_seed(
6144                                    ::buffa::json_helpers::NullableDeserializeSeed(
6145                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
6146                                            kv_predicate_constraint::UInt64In,
6147                                        >::new(),
6148                                    ),
6149                                )?;
6150                            if let Some(v) = v {
6151                                if __oneof_constraint.is_some() {
6152                                    return Err(
6153                                        serde::de::Error::custom(
6154                                            "multiple oneof fields set for 'constraint'",
6155                                        ),
6156                                    );
6157                                }
6158                                __oneof_constraint = Some(
6159                                    kv_predicate_constraint::Constraint::Uint64In(
6160                                        ::buffa::alloc::boxed::Box::new(v),
6161                                    ),
6162                                );
6163                            }
6164                        }
6165                        "fixedSizeBinaryIn" | "fixed_size_binary_in" => {
6166                            let v: Option<kv_predicate_constraint::FixedSizeBinaryIn> = map
6167                                .next_value_seed(
6168                                    ::buffa::json_helpers::NullableDeserializeSeed(
6169                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
6170                                            kv_predicate_constraint::FixedSizeBinaryIn,
6171                                        >::new(),
6172                                    ),
6173                                )?;
6174                            if let Some(v) = v {
6175                                if __oneof_constraint.is_some() {
6176                                    return Err(
6177                                        serde::de::Error::custom(
6178                                            "multiple oneof fields set for 'constraint'",
6179                                        ),
6180                                    );
6181                                }
6182                                __oneof_constraint = Some(
6183                                    kv_predicate_constraint::Constraint::FixedSizeBinaryIn(
6184                                        ::buffa::alloc::boxed::Box::new(v),
6185                                    ),
6186                                );
6187                            }
6188                        }
6189                        "decimal256Range" | "decimal256_range" => {
6190                            let v: Option<kv_predicate_constraint::Decimal256Range> = map
6191                                .next_value_seed(
6192                                    ::buffa::json_helpers::NullableDeserializeSeed(
6193                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
6194                                            kv_predicate_constraint::Decimal256Range,
6195                                        >::new(),
6196                                    ),
6197                                )?;
6198                            if let Some(v) = v {
6199                                if __oneof_constraint.is_some() {
6200                                    return Err(
6201                                        serde::de::Error::custom(
6202                                            "multiple oneof fields set for 'constraint'",
6203                                        ),
6204                                    );
6205                                }
6206                                __oneof_constraint = Some(
6207                                    kv_predicate_constraint::Constraint::Decimal256Range(
6208                                        ::buffa::alloc::boxed::Box::new(v),
6209                                    ),
6210                                );
6211                            }
6212                        }
6213                        _ => {
6214                            map.next_value::<serde::de::IgnoredAny>()?;
6215                        }
6216                    }
6217                }
6218                let mut __r = <KvPredicateConstraint as ::core::default::Default>::default();
6219                __r.constraint = __oneof_constraint;
6220                Ok(__r)
6221            }
6222        }
6223        d.deserialize_map(_V)
6224    }
6225}
6226impl ::buffa::json_helpers::ProtoElemJson for KvPredicateConstraint {
6227    fn serialize_proto_json<S: ::serde::Serializer>(
6228        v: &Self,
6229        s: S,
6230    ) -> ::core::result::Result<S::Ok, S::Error> {
6231        ::serde::Serialize::serialize(v, s)
6232    }
6233    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6234        d: D,
6235    ) -> ::core::result::Result<Self, D::Error> {
6236        <Self as ::serde::Deserialize>::deserialize(d)
6237    }
6238}
6239#[doc(hidden)]
6240pub const __KV_PREDICATE_CONSTRAINT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6241    type_url: "type.googleapis.com/store.query.v1.KvPredicateConstraint",
6242    to_json: ::buffa::type_registry::any_to_json::<KvPredicateConstraint>,
6243    from_json: ::buffa::type_registry::any_from_json::<KvPredicateConstraint>,
6244    is_wkt: false,
6245};
6246/// A constraint applied to a single field value during predicate evaluation.
6247/// Exactly one variant must be set.
6248#[derive(Clone, Debug, Default)]
6249pub struct KvPredicateConstraintView<'a> {
6250    pub constraint: ::core::option::Option<kv_predicate_constraint::ConstraintView<'a>>,
6251    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
6252}
6253impl<'a> KvPredicateConstraintView<'a> {
6254    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
6255    ///
6256    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
6257    /// and by generated sub-message decode arms with `depth - 1`.
6258    ///
6259    /// **Not part of the public API.** Named with a leading underscore to
6260    /// signal that it is for generated-code use only.
6261    #[doc(hidden)]
6262    pub fn _decode_depth(
6263        buf: &'a [u8],
6264        depth: u32,
6265    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6266        let mut view = Self::default();
6267        view._merge_into_view(buf, depth)?;
6268        ::core::result::Result::Ok(view)
6269    }
6270    /// Merge fields from `buf` into this view (proto merge semantics).
6271    ///
6272    /// Repeated fields append; singular fields last-wins; singular
6273    /// MESSAGE fields merge recursively. Used by sub-message decode
6274    /// arms when the same field appears multiple times on the wire.
6275    ///
6276    /// **Not part of the public API.**
6277    #[doc(hidden)]
6278    pub fn _merge_into_view(
6279        &mut self,
6280        buf: &'a [u8],
6281        depth: u32,
6282    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6283        let _ = depth;
6284        #[allow(unused_variables)]
6285        let view = self;
6286        let mut cur: &'a [u8] = buf;
6287        while !cur.is_empty() {
6288            let before_tag = cur;
6289            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
6290            match tag.field_number() {
6291                1u32 => {
6292                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6293                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6294                            field_number: 1u32,
6295                            expected: 2u8,
6296                            actual: tag.wire_type() as u8,
6297                        });
6298                    }
6299                    view.constraint = Some(
6300                        kv_predicate_constraint::ConstraintView::StringEq(
6301                            ::buffa::types::borrow_str(&mut cur)?,
6302                        ),
6303                    );
6304                }
6305                2u32 => {
6306                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
6307                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6308                            field_number: 2u32,
6309                            expected: 0u8,
6310                            actual: tag.wire_type() as u8,
6311                        });
6312                    }
6313                    view.constraint = Some(
6314                        kv_predicate_constraint::ConstraintView::BoolEq(
6315                            ::buffa::types::decode_bool(&mut cur)?,
6316                        ),
6317                    );
6318                }
6319                3u32 => {
6320                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6321                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6322                            field_number: 3u32,
6323                            expected: 2u8,
6324                            actual: tag.wire_type() as u8,
6325                        });
6326                    }
6327                    view.constraint = Some(
6328                        kv_predicate_constraint::ConstraintView::FixedSizeBinaryEq(
6329                            ::buffa::types::borrow_bytes(&mut cur)?,
6330                        ),
6331                    );
6332                }
6333                4u32 => {
6334                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6335                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6336                            field_number: 4u32,
6337                            expected: 2u8,
6338                            actual: tag.wire_type() as u8,
6339                        });
6340                    }
6341                    if depth == 0 {
6342                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
6343                    }
6344                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
6345                    if let Some(
6346                        kv_predicate_constraint::ConstraintView::IntRange(
6347                            ref mut existing,
6348                        ),
6349                    ) = view.constraint
6350                    {
6351                        existing._merge_into_view(sub, depth - 1)?;
6352                    } else {
6353                        view.constraint = Some(
6354                            kv_predicate_constraint::ConstraintView::IntRange(
6355                                ::buffa::alloc::boxed::Box::new(
6356                                    kv_predicate_constraint::IntRangeView::_decode_depth(
6357                                        sub,
6358                                        depth - 1,
6359                                    )?,
6360                                ),
6361                            ),
6362                        );
6363                    }
6364                }
6365                5u32 => {
6366                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6367                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6368                            field_number: 5u32,
6369                            expected: 2u8,
6370                            actual: tag.wire_type() as u8,
6371                        });
6372                    }
6373                    if depth == 0 {
6374                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
6375                    }
6376                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
6377                    if let Some(
6378                        kv_predicate_constraint::ConstraintView::Uint64Range(
6379                            ref mut existing,
6380                        ),
6381                    ) = view.constraint
6382                    {
6383                        existing._merge_into_view(sub, depth - 1)?;
6384                    } else {
6385                        view.constraint = Some(
6386                            kv_predicate_constraint::ConstraintView::Uint64Range(
6387                                ::buffa::alloc::boxed::Box::new(
6388                                    kv_predicate_constraint::UInt64RangeView::_decode_depth(
6389                                        sub,
6390                                        depth - 1,
6391                                    )?,
6392                                ),
6393                            ),
6394                        );
6395                    }
6396                }
6397                6u32 => {
6398                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6399                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6400                            field_number: 6u32,
6401                            expected: 2u8,
6402                            actual: tag.wire_type() as u8,
6403                        });
6404                    }
6405                    if depth == 0 {
6406                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
6407                    }
6408                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
6409                    if let Some(
6410                        kv_predicate_constraint::ConstraintView::FloatRange(
6411                            ref mut existing,
6412                        ),
6413                    ) = view.constraint
6414                    {
6415                        existing._merge_into_view(sub, depth - 1)?;
6416                    } else {
6417                        view.constraint = Some(
6418                            kv_predicate_constraint::ConstraintView::FloatRange(
6419                                ::buffa::alloc::boxed::Box::new(
6420                                    kv_predicate_constraint::FloatRangeView::_decode_depth(
6421                                        sub,
6422                                        depth - 1,
6423                                    )?,
6424                                ),
6425                            ),
6426                        );
6427                    }
6428                }
6429                7u32 => {
6430                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6431                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6432                            field_number: 7u32,
6433                            expected: 2u8,
6434                            actual: tag.wire_type() as u8,
6435                        });
6436                    }
6437                    if depth == 0 {
6438                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
6439                    }
6440                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
6441                    if let Some(
6442                        kv_predicate_constraint::ConstraintView::Decimal128Range(
6443                            ref mut existing,
6444                        ),
6445                    ) = view.constraint
6446                    {
6447                        existing._merge_into_view(sub, depth - 1)?;
6448                    } else {
6449                        view.constraint = Some(
6450                            kv_predicate_constraint::ConstraintView::Decimal128Range(
6451                                ::buffa::alloc::boxed::Box::new(
6452                                    kv_predicate_constraint::Decimal128RangeView::_decode_depth(
6453                                        sub,
6454                                        depth - 1,
6455                                    )?,
6456                                ),
6457                            ),
6458                        );
6459                    }
6460                }
6461                8u32 => {
6462                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
6463                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6464                            field_number: 8u32,
6465                            expected: 0u8,
6466                            actual: tag.wire_type() as u8,
6467                        });
6468                    }
6469                    view.constraint = Some(
6470                        kv_predicate_constraint::ConstraintView::IsNull(
6471                            ::buffa::types::decode_bool(&mut cur)?,
6472                        ),
6473                    );
6474                }
6475                9u32 => {
6476                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
6477                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6478                            field_number: 9u32,
6479                            expected: 0u8,
6480                            actual: tag.wire_type() as u8,
6481                        });
6482                    }
6483                    view.constraint = Some(
6484                        kv_predicate_constraint::ConstraintView::IsNotNull(
6485                            ::buffa::types::decode_bool(&mut cur)?,
6486                        ),
6487                    );
6488                }
6489                10u32 => {
6490                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6491                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6492                            field_number: 10u32,
6493                            expected: 2u8,
6494                            actual: tag.wire_type() as u8,
6495                        });
6496                    }
6497                    if depth == 0 {
6498                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
6499                    }
6500                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
6501                    if let Some(
6502                        kv_predicate_constraint::ConstraintView::StringIn(
6503                            ref mut existing,
6504                        ),
6505                    ) = view.constraint
6506                    {
6507                        existing._merge_into_view(sub, depth - 1)?;
6508                    } else {
6509                        view.constraint = Some(
6510                            kv_predicate_constraint::ConstraintView::StringIn(
6511                                ::buffa::alloc::boxed::Box::new(
6512                                    kv_predicate_constraint::StringInView::_decode_depth(
6513                                        sub,
6514                                        depth - 1,
6515                                    )?,
6516                                ),
6517                            ),
6518                        );
6519                    }
6520                }
6521                11u32 => {
6522                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6523                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6524                            field_number: 11u32,
6525                            expected: 2u8,
6526                            actual: tag.wire_type() as u8,
6527                        });
6528                    }
6529                    if depth == 0 {
6530                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
6531                    }
6532                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
6533                    if let Some(
6534                        kv_predicate_constraint::ConstraintView::IntIn(ref mut existing),
6535                    ) = view.constraint
6536                    {
6537                        existing._merge_into_view(sub, depth - 1)?;
6538                    } else {
6539                        view.constraint = Some(
6540                            kv_predicate_constraint::ConstraintView::IntIn(
6541                                ::buffa::alloc::boxed::Box::new(
6542                                    kv_predicate_constraint::IntInView::_decode_depth(
6543                                        sub,
6544                                        depth - 1,
6545                                    )?,
6546                                ),
6547                            ),
6548                        );
6549                    }
6550                }
6551                12u32 => {
6552                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6553                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6554                            field_number: 12u32,
6555                            expected: 2u8,
6556                            actual: tag.wire_type() as u8,
6557                        });
6558                    }
6559                    if depth == 0 {
6560                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
6561                    }
6562                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
6563                    if let Some(
6564                        kv_predicate_constraint::ConstraintView::Uint64In(
6565                            ref mut existing,
6566                        ),
6567                    ) = view.constraint
6568                    {
6569                        existing._merge_into_view(sub, depth - 1)?;
6570                    } else {
6571                        view.constraint = Some(
6572                            kv_predicate_constraint::ConstraintView::Uint64In(
6573                                ::buffa::alloc::boxed::Box::new(
6574                                    kv_predicate_constraint::UInt64InView::_decode_depth(
6575                                        sub,
6576                                        depth - 1,
6577                                    )?,
6578                                ),
6579                            ),
6580                        );
6581                    }
6582                }
6583                13u32 => {
6584                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6585                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6586                            field_number: 13u32,
6587                            expected: 2u8,
6588                            actual: tag.wire_type() as u8,
6589                        });
6590                    }
6591                    if depth == 0 {
6592                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
6593                    }
6594                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
6595                    if let Some(
6596                        kv_predicate_constraint::ConstraintView::FixedSizeBinaryIn(
6597                            ref mut existing,
6598                        ),
6599                    ) = view.constraint
6600                    {
6601                        existing._merge_into_view(sub, depth - 1)?;
6602                    } else {
6603                        view.constraint = Some(
6604                            kv_predicate_constraint::ConstraintView::FixedSizeBinaryIn(
6605                                ::buffa::alloc::boxed::Box::new(
6606                                    kv_predicate_constraint::FixedSizeBinaryInView::_decode_depth(
6607                                        sub,
6608                                        depth - 1,
6609                                    )?,
6610                                ),
6611                            ),
6612                        );
6613                    }
6614                }
6615                14u32 => {
6616                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
6617                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6618                            field_number: 14u32,
6619                            expected: 2u8,
6620                            actual: tag.wire_type() as u8,
6621                        });
6622                    }
6623                    if depth == 0 {
6624                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
6625                    }
6626                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
6627                    if let Some(
6628                        kv_predicate_constraint::ConstraintView::Decimal256Range(
6629                            ref mut existing,
6630                        ),
6631                    ) = view.constraint
6632                    {
6633                        existing._merge_into_view(sub, depth - 1)?;
6634                    } else {
6635                        view.constraint = Some(
6636                            kv_predicate_constraint::ConstraintView::Decimal256Range(
6637                                ::buffa::alloc::boxed::Box::new(
6638                                    kv_predicate_constraint::Decimal256RangeView::_decode_depth(
6639                                        sub,
6640                                        depth - 1,
6641                                    )?,
6642                                ),
6643                            ),
6644                        );
6645                    }
6646                }
6647                _ => {
6648                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
6649                    let span_len = before_tag.len() - cur.len();
6650                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
6651                }
6652            }
6653        }
6654        ::core::result::Result::Ok(())
6655    }
6656}
6657impl<'a> ::buffa::MessageView<'a> for KvPredicateConstraintView<'a> {
6658    type Owned = KvPredicateConstraint;
6659    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6660        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
6661    }
6662    fn decode_view_with_limit(
6663        buf: &'a [u8],
6664        depth: u32,
6665    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6666        Self::_decode_depth(buf, depth)
6667    }
6668    /// Convert this view to the owned message type.
6669    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
6670    fn to_owned_message(&self) -> KvPredicateConstraint {
6671        #[allow(unused_imports)]
6672        use ::buffa::alloc::string::ToString as _;
6673        KvPredicateConstraint {
6674            constraint: self
6675                .constraint
6676                .as_ref()
6677                .map(|v| match v {
6678                    kv_predicate_constraint::ConstraintView::StringEq(v) => {
6679                        kv_predicate_constraint::Constraint::StringEq(v.to_string())
6680                    }
6681                    kv_predicate_constraint::ConstraintView::BoolEq(v) => {
6682                        kv_predicate_constraint::Constraint::BoolEq(*v)
6683                    }
6684                    kv_predicate_constraint::ConstraintView::FixedSizeBinaryEq(v) => {
6685                        kv_predicate_constraint::Constraint::FixedSizeBinaryEq(
6686                            (v).to_vec(),
6687                        )
6688                    }
6689                    kv_predicate_constraint::ConstraintView::IntRange(v) => {
6690                        kv_predicate_constraint::Constraint::IntRange(
6691                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
6692                        )
6693                    }
6694                    kv_predicate_constraint::ConstraintView::Uint64Range(v) => {
6695                        kv_predicate_constraint::Constraint::Uint64Range(
6696                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
6697                        )
6698                    }
6699                    kv_predicate_constraint::ConstraintView::FloatRange(v) => {
6700                        kv_predicate_constraint::Constraint::FloatRange(
6701                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
6702                        )
6703                    }
6704                    kv_predicate_constraint::ConstraintView::Decimal128Range(v) => {
6705                        kv_predicate_constraint::Constraint::Decimal128Range(
6706                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
6707                        )
6708                    }
6709                    kv_predicate_constraint::ConstraintView::IsNull(v) => {
6710                        kv_predicate_constraint::Constraint::IsNull(*v)
6711                    }
6712                    kv_predicate_constraint::ConstraintView::IsNotNull(v) => {
6713                        kv_predicate_constraint::Constraint::IsNotNull(*v)
6714                    }
6715                    kv_predicate_constraint::ConstraintView::StringIn(v) => {
6716                        kv_predicate_constraint::Constraint::StringIn(
6717                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
6718                        )
6719                    }
6720                    kv_predicate_constraint::ConstraintView::IntIn(v) => {
6721                        kv_predicate_constraint::Constraint::IntIn(
6722                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
6723                        )
6724                    }
6725                    kv_predicate_constraint::ConstraintView::Uint64In(v) => {
6726                        kv_predicate_constraint::Constraint::Uint64In(
6727                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
6728                        )
6729                    }
6730                    kv_predicate_constraint::ConstraintView::FixedSizeBinaryIn(v) => {
6731                        kv_predicate_constraint::Constraint::FixedSizeBinaryIn(
6732                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
6733                        )
6734                    }
6735                    kv_predicate_constraint::ConstraintView::Decimal256Range(v) => {
6736                        kv_predicate_constraint::Constraint::Decimal256Range(
6737                            ::buffa::alloc::boxed::Box::new(v.to_owned_message()),
6738                        )
6739                    }
6740                }),
6741            __buffa_unknown_fields: self
6742                .__buffa_unknown_fields
6743                .to_owned()
6744                .unwrap_or_default()
6745                .into(),
6746            ..::core::default::Default::default()
6747        }
6748    }
6749}
6750unsafe impl ::buffa::DefaultViewInstance for KvPredicateConstraintView<'static> {
6751    fn default_view_instance() -> &'static Self {
6752        static VALUE: ::buffa::__private::OnceBox<KvPredicateConstraintView<'static>> = ::buffa::__private::OnceBox::new();
6753        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
6754    }
6755}
6756unsafe impl<'a> ::buffa::HasDefaultViewInstance for KvPredicateConstraintView<'a> {
6757    type Static = KvPredicateConstraintView<'static>;
6758}
6759pub mod kv_predicate_constraint {
6760    #[allow(unused_imports)]
6761    use super::*;
6762    /// Inclusive integer range. Omit `min` or `max` for a one-sided bound.
6763    #[derive(Clone, PartialEq, Default)]
6764    #[derive(::serde::Serialize, ::serde::Deserialize)]
6765    #[serde(default)]
6766    pub struct IntRange {
6767        /// Field 1: `min`
6768        #[serde(
6769            rename = "min",
6770            with = "::buffa::json_helpers::opt_int64",
6771            skip_serializing_if = "Option::is_none"
6772        )]
6773        pub min: Option<i64>,
6774        /// Field 2: `max`
6775        #[serde(
6776            rename = "max",
6777            with = "::buffa::json_helpers::opt_int64",
6778            skip_serializing_if = "Option::is_none"
6779        )]
6780        pub max: Option<i64>,
6781        #[serde(skip)]
6782        #[doc(hidden)]
6783        pub __buffa_unknown_fields: ::buffa::UnknownFields,
6784        #[doc(hidden)]
6785        #[serde(skip)]
6786        pub __buffa_cached_size: ::buffa::__private::CachedSize,
6787    }
6788    impl ::core::fmt::Debug for IntRange {
6789        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6790            f.debug_struct("IntRange")
6791                .field("min", &self.min)
6792                .field("max", &self.max)
6793                .finish()
6794        }
6795    }
6796    impl IntRange {
6797        /// Protobuf type URL for this message, for use with `Any::pack` and
6798        /// `Any::unpack_if`.
6799        ///
6800        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
6801        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicateConstraint.IntRange";
6802    }
6803    unsafe impl ::buffa::DefaultInstance for IntRange {
6804        fn default_instance() -> &'static Self {
6805            static VALUE: ::buffa::__private::OnceBox<IntRange> = ::buffa::__private::OnceBox::new();
6806            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
6807        }
6808    }
6809    impl ::buffa::Message for IntRange {
6810        /// Returns the total encoded size in bytes.
6811        ///
6812        /// The result is a `u32`; the protobuf specification requires all
6813        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
6814        /// compliant message will never overflow this type.
6815        fn compute_size(&self) -> u32 {
6816            #[allow(unused_imports)]
6817            use ::buffa::Enumeration as _;
6818            let mut size = 0u32;
6819            if let Some(v) = self.min {
6820                size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
6821            }
6822            if let Some(v) = self.max {
6823                size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
6824            }
6825            size += self.__buffa_unknown_fields.encoded_len() as u32;
6826            self.__buffa_cached_size.set(size);
6827            size
6828        }
6829        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
6830            #[allow(unused_imports)]
6831            use ::buffa::Enumeration as _;
6832            if let Some(v) = self.min {
6833                ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
6834                    .encode(buf);
6835                ::buffa::types::encode_int64(v, buf);
6836            }
6837            if let Some(v) = self.max {
6838                ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
6839                    .encode(buf);
6840                ::buffa::types::encode_int64(v, buf);
6841            }
6842            self.__buffa_unknown_fields.write_to(buf);
6843        }
6844        fn merge_field(
6845            &mut self,
6846            tag: ::buffa::encoding::Tag,
6847            buf: &mut impl ::buffa::bytes::Buf,
6848            depth: u32,
6849        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6850            #[allow(unused_imports)]
6851            use ::buffa::bytes::Buf as _;
6852            #[allow(unused_imports)]
6853            use ::buffa::Enumeration as _;
6854            match tag.field_number() {
6855                1u32 => {
6856                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
6857                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6858                            field_number: 1u32,
6859                            expected: 0u8,
6860                            actual: tag.wire_type() as u8,
6861                        });
6862                    }
6863                    self.min = ::core::option::Option::Some(
6864                        ::buffa::types::decode_int64(buf)?,
6865                    );
6866                }
6867                2u32 => {
6868                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
6869                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6870                            field_number: 2u32,
6871                            expected: 0u8,
6872                            actual: tag.wire_type() as u8,
6873                        });
6874                    }
6875                    self.max = ::core::option::Option::Some(
6876                        ::buffa::types::decode_int64(buf)?,
6877                    );
6878                }
6879                _ => {
6880                    self.__buffa_unknown_fields
6881                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
6882                }
6883            }
6884            ::core::result::Result::Ok(())
6885        }
6886        fn cached_size(&self) -> u32 {
6887            self.__buffa_cached_size.get()
6888        }
6889        fn clear(&mut self) {
6890            self.min = ::core::option::Option::None;
6891            self.max = ::core::option::Option::None;
6892            self.__buffa_unknown_fields.clear();
6893            self.__buffa_cached_size.set(0);
6894        }
6895    }
6896    impl ::buffa::ExtensionSet for IntRange {
6897        const PROTO_FQN: &'static str = "store.query.v1.KvPredicateConstraint.IntRange";
6898        fn unknown_fields(&self) -> &::buffa::UnknownFields {
6899            &self.__buffa_unknown_fields
6900        }
6901        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
6902            &mut self.__buffa_unknown_fields
6903        }
6904    }
6905    impl ::buffa::json_helpers::ProtoElemJson for IntRange {
6906        fn serialize_proto_json<S: ::serde::Serializer>(
6907            v: &Self,
6908            s: S,
6909        ) -> ::core::result::Result<S::Ok, S::Error> {
6910            ::serde::Serialize::serialize(v, s)
6911        }
6912        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
6913            d: D,
6914        ) -> ::core::result::Result<Self, D::Error> {
6915            <Self as ::serde::Deserialize>::deserialize(d)
6916        }
6917    }
6918    #[doc(hidden)]
6919    pub const __INT_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
6920        type_url: "type.googleapis.com/store.query.v1.KvPredicateConstraint.IntRange",
6921        to_json: ::buffa::type_registry::any_to_json::<IntRange>,
6922        from_json: ::buffa::type_registry::any_from_json::<IntRange>,
6923        is_wkt: false,
6924    };
6925    /// Inclusive integer range. Omit `min` or `max` for a one-sided bound.
6926    #[derive(Clone, Debug, Default)]
6927    pub struct IntRangeView<'a> {
6928        /// Field 1: `min`
6929        pub min: ::core::option::Option<i64>,
6930        /// Field 2: `max`
6931        pub max: ::core::option::Option<i64>,
6932        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
6933    }
6934    impl<'a> IntRangeView<'a> {
6935        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
6936        ///
6937        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
6938        /// and by generated sub-message decode arms with `depth - 1`.
6939        ///
6940        /// **Not part of the public API.** Named with a leading underscore to
6941        /// signal that it is for generated-code use only.
6942        #[doc(hidden)]
6943        pub fn _decode_depth(
6944            buf: &'a [u8],
6945            depth: u32,
6946        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6947            let mut view = Self::default();
6948            view._merge_into_view(buf, depth)?;
6949            ::core::result::Result::Ok(view)
6950        }
6951        /// Merge fields from `buf` into this view (proto merge semantics).
6952        ///
6953        /// Repeated fields append; singular fields last-wins; singular
6954        /// MESSAGE fields merge recursively. Used by sub-message decode
6955        /// arms when the same field appears multiple times on the wire.
6956        ///
6957        /// **Not part of the public API.**
6958        #[doc(hidden)]
6959        pub fn _merge_into_view(
6960            &mut self,
6961            buf: &'a [u8],
6962            depth: u32,
6963        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6964            let _ = depth;
6965            #[allow(unused_variables)]
6966            let view = self;
6967            let mut cur: &'a [u8] = buf;
6968            while !cur.is_empty() {
6969                let before_tag = cur;
6970                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
6971                match tag.field_number() {
6972                    1u32 => {
6973                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
6974                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6975                                field_number: 1u32,
6976                                expected: 0u8,
6977                                actual: tag.wire_type() as u8,
6978                            });
6979                        }
6980                        view.min = Some(::buffa::types::decode_int64(&mut cur)?);
6981                    }
6982                    2u32 => {
6983                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
6984                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6985                                field_number: 2u32,
6986                                expected: 0u8,
6987                                actual: tag.wire_type() as u8,
6988                            });
6989                        }
6990                        view.max = Some(::buffa::types::decode_int64(&mut cur)?);
6991                    }
6992                    _ => {
6993                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
6994                        let span_len = before_tag.len() - cur.len();
6995                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
6996                    }
6997                }
6998            }
6999            ::core::result::Result::Ok(())
7000        }
7001    }
7002    impl<'a> ::buffa::MessageView<'a> for IntRangeView<'a> {
7003        type Owned = IntRange;
7004        fn decode_view(
7005            buf: &'a [u8],
7006        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7007            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
7008        }
7009        fn decode_view_with_limit(
7010            buf: &'a [u8],
7011            depth: u32,
7012        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7013            Self::_decode_depth(buf, depth)
7014        }
7015        /// Convert this view to the owned message type.
7016        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
7017        fn to_owned_message(&self) -> IntRange {
7018            #[allow(unused_imports)]
7019            use ::buffa::alloc::string::ToString as _;
7020            IntRange {
7021                min: self.min,
7022                max: self.max,
7023                __buffa_unknown_fields: self
7024                    .__buffa_unknown_fields
7025                    .to_owned()
7026                    .unwrap_or_default()
7027                    .into(),
7028                ..::core::default::Default::default()
7029            }
7030        }
7031    }
7032    unsafe impl ::buffa::DefaultViewInstance for IntRangeView<'static> {
7033        fn default_view_instance() -> &'static Self {
7034            static VALUE: ::buffa::__private::OnceBox<IntRangeView<'static>> = ::buffa::__private::OnceBox::new();
7035            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
7036        }
7037    }
7038    unsafe impl<'a> ::buffa::HasDefaultViewInstance for IntRangeView<'a> {
7039        type Static = IntRangeView<'static>;
7040    }
7041    /// Inclusive uint64 range. Omit `min` or `max` for a one-sided bound.
7042    #[derive(Clone, PartialEq, Default)]
7043    #[derive(::serde::Serialize, ::serde::Deserialize)]
7044    #[serde(default)]
7045    pub struct UInt64Range {
7046        /// Field 1: `min`
7047        #[serde(
7048            rename = "min",
7049            with = "::buffa::json_helpers::opt_uint64",
7050            skip_serializing_if = "Option::is_none"
7051        )]
7052        pub min: Option<u64>,
7053        /// Field 2: `max`
7054        #[serde(
7055            rename = "max",
7056            with = "::buffa::json_helpers::opt_uint64",
7057            skip_serializing_if = "Option::is_none"
7058        )]
7059        pub max: Option<u64>,
7060        #[serde(skip)]
7061        #[doc(hidden)]
7062        pub __buffa_unknown_fields: ::buffa::UnknownFields,
7063        #[doc(hidden)]
7064        #[serde(skip)]
7065        pub __buffa_cached_size: ::buffa::__private::CachedSize,
7066    }
7067    impl ::core::fmt::Debug for UInt64Range {
7068        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7069            f.debug_struct("UInt64Range")
7070                .field("min", &self.min)
7071                .field("max", &self.max)
7072                .finish()
7073        }
7074    }
7075    impl UInt64Range {
7076        /// Protobuf type URL for this message, for use with `Any::pack` and
7077        /// `Any::unpack_if`.
7078        ///
7079        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
7080        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicateConstraint.UInt64Range";
7081    }
7082    unsafe impl ::buffa::DefaultInstance for UInt64Range {
7083        fn default_instance() -> &'static Self {
7084            static VALUE: ::buffa::__private::OnceBox<UInt64Range> = ::buffa::__private::OnceBox::new();
7085            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
7086        }
7087    }
7088    impl ::buffa::Message for UInt64Range {
7089        /// Returns the total encoded size in bytes.
7090        ///
7091        /// The result is a `u32`; the protobuf specification requires all
7092        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
7093        /// compliant message will never overflow this type.
7094        fn compute_size(&self) -> u32 {
7095            #[allow(unused_imports)]
7096            use ::buffa::Enumeration as _;
7097            let mut size = 0u32;
7098            if let Some(v) = self.min {
7099                size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
7100            }
7101            if let Some(v) = self.max {
7102                size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
7103            }
7104            size += self.__buffa_unknown_fields.encoded_len() as u32;
7105            self.__buffa_cached_size.set(size);
7106            size
7107        }
7108        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
7109            #[allow(unused_imports)]
7110            use ::buffa::Enumeration as _;
7111            if let Some(v) = self.min {
7112                ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
7113                    .encode(buf);
7114                ::buffa::types::encode_uint64(v, buf);
7115            }
7116            if let Some(v) = self.max {
7117                ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
7118                    .encode(buf);
7119                ::buffa::types::encode_uint64(v, buf);
7120            }
7121            self.__buffa_unknown_fields.write_to(buf);
7122        }
7123        fn merge_field(
7124            &mut self,
7125            tag: ::buffa::encoding::Tag,
7126            buf: &mut impl ::buffa::bytes::Buf,
7127            depth: u32,
7128        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
7129            #[allow(unused_imports)]
7130            use ::buffa::bytes::Buf as _;
7131            #[allow(unused_imports)]
7132            use ::buffa::Enumeration as _;
7133            match tag.field_number() {
7134                1u32 => {
7135                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
7136                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7137                            field_number: 1u32,
7138                            expected: 0u8,
7139                            actual: tag.wire_type() as u8,
7140                        });
7141                    }
7142                    self.min = ::core::option::Option::Some(
7143                        ::buffa::types::decode_uint64(buf)?,
7144                    );
7145                }
7146                2u32 => {
7147                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
7148                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7149                            field_number: 2u32,
7150                            expected: 0u8,
7151                            actual: tag.wire_type() as u8,
7152                        });
7153                    }
7154                    self.max = ::core::option::Option::Some(
7155                        ::buffa::types::decode_uint64(buf)?,
7156                    );
7157                }
7158                _ => {
7159                    self.__buffa_unknown_fields
7160                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
7161                }
7162            }
7163            ::core::result::Result::Ok(())
7164        }
7165        fn cached_size(&self) -> u32 {
7166            self.__buffa_cached_size.get()
7167        }
7168        fn clear(&mut self) {
7169            self.min = ::core::option::Option::None;
7170            self.max = ::core::option::Option::None;
7171            self.__buffa_unknown_fields.clear();
7172            self.__buffa_cached_size.set(0);
7173        }
7174    }
7175    impl ::buffa::ExtensionSet for UInt64Range {
7176        const PROTO_FQN: &'static str = "store.query.v1.KvPredicateConstraint.UInt64Range";
7177        fn unknown_fields(&self) -> &::buffa::UnknownFields {
7178            &self.__buffa_unknown_fields
7179        }
7180        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
7181            &mut self.__buffa_unknown_fields
7182        }
7183    }
7184    impl ::buffa::json_helpers::ProtoElemJson for UInt64Range {
7185        fn serialize_proto_json<S: ::serde::Serializer>(
7186            v: &Self,
7187            s: S,
7188        ) -> ::core::result::Result<S::Ok, S::Error> {
7189            ::serde::Serialize::serialize(v, s)
7190        }
7191        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
7192            d: D,
7193        ) -> ::core::result::Result<Self, D::Error> {
7194            <Self as ::serde::Deserialize>::deserialize(d)
7195        }
7196    }
7197    #[doc(hidden)]
7198    pub const __U_INT64RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
7199        type_url: "type.googleapis.com/store.query.v1.KvPredicateConstraint.UInt64Range",
7200        to_json: ::buffa::type_registry::any_to_json::<UInt64Range>,
7201        from_json: ::buffa::type_registry::any_from_json::<UInt64Range>,
7202        is_wkt: false,
7203    };
7204    /// Inclusive uint64 range. Omit `min` or `max` for a one-sided bound.
7205    #[derive(Clone, Debug, Default)]
7206    pub struct UInt64RangeView<'a> {
7207        /// Field 1: `min`
7208        pub min: ::core::option::Option<u64>,
7209        /// Field 2: `max`
7210        pub max: ::core::option::Option<u64>,
7211        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
7212    }
7213    impl<'a> UInt64RangeView<'a> {
7214        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
7215        ///
7216        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
7217        /// and by generated sub-message decode arms with `depth - 1`.
7218        ///
7219        /// **Not part of the public API.** Named with a leading underscore to
7220        /// signal that it is for generated-code use only.
7221        #[doc(hidden)]
7222        pub fn _decode_depth(
7223            buf: &'a [u8],
7224            depth: u32,
7225        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7226            let mut view = Self::default();
7227            view._merge_into_view(buf, depth)?;
7228            ::core::result::Result::Ok(view)
7229        }
7230        /// Merge fields from `buf` into this view (proto merge semantics).
7231        ///
7232        /// Repeated fields append; singular fields last-wins; singular
7233        /// MESSAGE fields merge recursively. Used by sub-message decode
7234        /// arms when the same field appears multiple times on the wire.
7235        ///
7236        /// **Not part of the public API.**
7237        #[doc(hidden)]
7238        pub fn _merge_into_view(
7239            &mut self,
7240            buf: &'a [u8],
7241            depth: u32,
7242        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
7243            let _ = depth;
7244            #[allow(unused_variables)]
7245            let view = self;
7246            let mut cur: &'a [u8] = buf;
7247            while !cur.is_empty() {
7248                let before_tag = cur;
7249                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
7250                match tag.field_number() {
7251                    1u32 => {
7252                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
7253                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7254                                field_number: 1u32,
7255                                expected: 0u8,
7256                                actual: tag.wire_type() as u8,
7257                            });
7258                        }
7259                        view.min = Some(::buffa::types::decode_uint64(&mut cur)?);
7260                    }
7261                    2u32 => {
7262                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
7263                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7264                                field_number: 2u32,
7265                                expected: 0u8,
7266                                actual: tag.wire_type() as u8,
7267                            });
7268                        }
7269                        view.max = Some(::buffa::types::decode_uint64(&mut cur)?);
7270                    }
7271                    _ => {
7272                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
7273                        let span_len = before_tag.len() - cur.len();
7274                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
7275                    }
7276                }
7277            }
7278            ::core::result::Result::Ok(())
7279        }
7280    }
7281    impl<'a> ::buffa::MessageView<'a> for UInt64RangeView<'a> {
7282        type Owned = UInt64Range;
7283        fn decode_view(
7284            buf: &'a [u8],
7285        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7286            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
7287        }
7288        fn decode_view_with_limit(
7289            buf: &'a [u8],
7290            depth: u32,
7291        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7292            Self::_decode_depth(buf, depth)
7293        }
7294        /// Convert this view to the owned message type.
7295        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
7296        fn to_owned_message(&self) -> UInt64Range {
7297            #[allow(unused_imports)]
7298            use ::buffa::alloc::string::ToString as _;
7299            UInt64Range {
7300                min: self.min,
7301                max: self.max,
7302                __buffa_unknown_fields: self
7303                    .__buffa_unknown_fields
7304                    .to_owned()
7305                    .unwrap_or_default()
7306                    .into(),
7307                ..::core::default::Default::default()
7308            }
7309        }
7310    }
7311    unsafe impl ::buffa::DefaultViewInstance for UInt64RangeView<'static> {
7312        fn default_view_instance() -> &'static Self {
7313            static VALUE: ::buffa::__private::OnceBox<UInt64RangeView<'static>> = ::buffa::__private::OnceBox::new();
7314            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
7315        }
7316    }
7317    unsafe impl<'a> ::buffa::HasDefaultViewInstance for UInt64RangeView<'a> {
7318        type Static = UInt64RangeView<'static>;
7319    }
7320    /// A single bound for a float range, with an inclusivity flag.
7321    #[derive(Clone, PartialEq, Default)]
7322    #[derive(::serde::Serialize, ::serde::Deserialize)]
7323    #[serde(default)]
7324    pub struct FloatBound {
7325        /// Field 1: `value`
7326        #[serde(
7327            rename = "value",
7328            with = "::buffa::json_helpers::double",
7329            skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f64"
7330        )]
7331        pub value: f64,
7332        /// When true the bound includes `value` itself (\<=/\>= semantics).
7333        ///
7334        /// Field 2: `inclusive`
7335        #[serde(
7336            rename = "inclusive",
7337            with = "::buffa::json_helpers::proto_bool",
7338            skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
7339        )]
7340        pub inclusive: bool,
7341        #[serde(skip)]
7342        #[doc(hidden)]
7343        pub __buffa_unknown_fields: ::buffa::UnknownFields,
7344        #[doc(hidden)]
7345        #[serde(skip)]
7346        pub __buffa_cached_size: ::buffa::__private::CachedSize,
7347    }
7348    impl ::core::fmt::Debug for FloatBound {
7349        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7350            f.debug_struct("FloatBound")
7351                .field("value", &self.value)
7352                .field("inclusive", &self.inclusive)
7353                .finish()
7354        }
7355    }
7356    impl FloatBound {
7357        /// Protobuf type URL for this message, for use with `Any::pack` and
7358        /// `Any::unpack_if`.
7359        ///
7360        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
7361        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicateConstraint.FloatBound";
7362    }
7363    unsafe impl ::buffa::DefaultInstance for FloatBound {
7364        fn default_instance() -> &'static Self {
7365            static VALUE: ::buffa::__private::OnceBox<FloatBound> = ::buffa::__private::OnceBox::new();
7366            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
7367        }
7368    }
7369    impl ::buffa::Message for FloatBound {
7370        /// Returns the total encoded size in bytes.
7371        ///
7372        /// The result is a `u32`; the protobuf specification requires all
7373        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
7374        /// compliant message will never overflow this type.
7375        fn compute_size(&self) -> u32 {
7376            #[allow(unused_imports)]
7377            use ::buffa::Enumeration as _;
7378            let mut size = 0u32;
7379            if self.value.to_bits() != 0u64 {
7380                size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
7381            }
7382            if self.inclusive {
7383                size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
7384            }
7385            size += self.__buffa_unknown_fields.encoded_len() as u32;
7386            self.__buffa_cached_size.set(size);
7387            size
7388        }
7389        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
7390            #[allow(unused_imports)]
7391            use ::buffa::Enumeration as _;
7392            if self.value.to_bits() != 0u64 {
7393                ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed64)
7394                    .encode(buf);
7395                ::buffa::types::encode_double(self.value, buf);
7396            }
7397            if self.inclusive {
7398                ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
7399                    .encode(buf);
7400                ::buffa::types::encode_bool(self.inclusive, buf);
7401            }
7402            self.__buffa_unknown_fields.write_to(buf);
7403        }
7404        fn merge_field(
7405            &mut self,
7406            tag: ::buffa::encoding::Tag,
7407            buf: &mut impl ::buffa::bytes::Buf,
7408            depth: u32,
7409        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
7410            #[allow(unused_imports)]
7411            use ::buffa::bytes::Buf as _;
7412            #[allow(unused_imports)]
7413            use ::buffa::Enumeration as _;
7414            match tag.field_number() {
7415                1u32 => {
7416                    if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
7417                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7418                            field_number: 1u32,
7419                            expected: 1u8,
7420                            actual: tag.wire_type() as u8,
7421                        });
7422                    }
7423                    self.value = ::buffa::types::decode_double(buf)?;
7424                }
7425                2u32 => {
7426                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
7427                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7428                            field_number: 2u32,
7429                            expected: 0u8,
7430                            actual: tag.wire_type() as u8,
7431                        });
7432                    }
7433                    self.inclusive = ::buffa::types::decode_bool(buf)?;
7434                }
7435                _ => {
7436                    self.__buffa_unknown_fields
7437                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
7438                }
7439            }
7440            ::core::result::Result::Ok(())
7441        }
7442        fn cached_size(&self) -> u32 {
7443            self.__buffa_cached_size.get()
7444        }
7445        fn clear(&mut self) {
7446            self.value = 0f64;
7447            self.inclusive = false;
7448            self.__buffa_unknown_fields.clear();
7449            self.__buffa_cached_size.set(0);
7450        }
7451    }
7452    impl ::buffa::ExtensionSet for FloatBound {
7453        const PROTO_FQN: &'static str = "store.query.v1.KvPredicateConstraint.FloatBound";
7454        fn unknown_fields(&self) -> &::buffa::UnknownFields {
7455            &self.__buffa_unknown_fields
7456        }
7457        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
7458            &mut self.__buffa_unknown_fields
7459        }
7460    }
7461    impl ::buffa::json_helpers::ProtoElemJson for FloatBound {
7462        fn serialize_proto_json<S: ::serde::Serializer>(
7463            v: &Self,
7464            s: S,
7465        ) -> ::core::result::Result<S::Ok, S::Error> {
7466            ::serde::Serialize::serialize(v, s)
7467        }
7468        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
7469            d: D,
7470        ) -> ::core::result::Result<Self, D::Error> {
7471            <Self as ::serde::Deserialize>::deserialize(d)
7472        }
7473    }
7474    #[doc(hidden)]
7475    pub const __FLOAT_BOUND_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
7476        type_url: "type.googleapis.com/store.query.v1.KvPredicateConstraint.FloatBound",
7477        to_json: ::buffa::type_registry::any_to_json::<FloatBound>,
7478        from_json: ::buffa::type_registry::any_from_json::<FloatBound>,
7479        is_wkt: false,
7480    };
7481    /// A single bound for a float range, with an inclusivity flag.
7482    #[derive(Clone, Debug, Default)]
7483    pub struct FloatBoundView<'a> {
7484        /// Field 1: `value`
7485        pub value: f64,
7486        /// When true the bound includes `value` itself (\<=/\>= semantics).
7487        ///
7488        /// Field 2: `inclusive`
7489        pub inclusive: bool,
7490        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
7491    }
7492    impl<'a> FloatBoundView<'a> {
7493        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
7494        ///
7495        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
7496        /// and by generated sub-message decode arms with `depth - 1`.
7497        ///
7498        /// **Not part of the public API.** Named with a leading underscore to
7499        /// signal that it is for generated-code use only.
7500        #[doc(hidden)]
7501        pub fn _decode_depth(
7502            buf: &'a [u8],
7503            depth: u32,
7504        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7505            let mut view = Self::default();
7506            view._merge_into_view(buf, depth)?;
7507            ::core::result::Result::Ok(view)
7508        }
7509        /// Merge fields from `buf` into this view (proto merge semantics).
7510        ///
7511        /// Repeated fields append; singular fields last-wins; singular
7512        /// MESSAGE fields merge recursively. Used by sub-message decode
7513        /// arms when the same field appears multiple times on the wire.
7514        ///
7515        /// **Not part of the public API.**
7516        #[doc(hidden)]
7517        pub fn _merge_into_view(
7518            &mut self,
7519            buf: &'a [u8],
7520            depth: u32,
7521        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
7522            let _ = depth;
7523            #[allow(unused_variables)]
7524            let view = self;
7525            let mut cur: &'a [u8] = buf;
7526            while !cur.is_empty() {
7527                let before_tag = cur;
7528                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
7529                match tag.field_number() {
7530                    1u32 => {
7531                        if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
7532                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7533                                field_number: 1u32,
7534                                expected: 1u8,
7535                                actual: tag.wire_type() as u8,
7536                            });
7537                        }
7538                        view.value = ::buffa::types::decode_double(&mut cur)?;
7539                    }
7540                    2u32 => {
7541                        if tag.wire_type() != ::buffa::encoding::WireType::Varint {
7542                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7543                                field_number: 2u32,
7544                                expected: 0u8,
7545                                actual: tag.wire_type() as u8,
7546                            });
7547                        }
7548                        view.inclusive = ::buffa::types::decode_bool(&mut cur)?;
7549                    }
7550                    _ => {
7551                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
7552                        let span_len = before_tag.len() - cur.len();
7553                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
7554                    }
7555                }
7556            }
7557            ::core::result::Result::Ok(())
7558        }
7559    }
7560    impl<'a> ::buffa::MessageView<'a> for FloatBoundView<'a> {
7561        type Owned = FloatBound;
7562        fn decode_view(
7563            buf: &'a [u8],
7564        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7565            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
7566        }
7567        fn decode_view_with_limit(
7568            buf: &'a [u8],
7569            depth: u32,
7570        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7571            Self::_decode_depth(buf, depth)
7572        }
7573        /// Convert this view to the owned message type.
7574        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
7575        fn to_owned_message(&self) -> FloatBound {
7576            #[allow(unused_imports)]
7577            use ::buffa::alloc::string::ToString as _;
7578            FloatBound {
7579                value: self.value,
7580                inclusive: self.inclusive,
7581                __buffa_unknown_fields: self
7582                    .__buffa_unknown_fields
7583                    .to_owned()
7584                    .unwrap_or_default()
7585                    .into(),
7586                ..::core::default::Default::default()
7587            }
7588        }
7589    }
7590    unsafe impl ::buffa::DefaultViewInstance for FloatBoundView<'static> {
7591        fn default_view_instance() -> &'static Self {
7592            static VALUE: ::buffa::__private::OnceBox<FloatBoundView<'static>> = ::buffa::__private::OnceBox::new();
7593            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
7594        }
7595    }
7596    unsafe impl<'a> ::buffa::HasDefaultViewInstance for FloatBoundView<'a> {
7597        type Static = FloatBoundView<'static>;
7598    }
7599    /// Float range with independently inclusive/exclusive bounds.
7600    #[derive(Clone, PartialEq, Default)]
7601    #[derive(::serde::Serialize, ::serde::Deserialize)]
7602    #[serde(default)]
7603    pub struct FloatRange {
7604        /// Field 1: `min`
7605        #[serde(
7606            rename = "min",
7607            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
7608        )]
7609        pub min: ::buffa::MessageField<kv_predicate_constraint::FloatBound>,
7610        /// Field 2: `max`
7611        #[serde(
7612            rename = "max",
7613            skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
7614        )]
7615        pub max: ::buffa::MessageField<kv_predicate_constraint::FloatBound>,
7616        #[serde(skip)]
7617        #[doc(hidden)]
7618        pub __buffa_unknown_fields: ::buffa::UnknownFields,
7619        #[doc(hidden)]
7620        #[serde(skip)]
7621        pub __buffa_cached_size: ::buffa::__private::CachedSize,
7622    }
7623    impl ::core::fmt::Debug for FloatRange {
7624        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7625            f.debug_struct("FloatRange")
7626                .field("min", &self.min)
7627                .field("max", &self.max)
7628                .finish()
7629        }
7630    }
7631    impl FloatRange {
7632        /// Protobuf type URL for this message, for use with `Any::pack` and
7633        /// `Any::unpack_if`.
7634        ///
7635        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
7636        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicateConstraint.FloatRange";
7637    }
7638    unsafe impl ::buffa::DefaultInstance for FloatRange {
7639        fn default_instance() -> &'static Self {
7640            static VALUE: ::buffa::__private::OnceBox<FloatRange> = ::buffa::__private::OnceBox::new();
7641            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
7642        }
7643    }
7644    impl ::buffa::Message for FloatRange {
7645        /// Returns the total encoded size in bytes.
7646        ///
7647        /// The result is a `u32`; the protobuf specification requires all
7648        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
7649        /// compliant message will never overflow this type.
7650        fn compute_size(&self) -> u32 {
7651            #[allow(unused_imports)]
7652            use ::buffa::Enumeration as _;
7653            let mut size = 0u32;
7654            if self.min.is_set() {
7655                let inner_size = self.min.compute_size();
7656                size
7657                    += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
7658                        + inner_size;
7659            }
7660            if self.max.is_set() {
7661                let inner_size = self.max.compute_size();
7662                size
7663                    += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
7664                        + inner_size;
7665            }
7666            size += self.__buffa_unknown_fields.encoded_len() as u32;
7667            self.__buffa_cached_size.set(size);
7668            size
7669        }
7670        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
7671            #[allow(unused_imports)]
7672            use ::buffa::Enumeration as _;
7673            if self.min.is_set() {
7674                ::buffa::encoding::Tag::new(
7675                        1u32,
7676                        ::buffa::encoding::WireType::LengthDelimited,
7677                    )
7678                    .encode(buf);
7679                ::buffa::encoding::encode_varint(self.min.cached_size() as u64, buf);
7680                self.min.write_to(buf);
7681            }
7682            if self.max.is_set() {
7683                ::buffa::encoding::Tag::new(
7684                        2u32,
7685                        ::buffa::encoding::WireType::LengthDelimited,
7686                    )
7687                    .encode(buf);
7688                ::buffa::encoding::encode_varint(self.max.cached_size() as u64, buf);
7689                self.max.write_to(buf);
7690            }
7691            self.__buffa_unknown_fields.write_to(buf);
7692        }
7693        fn merge_field(
7694            &mut self,
7695            tag: ::buffa::encoding::Tag,
7696            buf: &mut impl ::buffa::bytes::Buf,
7697            depth: u32,
7698        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
7699            #[allow(unused_imports)]
7700            use ::buffa::bytes::Buf as _;
7701            #[allow(unused_imports)]
7702            use ::buffa::Enumeration as _;
7703            match tag.field_number() {
7704                1u32 => {
7705                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
7706                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7707                            field_number: 1u32,
7708                            expected: 2u8,
7709                            actual: tag.wire_type() as u8,
7710                        });
7711                    }
7712                    ::buffa::Message::merge_length_delimited(
7713                        self.min.get_or_insert_default(),
7714                        buf,
7715                        depth,
7716                    )?;
7717                }
7718                2u32 => {
7719                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
7720                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7721                            field_number: 2u32,
7722                            expected: 2u8,
7723                            actual: tag.wire_type() as u8,
7724                        });
7725                    }
7726                    ::buffa::Message::merge_length_delimited(
7727                        self.max.get_or_insert_default(),
7728                        buf,
7729                        depth,
7730                    )?;
7731                }
7732                _ => {
7733                    self.__buffa_unknown_fields
7734                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
7735                }
7736            }
7737            ::core::result::Result::Ok(())
7738        }
7739        fn cached_size(&self) -> u32 {
7740            self.__buffa_cached_size.get()
7741        }
7742        fn clear(&mut self) {
7743            self.min = ::buffa::MessageField::none();
7744            self.max = ::buffa::MessageField::none();
7745            self.__buffa_unknown_fields.clear();
7746            self.__buffa_cached_size.set(0);
7747        }
7748    }
7749    impl ::buffa::ExtensionSet for FloatRange {
7750        const PROTO_FQN: &'static str = "store.query.v1.KvPredicateConstraint.FloatRange";
7751        fn unknown_fields(&self) -> &::buffa::UnknownFields {
7752            &self.__buffa_unknown_fields
7753        }
7754        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
7755            &mut self.__buffa_unknown_fields
7756        }
7757    }
7758    impl ::buffa::json_helpers::ProtoElemJson for FloatRange {
7759        fn serialize_proto_json<S: ::serde::Serializer>(
7760            v: &Self,
7761            s: S,
7762        ) -> ::core::result::Result<S::Ok, S::Error> {
7763            ::serde::Serialize::serialize(v, s)
7764        }
7765        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
7766            d: D,
7767        ) -> ::core::result::Result<Self, D::Error> {
7768            <Self as ::serde::Deserialize>::deserialize(d)
7769        }
7770    }
7771    #[doc(hidden)]
7772    pub const __FLOAT_RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
7773        type_url: "type.googleapis.com/store.query.v1.KvPredicateConstraint.FloatRange",
7774        to_json: ::buffa::type_registry::any_to_json::<FloatRange>,
7775        from_json: ::buffa::type_registry::any_from_json::<FloatRange>,
7776        is_wkt: false,
7777    };
7778    /// Float range with independently inclusive/exclusive bounds.
7779    #[derive(Clone, Debug, Default)]
7780    pub struct FloatRangeView<'a> {
7781        /// Field 1: `min`
7782        pub min: ::buffa::MessageFieldView<kv_predicate_constraint::FloatBoundView<'a>>,
7783        /// Field 2: `max`
7784        pub max: ::buffa::MessageFieldView<kv_predicate_constraint::FloatBoundView<'a>>,
7785        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
7786    }
7787    impl<'a> FloatRangeView<'a> {
7788        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
7789        ///
7790        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
7791        /// and by generated sub-message decode arms with `depth - 1`.
7792        ///
7793        /// **Not part of the public API.** Named with a leading underscore to
7794        /// signal that it is for generated-code use only.
7795        #[doc(hidden)]
7796        pub fn _decode_depth(
7797            buf: &'a [u8],
7798            depth: u32,
7799        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7800            let mut view = Self::default();
7801            view._merge_into_view(buf, depth)?;
7802            ::core::result::Result::Ok(view)
7803        }
7804        /// Merge fields from `buf` into this view (proto merge semantics).
7805        ///
7806        /// Repeated fields append; singular fields last-wins; singular
7807        /// MESSAGE fields merge recursively. Used by sub-message decode
7808        /// arms when the same field appears multiple times on the wire.
7809        ///
7810        /// **Not part of the public API.**
7811        #[doc(hidden)]
7812        pub fn _merge_into_view(
7813            &mut self,
7814            buf: &'a [u8],
7815            depth: u32,
7816        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
7817            let _ = depth;
7818            #[allow(unused_variables)]
7819            let view = self;
7820            let mut cur: &'a [u8] = buf;
7821            while !cur.is_empty() {
7822                let before_tag = cur;
7823                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
7824                match tag.field_number() {
7825                    1u32 => {
7826                        if tag.wire_type()
7827                            != ::buffa::encoding::WireType::LengthDelimited
7828                        {
7829                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7830                                field_number: 1u32,
7831                                expected: 2u8,
7832                                actual: tag.wire_type() as u8,
7833                            });
7834                        }
7835                        if depth == 0 {
7836                            return Err(::buffa::DecodeError::RecursionLimitExceeded);
7837                        }
7838                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
7839                        match view.min.as_mut() {
7840                            Some(existing) => existing._merge_into_view(sub, depth - 1)?,
7841                            None => {
7842                                view.min = ::buffa::MessageFieldView::set(
7843                                    kv_predicate_constraint::FloatBoundView::_decode_depth(
7844                                        sub,
7845                                        depth - 1,
7846                                    )?,
7847                                );
7848                            }
7849                        }
7850                    }
7851                    2u32 => {
7852                        if tag.wire_type()
7853                            != ::buffa::encoding::WireType::LengthDelimited
7854                        {
7855                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
7856                                field_number: 2u32,
7857                                expected: 2u8,
7858                                actual: tag.wire_type() as u8,
7859                            });
7860                        }
7861                        if depth == 0 {
7862                            return Err(::buffa::DecodeError::RecursionLimitExceeded);
7863                        }
7864                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
7865                        match view.max.as_mut() {
7866                            Some(existing) => existing._merge_into_view(sub, depth - 1)?,
7867                            None => {
7868                                view.max = ::buffa::MessageFieldView::set(
7869                                    kv_predicate_constraint::FloatBoundView::_decode_depth(
7870                                        sub,
7871                                        depth - 1,
7872                                    )?,
7873                                );
7874                            }
7875                        }
7876                    }
7877                    _ => {
7878                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
7879                        let span_len = before_tag.len() - cur.len();
7880                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
7881                    }
7882                }
7883            }
7884            ::core::result::Result::Ok(())
7885        }
7886    }
7887    impl<'a> ::buffa::MessageView<'a> for FloatRangeView<'a> {
7888        type Owned = FloatRange;
7889        fn decode_view(
7890            buf: &'a [u8],
7891        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7892            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
7893        }
7894        fn decode_view_with_limit(
7895            buf: &'a [u8],
7896            depth: u32,
7897        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
7898            Self::_decode_depth(buf, depth)
7899        }
7900        /// Convert this view to the owned message type.
7901        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
7902        fn to_owned_message(&self) -> FloatRange {
7903            #[allow(unused_imports)]
7904            use ::buffa::alloc::string::ToString as _;
7905            FloatRange {
7906                min: match self.min.as_option() {
7907                    Some(v) => {
7908                        ::buffa::MessageField::<
7909                            kv_predicate_constraint::FloatBound,
7910                        >::some(v.to_owned_message())
7911                    }
7912                    None => ::buffa::MessageField::none(),
7913                },
7914                max: match self.max.as_option() {
7915                    Some(v) => {
7916                        ::buffa::MessageField::<
7917                            kv_predicate_constraint::FloatBound,
7918                        >::some(v.to_owned_message())
7919                    }
7920                    None => ::buffa::MessageField::none(),
7921                },
7922                __buffa_unknown_fields: self
7923                    .__buffa_unknown_fields
7924                    .to_owned()
7925                    .unwrap_or_default()
7926                    .into(),
7927                ..::core::default::Default::default()
7928            }
7929        }
7930    }
7931    unsafe impl ::buffa::DefaultViewInstance for FloatRangeView<'static> {
7932        fn default_view_instance() -> &'static Self {
7933            static VALUE: ::buffa::__private::OnceBox<FloatRangeView<'static>> = ::buffa::__private::OnceBox::new();
7934            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
7935        }
7936    }
7937    unsafe impl<'a> ::buffa::HasDefaultViewInstance for FloatRangeView<'a> {
7938        type Static = FloatRangeView<'static>;
7939    }
7940    /// Inclusive Decimal128 range (16-byte little-endian).
7941    #[derive(Clone, PartialEq, Default)]
7942    #[derive(::serde::Serialize, ::serde::Deserialize)]
7943    #[serde(default)]
7944    pub struct Decimal128Range {
7945        /// Field 1: `min`
7946        #[serde(
7947            rename = "min",
7948            with = "::buffa::json_helpers::opt_bytes",
7949            skip_serializing_if = "Option::is_none"
7950        )]
7951        pub min: Option<::buffa::alloc::vec::Vec<u8>>,
7952        /// Field 2: `max`
7953        #[serde(
7954            rename = "max",
7955            with = "::buffa::json_helpers::opt_bytes",
7956            skip_serializing_if = "Option::is_none"
7957        )]
7958        pub max: Option<::buffa::alloc::vec::Vec<u8>>,
7959        #[serde(skip)]
7960        #[doc(hidden)]
7961        pub __buffa_unknown_fields: ::buffa::UnknownFields,
7962        #[doc(hidden)]
7963        #[serde(skip)]
7964        pub __buffa_cached_size: ::buffa::__private::CachedSize,
7965    }
7966    impl ::core::fmt::Debug for Decimal128Range {
7967        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7968            f.debug_struct("Decimal128Range")
7969                .field("min", &self.min)
7970                .field("max", &self.max)
7971                .finish()
7972        }
7973    }
7974    impl Decimal128Range {
7975        /// Protobuf type URL for this message, for use with `Any::pack` and
7976        /// `Any::unpack_if`.
7977        ///
7978        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
7979        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicateConstraint.Decimal128Range";
7980    }
7981    unsafe impl ::buffa::DefaultInstance for Decimal128Range {
7982        fn default_instance() -> &'static Self {
7983            static VALUE: ::buffa::__private::OnceBox<Decimal128Range> = ::buffa::__private::OnceBox::new();
7984            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
7985        }
7986    }
7987    impl ::buffa::Message for Decimal128Range {
7988        /// Returns the total encoded size in bytes.
7989        ///
7990        /// The result is a `u32`; the protobuf specification requires all
7991        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
7992        /// compliant message will never overflow this type.
7993        fn compute_size(&self) -> u32 {
7994            #[allow(unused_imports)]
7995            use ::buffa::Enumeration as _;
7996            let mut size = 0u32;
7997            if let Some(ref v) = self.min {
7998                size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
7999            }
8000            if let Some(ref v) = self.max {
8001                size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
8002            }
8003            size += self.__buffa_unknown_fields.encoded_len() as u32;
8004            self.__buffa_cached_size.set(size);
8005            size
8006        }
8007        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
8008            #[allow(unused_imports)]
8009            use ::buffa::Enumeration as _;
8010            if let Some(ref v) = self.min {
8011                ::buffa::encoding::Tag::new(
8012                        1u32,
8013                        ::buffa::encoding::WireType::LengthDelimited,
8014                    )
8015                    .encode(buf);
8016                ::buffa::types::encode_bytes(v, buf);
8017            }
8018            if let Some(ref v) = self.max {
8019                ::buffa::encoding::Tag::new(
8020                        2u32,
8021                        ::buffa::encoding::WireType::LengthDelimited,
8022                    )
8023                    .encode(buf);
8024                ::buffa::types::encode_bytes(v, buf);
8025            }
8026            self.__buffa_unknown_fields.write_to(buf);
8027        }
8028        fn merge_field(
8029            &mut self,
8030            tag: ::buffa::encoding::Tag,
8031            buf: &mut impl ::buffa::bytes::Buf,
8032            depth: u32,
8033        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
8034            #[allow(unused_imports)]
8035            use ::buffa::bytes::Buf as _;
8036            #[allow(unused_imports)]
8037            use ::buffa::Enumeration as _;
8038            match tag.field_number() {
8039                1u32 => {
8040                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8041                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8042                            field_number: 1u32,
8043                            expected: 2u8,
8044                            actual: tag.wire_type() as u8,
8045                        });
8046                    }
8047                    ::buffa::types::merge_bytes(
8048                        self.min.get_or_insert_with(::buffa::alloc::vec::Vec::new),
8049                        buf,
8050                    )?;
8051                }
8052                2u32 => {
8053                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8054                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8055                            field_number: 2u32,
8056                            expected: 2u8,
8057                            actual: tag.wire_type() as u8,
8058                        });
8059                    }
8060                    ::buffa::types::merge_bytes(
8061                        self.max.get_or_insert_with(::buffa::alloc::vec::Vec::new),
8062                        buf,
8063                    )?;
8064                }
8065                _ => {
8066                    self.__buffa_unknown_fields
8067                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
8068                }
8069            }
8070            ::core::result::Result::Ok(())
8071        }
8072        fn cached_size(&self) -> u32 {
8073            self.__buffa_cached_size.get()
8074        }
8075        fn clear(&mut self) {
8076            self.min = ::core::option::Option::None;
8077            self.max = ::core::option::Option::None;
8078            self.__buffa_unknown_fields.clear();
8079            self.__buffa_cached_size.set(0);
8080        }
8081    }
8082    impl ::buffa::ExtensionSet for Decimal128Range {
8083        const PROTO_FQN: &'static str = "store.query.v1.KvPredicateConstraint.Decimal128Range";
8084        fn unknown_fields(&self) -> &::buffa::UnknownFields {
8085            &self.__buffa_unknown_fields
8086        }
8087        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
8088            &mut self.__buffa_unknown_fields
8089        }
8090    }
8091    impl ::buffa::json_helpers::ProtoElemJson for Decimal128Range {
8092        fn serialize_proto_json<S: ::serde::Serializer>(
8093            v: &Self,
8094            s: S,
8095        ) -> ::core::result::Result<S::Ok, S::Error> {
8096            ::serde::Serialize::serialize(v, s)
8097        }
8098        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
8099            d: D,
8100        ) -> ::core::result::Result<Self, D::Error> {
8101            <Self as ::serde::Deserialize>::deserialize(d)
8102        }
8103    }
8104    #[doc(hidden)]
8105    pub const __DECIMAL128RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
8106        type_url: "type.googleapis.com/store.query.v1.KvPredicateConstraint.Decimal128Range",
8107        to_json: ::buffa::type_registry::any_to_json::<Decimal128Range>,
8108        from_json: ::buffa::type_registry::any_from_json::<Decimal128Range>,
8109        is_wkt: false,
8110    };
8111    /// Inclusive Decimal128 range (16-byte little-endian).
8112    #[derive(Clone, Debug, Default)]
8113    pub struct Decimal128RangeView<'a> {
8114        /// Field 1: `min`
8115        pub min: ::core::option::Option<&'a [u8]>,
8116        /// Field 2: `max`
8117        pub max: ::core::option::Option<&'a [u8]>,
8118        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
8119    }
8120    impl<'a> Decimal128RangeView<'a> {
8121        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
8122        ///
8123        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
8124        /// and by generated sub-message decode arms with `depth - 1`.
8125        ///
8126        /// **Not part of the public API.** Named with a leading underscore to
8127        /// signal that it is for generated-code use only.
8128        #[doc(hidden)]
8129        pub fn _decode_depth(
8130            buf: &'a [u8],
8131            depth: u32,
8132        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8133            let mut view = Self::default();
8134            view._merge_into_view(buf, depth)?;
8135            ::core::result::Result::Ok(view)
8136        }
8137        /// Merge fields from `buf` into this view (proto merge semantics).
8138        ///
8139        /// Repeated fields append; singular fields last-wins; singular
8140        /// MESSAGE fields merge recursively. Used by sub-message decode
8141        /// arms when the same field appears multiple times on the wire.
8142        ///
8143        /// **Not part of the public API.**
8144        #[doc(hidden)]
8145        pub fn _merge_into_view(
8146            &mut self,
8147            buf: &'a [u8],
8148            depth: u32,
8149        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
8150            let _ = depth;
8151            #[allow(unused_variables)]
8152            let view = self;
8153            let mut cur: &'a [u8] = buf;
8154            while !cur.is_empty() {
8155                let before_tag = cur;
8156                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
8157                match tag.field_number() {
8158                    1u32 => {
8159                        if tag.wire_type()
8160                            != ::buffa::encoding::WireType::LengthDelimited
8161                        {
8162                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8163                                field_number: 1u32,
8164                                expected: 2u8,
8165                                actual: tag.wire_type() as u8,
8166                            });
8167                        }
8168                        view.min = Some(::buffa::types::borrow_bytes(&mut cur)?);
8169                    }
8170                    2u32 => {
8171                        if tag.wire_type()
8172                            != ::buffa::encoding::WireType::LengthDelimited
8173                        {
8174                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8175                                field_number: 2u32,
8176                                expected: 2u8,
8177                                actual: tag.wire_type() as u8,
8178                            });
8179                        }
8180                        view.max = Some(::buffa::types::borrow_bytes(&mut cur)?);
8181                    }
8182                    _ => {
8183                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
8184                        let span_len = before_tag.len() - cur.len();
8185                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
8186                    }
8187                }
8188            }
8189            ::core::result::Result::Ok(())
8190        }
8191    }
8192    impl<'a> ::buffa::MessageView<'a> for Decimal128RangeView<'a> {
8193        type Owned = Decimal128Range;
8194        fn decode_view(
8195            buf: &'a [u8],
8196        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8197            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
8198        }
8199        fn decode_view_with_limit(
8200            buf: &'a [u8],
8201            depth: u32,
8202        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8203            Self::_decode_depth(buf, depth)
8204        }
8205        /// Convert this view to the owned message type.
8206        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
8207        fn to_owned_message(&self) -> Decimal128Range {
8208            #[allow(unused_imports)]
8209            use ::buffa::alloc::string::ToString as _;
8210            Decimal128Range {
8211                min: self.min.map(|b| (b).to_vec()),
8212                max: self.max.map(|b| (b).to_vec()),
8213                __buffa_unknown_fields: self
8214                    .__buffa_unknown_fields
8215                    .to_owned()
8216                    .unwrap_or_default()
8217                    .into(),
8218                ..::core::default::Default::default()
8219            }
8220        }
8221    }
8222    unsafe impl ::buffa::DefaultViewInstance for Decimal128RangeView<'static> {
8223        fn default_view_instance() -> &'static Self {
8224            static VALUE: ::buffa::__private::OnceBox<Decimal128RangeView<'static>> = ::buffa::__private::OnceBox::new();
8225            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
8226        }
8227    }
8228    unsafe impl<'a> ::buffa::HasDefaultViewInstance for Decimal128RangeView<'a> {
8229        type Static = Decimal128RangeView<'static>;
8230    }
8231    /// Inclusive Decimal256 range (32-byte little-endian).
8232    #[derive(Clone, PartialEq, Default)]
8233    #[derive(::serde::Serialize, ::serde::Deserialize)]
8234    #[serde(default)]
8235    pub struct Decimal256Range {
8236        /// Field 1: `min`
8237        #[serde(
8238            rename = "min",
8239            with = "::buffa::json_helpers::opt_bytes",
8240            skip_serializing_if = "Option::is_none"
8241        )]
8242        pub min: Option<::buffa::alloc::vec::Vec<u8>>,
8243        /// Field 2: `max`
8244        #[serde(
8245            rename = "max",
8246            with = "::buffa::json_helpers::opt_bytes",
8247            skip_serializing_if = "Option::is_none"
8248        )]
8249        pub max: Option<::buffa::alloc::vec::Vec<u8>>,
8250        #[serde(skip)]
8251        #[doc(hidden)]
8252        pub __buffa_unknown_fields: ::buffa::UnknownFields,
8253        #[doc(hidden)]
8254        #[serde(skip)]
8255        pub __buffa_cached_size: ::buffa::__private::CachedSize,
8256    }
8257    impl ::core::fmt::Debug for Decimal256Range {
8258        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8259            f.debug_struct("Decimal256Range")
8260                .field("min", &self.min)
8261                .field("max", &self.max)
8262                .finish()
8263        }
8264    }
8265    impl Decimal256Range {
8266        /// Protobuf type URL for this message, for use with `Any::pack` and
8267        /// `Any::unpack_if`.
8268        ///
8269        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
8270        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicateConstraint.Decimal256Range";
8271    }
8272    unsafe impl ::buffa::DefaultInstance for Decimal256Range {
8273        fn default_instance() -> &'static Self {
8274            static VALUE: ::buffa::__private::OnceBox<Decimal256Range> = ::buffa::__private::OnceBox::new();
8275            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
8276        }
8277    }
8278    impl ::buffa::Message for Decimal256Range {
8279        /// Returns the total encoded size in bytes.
8280        ///
8281        /// The result is a `u32`; the protobuf specification requires all
8282        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
8283        /// compliant message will never overflow this type.
8284        fn compute_size(&self) -> u32 {
8285            #[allow(unused_imports)]
8286            use ::buffa::Enumeration as _;
8287            let mut size = 0u32;
8288            if let Some(ref v) = self.min {
8289                size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
8290            }
8291            if let Some(ref v) = self.max {
8292                size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
8293            }
8294            size += self.__buffa_unknown_fields.encoded_len() as u32;
8295            self.__buffa_cached_size.set(size);
8296            size
8297        }
8298        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
8299            #[allow(unused_imports)]
8300            use ::buffa::Enumeration as _;
8301            if let Some(ref v) = self.min {
8302                ::buffa::encoding::Tag::new(
8303                        1u32,
8304                        ::buffa::encoding::WireType::LengthDelimited,
8305                    )
8306                    .encode(buf);
8307                ::buffa::types::encode_bytes(v, buf);
8308            }
8309            if let Some(ref v) = self.max {
8310                ::buffa::encoding::Tag::new(
8311                        2u32,
8312                        ::buffa::encoding::WireType::LengthDelimited,
8313                    )
8314                    .encode(buf);
8315                ::buffa::types::encode_bytes(v, buf);
8316            }
8317            self.__buffa_unknown_fields.write_to(buf);
8318        }
8319        fn merge_field(
8320            &mut self,
8321            tag: ::buffa::encoding::Tag,
8322            buf: &mut impl ::buffa::bytes::Buf,
8323            depth: u32,
8324        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
8325            #[allow(unused_imports)]
8326            use ::buffa::bytes::Buf as _;
8327            #[allow(unused_imports)]
8328            use ::buffa::Enumeration as _;
8329            match tag.field_number() {
8330                1u32 => {
8331                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8332                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8333                            field_number: 1u32,
8334                            expected: 2u8,
8335                            actual: tag.wire_type() as u8,
8336                        });
8337                    }
8338                    ::buffa::types::merge_bytes(
8339                        self.min.get_or_insert_with(::buffa::alloc::vec::Vec::new),
8340                        buf,
8341                    )?;
8342                }
8343                2u32 => {
8344                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8345                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8346                            field_number: 2u32,
8347                            expected: 2u8,
8348                            actual: tag.wire_type() as u8,
8349                        });
8350                    }
8351                    ::buffa::types::merge_bytes(
8352                        self.max.get_or_insert_with(::buffa::alloc::vec::Vec::new),
8353                        buf,
8354                    )?;
8355                }
8356                _ => {
8357                    self.__buffa_unknown_fields
8358                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
8359                }
8360            }
8361            ::core::result::Result::Ok(())
8362        }
8363        fn cached_size(&self) -> u32 {
8364            self.__buffa_cached_size.get()
8365        }
8366        fn clear(&mut self) {
8367            self.min = ::core::option::Option::None;
8368            self.max = ::core::option::Option::None;
8369            self.__buffa_unknown_fields.clear();
8370            self.__buffa_cached_size.set(0);
8371        }
8372    }
8373    impl ::buffa::ExtensionSet for Decimal256Range {
8374        const PROTO_FQN: &'static str = "store.query.v1.KvPredicateConstraint.Decimal256Range";
8375        fn unknown_fields(&self) -> &::buffa::UnknownFields {
8376            &self.__buffa_unknown_fields
8377        }
8378        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
8379            &mut self.__buffa_unknown_fields
8380        }
8381    }
8382    impl ::buffa::json_helpers::ProtoElemJson for Decimal256Range {
8383        fn serialize_proto_json<S: ::serde::Serializer>(
8384            v: &Self,
8385            s: S,
8386        ) -> ::core::result::Result<S::Ok, S::Error> {
8387            ::serde::Serialize::serialize(v, s)
8388        }
8389        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
8390            d: D,
8391        ) -> ::core::result::Result<Self, D::Error> {
8392            <Self as ::serde::Deserialize>::deserialize(d)
8393        }
8394    }
8395    #[doc(hidden)]
8396    pub const __DECIMAL256RANGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
8397        type_url: "type.googleapis.com/store.query.v1.KvPredicateConstraint.Decimal256Range",
8398        to_json: ::buffa::type_registry::any_to_json::<Decimal256Range>,
8399        from_json: ::buffa::type_registry::any_from_json::<Decimal256Range>,
8400        is_wkt: false,
8401    };
8402    /// Inclusive Decimal256 range (32-byte little-endian).
8403    #[derive(Clone, Debug, Default)]
8404    pub struct Decimal256RangeView<'a> {
8405        /// Field 1: `min`
8406        pub min: ::core::option::Option<&'a [u8]>,
8407        /// Field 2: `max`
8408        pub max: ::core::option::Option<&'a [u8]>,
8409        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
8410    }
8411    impl<'a> Decimal256RangeView<'a> {
8412        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
8413        ///
8414        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
8415        /// and by generated sub-message decode arms with `depth - 1`.
8416        ///
8417        /// **Not part of the public API.** Named with a leading underscore to
8418        /// signal that it is for generated-code use only.
8419        #[doc(hidden)]
8420        pub fn _decode_depth(
8421            buf: &'a [u8],
8422            depth: u32,
8423        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8424            let mut view = Self::default();
8425            view._merge_into_view(buf, depth)?;
8426            ::core::result::Result::Ok(view)
8427        }
8428        /// Merge fields from `buf` into this view (proto merge semantics).
8429        ///
8430        /// Repeated fields append; singular fields last-wins; singular
8431        /// MESSAGE fields merge recursively. Used by sub-message decode
8432        /// arms when the same field appears multiple times on the wire.
8433        ///
8434        /// **Not part of the public API.**
8435        #[doc(hidden)]
8436        pub fn _merge_into_view(
8437            &mut self,
8438            buf: &'a [u8],
8439            depth: u32,
8440        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
8441            let _ = depth;
8442            #[allow(unused_variables)]
8443            let view = self;
8444            let mut cur: &'a [u8] = buf;
8445            while !cur.is_empty() {
8446                let before_tag = cur;
8447                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
8448                match tag.field_number() {
8449                    1u32 => {
8450                        if tag.wire_type()
8451                            != ::buffa::encoding::WireType::LengthDelimited
8452                        {
8453                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8454                                field_number: 1u32,
8455                                expected: 2u8,
8456                                actual: tag.wire_type() as u8,
8457                            });
8458                        }
8459                        view.min = Some(::buffa::types::borrow_bytes(&mut cur)?);
8460                    }
8461                    2u32 => {
8462                        if tag.wire_type()
8463                            != ::buffa::encoding::WireType::LengthDelimited
8464                        {
8465                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8466                                field_number: 2u32,
8467                                expected: 2u8,
8468                                actual: tag.wire_type() as u8,
8469                            });
8470                        }
8471                        view.max = Some(::buffa::types::borrow_bytes(&mut cur)?);
8472                    }
8473                    _ => {
8474                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
8475                        let span_len = before_tag.len() - cur.len();
8476                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
8477                    }
8478                }
8479            }
8480            ::core::result::Result::Ok(())
8481        }
8482    }
8483    impl<'a> ::buffa::MessageView<'a> for Decimal256RangeView<'a> {
8484        type Owned = Decimal256Range;
8485        fn decode_view(
8486            buf: &'a [u8],
8487        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8488            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
8489        }
8490        fn decode_view_with_limit(
8491            buf: &'a [u8],
8492            depth: u32,
8493        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8494            Self::_decode_depth(buf, depth)
8495        }
8496        /// Convert this view to the owned message type.
8497        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
8498        fn to_owned_message(&self) -> Decimal256Range {
8499            #[allow(unused_imports)]
8500            use ::buffa::alloc::string::ToString as _;
8501            Decimal256Range {
8502                min: self.min.map(|b| (b).to_vec()),
8503                max: self.max.map(|b| (b).to_vec()),
8504                __buffa_unknown_fields: self
8505                    .__buffa_unknown_fields
8506                    .to_owned()
8507                    .unwrap_or_default()
8508                    .into(),
8509                ..::core::default::Default::default()
8510            }
8511        }
8512    }
8513    unsafe impl ::buffa::DefaultViewInstance for Decimal256RangeView<'static> {
8514        fn default_view_instance() -> &'static Self {
8515            static VALUE: ::buffa::__private::OnceBox<Decimal256RangeView<'static>> = ::buffa::__private::OnceBox::new();
8516            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
8517        }
8518    }
8519    unsafe impl<'a> ::buffa::HasDefaultViewInstance for Decimal256RangeView<'a> {
8520        type Static = Decimal256RangeView<'static>;
8521    }
8522    /// Set membership test for UTF-8 strings.
8523    #[derive(Clone, PartialEq, Default)]
8524    #[derive(::serde::Serialize, ::serde::Deserialize)]
8525    #[serde(default)]
8526    pub struct StringIn {
8527        /// Field 1: `values`
8528        #[serde(
8529            rename = "values",
8530            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
8531            deserialize_with = "::buffa::json_helpers::null_as_default"
8532        )]
8533        pub values: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
8534        #[serde(skip)]
8535        #[doc(hidden)]
8536        pub __buffa_unknown_fields: ::buffa::UnknownFields,
8537        #[doc(hidden)]
8538        #[serde(skip)]
8539        pub __buffa_cached_size: ::buffa::__private::CachedSize,
8540    }
8541    impl ::core::fmt::Debug for StringIn {
8542        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8543            f.debug_struct("StringIn").field("values", &self.values).finish()
8544        }
8545    }
8546    impl StringIn {
8547        /// Protobuf type URL for this message, for use with `Any::pack` and
8548        /// `Any::unpack_if`.
8549        ///
8550        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
8551        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicateConstraint.StringIn";
8552    }
8553    unsafe impl ::buffa::DefaultInstance for StringIn {
8554        fn default_instance() -> &'static Self {
8555            static VALUE: ::buffa::__private::OnceBox<StringIn> = ::buffa::__private::OnceBox::new();
8556            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
8557        }
8558    }
8559    impl ::buffa::Message for StringIn {
8560        /// Returns the total encoded size in bytes.
8561        ///
8562        /// The result is a `u32`; the protobuf specification requires all
8563        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
8564        /// compliant message will never overflow this type.
8565        fn compute_size(&self) -> u32 {
8566            #[allow(unused_imports)]
8567            use ::buffa::Enumeration as _;
8568            let mut size = 0u32;
8569            for v in &self.values {
8570                size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
8571            }
8572            size += self.__buffa_unknown_fields.encoded_len() as u32;
8573            self.__buffa_cached_size.set(size);
8574            size
8575        }
8576        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
8577            #[allow(unused_imports)]
8578            use ::buffa::Enumeration as _;
8579            for v in &self.values {
8580                ::buffa::encoding::Tag::new(
8581                        1u32,
8582                        ::buffa::encoding::WireType::LengthDelimited,
8583                    )
8584                    .encode(buf);
8585                ::buffa::types::encode_string(v, buf);
8586            }
8587            self.__buffa_unknown_fields.write_to(buf);
8588        }
8589        fn merge_field(
8590            &mut self,
8591            tag: ::buffa::encoding::Tag,
8592            buf: &mut impl ::buffa::bytes::Buf,
8593            depth: u32,
8594        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
8595            #[allow(unused_imports)]
8596            use ::buffa::bytes::Buf as _;
8597            #[allow(unused_imports)]
8598            use ::buffa::Enumeration as _;
8599            match tag.field_number() {
8600                1u32 => {
8601                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
8602                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8603                            field_number: 1u32,
8604                            expected: 2u8,
8605                            actual: tag.wire_type() as u8,
8606                        });
8607                    }
8608                    self.values.push(::buffa::types::decode_string(buf)?);
8609                }
8610                _ => {
8611                    self.__buffa_unknown_fields
8612                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
8613                }
8614            }
8615            ::core::result::Result::Ok(())
8616        }
8617        fn cached_size(&self) -> u32 {
8618            self.__buffa_cached_size.get()
8619        }
8620        fn clear(&mut self) {
8621            self.values.clear();
8622            self.__buffa_unknown_fields.clear();
8623            self.__buffa_cached_size.set(0);
8624        }
8625    }
8626    impl ::buffa::ExtensionSet for StringIn {
8627        const PROTO_FQN: &'static str = "store.query.v1.KvPredicateConstraint.StringIn";
8628        fn unknown_fields(&self) -> &::buffa::UnknownFields {
8629            &self.__buffa_unknown_fields
8630        }
8631        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
8632            &mut self.__buffa_unknown_fields
8633        }
8634    }
8635    impl ::buffa::json_helpers::ProtoElemJson for StringIn {
8636        fn serialize_proto_json<S: ::serde::Serializer>(
8637            v: &Self,
8638            s: S,
8639        ) -> ::core::result::Result<S::Ok, S::Error> {
8640            ::serde::Serialize::serialize(v, s)
8641        }
8642        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
8643            d: D,
8644        ) -> ::core::result::Result<Self, D::Error> {
8645            <Self as ::serde::Deserialize>::deserialize(d)
8646        }
8647    }
8648    #[doc(hidden)]
8649    pub const __STRING_IN_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
8650        type_url: "type.googleapis.com/store.query.v1.KvPredicateConstraint.StringIn",
8651        to_json: ::buffa::type_registry::any_to_json::<StringIn>,
8652        from_json: ::buffa::type_registry::any_from_json::<StringIn>,
8653        is_wkt: false,
8654    };
8655    /// Set membership test for UTF-8 strings.
8656    #[derive(Clone, Debug, Default)]
8657    pub struct StringInView<'a> {
8658        /// Field 1: `values`
8659        pub values: ::buffa::RepeatedView<'a, &'a str>,
8660        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
8661    }
8662    impl<'a> StringInView<'a> {
8663        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
8664        ///
8665        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
8666        /// and by generated sub-message decode arms with `depth - 1`.
8667        ///
8668        /// **Not part of the public API.** Named with a leading underscore to
8669        /// signal that it is for generated-code use only.
8670        #[doc(hidden)]
8671        pub fn _decode_depth(
8672            buf: &'a [u8],
8673            depth: u32,
8674        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8675            let mut view = Self::default();
8676            view._merge_into_view(buf, depth)?;
8677            ::core::result::Result::Ok(view)
8678        }
8679        /// Merge fields from `buf` into this view (proto merge semantics).
8680        ///
8681        /// Repeated fields append; singular fields last-wins; singular
8682        /// MESSAGE fields merge recursively. Used by sub-message decode
8683        /// arms when the same field appears multiple times on the wire.
8684        ///
8685        /// **Not part of the public API.**
8686        #[doc(hidden)]
8687        pub fn _merge_into_view(
8688            &mut self,
8689            buf: &'a [u8],
8690            depth: u32,
8691        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
8692            let _ = depth;
8693            #[allow(unused_variables)]
8694            let view = self;
8695            let mut cur: &'a [u8] = buf;
8696            while !cur.is_empty() {
8697                let before_tag = cur;
8698                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
8699                match tag.field_number() {
8700                    1u32 => {
8701                        if tag.wire_type()
8702                            != ::buffa::encoding::WireType::LengthDelimited
8703                        {
8704                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8705                                field_number: 1u32,
8706                                expected: 2u8,
8707                                actual: tag.wire_type() as u8,
8708                            });
8709                        }
8710                        view.values.push(::buffa::types::borrow_str(&mut cur)?);
8711                    }
8712                    _ => {
8713                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
8714                        let span_len = before_tag.len() - cur.len();
8715                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
8716                    }
8717                }
8718            }
8719            ::core::result::Result::Ok(())
8720        }
8721    }
8722    impl<'a> ::buffa::MessageView<'a> for StringInView<'a> {
8723        type Owned = StringIn;
8724        fn decode_view(
8725            buf: &'a [u8],
8726        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8727            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
8728        }
8729        fn decode_view_with_limit(
8730            buf: &'a [u8],
8731            depth: u32,
8732        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8733            Self::_decode_depth(buf, depth)
8734        }
8735        /// Convert this view to the owned message type.
8736        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
8737        fn to_owned_message(&self) -> StringIn {
8738            #[allow(unused_imports)]
8739            use ::buffa::alloc::string::ToString as _;
8740            StringIn {
8741                values: self.values.iter().map(|s| s.to_string()).collect(),
8742                __buffa_unknown_fields: self
8743                    .__buffa_unknown_fields
8744                    .to_owned()
8745                    .unwrap_or_default()
8746                    .into(),
8747                ..::core::default::Default::default()
8748            }
8749        }
8750    }
8751    unsafe impl ::buffa::DefaultViewInstance for StringInView<'static> {
8752        fn default_view_instance() -> &'static Self {
8753            static VALUE: ::buffa::__private::OnceBox<StringInView<'static>> = ::buffa::__private::OnceBox::new();
8754            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
8755        }
8756    }
8757    unsafe impl<'a> ::buffa::HasDefaultViewInstance for StringInView<'a> {
8758        type Static = StringInView<'static>;
8759    }
8760    /// Set membership test for int64 values.
8761    #[derive(Clone, PartialEq, Default)]
8762    #[derive(::serde::Serialize, ::serde::Deserialize)]
8763    #[serde(default)]
8764    pub struct IntIn {
8765        /// Field 1: `values`
8766        #[serde(
8767            rename = "values",
8768            with = "::buffa::json_helpers::proto_seq",
8769            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
8770        )]
8771        pub values: ::buffa::alloc::vec::Vec<i64>,
8772        #[serde(skip)]
8773        #[doc(hidden)]
8774        pub __buffa_unknown_fields: ::buffa::UnknownFields,
8775        #[doc(hidden)]
8776        #[serde(skip)]
8777        pub __buffa_cached_size: ::buffa::__private::CachedSize,
8778    }
8779    impl ::core::fmt::Debug for IntIn {
8780        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8781            f.debug_struct("IntIn").field("values", &self.values).finish()
8782        }
8783    }
8784    impl IntIn {
8785        /// Protobuf type URL for this message, for use with `Any::pack` and
8786        /// `Any::unpack_if`.
8787        ///
8788        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
8789        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicateConstraint.IntIn";
8790    }
8791    unsafe impl ::buffa::DefaultInstance for IntIn {
8792        fn default_instance() -> &'static Self {
8793            static VALUE: ::buffa::__private::OnceBox<IntIn> = ::buffa::__private::OnceBox::new();
8794            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
8795        }
8796    }
8797    impl ::buffa::Message for IntIn {
8798        /// Returns the total encoded size in bytes.
8799        ///
8800        /// The result is a `u32`; the protobuf specification requires all
8801        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
8802        /// compliant message will never overflow this type.
8803        fn compute_size(&self) -> u32 {
8804            #[allow(unused_imports)]
8805            use ::buffa::Enumeration as _;
8806            let mut size = 0u32;
8807            if !self.values.is_empty() {
8808                let payload: u32 = self
8809                    .values
8810                    .iter()
8811                    .map(|&v| ::buffa::types::int64_encoded_len(v) as u32)
8812                    .sum::<u32>();
8813                size
8814                    += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
8815                        + payload;
8816            }
8817            size += self.__buffa_unknown_fields.encoded_len() as u32;
8818            self.__buffa_cached_size.set(size);
8819            size
8820        }
8821        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
8822            #[allow(unused_imports)]
8823            use ::buffa::Enumeration as _;
8824            if !self.values.is_empty() {
8825                let payload: u32 = self
8826                    .values
8827                    .iter()
8828                    .map(|&v| ::buffa::types::int64_encoded_len(v) as u32)
8829                    .sum::<u32>();
8830                ::buffa::encoding::Tag::new(
8831                        1u32,
8832                        ::buffa::encoding::WireType::LengthDelimited,
8833                    )
8834                    .encode(buf);
8835                ::buffa::encoding::encode_varint(payload as u64, buf);
8836                for &v in &self.values {
8837                    ::buffa::types::encode_int64(v, buf);
8838                }
8839            }
8840            self.__buffa_unknown_fields.write_to(buf);
8841        }
8842        fn merge_field(
8843            &mut self,
8844            tag: ::buffa::encoding::Tag,
8845            buf: &mut impl ::buffa::bytes::Buf,
8846            depth: u32,
8847        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
8848            #[allow(unused_imports)]
8849            use ::buffa::bytes::Buf as _;
8850            #[allow(unused_imports)]
8851            use ::buffa::Enumeration as _;
8852            match tag.field_number() {
8853                1u32 => {
8854                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
8855                        let len = ::buffa::encoding::decode_varint(buf)?;
8856                        let len = usize::try_from(len)
8857                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
8858                        if buf.remaining() < len {
8859                            return ::core::result::Result::Err(
8860                                ::buffa::DecodeError::UnexpectedEof,
8861                            );
8862                        }
8863                        self.values.reserve(len);
8864                        let mut limited = buf.take(len);
8865                        while limited.has_remaining() {
8866                            self.values
8867                                .push(::buffa::types::decode_int64(&mut limited)?);
8868                        }
8869                        let leftover = limited.remaining();
8870                        if leftover > 0 {
8871                            limited.advance(leftover);
8872                        }
8873                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
8874                        self.values.push(::buffa::types::decode_int64(buf)?);
8875                    } else {
8876                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
8877                            field_number: 1u32,
8878                            expected: 2u8,
8879                            actual: tag.wire_type() as u8,
8880                        });
8881                    }
8882                }
8883                _ => {
8884                    self.__buffa_unknown_fields
8885                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
8886                }
8887            }
8888            ::core::result::Result::Ok(())
8889        }
8890        fn cached_size(&self) -> u32 {
8891            self.__buffa_cached_size.get()
8892        }
8893        fn clear(&mut self) {
8894            self.values.clear();
8895            self.__buffa_unknown_fields.clear();
8896            self.__buffa_cached_size.set(0);
8897        }
8898    }
8899    impl ::buffa::ExtensionSet for IntIn {
8900        const PROTO_FQN: &'static str = "store.query.v1.KvPredicateConstraint.IntIn";
8901        fn unknown_fields(&self) -> &::buffa::UnknownFields {
8902            &self.__buffa_unknown_fields
8903        }
8904        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
8905            &mut self.__buffa_unknown_fields
8906        }
8907    }
8908    impl ::buffa::json_helpers::ProtoElemJson for IntIn {
8909        fn serialize_proto_json<S: ::serde::Serializer>(
8910            v: &Self,
8911            s: S,
8912        ) -> ::core::result::Result<S::Ok, S::Error> {
8913            ::serde::Serialize::serialize(v, s)
8914        }
8915        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
8916            d: D,
8917        ) -> ::core::result::Result<Self, D::Error> {
8918            <Self as ::serde::Deserialize>::deserialize(d)
8919        }
8920    }
8921    #[doc(hidden)]
8922    pub const __INT_IN_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
8923        type_url: "type.googleapis.com/store.query.v1.KvPredicateConstraint.IntIn",
8924        to_json: ::buffa::type_registry::any_to_json::<IntIn>,
8925        from_json: ::buffa::type_registry::any_from_json::<IntIn>,
8926        is_wkt: false,
8927    };
8928    /// Set membership test for int64 values.
8929    #[derive(Clone, Debug, Default)]
8930    pub struct IntInView<'a> {
8931        /// Field 1: `values`
8932        pub values: ::buffa::RepeatedView<'a, i64>,
8933        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
8934    }
8935    impl<'a> IntInView<'a> {
8936        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
8937        ///
8938        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
8939        /// and by generated sub-message decode arms with `depth - 1`.
8940        ///
8941        /// **Not part of the public API.** Named with a leading underscore to
8942        /// signal that it is for generated-code use only.
8943        #[doc(hidden)]
8944        pub fn _decode_depth(
8945            buf: &'a [u8],
8946            depth: u32,
8947        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
8948            let mut view = Self::default();
8949            view._merge_into_view(buf, depth)?;
8950            ::core::result::Result::Ok(view)
8951        }
8952        /// Merge fields from `buf` into this view (proto merge semantics).
8953        ///
8954        /// Repeated fields append; singular fields last-wins; singular
8955        /// MESSAGE fields merge recursively. Used by sub-message decode
8956        /// arms when the same field appears multiple times on the wire.
8957        ///
8958        /// **Not part of the public API.**
8959        #[doc(hidden)]
8960        pub fn _merge_into_view(
8961            &mut self,
8962            buf: &'a [u8],
8963            depth: u32,
8964        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
8965            let _ = depth;
8966            #[allow(unused_variables)]
8967            let view = self;
8968            let mut cur: &'a [u8] = buf;
8969            while !cur.is_empty() {
8970                let before_tag = cur;
8971                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
8972                match tag.field_number() {
8973                    1u32 => {
8974                        if tag.wire_type()
8975                            == ::buffa::encoding::WireType::LengthDelimited
8976                        {
8977                            let payload = ::buffa::types::borrow_bytes(&mut cur)?;
8978                            let mut pcur: &[u8] = payload;
8979                            while !pcur.is_empty() {
8980                                view.values.push(::buffa::types::decode_int64(&mut pcur)?);
8981                            }
8982                        } else if tag.wire_type() == ::buffa::encoding::WireType::Varint
8983                        {
8984                            view.values.push(::buffa::types::decode_int64(&mut cur)?);
8985                        } else {
8986                            return Err(::buffa::DecodeError::WireTypeMismatch {
8987                                field_number: 1u32,
8988                                expected: 2u8,
8989                                actual: tag.wire_type() as u8,
8990                            });
8991                        }
8992                    }
8993                    _ => {
8994                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
8995                        let span_len = before_tag.len() - cur.len();
8996                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
8997                    }
8998                }
8999            }
9000            ::core::result::Result::Ok(())
9001        }
9002    }
9003    impl<'a> ::buffa::MessageView<'a> for IntInView<'a> {
9004        type Owned = IntIn;
9005        fn decode_view(
9006            buf: &'a [u8],
9007        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9008            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
9009        }
9010        fn decode_view_with_limit(
9011            buf: &'a [u8],
9012            depth: u32,
9013        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9014            Self::_decode_depth(buf, depth)
9015        }
9016        /// Convert this view to the owned message type.
9017        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
9018        fn to_owned_message(&self) -> IntIn {
9019            #[allow(unused_imports)]
9020            use ::buffa::alloc::string::ToString as _;
9021            IntIn {
9022                values: self.values.to_vec(),
9023                __buffa_unknown_fields: self
9024                    .__buffa_unknown_fields
9025                    .to_owned()
9026                    .unwrap_or_default()
9027                    .into(),
9028                ..::core::default::Default::default()
9029            }
9030        }
9031    }
9032    unsafe impl ::buffa::DefaultViewInstance for IntInView<'static> {
9033        fn default_view_instance() -> &'static Self {
9034            static VALUE: ::buffa::__private::OnceBox<IntInView<'static>> = ::buffa::__private::OnceBox::new();
9035            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
9036        }
9037    }
9038    unsafe impl<'a> ::buffa::HasDefaultViewInstance for IntInView<'a> {
9039        type Static = IntInView<'static>;
9040    }
9041    /// Set membership test for uint64 values.
9042    #[derive(Clone, PartialEq, Default)]
9043    #[derive(::serde::Serialize, ::serde::Deserialize)]
9044    #[serde(default)]
9045    pub struct UInt64In {
9046        /// Field 1: `values`
9047        #[serde(
9048            rename = "values",
9049            with = "::buffa::json_helpers::proto_seq",
9050            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
9051        )]
9052        pub values: ::buffa::alloc::vec::Vec<u64>,
9053        #[serde(skip)]
9054        #[doc(hidden)]
9055        pub __buffa_unknown_fields: ::buffa::UnknownFields,
9056        #[doc(hidden)]
9057        #[serde(skip)]
9058        pub __buffa_cached_size: ::buffa::__private::CachedSize,
9059    }
9060    impl ::core::fmt::Debug for UInt64In {
9061        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9062            f.debug_struct("UInt64In").field("values", &self.values).finish()
9063        }
9064    }
9065    impl UInt64In {
9066        /// Protobuf type URL for this message, for use with `Any::pack` and
9067        /// `Any::unpack_if`.
9068        ///
9069        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
9070        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicateConstraint.UInt64In";
9071    }
9072    unsafe impl ::buffa::DefaultInstance for UInt64In {
9073        fn default_instance() -> &'static Self {
9074            static VALUE: ::buffa::__private::OnceBox<UInt64In> = ::buffa::__private::OnceBox::new();
9075            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
9076        }
9077    }
9078    impl ::buffa::Message for UInt64In {
9079        /// Returns the total encoded size in bytes.
9080        ///
9081        /// The result is a `u32`; the protobuf specification requires all
9082        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
9083        /// compliant message will never overflow this type.
9084        fn compute_size(&self) -> u32 {
9085            #[allow(unused_imports)]
9086            use ::buffa::Enumeration as _;
9087            let mut size = 0u32;
9088            if !self.values.is_empty() {
9089                let payload: u32 = self
9090                    .values
9091                    .iter()
9092                    .map(|&v| ::buffa::types::uint64_encoded_len(v) as u32)
9093                    .sum::<u32>();
9094                size
9095                    += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32
9096                        + payload;
9097            }
9098            size += self.__buffa_unknown_fields.encoded_len() as u32;
9099            self.__buffa_cached_size.set(size);
9100            size
9101        }
9102        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
9103            #[allow(unused_imports)]
9104            use ::buffa::Enumeration as _;
9105            if !self.values.is_empty() {
9106                let payload: u32 = self
9107                    .values
9108                    .iter()
9109                    .map(|&v| ::buffa::types::uint64_encoded_len(v) as u32)
9110                    .sum::<u32>();
9111                ::buffa::encoding::Tag::new(
9112                        1u32,
9113                        ::buffa::encoding::WireType::LengthDelimited,
9114                    )
9115                    .encode(buf);
9116                ::buffa::encoding::encode_varint(payload as u64, buf);
9117                for &v in &self.values {
9118                    ::buffa::types::encode_uint64(v, buf);
9119                }
9120            }
9121            self.__buffa_unknown_fields.write_to(buf);
9122        }
9123        fn merge_field(
9124            &mut self,
9125            tag: ::buffa::encoding::Tag,
9126            buf: &mut impl ::buffa::bytes::Buf,
9127            depth: u32,
9128        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
9129            #[allow(unused_imports)]
9130            use ::buffa::bytes::Buf as _;
9131            #[allow(unused_imports)]
9132            use ::buffa::Enumeration as _;
9133            match tag.field_number() {
9134                1u32 => {
9135                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
9136                        let len = ::buffa::encoding::decode_varint(buf)?;
9137                        let len = usize::try_from(len)
9138                            .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
9139                        if buf.remaining() < len {
9140                            return ::core::result::Result::Err(
9141                                ::buffa::DecodeError::UnexpectedEof,
9142                            );
9143                        }
9144                        self.values.reserve(len);
9145                        let mut limited = buf.take(len);
9146                        while limited.has_remaining() {
9147                            self.values
9148                                .push(::buffa::types::decode_uint64(&mut limited)?);
9149                        }
9150                        let leftover = limited.remaining();
9151                        if leftover > 0 {
9152                            limited.advance(leftover);
9153                        }
9154                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
9155                        self.values.push(::buffa::types::decode_uint64(buf)?);
9156                    } else {
9157                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
9158                            field_number: 1u32,
9159                            expected: 2u8,
9160                            actual: tag.wire_type() as u8,
9161                        });
9162                    }
9163                }
9164                _ => {
9165                    self.__buffa_unknown_fields
9166                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
9167                }
9168            }
9169            ::core::result::Result::Ok(())
9170        }
9171        fn cached_size(&self) -> u32 {
9172            self.__buffa_cached_size.get()
9173        }
9174        fn clear(&mut self) {
9175            self.values.clear();
9176            self.__buffa_unknown_fields.clear();
9177            self.__buffa_cached_size.set(0);
9178        }
9179    }
9180    impl ::buffa::ExtensionSet for UInt64In {
9181        const PROTO_FQN: &'static str = "store.query.v1.KvPredicateConstraint.UInt64In";
9182        fn unknown_fields(&self) -> &::buffa::UnknownFields {
9183            &self.__buffa_unknown_fields
9184        }
9185        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
9186            &mut self.__buffa_unknown_fields
9187        }
9188    }
9189    impl ::buffa::json_helpers::ProtoElemJson for UInt64In {
9190        fn serialize_proto_json<S: ::serde::Serializer>(
9191            v: &Self,
9192            s: S,
9193        ) -> ::core::result::Result<S::Ok, S::Error> {
9194            ::serde::Serialize::serialize(v, s)
9195        }
9196        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
9197            d: D,
9198        ) -> ::core::result::Result<Self, D::Error> {
9199            <Self as ::serde::Deserialize>::deserialize(d)
9200        }
9201    }
9202    #[doc(hidden)]
9203    pub const __U_INT64IN_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
9204        type_url: "type.googleapis.com/store.query.v1.KvPredicateConstraint.UInt64In",
9205        to_json: ::buffa::type_registry::any_to_json::<UInt64In>,
9206        from_json: ::buffa::type_registry::any_from_json::<UInt64In>,
9207        is_wkt: false,
9208    };
9209    /// Set membership test for uint64 values.
9210    #[derive(Clone, Debug, Default)]
9211    pub struct UInt64InView<'a> {
9212        /// Field 1: `values`
9213        pub values: ::buffa::RepeatedView<'a, u64>,
9214        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
9215    }
9216    impl<'a> UInt64InView<'a> {
9217        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
9218        ///
9219        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
9220        /// and by generated sub-message decode arms with `depth - 1`.
9221        ///
9222        /// **Not part of the public API.** Named with a leading underscore to
9223        /// signal that it is for generated-code use only.
9224        #[doc(hidden)]
9225        pub fn _decode_depth(
9226            buf: &'a [u8],
9227            depth: u32,
9228        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9229            let mut view = Self::default();
9230            view._merge_into_view(buf, depth)?;
9231            ::core::result::Result::Ok(view)
9232        }
9233        /// Merge fields from `buf` into this view (proto merge semantics).
9234        ///
9235        /// Repeated fields append; singular fields last-wins; singular
9236        /// MESSAGE fields merge recursively. Used by sub-message decode
9237        /// arms when the same field appears multiple times on the wire.
9238        ///
9239        /// **Not part of the public API.**
9240        #[doc(hidden)]
9241        pub fn _merge_into_view(
9242            &mut self,
9243            buf: &'a [u8],
9244            depth: u32,
9245        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
9246            let _ = depth;
9247            #[allow(unused_variables)]
9248            let view = self;
9249            let mut cur: &'a [u8] = buf;
9250            while !cur.is_empty() {
9251                let before_tag = cur;
9252                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
9253                match tag.field_number() {
9254                    1u32 => {
9255                        if tag.wire_type()
9256                            == ::buffa::encoding::WireType::LengthDelimited
9257                        {
9258                            let payload = ::buffa::types::borrow_bytes(&mut cur)?;
9259                            let mut pcur: &[u8] = payload;
9260                            while !pcur.is_empty() {
9261                                view.values.push(::buffa::types::decode_uint64(&mut pcur)?);
9262                            }
9263                        } else if tag.wire_type() == ::buffa::encoding::WireType::Varint
9264                        {
9265                            view.values.push(::buffa::types::decode_uint64(&mut cur)?);
9266                        } else {
9267                            return Err(::buffa::DecodeError::WireTypeMismatch {
9268                                field_number: 1u32,
9269                                expected: 2u8,
9270                                actual: tag.wire_type() as u8,
9271                            });
9272                        }
9273                    }
9274                    _ => {
9275                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
9276                        let span_len = before_tag.len() - cur.len();
9277                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
9278                    }
9279                }
9280            }
9281            ::core::result::Result::Ok(())
9282        }
9283    }
9284    impl<'a> ::buffa::MessageView<'a> for UInt64InView<'a> {
9285        type Owned = UInt64In;
9286        fn decode_view(
9287            buf: &'a [u8],
9288        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9289            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
9290        }
9291        fn decode_view_with_limit(
9292            buf: &'a [u8],
9293            depth: u32,
9294        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9295            Self::_decode_depth(buf, depth)
9296        }
9297        /// Convert this view to the owned message type.
9298        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
9299        fn to_owned_message(&self) -> UInt64In {
9300            #[allow(unused_imports)]
9301            use ::buffa::alloc::string::ToString as _;
9302            UInt64In {
9303                values: self.values.to_vec(),
9304                __buffa_unknown_fields: self
9305                    .__buffa_unknown_fields
9306                    .to_owned()
9307                    .unwrap_or_default()
9308                    .into(),
9309                ..::core::default::Default::default()
9310            }
9311        }
9312    }
9313    unsafe impl ::buffa::DefaultViewInstance for UInt64InView<'static> {
9314        fn default_view_instance() -> &'static Self {
9315            static VALUE: ::buffa::__private::OnceBox<UInt64InView<'static>> = ::buffa::__private::OnceBox::new();
9316            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
9317        }
9318    }
9319    unsafe impl<'a> ::buffa::HasDefaultViewInstance for UInt64InView<'a> {
9320        type Static = UInt64InView<'static>;
9321    }
9322    /// Set membership test for fixed-size binary values.
9323    #[derive(Clone, PartialEq, Default)]
9324    #[derive(::serde::Serialize, ::serde::Deserialize)]
9325    #[serde(default)]
9326    pub struct FixedSizeBinaryIn {
9327        /// Field 1: `values`
9328        #[serde(
9329            rename = "values",
9330            with = "::buffa::json_helpers::proto_seq",
9331            skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
9332        )]
9333        pub values: ::buffa::alloc::vec::Vec<::buffa::alloc::vec::Vec<u8>>,
9334        #[serde(skip)]
9335        #[doc(hidden)]
9336        pub __buffa_unknown_fields: ::buffa::UnknownFields,
9337        #[doc(hidden)]
9338        #[serde(skip)]
9339        pub __buffa_cached_size: ::buffa::__private::CachedSize,
9340    }
9341    impl ::core::fmt::Debug for FixedSizeBinaryIn {
9342        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9343            f.debug_struct("FixedSizeBinaryIn").field("values", &self.values).finish()
9344        }
9345    }
9346    impl FixedSizeBinaryIn {
9347        /// Protobuf type URL for this message, for use with `Any::pack` and
9348        /// `Any::unpack_if`.
9349        ///
9350        /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
9351        pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicateConstraint.FixedSizeBinaryIn";
9352    }
9353    unsafe impl ::buffa::DefaultInstance for FixedSizeBinaryIn {
9354        fn default_instance() -> &'static Self {
9355            static VALUE: ::buffa::__private::OnceBox<FixedSizeBinaryIn> = ::buffa::__private::OnceBox::new();
9356            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
9357        }
9358    }
9359    impl ::buffa::Message for FixedSizeBinaryIn {
9360        /// Returns the total encoded size in bytes.
9361        ///
9362        /// The result is a `u32`; the protobuf specification requires all
9363        /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
9364        /// compliant message will never overflow this type.
9365        fn compute_size(&self) -> u32 {
9366            #[allow(unused_imports)]
9367            use ::buffa::Enumeration as _;
9368            let mut size = 0u32;
9369            for v in &self.values {
9370                size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
9371            }
9372            size += self.__buffa_unknown_fields.encoded_len() as u32;
9373            self.__buffa_cached_size.set(size);
9374            size
9375        }
9376        fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
9377            #[allow(unused_imports)]
9378            use ::buffa::Enumeration as _;
9379            for v in &self.values {
9380                ::buffa::encoding::Tag::new(
9381                        1u32,
9382                        ::buffa::encoding::WireType::LengthDelimited,
9383                    )
9384                    .encode(buf);
9385                ::buffa::types::encode_bytes(v, buf);
9386            }
9387            self.__buffa_unknown_fields.write_to(buf);
9388        }
9389        fn merge_field(
9390            &mut self,
9391            tag: ::buffa::encoding::Tag,
9392            buf: &mut impl ::buffa::bytes::Buf,
9393            depth: u32,
9394        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
9395            #[allow(unused_imports)]
9396            use ::buffa::bytes::Buf as _;
9397            #[allow(unused_imports)]
9398            use ::buffa::Enumeration as _;
9399            match tag.field_number() {
9400                1u32 => {
9401                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
9402                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
9403                            field_number: 1u32,
9404                            expected: 2u8,
9405                            actual: tag.wire_type() as u8,
9406                        });
9407                    }
9408                    self.values.push(::buffa::types::decode_bytes(buf)?);
9409                }
9410                _ => {
9411                    self.__buffa_unknown_fields
9412                        .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
9413                }
9414            }
9415            ::core::result::Result::Ok(())
9416        }
9417        fn cached_size(&self) -> u32 {
9418            self.__buffa_cached_size.get()
9419        }
9420        fn clear(&mut self) {
9421            self.values.clear();
9422            self.__buffa_unknown_fields.clear();
9423            self.__buffa_cached_size.set(0);
9424        }
9425    }
9426    impl ::buffa::ExtensionSet for FixedSizeBinaryIn {
9427        const PROTO_FQN: &'static str = "store.query.v1.KvPredicateConstraint.FixedSizeBinaryIn";
9428        fn unknown_fields(&self) -> &::buffa::UnknownFields {
9429            &self.__buffa_unknown_fields
9430        }
9431        fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
9432            &mut self.__buffa_unknown_fields
9433        }
9434    }
9435    impl ::buffa::json_helpers::ProtoElemJson for FixedSizeBinaryIn {
9436        fn serialize_proto_json<S: ::serde::Serializer>(
9437            v: &Self,
9438            s: S,
9439        ) -> ::core::result::Result<S::Ok, S::Error> {
9440            ::serde::Serialize::serialize(v, s)
9441        }
9442        fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
9443            d: D,
9444        ) -> ::core::result::Result<Self, D::Error> {
9445            <Self as ::serde::Deserialize>::deserialize(d)
9446        }
9447    }
9448    #[doc(hidden)]
9449    pub const __FIXED_SIZE_BINARY_IN_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
9450        type_url: "type.googleapis.com/store.query.v1.KvPredicateConstraint.FixedSizeBinaryIn",
9451        to_json: ::buffa::type_registry::any_to_json::<FixedSizeBinaryIn>,
9452        from_json: ::buffa::type_registry::any_from_json::<FixedSizeBinaryIn>,
9453        is_wkt: false,
9454    };
9455    /// Set membership test for fixed-size binary values.
9456    #[derive(Clone, Debug, Default)]
9457    pub struct FixedSizeBinaryInView<'a> {
9458        /// Field 1: `values`
9459        pub values: ::buffa::RepeatedView<'a, &'a [u8]>,
9460        pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
9461    }
9462    impl<'a> FixedSizeBinaryInView<'a> {
9463        /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
9464        ///
9465        /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
9466        /// and by generated sub-message decode arms with `depth - 1`.
9467        ///
9468        /// **Not part of the public API.** Named with a leading underscore to
9469        /// signal that it is for generated-code use only.
9470        #[doc(hidden)]
9471        pub fn _decode_depth(
9472            buf: &'a [u8],
9473            depth: u32,
9474        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9475            let mut view = Self::default();
9476            view._merge_into_view(buf, depth)?;
9477            ::core::result::Result::Ok(view)
9478        }
9479        /// Merge fields from `buf` into this view (proto merge semantics).
9480        ///
9481        /// Repeated fields append; singular fields last-wins; singular
9482        /// MESSAGE fields merge recursively. Used by sub-message decode
9483        /// arms when the same field appears multiple times on the wire.
9484        ///
9485        /// **Not part of the public API.**
9486        #[doc(hidden)]
9487        pub fn _merge_into_view(
9488            &mut self,
9489            buf: &'a [u8],
9490            depth: u32,
9491        ) -> ::core::result::Result<(), ::buffa::DecodeError> {
9492            let _ = depth;
9493            #[allow(unused_variables)]
9494            let view = self;
9495            let mut cur: &'a [u8] = buf;
9496            while !cur.is_empty() {
9497                let before_tag = cur;
9498                let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
9499                match tag.field_number() {
9500                    1u32 => {
9501                        if tag.wire_type()
9502                            != ::buffa::encoding::WireType::LengthDelimited
9503                        {
9504                            return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
9505                                field_number: 1u32,
9506                                expected: 2u8,
9507                                actual: tag.wire_type() as u8,
9508                            });
9509                        }
9510                        view.values.push(::buffa::types::borrow_bytes(&mut cur)?);
9511                    }
9512                    _ => {
9513                        ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
9514                        let span_len = before_tag.len() - cur.len();
9515                        view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
9516                    }
9517                }
9518            }
9519            ::core::result::Result::Ok(())
9520        }
9521    }
9522    impl<'a> ::buffa::MessageView<'a> for FixedSizeBinaryInView<'a> {
9523        type Owned = FixedSizeBinaryIn;
9524        fn decode_view(
9525            buf: &'a [u8],
9526        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9527            Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
9528        }
9529        fn decode_view_with_limit(
9530            buf: &'a [u8],
9531            depth: u32,
9532        ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
9533            Self::_decode_depth(buf, depth)
9534        }
9535        /// Convert this view to the owned message type.
9536        #[allow(clippy::redundant_closure, clippy::useless_conversion)]
9537        fn to_owned_message(&self) -> FixedSizeBinaryIn {
9538            #[allow(unused_imports)]
9539            use ::buffa::alloc::string::ToString as _;
9540            FixedSizeBinaryIn {
9541                values: self.values.iter().map(|b| (b).to_vec()).collect(),
9542                __buffa_unknown_fields: self
9543                    .__buffa_unknown_fields
9544                    .to_owned()
9545                    .unwrap_or_default()
9546                    .into(),
9547                ..::core::default::Default::default()
9548            }
9549        }
9550    }
9551    unsafe impl ::buffa::DefaultViewInstance for FixedSizeBinaryInView<'static> {
9552        fn default_view_instance() -> &'static Self {
9553            static VALUE: ::buffa::__private::OnceBox<FixedSizeBinaryInView<'static>> = ::buffa::__private::OnceBox::new();
9554            VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
9555        }
9556    }
9557    unsafe impl<'a> ::buffa::HasDefaultViewInstance for FixedSizeBinaryInView<'a> {
9558        type Static = FixedSizeBinaryInView<'static>;
9559    }
9560    #[derive(Clone, PartialEq, Debug)]
9561    pub enum Constraint {
9562        StringEq(::buffa::alloc::string::String),
9563        BoolEq(bool),
9564        FixedSizeBinaryEq(::buffa::alloc::vec::Vec<u8>),
9565        IntRange(::buffa::alloc::boxed::Box<super::kv_predicate_constraint::IntRange>),
9566        Uint64Range(
9567            ::buffa::alloc::boxed::Box<super::kv_predicate_constraint::UInt64Range>,
9568        ),
9569        FloatRange(
9570            ::buffa::alloc::boxed::Box<super::kv_predicate_constraint::FloatRange>,
9571        ),
9572        Decimal128Range(
9573            ::buffa::alloc::boxed::Box<super::kv_predicate_constraint::Decimal128Range>,
9574        ),
9575        IsNull(bool),
9576        IsNotNull(bool),
9577        StringIn(::buffa::alloc::boxed::Box<super::kv_predicate_constraint::StringIn>),
9578        IntIn(::buffa::alloc::boxed::Box<super::kv_predicate_constraint::IntIn>),
9579        Uint64In(::buffa::alloc::boxed::Box<super::kv_predicate_constraint::UInt64In>),
9580        FixedSizeBinaryIn(
9581            ::buffa::alloc::boxed::Box<super::kv_predicate_constraint::FixedSizeBinaryIn>,
9582        ),
9583        Decimal256Range(
9584            ::buffa::alloc::boxed::Box<super::kv_predicate_constraint::Decimal256Range>,
9585        ),
9586    }
9587    impl ::buffa::Oneof for Constraint {}
9588    impl From<super::kv_predicate_constraint::IntRange> for Constraint {
9589        fn from(v: super::kv_predicate_constraint::IntRange) -> Self {
9590            Self::IntRange(::buffa::alloc::boxed::Box::new(v))
9591        }
9592    }
9593    impl From<super::kv_predicate_constraint::IntRange>
9594    for ::core::option::Option<Constraint> {
9595        fn from(v: super::kv_predicate_constraint::IntRange) -> Self {
9596            Self::Some(Constraint::from(v))
9597        }
9598    }
9599    impl From<super::kv_predicate_constraint::UInt64Range> for Constraint {
9600        fn from(v: super::kv_predicate_constraint::UInt64Range) -> Self {
9601            Self::Uint64Range(::buffa::alloc::boxed::Box::new(v))
9602        }
9603    }
9604    impl From<super::kv_predicate_constraint::UInt64Range>
9605    for ::core::option::Option<Constraint> {
9606        fn from(v: super::kv_predicate_constraint::UInt64Range) -> Self {
9607            Self::Some(Constraint::from(v))
9608        }
9609    }
9610    impl From<super::kv_predicate_constraint::FloatRange> for Constraint {
9611        fn from(v: super::kv_predicate_constraint::FloatRange) -> Self {
9612            Self::FloatRange(::buffa::alloc::boxed::Box::new(v))
9613        }
9614    }
9615    impl From<super::kv_predicate_constraint::FloatRange>
9616    for ::core::option::Option<Constraint> {
9617        fn from(v: super::kv_predicate_constraint::FloatRange) -> Self {
9618            Self::Some(Constraint::from(v))
9619        }
9620    }
9621    impl From<super::kv_predicate_constraint::Decimal128Range> for Constraint {
9622        fn from(v: super::kv_predicate_constraint::Decimal128Range) -> Self {
9623            Self::Decimal128Range(::buffa::alloc::boxed::Box::new(v))
9624        }
9625    }
9626    impl From<super::kv_predicate_constraint::Decimal128Range>
9627    for ::core::option::Option<Constraint> {
9628        fn from(v: super::kv_predicate_constraint::Decimal128Range) -> Self {
9629            Self::Some(Constraint::from(v))
9630        }
9631    }
9632    impl From<super::kv_predicate_constraint::StringIn> for Constraint {
9633        fn from(v: super::kv_predicate_constraint::StringIn) -> Self {
9634            Self::StringIn(::buffa::alloc::boxed::Box::new(v))
9635        }
9636    }
9637    impl From<super::kv_predicate_constraint::StringIn>
9638    for ::core::option::Option<Constraint> {
9639        fn from(v: super::kv_predicate_constraint::StringIn) -> Self {
9640            Self::Some(Constraint::from(v))
9641        }
9642    }
9643    impl From<super::kv_predicate_constraint::IntIn> for Constraint {
9644        fn from(v: super::kv_predicate_constraint::IntIn) -> Self {
9645            Self::IntIn(::buffa::alloc::boxed::Box::new(v))
9646        }
9647    }
9648    impl From<super::kv_predicate_constraint::IntIn>
9649    for ::core::option::Option<Constraint> {
9650        fn from(v: super::kv_predicate_constraint::IntIn) -> Self {
9651            Self::Some(Constraint::from(v))
9652        }
9653    }
9654    impl From<super::kv_predicate_constraint::UInt64In> for Constraint {
9655        fn from(v: super::kv_predicate_constraint::UInt64In) -> Self {
9656            Self::Uint64In(::buffa::alloc::boxed::Box::new(v))
9657        }
9658    }
9659    impl From<super::kv_predicate_constraint::UInt64In>
9660    for ::core::option::Option<Constraint> {
9661        fn from(v: super::kv_predicate_constraint::UInt64In) -> Self {
9662            Self::Some(Constraint::from(v))
9663        }
9664    }
9665    impl From<super::kv_predicate_constraint::FixedSizeBinaryIn> for Constraint {
9666        fn from(v: super::kv_predicate_constraint::FixedSizeBinaryIn) -> Self {
9667            Self::FixedSizeBinaryIn(::buffa::alloc::boxed::Box::new(v))
9668        }
9669    }
9670    impl From<super::kv_predicate_constraint::FixedSizeBinaryIn>
9671    for ::core::option::Option<Constraint> {
9672        fn from(v: super::kv_predicate_constraint::FixedSizeBinaryIn) -> Self {
9673            Self::Some(Constraint::from(v))
9674        }
9675    }
9676    impl From<super::kv_predicate_constraint::Decimal256Range> for Constraint {
9677        fn from(v: super::kv_predicate_constraint::Decimal256Range) -> Self {
9678            Self::Decimal256Range(::buffa::alloc::boxed::Box::new(v))
9679        }
9680    }
9681    impl From<super::kv_predicate_constraint::Decimal256Range>
9682    for ::core::option::Option<Constraint> {
9683        fn from(v: super::kv_predicate_constraint::Decimal256Range) -> Self {
9684            Self::Some(Constraint::from(v))
9685        }
9686    }
9687    impl serde::Serialize for Constraint {
9688        fn serialize<S: serde::Serializer>(
9689            &self,
9690            s: S,
9691        ) -> ::core::result::Result<S::Ok, S::Error> {
9692            use serde::ser::SerializeMap;
9693            let mut map = s.serialize_map(Some(1))?;
9694            match self {
9695                Constraint::StringEq(v) => {
9696                    map.serialize_entry("stringEq", v)?;
9697                }
9698                Constraint::BoolEq(v) => {
9699                    map.serialize_entry("boolEq", v)?;
9700                }
9701                Constraint::FixedSizeBinaryEq(v) => {
9702                    struct _W<'a>(&'a ::buffa::alloc::vec::Vec<u8>);
9703                    impl serde::Serialize for _W<'_> {
9704                        fn serialize<S2: serde::Serializer>(
9705                            &self,
9706                            s: S2,
9707                        ) -> ::core::result::Result<S2::Ok, S2::Error> {
9708                            ::buffa::json_helpers::bytes::serialize(self.0, s)
9709                        }
9710                    }
9711                    map.serialize_entry("fixedSizeBinaryEq", &_W(v))?;
9712                }
9713                Constraint::IntRange(v) => {
9714                    map.serialize_entry("intRange", v)?;
9715                }
9716                Constraint::Uint64Range(v) => {
9717                    map.serialize_entry("uint64Range", v)?;
9718                }
9719                Constraint::FloatRange(v) => {
9720                    map.serialize_entry("floatRange", v)?;
9721                }
9722                Constraint::Decimal128Range(v) => {
9723                    map.serialize_entry("decimal128Range", v)?;
9724                }
9725                Constraint::IsNull(v) => {
9726                    map.serialize_entry("isNull", v)?;
9727                }
9728                Constraint::IsNotNull(v) => {
9729                    map.serialize_entry("isNotNull", v)?;
9730                }
9731                Constraint::StringIn(v) => {
9732                    map.serialize_entry("stringIn", v)?;
9733                }
9734                Constraint::IntIn(v) => {
9735                    map.serialize_entry("intIn", v)?;
9736                }
9737                Constraint::Uint64In(v) => {
9738                    map.serialize_entry("uint64In", v)?;
9739                }
9740                Constraint::FixedSizeBinaryIn(v) => {
9741                    map.serialize_entry("fixedSizeBinaryIn", v)?;
9742                }
9743                Constraint::Decimal256Range(v) => {
9744                    map.serialize_entry("decimal256Range", v)?;
9745                }
9746            }
9747            map.end()
9748        }
9749    }
9750    #[derive(Clone, Debug)]
9751    pub enum ConstraintView<'a> {
9752        StringEq(&'a str),
9753        BoolEq(bool),
9754        FixedSizeBinaryEq(&'a [u8]),
9755        IntRange(
9756            ::buffa::alloc::boxed::Box<super::kv_predicate_constraint::IntRangeView<'a>>,
9757        ),
9758        Uint64Range(
9759            ::buffa::alloc::boxed::Box<
9760                super::kv_predicate_constraint::UInt64RangeView<'a>,
9761            >,
9762        ),
9763        FloatRange(
9764            ::buffa::alloc::boxed::Box<
9765                super::kv_predicate_constraint::FloatRangeView<'a>,
9766            >,
9767        ),
9768        Decimal128Range(
9769            ::buffa::alloc::boxed::Box<
9770                super::kv_predicate_constraint::Decimal128RangeView<'a>,
9771            >,
9772        ),
9773        IsNull(bool),
9774        IsNotNull(bool),
9775        StringIn(
9776            ::buffa::alloc::boxed::Box<super::kv_predicate_constraint::StringInView<'a>>,
9777        ),
9778        IntIn(::buffa::alloc::boxed::Box<super::kv_predicate_constraint::IntInView<'a>>),
9779        Uint64In(
9780            ::buffa::alloc::boxed::Box<super::kv_predicate_constraint::UInt64InView<'a>>,
9781        ),
9782        FixedSizeBinaryIn(
9783            ::buffa::alloc::boxed::Box<
9784                super::kv_predicate_constraint::FixedSizeBinaryInView<'a>,
9785            >,
9786        ),
9787        Decimal256Range(
9788            ::buffa::alloc::boxed::Box<
9789                super::kv_predicate_constraint::Decimal256RangeView<'a>,
9790            >,
9791        ),
9792    }
9793}
9794/// A single predicate check: extract the field, then test it against the
9795/// constraint.
9796#[derive(Clone, PartialEq, Default)]
9797#[derive(::serde::Serialize, ::serde::Deserialize)]
9798#[serde(default)]
9799pub struct KvPredicateCheck {
9800    /// The field to extract from each row.
9801    ///
9802    /// Field 1: `field`
9803    #[serde(
9804        rename = "field",
9805        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
9806    )]
9807    pub field: ::buffa::MessageField<KvFieldRef>,
9808    /// The constraint the field value must satisfy.
9809    ///
9810    /// Field 2: `constraint`
9811    #[serde(
9812        rename = "constraint",
9813        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
9814    )]
9815    pub constraint: ::buffa::MessageField<KvPredicateConstraint>,
9816    #[serde(skip)]
9817    #[doc(hidden)]
9818    pub __buffa_unknown_fields: ::buffa::UnknownFields,
9819    #[doc(hidden)]
9820    #[serde(skip)]
9821    pub __buffa_cached_size: ::buffa::__private::CachedSize,
9822}
9823impl ::core::fmt::Debug for KvPredicateCheck {
9824    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9825        f.debug_struct("KvPredicateCheck")
9826            .field("field", &self.field)
9827            .field("constraint", &self.constraint)
9828            .finish()
9829    }
9830}
9831impl KvPredicateCheck {
9832    /// Protobuf type URL for this message, for use with `Any::pack` and
9833    /// `Any::unpack_if`.
9834    ///
9835    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
9836    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicateCheck";
9837}
9838unsafe impl ::buffa::DefaultInstance for KvPredicateCheck {
9839    fn default_instance() -> &'static Self {
9840        static VALUE: ::buffa::__private::OnceBox<KvPredicateCheck> = ::buffa::__private::OnceBox::new();
9841        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
9842    }
9843}
9844impl ::buffa::Message for KvPredicateCheck {
9845    /// Returns the total encoded size in bytes.
9846    ///
9847    /// The result is a `u32`; the protobuf specification requires all
9848    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
9849    /// compliant message will never overflow this type.
9850    fn compute_size(&self) -> u32 {
9851        #[allow(unused_imports)]
9852        use ::buffa::Enumeration as _;
9853        let mut size = 0u32;
9854        if self.field.is_set() {
9855            let inner_size = self.field.compute_size();
9856            size
9857                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
9858                    + inner_size;
9859        }
9860        if self.constraint.is_set() {
9861            let inner_size = self.constraint.compute_size();
9862            size
9863                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
9864                    + inner_size;
9865        }
9866        size += self.__buffa_unknown_fields.encoded_len() as u32;
9867        self.__buffa_cached_size.set(size);
9868        size
9869    }
9870    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
9871        #[allow(unused_imports)]
9872        use ::buffa::Enumeration as _;
9873        if self.field.is_set() {
9874            ::buffa::encoding::Tag::new(
9875                    1u32,
9876                    ::buffa::encoding::WireType::LengthDelimited,
9877                )
9878                .encode(buf);
9879            ::buffa::encoding::encode_varint(self.field.cached_size() as u64, buf);
9880            self.field.write_to(buf);
9881        }
9882        if self.constraint.is_set() {
9883            ::buffa::encoding::Tag::new(
9884                    2u32,
9885                    ::buffa::encoding::WireType::LengthDelimited,
9886                )
9887                .encode(buf);
9888            ::buffa::encoding::encode_varint(self.constraint.cached_size() as u64, buf);
9889            self.constraint.write_to(buf);
9890        }
9891        self.__buffa_unknown_fields.write_to(buf);
9892    }
9893    fn merge_field(
9894        &mut self,
9895        tag: ::buffa::encoding::Tag,
9896        buf: &mut impl ::buffa::bytes::Buf,
9897        depth: u32,
9898    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
9899        #[allow(unused_imports)]
9900        use ::buffa::bytes::Buf as _;
9901        #[allow(unused_imports)]
9902        use ::buffa::Enumeration as _;
9903        match tag.field_number() {
9904            1u32 => {
9905                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
9906                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
9907                        field_number: 1u32,
9908                        expected: 2u8,
9909                        actual: tag.wire_type() as u8,
9910                    });
9911                }
9912                ::buffa::Message::merge_length_delimited(
9913                    self.field.get_or_insert_default(),
9914                    buf,
9915                    depth,
9916                )?;
9917            }
9918            2u32 => {
9919                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
9920                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
9921                        field_number: 2u32,
9922                        expected: 2u8,
9923                        actual: tag.wire_type() as u8,
9924                    });
9925                }
9926                ::buffa::Message::merge_length_delimited(
9927                    self.constraint.get_or_insert_default(),
9928                    buf,
9929                    depth,
9930                )?;
9931            }
9932            _ => {
9933                self.__buffa_unknown_fields
9934                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
9935            }
9936        }
9937        ::core::result::Result::Ok(())
9938    }
9939    fn cached_size(&self) -> u32 {
9940        self.__buffa_cached_size.get()
9941    }
9942    fn clear(&mut self) {
9943        self.field = ::buffa::MessageField::none();
9944        self.constraint = ::buffa::MessageField::none();
9945        self.__buffa_unknown_fields.clear();
9946        self.__buffa_cached_size.set(0);
9947    }
9948}
9949impl ::buffa::ExtensionSet for KvPredicateCheck {
9950    const PROTO_FQN: &'static str = "store.query.v1.KvPredicateCheck";
9951    fn unknown_fields(&self) -> &::buffa::UnknownFields {
9952        &self.__buffa_unknown_fields
9953    }
9954    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
9955        &mut self.__buffa_unknown_fields
9956    }
9957}
9958impl ::buffa::json_helpers::ProtoElemJson for KvPredicateCheck {
9959    fn serialize_proto_json<S: ::serde::Serializer>(
9960        v: &Self,
9961        s: S,
9962    ) -> ::core::result::Result<S::Ok, S::Error> {
9963        ::serde::Serialize::serialize(v, s)
9964    }
9965    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
9966        d: D,
9967    ) -> ::core::result::Result<Self, D::Error> {
9968        <Self as ::serde::Deserialize>::deserialize(d)
9969    }
9970}
9971#[doc(hidden)]
9972pub const __KV_PREDICATE_CHECK_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
9973    type_url: "type.googleapis.com/store.query.v1.KvPredicateCheck",
9974    to_json: ::buffa::type_registry::any_to_json::<KvPredicateCheck>,
9975    from_json: ::buffa::type_registry::any_from_json::<KvPredicateCheck>,
9976    is_wkt: false,
9977};
9978/// A single predicate check: extract the field, then test it against the
9979/// constraint.
9980#[derive(Clone, Debug, Default)]
9981pub struct KvPredicateCheckView<'a> {
9982    /// The field to extract from each row.
9983    ///
9984    /// Field 1: `field`
9985    pub field: ::buffa::MessageFieldView<KvFieldRefView<'a>>,
9986    /// The constraint the field value must satisfy.
9987    ///
9988    /// Field 2: `constraint`
9989    pub constraint: ::buffa::MessageFieldView<KvPredicateConstraintView<'a>>,
9990    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
9991}
9992impl<'a> KvPredicateCheckView<'a> {
9993    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
9994    ///
9995    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
9996    /// and by generated sub-message decode arms with `depth - 1`.
9997    ///
9998    /// **Not part of the public API.** Named with a leading underscore to
9999    /// signal that it is for generated-code use only.
10000    #[doc(hidden)]
10001    pub fn _decode_depth(
10002        buf: &'a [u8],
10003        depth: u32,
10004    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10005        let mut view = Self::default();
10006        view._merge_into_view(buf, depth)?;
10007        ::core::result::Result::Ok(view)
10008    }
10009    /// Merge fields from `buf` into this view (proto merge semantics).
10010    ///
10011    /// Repeated fields append; singular fields last-wins; singular
10012    /// MESSAGE fields merge recursively. Used by sub-message decode
10013    /// arms when the same field appears multiple times on the wire.
10014    ///
10015    /// **Not part of the public API.**
10016    #[doc(hidden)]
10017    pub fn _merge_into_view(
10018        &mut self,
10019        buf: &'a [u8],
10020        depth: u32,
10021    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
10022        let _ = depth;
10023        #[allow(unused_variables)]
10024        let view = self;
10025        let mut cur: &'a [u8] = buf;
10026        while !cur.is_empty() {
10027            let before_tag = cur;
10028            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
10029            match tag.field_number() {
10030                1u32 => {
10031                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10032                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10033                            field_number: 1u32,
10034                            expected: 2u8,
10035                            actual: tag.wire_type() as u8,
10036                        });
10037                    }
10038                    if depth == 0 {
10039                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
10040                    }
10041                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
10042                    match view.field.as_mut() {
10043                        Some(existing) => existing._merge_into_view(sub, depth - 1)?,
10044                        None => {
10045                            view.field = ::buffa::MessageFieldView::set(
10046                                KvFieldRefView::_decode_depth(sub, depth - 1)?,
10047                            );
10048                        }
10049                    }
10050                }
10051                2u32 => {
10052                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10053                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10054                            field_number: 2u32,
10055                            expected: 2u8,
10056                            actual: tag.wire_type() as u8,
10057                        });
10058                    }
10059                    if depth == 0 {
10060                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
10061                    }
10062                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
10063                    match view.constraint.as_mut() {
10064                        Some(existing) => existing._merge_into_view(sub, depth - 1)?,
10065                        None => {
10066                            view.constraint = ::buffa::MessageFieldView::set(
10067                                KvPredicateConstraintView::_decode_depth(sub, depth - 1)?,
10068                            );
10069                        }
10070                    }
10071                }
10072                _ => {
10073                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
10074                    let span_len = before_tag.len() - cur.len();
10075                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
10076                }
10077            }
10078        }
10079        ::core::result::Result::Ok(())
10080    }
10081}
10082impl<'a> ::buffa::MessageView<'a> for KvPredicateCheckView<'a> {
10083    type Owned = KvPredicateCheck;
10084    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10085        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
10086    }
10087    fn decode_view_with_limit(
10088        buf: &'a [u8],
10089        depth: u32,
10090    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10091        Self::_decode_depth(buf, depth)
10092    }
10093    /// Convert this view to the owned message type.
10094    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
10095    fn to_owned_message(&self) -> KvPredicateCheck {
10096        #[allow(unused_imports)]
10097        use ::buffa::alloc::string::ToString as _;
10098        KvPredicateCheck {
10099            field: match self.field.as_option() {
10100                Some(v) => {
10101                    ::buffa::MessageField::<KvFieldRef>::some(v.to_owned_message())
10102                }
10103                None => ::buffa::MessageField::none(),
10104            },
10105            constraint: match self.constraint.as_option() {
10106                Some(v) => {
10107                    ::buffa::MessageField::<
10108                        KvPredicateConstraint,
10109                    >::some(v.to_owned_message())
10110                }
10111                None => ::buffa::MessageField::none(),
10112            },
10113            __buffa_unknown_fields: self
10114                .__buffa_unknown_fields
10115                .to_owned()
10116                .unwrap_or_default()
10117                .into(),
10118            ..::core::default::Default::default()
10119        }
10120    }
10121}
10122unsafe impl ::buffa::DefaultViewInstance for KvPredicateCheckView<'static> {
10123    fn default_view_instance() -> &'static Self {
10124        static VALUE: ::buffa::__private::OnceBox<KvPredicateCheckView<'static>> = ::buffa::__private::OnceBox::new();
10125        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
10126    }
10127}
10128unsafe impl<'a> ::buffa::HasDefaultViewInstance for KvPredicateCheckView<'a> {
10129    type Static = KvPredicateCheckView<'static>;
10130}
10131/// Conjunction (AND) of predicate checks used to filter rows before reduction.
10132#[derive(Clone, PartialEq, Default)]
10133#[derive(::serde::Serialize, ::serde::Deserialize)]
10134#[serde(default)]
10135pub struct KvPredicate {
10136    /// All checks must pass for a row to be included.
10137    ///
10138    /// Field 1: `checks`
10139    #[serde(
10140        rename = "checks",
10141        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
10142        deserialize_with = "::buffa::json_helpers::null_as_default"
10143    )]
10144    pub checks: ::buffa::alloc::vec::Vec<KvPredicateCheck>,
10145    /// When true, the predicate is statically unsatisfiable and the server may
10146    /// short-circuit evaluation (returns zero rows).
10147    ///
10148    /// Field 2: `contradiction`
10149    #[serde(
10150        rename = "contradiction",
10151        with = "::buffa::json_helpers::proto_bool",
10152        skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
10153    )]
10154    pub contradiction: bool,
10155    #[serde(skip)]
10156    #[doc(hidden)]
10157    pub __buffa_unknown_fields: ::buffa::UnknownFields,
10158    #[doc(hidden)]
10159    #[serde(skip)]
10160    pub __buffa_cached_size: ::buffa::__private::CachedSize,
10161}
10162impl ::core::fmt::Debug for KvPredicate {
10163    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10164        f.debug_struct("KvPredicate")
10165            .field("checks", &self.checks)
10166            .field("contradiction", &self.contradiction)
10167            .finish()
10168    }
10169}
10170impl KvPredicate {
10171    /// Protobuf type URL for this message, for use with `Any::pack` and
10172    /// `Any::unpack_if`.
10173    ///
10174    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
10175    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.KvPredicate";
10176}
10177unsafe impl ::buffa::DefaultInstance for KvPredicate {
10178    fn default_instance() -> &'static Self {
10179        static VALUE: ::buffa::__private::OnceBox<KvPredicate> = ::buffa::__private::OnceBox::new();
10180        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
10181    }
10182}
10183impl ::buffa::Message for KvPredicate {
10184    /// Returns the total encoded size in bytes.
10185    ///
10186    /// The result is a `u32`; the protobuf specification requires all
10187    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
10188    /// compliant message will never overflow this type.
10189    fn compute_size(&self) -> u32 {
10190        #[allow(unused_imports)]
10191        use ::buffa::Enumeration as _;
10192        let mut size = 0u32;
10193        if self.contradiction {
10194            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
10195        }
10196        for v in &self.checks {
10197            let inner_size = v.compute_size();
10198            size
10199                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
10200                    + inner_size;
10201        }
10202        size += self.__buffa_unknown_fields.encoded_len() as u32;
10203        self.__buffa_cached_size.set(size);
10204        size
10205    }
10206    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
10207        #[allow(unused_imports)]
10208        use ::buffa::Enumeration as _;
10209        if self.contradiction {
10210            ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
10211                .encode(buf);
10212            ::buffa::types::encode_bool(self.contradiction, buf);
10213        }
10214        for v in &self.checks {
10215            ::buffa::encoding::Tag::new(
10216                    1u32,
10217                    ::buffa::encoding::WireType::LengthDelimited,
10218                )
10219                .encode(buf);
10220            ::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
10221            v.write_to(buf);
10222        }
10223        self.__buffa_unknown_fields.write_to(buf);
10224    }
10225    fn merge_field(
10226        &mut self,
10227        tag: ::buffa::encoding::Tag,
10228        buf: &mut impl ::buffa::bytes::Buf,
10229        depth: u32,
10230    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
10231        #[allow(unused_imports)]
10232        use ::buffa::bytes::Buf as _;
10233        #[allow(unused_imports)]
10234        use ::buffa::Enumeration as _;
10235        match tag.field_number() {
10236            2u32 => {
10237                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10238                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10239                        field_number: 2u32,
10240                        expected: 0u8,
10241                        actual: tag.wire_type() as u8,
10242                    });
10243                }
10244                self.contradiction = ::buffa::types::decode_bool(buf)?;
10245            }
10246            1u32 => {
10247                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10248                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10249                        field_number: 1u32,
10250                        expected: 2u8,
10251                        actual: tag.wire_type() as u8,
10252                    });
10253                }
10254                let mut elem = ::core::default::Default::default();
10255                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
10256                self.checks.push(elem);
10257            }
10258            _ => {
10259                self.__buffa_unknown_fields
10260                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
10261            }
10262        }
10263        ::core::result::Result::Ok(())
10264    }
10265    fn cached_size(&self) -> u32 {
10266        self.__buffa_cached_size.get()
10267    }
10268    fn clear(&mut self) {
10269        self.contradiction = false;
10270        self.checks.clear();
10271        self.__buffa_unknown_fields.clear();
10272        self.__buffa_cached_size.set(0);
10273    }
10274}
10275impl ::buffa::ExtensionSet for KvPredicate {
10276    const PROTO_FQN: &'static str = "store.query.v1.KvPredicate";
10277    fn unknown_fields(&self) -> &::buffa::UnknownFields {
10278        &self.__buffa_unknown_fields
10279    }
10280    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
10281        &mut self.__buffa_unknown_fields
10282    }
10283}
10284impl ::buffa::json_helpers::ProtoElemJson for KvPredicate {
10285    fn serialize_proto_json<S: ::serde::Serializer>(
10286        v: &Self,
10287        s: S,
10288    ) -> ::core::result::Result<S::Ok, S::Error> {
10289        ::serde::Serialize::serialize(v, s)
10290    }
10291    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
10292        d: D,
10293    ) -> ::core::result::Result<Self, D::Error> {
10294        <Self as ::serde::Deserialize>::deserialize(d)
10295    }
10296}
10297#[doc(hidden)]
10298pub const __KV_PREDICATE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
10299    type_url: "type.googleapis.com/store.query.v1.KvPredicate",
10300    to_json: ::buffa::type_registry::any_to_json::<KvPredicate>,
10301    from_json: ::buffa::type_registry::any_from_json::<KvPredicate>,
10302    is_wkt: false,
10303};
10304/// Conjunction (AND) of predicate checks used to filter rows before reduction.
10305#[derive(Clone, Debug, Default)]
10306pub struct KvPredicateView<'a> {
10307    /// All checks must pass for a row to be included.
10308    ///
10309    /// Field 1: `checks`
10310    pub checks: ::buffa::RepeatedView<'a, KvPredicateCheckView<'a>>,
10311    /// When true, the predicate is statically unsatisfiable and the server may
10312    /// short-circuit evaluation (returns zero rows).
10313    ///
10314    /// Field 2: `contradiction`
10315    pub contradiction: bool,
10316    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
10317}
10318impl<'a> KvPredicateView<'a> {
10319    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
10320    ///
10321    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
10322    /// and by generated sub-message decode arms with `depth - 1`.
10323    ///
10324    /// **Not part of the public API.** Named with a leading underscore to
10325    /// signal that it is for generated-code use only.
10326    #[doc(hidden)]
10327    pub fn _decode_depth(
10328        buf: &'a [u8],
10329        depth: u32,
10330    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10331        let mut view = Self::default();
10332        view._merge_into_view(buf, depth)?;
10333        ::core::result::Result::Ok(view)
10334    }
10335    /// Merge fields from `buf` into this view (proto merge semantics).
10336    ///
10337    /// Repeated fields append; singular fields last-wins; singular
10338    /// MESSAGE fields merge recursively. Used by sub-message decode
10339    /// arms when the same field appears multiple times on the wire.
10340    ///
10341    /// **Not part of the public API.**
10342    #[doc(hidden)]
10343    pub fn _merge_into_view(
10344        &mut self,
10345        buf: &'a [u8],
10346        depth: u32,
10347    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
10348        let _ = depth;
10349        #[allow(unused_variables)]
10350        let view = self;
10351        let mut cur: &'a [u8] = buf;
10352        while !cur.is_empty() {
10353            let before_tag = cur;
10354            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
10355            match tag.field_number() {
10356                2u32 => {
10357                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10358                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10359                            field_number: 2u32,
10360                            expected: 0u8,
10361                            actual: tag.wire_type() as u8,
10362                        });
10363                    }
10364                    view.contradiction = ::buffa::types::decode_bool(&mut cur)?;
10365                }
10366                1u32 => {
10367                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10368                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10369                            field_number: 1u32,
10370                            expected: 2u8,
10371                            actual: tag.wire_type() as u8,
10372                        });
10373                    }
10374                    if depth == 0 {
10375                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
10376                    }
10377                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
10378                    view.checks
10379                        .push(KvPredicateCheckView::_decode_depth(sub, depth - 1)?);
10380                }
10381                _ => {
10382                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
10383                    let span_len = before_tag.len() - cur.len();
10384                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
10385                }
10386            }
10387        }
10388        ::core::result::Result::Ok(())
10389    }
10390}
10391impl<'a> ::buffa::MessageView<'a> for KvPredicateView<'a> {
10392    type Owned = KvPredicate;
10393    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10394        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
10395    }
10396    fn decode_view_with_limit(
10397        buf: &'a [u8],
10398        depth: u32,
10399    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10400        Self::_decode_depth(buf, depth)
10401    }
10402    /// Convert this view to the owned message type.
10403    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
10404    fn to_owned_message(&self) -> KvPredicate {
10405        #[allow(unused_imports)]
10406        use ::buffa::alloc::string::ToString as _;
10407        KvPredicate {
10408            checks: self.checks.iter().map(|v| v.to_owned_message()).collect(),
10409            contradiction: self.contradiction,
10410            __buffa_unknown_fields: self
10411                .__buffa_unknown_fields
10412                .to_owned()
10413                .unwrap_or_default()
10414                .into(),
10415            ..::core::default::Default::default()
10416        }
10417    }
10418}
10419unsafe impl ::buffa::DefaultViewInstance for KvPredicateView<'static> {
10420    fn default_view_instance() -> &'static Self {
10421        static VALUE: ::buffa::__private::OnceBox<KvPredicateView<'static>> = ::buffa::__private::OnceBox::new();
10422        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
10423    }
10424}
10425unsafe impl<'a> ::buffa::HasDefaultViewInstance for KvPredicateView<'a> {
10426    type Static = KvPredicateView<'static>;
10427}
10428/// A single aggregation to compute over the scanned range.
10429#[derive(Clone, PartialEq, Default)]
10430#[derive(::serde::Serialize, ::serde::Deserialize)]
10431#[serde(default)]
10432pub struct RangeReducerSpec {
10433    /// The aggregation operation.
10434    ///
10435    /// Field 1: `op`
10436    #[serde(
10437        rename = "op",
10438        with = "::buffa::json_helpers::proto_enum",
10439        skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
10440    )]
10441    pub op: ::buffa::EnumValue<RangeReduceOp>,
10442    /// Expression to evaluate per row. Required for all ops except
10443    /// `COUNT_ALL` (where it must be absent).
10444    ///
10445    /// Field 2: `expr`
10446    #[serde(
10447        rename = "expr",
10448        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
10449    )]
10450    pub expr: ::buffa::MessageField<KvExpr>,
10451    #[serde(skip)]
10452    #[doc(hidden)]
10453    pub __buffa_unknown_fields: ::buffa::UnknownFields,
10454    #[doc(hidden)]
10455    #[serde(skip)]
10456    pub __buffa_cached_size: ::buffa::__private::CachedSize,
10457}
10458impl ::core::fmt::Debug for RangeReducerSpec {
10459    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10460        f.debug_struct("RangeReducerSpec")
10461            .field("op", &self.op)
10462            .field("expr", &self.expr)
10463            .finish()
10464    }
10465}
10466impl RangeReducerSpec {
10467    /// Protobuf type URL for this message, for use with `Any::pack` and
10468    /// `Any::unpack_if`.
10469    ///
10470    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
10471    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.RangeReducerSpec";
10472}
10473unsafe impl ::buffa::DefaultInstance for RangeReducerSpec {
10474    fn default_instance() -> &'static Self {
10475        static VALUE: ::buffa::__private::OnceBox<RangeReducerSpec> = ::buffa::__private::OnceBox::new();
10476        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
10477    }
10478}
10479impl ::buffa::Message for RangeReducerSpec {
10480    /// Returns the total encoded size in bytes.
10481    ///
10482    /// The result is a `u32`; the protobuf specification requires all
10483    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
10484    /// compliant message will never overflow this type.
10485    fn compute_size(&self) -> u32 {
10486        #[allow(unused_imports)]
10487        use ::buffa::Enumeration as _;
10488        let mut size = 0u32;
10489        {
10490            let val = self.op.to_i32();
10491            if val != 0 {
10492                size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
10493            }
10494        }
10495        if self.expr.is_set() {
10496            let inner_size = self.expr.compute_size();
10497            size
10498                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
10499                    + inner_size;
10500        }
10501        size += self.__buffa_unknown_fields.encoded_len() as u32;
10502        self.__buffa_cached_size.set(size);
10503        size
10504    }
10505    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
10506        #[allow(unused_imports)]
10507        use ::buffa::Enumeration as _;
10508        {
10509            let val = self.op.to_i32();
10510            if val != 0 {
10511                ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
10512                    .encode(buf);
10513                ::buffa::types::encode_int32(val, buf);
10514            }
10515        }
10516        if self.expr.is_set() {
10517            ::buffa::encoding::Tag::new(
10518                    2u32,
10519                    ::buffa::encoding::WireType::LengthDelimited,
10520                )
10521                .encode(buf);
10522            ::buffa::encoding::encode_varint(self.expr.cached_size() as u64, buf);
10523            self.expr.write_to(buf);
10524        }
10525        self.__buffa_unknown_fields.write_to(buf);
10526    }
10527    fn merge_field(
10528        &mut self,
10529        tag: ::buffa::encoding::Tag,
10530        buf: &mut impl ::buffa::bytes::Buf,
10531        depth: u32,
10532    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
10533        #[allow(unused_imports)]
10534        use ::buffa::bytes::Buf as _;
10535        #[allow(unused_imports)]
10536        use ::buffa::Enumeration as _;
10537        match tag.field_number() {
10538            1u32 => {
10539                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10540                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10541                        field_number: 1u32,
10542                        expected: 0u8,
10543                        actual: tag.wire_type() as u8,
10544                    });
10545                }
10546                self.op = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
10547            }
10548            2u32 => {
10549                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10550                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10551                        field_number: 2u32,
10552                        expected: 2u8,
10553                        actual: tag.wire_type() as u8,
10554                    });
10555                }
10556                ::buffa::Message::merge_length_delimited(
10557                    self.expr.get_or_insert_default(),
10558                    buf,
10559                    depth,
10560                )?;
10561            }
10562            _ => {
10563                self.__buffa_unknown_fields
10564                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
10565            }
10566        }
10567        ::core::result::Result::Ok(())
10568    }
10569    fn cached_size(&self) -> u32 {
10570        self.__buffa_cached_size.get()
10571    }
10572    fn clear(&mut self) {
10573        self.op = ::buffa::EnumValue::from(0);
10574        self.expr = ::buffa::MessageField::none();
10575        self.__buffa_unknown_fields.clear();
10576        self.__buffa_cached_size.set(0);
10577    }
10578}
10579impl ::buffa::ExtensionSet for RangeReducerSpec {
10580    const PROTO_FQN: &'static str = "store.query.v1.RangeReducerSpec";
10581    fn unknown_fields(&self) -> &::buffa::UnknownFields {
10582        &self.__buffa_unknown_fields
10583    }
10584    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
10585        &mut self.__buffa_unknown_fields
10586    }
10587}
10588impl ::buffa::json_helpers::ProtoElemJson for RangeReducerSpec {
10589    fn serialize_proto_json<S: ::serde::Serializer>(
10590        v: &Self,
10591        s: S,
10592    ) -> ::core::result::Result<S::Ok, S::Error> {
10593        ::serde::Serialize::serialize(v, s)
10594    }
10595    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
10596        d: D,
10597    ) -> ::core::result::Result<Self, D::Error> {
10598        <Self as ::serde::Deserialize>::deserialize(d)
10599    }
10600}
10601#[doc(hidden)]
10602pub const __RANGE_REDUCER_SPEC_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
10603    type_url: "type.googleapis.com/store.query.v1.RangeReducerSpec",
10604    to_json: ::buffa::type_registry::any_to_json::<RangeReducerSpec>,
10605    from_json: ::buffa::type_registry::any_from_json::<RangeReducerSpec>,
10606    is_wkt: false,
10607};
10608/// A single aggregation to compute over the scanned range.
10609#[derive(Clone, Debug, Default)]
10610pub struct RangeReducerSpecView<'a> {
10611    /// The aggregation operation.
10612    ///
10613    /// Field 1: `op`
10614    pub op: ::buffa::EnumValue<RangeReduceOp>,
10615    /// Expression to evaluate per row. Required for all ops except
10616    /// `COUNT_ALL` (where it must be absent).
10617    ///
10618    /// Field 2: `expr`
10619    pub expr: ::buffa::MessageFieldView<KvExprView<'a>>,
10620    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
10621}
10622impl<'a> RangeReducerSpecView<'a> {
10623    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
10624    ///
10625    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
10626    /// and by generated sub-message decode arms with `depth - 1`.
10627    ///
10628    /// **Not part of the public API.** Named with a leading underscore to
10629    /// signal that it is for generated-code use only.
10630    #[doc(hidden)]
10631    pub fn _decode_depth(
10632        buf: &'a [u8],
10633        depth: u32,
10634    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10635        let mut view = Self::default();
10636        view._merge_into_view(buf, depth)?;
10637        ::core::result::Result::Ok(view)
10638    }
10639    /// Merge fields from `buf` into this view (proto merge semantics).
10640    ///
10641    /// Repeated fields append; singular fields last-wins; singular
10642    /// MESSAGE fields merge recursively. Used by sub-message decode
10643    /// arms when the same field appears multiple times on the wire.
10644    ///
10645    /// **Not part of the public API.**
10646    #[doc(hidden)]
10647    pub fn _merge_into_view(
10648        &mut self,
10649        buf: &'a [u8],
10650        depth: u32,
10651    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
10652        let _ = depth;
10653        #[allow(unused_variables)]
10654        let view = self;
10655        let mut cur: &'a [u8] = buf;
10656        while !cur.is_empty() {
10657            let before_tag = cur;
10658            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
10659            match tag.field_number() {
10660                1u32 => {
10661                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
10662                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10663                            field_number: 1u32,
10664                            expected: 0u8,
10665                            actual: tag.wire_type() as u8,
10666                        });
10667                    }
10668                    view.op = ::buffa::EnumValue::from(
10669                        ::buffa::types::decode_int32(&mut cur)?,
10670                    );
10671                }
10672                2u32 => {
10673                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10674                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10675                            field_number: 2u32,
10676                            expected: 2u8,
10677                            actual: tag.wire_type() as u8,
10678                        });
10679                    }
10680                    if depth == 0 {
10681                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
10682                    }
10683                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
10684                    match view.expr.as_mut() {
10685                        Some(existing) => existing._merge_into_view(sub, depth - 1)?,
10686                        None => {
10687                            view.expr = ::buffa::MessageFieldView::set(
10688                                KvExprView::_decode_depth(sub, depth - 1)?,
10689                            );
10690                        }
10691                    }
10692                }
10693                _ => {
10694                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
10695                    let span_len = before_tag.len() - cur.len();
10696                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
10697                }
10698            }
10699        }
10700        ::core::result::Result::Ok(())
10701    }
10702}
10703impl<'a> ::buffa::MessageView<'a> for RangeReducerSpecView<'a> {
10704    type Owned = RangeReducerSpec;
10705    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10706        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
10707    }
10708    fn decode_view_with_limit(
10709        buf: &'a [u8],
10710        depth: u32,
10711    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
10712        Self::_decode_depth(buf, depth)
10713    }
10714    /// Convert this view to the owned message type.
10715    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
10716    fn to_owned_message(&self) -> RangeReducerSpec {
10717        #[allow(unused_imports)]
10718        use ::buffa::alloc::string::ToString as _;
10719        RangeReducerSpec {
10720            op: self.op,
10721            expr: match self.expr.as_option() {
10722                Some(v) => ::buffa::MessageField::<KvExpr>::some(v.to_owned_message()),
10723                None => ::buffa::MessageField::none(),
10724            },
10725            __buffa_unknown_fields: self
10726                .__buffa_unknown_fields
10727                .to_owned()
10728                .unwrap_or_default()
10729                .into(),
10730            ..::core::default::Default::default()
10731        }
10732    }
10733}
10734unsafe impl ::buffa::DefaultViewInstance for RangeReducerSpecView<'static> {
10735    fn default_view_instance() -> &'static Self {
10736        static VALUE: ::buffa::__private::OnceBox<RangeReducerSpecView<'static>> = ::buffa::__private::OnceBox::new();
10737        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
10738    }
10739}
10740unsafe impl<'a> ::buffa::HasDefaultViewInstance for RangeReducerSpecView<'a> {
10741    type Static = RangeReducerSpecView<'static>;
10742}
10743/// Parameters for a Reduce RPC: what to aggregate, how to group, and an
10744/// optional row filter.
10745#[derive(Clone, PartialEq, Default)]
10746#[derive(::serde::Serialize, ::serde::Deserialize)]
10747#[serde(default)]
10748pub struct ReduceParams {
10749    /// Aggregations to compute. At least one reducer or one `group_by`
10750    /// expression is required.
10751    ///
10752    /// Field 1: `reducers`
10753    #[serde(
10754        rename = "reducers",
10755        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
10756        deserialize_with = "::buffa::json_helpers::null_as_default"
10757    )]
10758    pub reducers: ::buffa::alloc::vec::Vec<RangeReducerSpec>,
10759    /// Expressions whose values partition rows into groups. When non-empty,
10760    /// results are returned per-group in `ReduceResponse.groups` instead of as
10761    /// flat scalar results.
10762    ///
10763    /// Field 2: `group_by`
10764    #[serde(
10765        rename = "groupBy",
10766        alias = "group_by",
10767        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
10768        deserialize_with = "::buffa::json_helpers::null_as_default"
10769    )]
10770    pub group_by: ::buffa::alloc::vec::Vec<KvExpr>,
10771    /// Optional predicate to exclude rows before aggregation.
10772    ///
10773    /// Field 3: `filter`
10774    #[serde(
10775        rename = "filter",
10776        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
10777    )]
10778    pub filter: ::buffa::MessageField<KvPredicate>,
10779    #[serde(skip)]
10780    #[doc(hidden)]
10781    pub __buffa_unknown_fields: ::buffa::UnknownFields,
10782    #[doc(hidden)]
10783    #[serde(skip)]
10784    pub __buffa_cached_size: ::buffa::__private::CachedSize,
10785}
10786impl ::core::fmt::Debug for ReduceParams {
10787    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10788        f.debug_struct("ReduceParams")
10789            .field("reducers", &self.reducers)
10790            .field("group_by", &self.group_by)
10791            .field("filter", &self.filter)
10792            .finish()
10793    }
10794}
10795impl ReduceParams {
10796    /// Protobuf type URL for this message, for use with `Any::pack` and
10797    /// `Any::unpack_if`.
10798    ///
10799    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
10800    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.ReduceParams";
10801}
10802unsafe impl ::buffa::DefaultInstance for ReduceParams {
10803    fn default_instance() -> &'static Self {
10804        static VALUE: ::buffa::__private::OnceBox<ReduceParams> = ::buffa::__private::OnceBox::new();
10805        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
10806    }
10807}
10808impl ::buffa::Message for ReduceParams {
10809    /// Returns the total encoded size in bytes.
10810    ///
10811    /// The result is a `u32`; the protobuf specification requires all
10812    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
10813    /// compliant message will never overflow this type.
10814    fn compute_size(&self) -> u32 {
10815        #[allow(unused_imports)]
10816        use ::buffa::Enumeration as _;
10817        let mut size = 0u32;
10818        if self.filter.is_set() {
10819            let inner_size = self.filter.compute_size();
10820            size
10821                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
10822                    + inner_size;
10823        }
10824        for v in &self.reducers {
10825            let inner_size = v.compute_size();
10826            size
10827                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
10828                    + inner_size;
10829        }
10830        for v in &self.group_by {
10831            let inner_size = v.compute_size();
10832            size
10833                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
10834                    + inner_size;
10835        }
10836        size += self.__buffa_unknown_fields.encoded_len() as u32;
10837        self.__buffa_cached_size.set(size);
10838        size
10839    }
10840    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
10841        #[allow(unused_imports)]
10842        use ::buffa::Enumeration as _;
10843        if self.filter.is_set() {
10844            ::buffa::encoding::Tag::new(
10845                    3u32,
10846                    ::buffa::encoding::WireType::LengthDelimited,
10847                )
10848                .encode(buf);
10849            ::buffa::encoding::encode_varint(self.filter.cached_size() as u64, buf);
10850            self.filter.write_to(buf);
10851        }
10852        for v in &self.reducers {
10853            ::buffa::encoding::Tag::new(
10854                    1u32,
10855                    ::buffa::encoding::WireType::LengthDelimited,
10856                )
10857                .encode(buf);
10858            ::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
10859            v.write_to(buf);
10860        }
10861        for v in &self.group_by {
10862            ::buffa::encoding::Tag::new(
10863                    2u32,
10864                    ::buffa::encoding::WireType::LengthDelimited,
10865                )
10866                .encode(buf);
10867            ::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
10868            v.write_to(buf);
10869        }
10870        self.__buffa_unknown_fields.write_to(buf);
10871    }
10872    fn merge_field(
10873        &mut self,
10874        tag: ::buffa::encoding::Tag,
10875        buf: &mut impl ::buffa::bytes::Buf,
10876        depth: u32,
10877    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
10878        #[allow(unused_imports)]
10879        use ::buffa::bytes::Buf as _;
10880        #[allow(unused_imports)]
10881        use ::buffa::Enumeration as _;
10882        match tag.field_number() {
10883            3u32 => {
10884                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10885                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10886                        field_number: 3u32,
10887                        expected: 2u8,
10888                        actual: tag.wire_type() as u8,
10889                    });
10890                }
10891                ::buffa::Message::merge_length_delimited(
10892                    self.filter.get_or_insert_default(),
10893                    buf,
10894                    depth,
10895                )?;
10896            }
10897            1u32 => {
10898                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10899                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10900                        field_number: 1u32,
10901                        expected: 2u8,
10902                        actual: tag.wire_type() as u8,
10903                    });
10904                }
10905                let mut elem = ::core::default::Default::default();
10906                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
10907                self.reducers.push(elem);
10908            }
10909            2u32 => {
10910                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
10911                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
10912                        field_number: 2u32,
10913                        expected: 2u8,
10914                        actual: tag.wire_type() as u8,
10915                    });
10916                }
10917                let mut elem = ::core::default::Default::default();
10918                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
10919                self.group_by.push(elem);
10920            }
10921            _ => {
10922                self.__buffa_unknown_fields
10923                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
10924            }
10925        }
10926        ::core::result::Result::Ok(())
10927    }
10928    fn cached_size(&self) -> u32 {
10929        self.__buffa_cached_size.get()
10930    }
10931    fn clear(&mut self) {
10932        self.filter = ::buffa::MessageField::none();
10933        self.reducers.clear();
10934        self.group_by.clear();
10935        self.__buffa_unknown_fields.clear();
10936        self.__buffa_cached_size.set(0);
10937    }
10938}
10939impl ::buffa::ExtensionSet for ReduceParams {
10940    const PROTO_FQN: &'static str = "store.query.v1.ReduceParams";
10941    fn unknown_fields(&self) -> &::buffa::UnknownFields {
10942        &self.__buffa_unknown_fields
10943    }
10944    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
10945        &mut self.__buffa_unknown_fields
10946    }
10947}
10948impl ::buffa::json_helpers::ProtoElemJson for ReduceParams {
10949    fn serialize_proto_json<S: ::serde::Serializer>(
10950        v: &Self,
10951        s: S,
10952    ) -> ::core::result::Result<S::Ok, S::Error> {
10953        ::serde::Serialize::serialize(v, s)
10954    }
10955    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
10956        d: D,
10957    ) -> ::core::result::Result<Self, D::Error> {
10958        <Self as ::serde::Deserialize>::deserialize(d)
10959    }
10960}
10961#[doc(hidden)]
10962pub const __REDUCE_PARAMS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
10963    type_url: "type.googleapis.com/store.query.v1.ReduceParams",
10964    to_json: ::buffa::type_registry::any_to_json::<ReduceParams>,
10965    from_json: ::buffa::type_registry::any_from_json::<ReduceParams>,
10966    is_wkt: false,
10967};
10968/// Parameters for a Reduce RPC: what to aggregate, how to group, and an
10969/// optional row filter.
10970#[derive(Clone, Debug, Default)]
10971pub struct ReduceParamsView<'a> {
10972    /// Aggregations to compute. At least one reducer or one `group_by`
10973    /// expression is required.
10974    ///
10975    /// Field 1: `reducers`
10976    pub reducers: ::buffa::RepeatedView<'a, RangeReducerSpecView<'a>>,
10977    /// Expressions whose values partition rows into groups. When non-empty,
10978    /// results are returned per-group in `ReduceResponse.groups` instead of as
10979    /// flat scalar results.
10980    ///
10981    /// Field 2: `group_by`
10982    pub group_by: ::buffa::RepeatedView<'a, KvExprView<'a>>,
10983    /// Optional predicate to exclude rows before aggregation.
10984    ///
10985    /// Field 3: `filter`
10986    pub filter: ::buffa::MessageFieldView<KvPredicateView<'a>>,
10987    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
10988}
10989impl<'a> ReduceParamsView<'a> {
10990    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
10991    ///
10992    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
10993    /// and by generated sub-message decode arms with `depth - 1`.
10994    ///
10995    /// **Not part of the public API.** Named with a leading underscore to
10996    /// signal that it is for generated-code use only.
10997    #[doc(hidden)]
10998    pub fn _decode_depth(
10999        buf: &'a [u8],
11000        depth: u32,
11001    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11002        let mut view = Self::default();
11003        view._merge_into_view(buf, depth)?;
11004        ::core::result::Result::Ok(view)
11005    }
11006    /// Merge fields from `buf` into this view (proto merge semantics).
11007    ///
11008    /// Repeated fields append; singular fields last-wins; singular
11009    /// MESSAGE fields merge recursively. Used by sub-message decode
11010    /// arms when the same field appears multiple times on the wire.
11011    ///
11012    /// **Not part of the public API.**
11013    #[doc(hidden)]
11014    pub fn _merge_into_view(
11015        &mut self,
11016        buf: &'a [u8],
11017        depth: u32,
11018    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11019        let _ = depth;
11020        #[allow(unused_variables)]
11021        let view = self;
11022        let mut cur: &'a [u8] = buf;
11023        while !cur.is_empty() {
11024            let before_tag = cur;
11025            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
11026            match tag.field_number() {
11027                3u32 => {
11028                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
11029                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
11030                            field_number: 3u32,
11031                            expected: 2u8,
11032                            actual: tag.wire_type() as u8,
11033                        });
11034                    }
11035                    if depth == 0 {
11036                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
11037                    }
11038                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
11039                    match view.filter.as_mut() {
11040                        Some(existing) => existing._merge_into_view(sub, depth - 1)?,
11041                        None => {
11042                            view.filter = ::buffa::MessageFieldView::set(
11043                                KvPredicateView::_decode_depth(sub, depth - 1)?,
11044                            );
11045                        }
11046                    }
11047                }
11048                1u32 => {
11049                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
11050                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
11051                            field_number: 1u32,
11052                            expected: 2u8,
11053                            actual: tag.wire_type() as u8,
11054                        });
11055                    }
11056                    if depth == 0 {
11057                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
11058                    }
11059                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
11060                    view.reducers
11061                        .push(RangeReducerSpecView::_decode_depth(sub, depth - 1)?);
11062                }
11063                2u32 => {
11064                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
11065                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
11066                            field_number: 2u32,
11067                            expected: 2u8,
11068                            actual: tag.wire_type() as u8,
11069                        });
11070                    }
11071                    if depth == 0 {
11072                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
11073                    }
11074                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
11075                    view.group_by.push(KvExprView::_decode_depth(sub, depth - 1)?);
11076                }
11077                _ => {
11078                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
11079                    let span_len = before_tag.len() - cur.len();
11080                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
11081                }
11082            }
11083        }
11084        ::core::result::Result::Ok(())
11085    }
11086}
11087impl<'a> ::buffa::MessageView<'a> for ReduceParamsView<'a> {
11088    type Owned = ReduceParams;
11089    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11090        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
11091    }
11092    fn decode_view_with_limit(
11093        buf: &'a [u8],
11094        depth: u32,
11095    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11096        Self::_decode_depth(buf, depth)
11097    }
11098    /// Convert this view to the owned message type.
11099    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
11100    fn to_owned_message(&self) -> ReduceParams {
11101        #[allow(unused_imports)]
11102        use ::buffa::alloc::string::ToString as _;
11103        ReduceParams {
11104            reducers: self.reducers.iter().map(|v| v.to_owned_message()).collect(),
11105            group_by: self.group_by.iter().map(|v| v.to_owned_message()).collect(),
11106            filter: match self.filter.as_option() {
11107                Some(v) => {
11108                    ::buffa::MessageField::<KvPredicate>::some(v.to_owned_message())
11109                }
11110                None => ::buffa::MessageField::none(),
11111            },
11112            __buffa_unknown_fields: self
11113                .__buffa_unknown_fields
11114                .to_owned()
11115                .unwrap_or_default()
11116                .into(),
11117            ..::core::default::Default::default()
11118        }
11119    }
11120}
11121unsafe impl ::buffa::DefaultViewInstance for ReduceParamsView<'static> {
11122    fn default_view_instance() -> &'static Self {
11123        static VALUE: ::buffa::__private::OnceBox<ReduceParamsView<'static>> = ::buffa::__private::OnceBox::new();
11124        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
11125    }
11126}
11127unsafe impl<'a> ::buffa::HasDefaultViewInstance for ReduceParamsView<'a> {
11128    type Static = ReduceParamsView<'static>;
11129}
11130/// The result of a single reducer. Absent when no rows contributed (e.g. SUM
11131/// over zero matching rows).
11132#[derive(Clone, PartialEq, Default)]
11133#[derive(::serde::Serialize, ::serde::Deserialize)]
11134#[serde(default)]
11135pub struct RangeReduceResult {
11136    /// Field 1: `value`
11137    #[serde(
11138        rename = "value",
11139        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
11140    )]
11141    pub value: ::buffa::MessageField<KvReducedValue>,
11142    #[serde(skip)]
11143    #[doc(hidden)]
11144    pub __buffa_unknown_fields: ::buffa::UnknownFields,
11145    #[doc(hidden)]
11146    #[serde(skip)]
11147    pub __buffa_cached_size: ::buffa::__private::CachedSize,
11148}
11149impl ::core::fmt::Debug for RangeReduceResult {
11150    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11151        f.debug_struct("RangeReduceResult").field("value", &self.value).finish()
11152    }
11153}
11154impl RangeReduceResult {
11155    /// Protobuf type URL for this message, for use with `Any::pack` and
11156    /// `Any::unpack_if`.
11157    ///
11158    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
11159    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.RangeReduceResult";
11160}
11161unsafe impl ::buffa::DefaultInstance for RangeReduceResult {
11162    fn default_instance() -> &'static Self {
11163        static VALUE: ::buffa::__private::OnceBox<RangeReduceResult> = ::buffa::__private::OnceBox::new();
11164        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
11165    }
11166}
11167impl ::buffa::Message for RangeReduceResult {
11168    /// Returns the total encoded size in bytes.
11169    ///
11170    /// The result is a `u32`; the protobuf specification requires all
11171    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
11172    /// compliant message will never overflow this type.
11173    fn compute_size(&self) -> u32 {
11174        #[allow(unused_imports)]
11175        use ::buffa::Enumeration as _;
11176        let mut size = 0u32;
11177        if self.value.is_set() {
11178            let inner_size = self.value.compute_size();
11179            size
11180                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
11181                    + inner_size;
11182        }
11183        size += self.__buffa_unknown_fields.encoded_len() as u32;
11184        self.__buffa_cached_size.set(size);
11185        size
11186    }
11187    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
11188        #[allow(unused_imports)]
11189        use ::buffa::Enumeration as _;
11190        if self.value.is_set() {
11191            ::buffa::encoding::Tag::new(
11192                    1u32,
11193                    ::buffa::encoding::WireType::LengthDelimited,
11194                )
11195                .encode(buf);
11196            ::buffa::encoding::encode_varint(self.value.cached_size() as u64, buf);
11197            self.value.write_to(buf);
11198        }
11199        self.__buffa_unknown_fields.write_to(buf);
11200    }
11201    fn merge_field(
11202        &mut self,
11203        tag: ::buffa::encoding::Tag,
11204        buf: &mut impl ::buffa::bytes::Buf,
11205        depth: u32,
11206    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11207        #[allow(unused_imports)]
11208        use ::buffa::bytes::Buf as _;
11209        #[allow(unused_imports)]
11210        use ::buffa::Enumeration as _;
11211        match tag.field_number() {
11212            1u32 => {
11213                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
11214                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
11215                        field_number: 1u32,
11216                        expected: 2u8,
11217                        actual: tag.wire_type() as u8,
11218                    });
11219                }
11220                ::buffa::Message::merge_length_delimited(
11221                    self.value.get_or_insert_default(),
11222                    buf,
11223                    depth,
11224                )?;
11225            }
11226            _ => {
11227                self.__buffa_unknown_fields
11228                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
11229            }
11230        }
11231        ::core::result::Result::Ok(())
11232    }
11233    fn cached_size(&self) -> u32 {
11234        self.__buffa_cached_size.get()
11235    }
11236    fn clear(&mut self) {
11237        self.value = ::buffa::MessageField::none();
11238        self.__buffa_unknown_fields.clear();
11239        self.__buffa_cached_size.set(0);
11240    }
11241}
11242impl ::buffa::ExtensionSet for RangeReduceResult {
11243    const PROTO_FQN: &'static str = "store.query.v1.RangeReduceResult";
11244    fn unknown_fields(&self) -> &::buffa::UnknownFields {
11245        &self.__buffa_unknown_fields
11246    }
11247    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
11248        &mut self.__buffa_unknown_fields
11249    }
11250}
11251impl ::buffa::json_helpers::ProtoElemJson for RangeReduceResult {
11252    fn serialize_proto_json<S: ::serde::Serializer>(
11253        v: &Self,
11254        s: S,
11255    ) -> ::core::result::Result<S::Ok, S::Error> {
11256        ::serde::Serialize::serialize(v, s)
11257    }
11258    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11259        d: D,
11260    ) -> ::core::result::Result<Self, D::Error> {
11261        <Self as ::serde::Deserialize>::deserialize(d)
11262    }
11263}
11264#[doc(hidden)]
11265pub const __RANGE_REDUCE_RESULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
11266    type_url: "type.googleapis.com/store.query.v1.RangeReduceResult",
11267    to_json: ::buffa::type_registry::any_to_json::<RangeReduceResult>,
11268    from_json: ::buffa::type_registry::any_from_json::<RangeReduceResult>,
11269    is_wkt: false,
11270};
11271/// The result of a single reducer. Absent when no rows contributed (e.g. SUM
11272/// over zero matching rows).
11273#[derive(Clone, Debug, Default)]
11274pub struct RangeReduceResultView<'a> {
11275    /// Field 1: `value`
11276    pub value: ::buffa::MessageFieldView<KvReducedValueView<'a>>,
11277    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
11278}
11279impl<'a> RangeReduceResultView<'a> {
11280    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
11281    ///
11282    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
11283    /// and by generated sub-message decode arms with `depth - 1`.
11284    ///
11285    /// **Not part of the public API.** Named with a leading underscore to
11286    /// signal that it is for generated-code use only.
11287    #[doc(hidden)]
11288    pub fn _decode_depth(
11289        buf: &'a [u8],
11290        depth: u32,
11291    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11292        let mut view = Self::default();
11293        view._merge_into_view(buf, depth)?;
11294        ::core::result::Result::Ok(view)
11295    }
11296    /// Merge fields from `buf` into this view (proto merge semantics).
11297    ///
11298    /// Repeated fields append; singular fields last-wins; singular
11299    /// MESSAGE fields merge recursively. Used by sub-message decode
11300    /// arms when the same field appears multiple times on the wire.
11301    ///
11302    /// **Not part of the public API.**
11303    #[doc(hidden)]
11304    pub fn _merge_into_view(
11305        &mut self,
11306        buf: &'a [u8],
11307        depth: u32,
11308    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11309        let _ = depth;
11310        #[allow(unused_variables)]
11311        let view = self;
11312        let mut cur: &'a [u8] = buf;
11313        while !cur.is_empty() {
11314            let before_tag = cur;
11315            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
11316            match tag.field_number() {
11317                1u32 => {
11318                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
11319                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
11320                            field_number: 1u32,
11321                            expected: 2u8,
11322                            actual: tag.wire_type() as u8,
11323                        });
11324                    }
11325                    if depth == 0 {
11326                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
11327                    }
11328                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
11329                    match view.value.as_mut() {
11330                        Some(existing) => existing._merge_into_view(sub, depth - 1)?,
11331                        None => {
11332                            view.value = ::buffa::MessageFieldView::set(
11333                                KvReducedValueView::_decode_depth(sub, depth - 1)?,
11334                            );
11335                        }
11336                    }
11337                }
11338                _ => {
11339                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
11340                    let span_len = before_tag.len() - cur.len();
11341                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
11342                }
11343            }
11344        }
11345        ::core::result::Result::Ok(())
11346    }
11347}
11348impl<'a> ::buffa::MessageView<'a> for RangeReduceResultView<'a> {
11349    type Owned = RangeReduceResult;
11350    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11351        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
11352    }
11353    fn decode_view_with_limit(
11354        buf: &'a [u8],
11355        depth: u32,
11356    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11357        Self::_decode_depth(buf, depth)
11358    }
11359    /// Convert this view to the owned message type.
11360    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
11361    fn to_owned_message(&self) -> RangeReduceResult {
11362        #[allow(unused_imports)]
11363        use ::buffa::alloc::string::ToString as _;
11364        RangeReduceResult {
11365            value: match self.value.as_option() {
11366                Some(v) => {
11367                    ::buffa::MessageField::<KvReducedValue>::some(v.to_owned_message())
11368                }
11369                None => ::buffa::MessageField::none(),
11370            },
11371            __buffa_unknown_fields: self
11372                .__buffa_unknown_fields
11373                .to_owned()
11374                .unwrap_or_default()
11375                .into(),
11376            ..::core::default::Default::default()
11377        }
11378    }
11379}
11380unsafe impl ::buffa::DefaultViewInstance for RangeReduceResultView<'static> {
11381    fn default_view_instance() -> &'static Self {
11382        static VALUE: ::buffa::__private::OnceBox<RangeReduceResultView<'static>> = ::buffa::__private::OnceBox::new();
11383        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
11384    }
11385}
11386unsafe impl<'a> ::buffa::HasDefaultViewInstance for RangeReduceResultView<'a> {
11387    type Static = RangeReduceResultView<'static>;
11388}
11389/// Aggregation results for one distinct combination of group-by values.
11390#[derive(Clone, PartialEq, Default)]
11391#[derive(::serde::Serialize, ::serde::Deserialize)]
11392#[serde(default)]
11393pub struct RangeReduceGroup {
11394    /// The evaluated group-by expression values for this group, in the same
11395    /// order as `ReduceParams.group_by`.
11396    ///
11397    /// Field 1: `group_values`
11398    #[serde(
11399        rename = "groupValues",
11400        alias = "group_values",
11401        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
11402        deserialize_with = "::buffa::json_helpers::null_as_default"
11403    )]
11404    pub group_values: ::buffa::alloc::vec::Vec<KvReducedValue>,
11405    /// Parallel to `group_values`; false when the corresponding group value is
11406    /// NULL (the proto value is a default zero, but should be treated as absent).
11407    ///
11408    /// Field 2: `group_values_present`
11409    #[serde(
11410        rename = "groupValuesPresent",
11411        alias = "group_values_present",
11412        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
11413        deserialize_with = "::buffa::json_helpers::null_as_default"
11414    )]
11415    pub group_values_present: ::buffa::alloc::vec::Vec<bool>,
11416    /// Reducer results for this group, in the same order as
11417    /// `ReduceParams.reducers`.
11418    ///
11419    /// Field 3: `results`
11420    #[serde(
11421        rename = "results",
11422        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
11423        deserialize_with = "::buffa::json_helpers::null_as_default"
11424    )]
11425    pub results: ::buffa::alloc::vec::Vec<RangeReduceResult>,
11426    #[serde(skip)]
11427    #[doc(hidden)]
11428    pub __buffa_unknown_fields: ::buffa::UnknownFields,
11429    #[doc(hidden)]
11430    #[serde(skip)]
11431    pub __buffa_cached_size: ::buffa::__private::CachedSize,
11432}
11433impl ::core::fmt::Debug for RangeReduceGroup {
11434    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11435        f.debug_struct("RangeReduceGroup")
11436            .field("group_values", &self.group_values)
11437            .field("group_values_present", &self.group_values_present)
11438            .field("results", &self.results)
11439            .finish()
11440    }
11441}
11442impl RangeReduceGroup {
11443    /// Protobuf type URL for this message, for use with `Any::pack` and
11444    /// `Any::unpack_if`.
11445    ///
11446    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
11447    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.RangeReduceGroup";
11448}
11449unsafe impl ::buffa::DefaultInstance for RangeReduceGroup {
11450    fn default_instance() -> &'static Self {
11451        static VALUE: ::buffa::__private::OnceBox<RangeReduceGroup> = ::buffa::__private::OnceBox::new();
11452        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
11453    }
11454}
11455impl ::buffa::Message for RangeReduceGroup {
11456    /// Returns the total encoded size in bytes.
11457    ///
11458    /// The result is a `u32`; the protobuf specification requires all
11459    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
11460    /// compliant message will never overflow this type.
11461    fn compute_size(&self) -> u32 {
11462        #[allow(unused_imports)]
11463        use ::buffa::Enumeration as _;
11464        let mut size = 0u32;
11465        for v in &self.group_values {
11466            let inner_size = v.compute_size();
11467            size
11468                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
11469                    + inner_size;
11470        }
11471        if !self.group_values_present.is_empty() {
11472            let payload: u32 = self.group_values_present.len() as u32
11473                * ::buffa::types::BOOL_ENCODED_LEN as u32;
11474            size
11475                += 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32 + payload;
11476        }
11477        for v in &self.results {
11478            let inner_size = v.compute_size();
11479            size
11480                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
11481                    + inner_size;
11482        }
11483        size += self.__buffa_unknown_fields.encoded_len() as u32;
11484        self.__buffa_cached_size.set(size);
11485        size
11486    }
11487    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
11488        #[allow(unused_imports)]
11489        use ::buffa::Enumeration as _;
11490        for v in &self.group_values {
11491            ::buffa::encoding::Tag::new(
11492                    1u32,
11493                    ::buffa::encoding::WireType::LengthDelimited,
11494                )
11495                .encode(buf);
11496            ::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
11497            v.write_to(buf);
11498        }
11499        if !self.group_values_present.is_empty() {
11500            let payload: u32 = self.group_values_present.len() as u32
11501                * ::buffa::types::BOOL_ENCODED_LEN as u32;
11502            ::buffa::encoding::Tag::new(
11503                    2u32,
11504                    ::buffa::encoding::WireType::LengthDelimited,
11505                )
11506                .encode(buf);
11507            ::buffa::encoding::encode_varint(payload as u64, buf);
11508            for &v in &self.group_values_present {
11509                ::buffa::types::encode_bool(v, buf);
11510            }
11511        }
11512        for v in &self.results {
11513            ::buffa::encoding::Tag::new(
11514                    3u32,
11515                    ::buffa::encoding::WireType::LengthDelimited,
11516                )
11517                .encode(buf);
11518            ::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
11519            v.write_to(buf);
11520        }
11521        self.__buffa_unknown_fields.write_to(buf);
11522    }
11523    fn merge_field(
11524        &mut self,
11525        tag: ::buffa::encoding::Tag,
11526        buf: &mut impl ::buffa::bytes::Buf,
11527        depth: u32,
11528    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11529        #[allow(unused_imports)]
11530        use ::buffa::bytes::Buf as _;
11531        #[allow(unused_imports)]
11532        use ::buffa::Enumeration as _;
11533        match tag.field_number() {
11534            1u32 => {
11535                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
11536                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
11537                        field_number: 1u32,
11538                        expected: 2u8,
11539                        actual: tag.wire_type() as u8,
11540                    });
11541                }
11542                let mut elem = ::core::default::Default::default();
11543                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
11544                self.group_values.push(elem);
11545            }
11546            2u32 => {
11547                if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
11548                    let len = ::buffa::encoding::decode_varint(buf)?;
11549                    let len = usize::try_from(len)
11550                        .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
11551                    if buf.remaining() < len {
11552                        return ::core::result::Result::Err(
11553                            ::buffa::DecodeError::UnexpectedEof,
11554                        );
11555                    }
11556                    self.group_values_present.reserve(len);
11557                    let mut limited = buf.take(len);
11558                    while limited.has_remaining() {
11559                        self.group_values_present
11560                            .push(::buffa::types::decode_bool(&mut limited)?);
11561                    }
11562                    let leftover = limited.remaining();
11563                    if leftover > 0 {
11564                        limited.advance(leftover);
11565                    }
11566                } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
11567                    self.group_values_present.push(::buffa::types::decode_bool(buf)?);
11568                } else {
11569                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
11570                        field_number: 2u32,
11571                        expected: 2u8,
11572                        actual: tag.wire_type() as u8,
11573                    });
11574                }
11575            }
11576            3u32 => {
11577                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
11578                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
11579                        field_number: 3u32,
11580                        expected: 2u8,
11581                        actual: tag.wire_type() as u8,
11582                    });
11583                }
11584                let mut elem = ::core::default::Default::default();
11585                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
11586                self.results.push(elem);
11587            }
11588            _ => {
11589                self.__buffa_unknown_fields
11590                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
11591            }
11592        }
11593        ::core::result::Result::Ok(())
11594    }
11595    fn cached_size(&self) -> u32 {
11596        self.__buffa_cached_size.get()
11597    }
11598    fn clear(&mut self) {
11599        self.group_values.clear();
11600        self.group_values_present.clear();
11601        self.results.clear();
11602        self.__buffa_unknown_fields.clear();
11603        self.__buffa_cached_size.set(0);
11604    }
11605}
11606impl ::buffa::ExtensionSet for RangeReduceGroup {
11607    const PROTO_FQN: &'static str = "store.query.v1.RangeReduceGroup";
11608    fn unknown_fields(&self) -> &::buffa::UnknownFields {
11609        &self.__buffa_unknown_fields
11610    }
11611    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
11612        &mut self.__buffa_unknown_fields
11613    }
11614}
11615impl ::buffa::json_helpers::ProtoElemJson for RangeReduceGroup {
11616    fn serialize_proto_json<S: ::serde::Serializer>(
11617        v: &Self,
11618        s: S,
11619    ) -> ::core::result::Result<S::Ok, S::Error> {
11620        ::serde::Serialize::serialize(v, s)
11621    }
11622    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11623        d: D,
11624    ) -> ::core::result::Result<Self, D::Error> {
11625        <Self as ::serde::Deserialize>::deserialize(d)
11626    }
11627}
11628#[doc(hidden)]
11629pub const __RANGE_REDUCE_GROUP_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
11630    type_url: "type.googleapis.com/store.query.v1.RangeReduceGroup",
11631    to_json: ::buffa::type_registry::any_to_json::<RangeReduceGroup>,
11632    from_json: ::buffa::type_registry::any_from_json::<RangeReduceGroup>,
11633    is_wkt: false,
11634};
11635/// Aggregation results for one distinct combination of group-by values.
11636#[derive(Clone, Debug, Default)]
11637pub struct RangeReduceGroupView<'a> {
11638    /// The evaluated group-by expression values for this group, in the same
11639    /// order as `ReduceParams.group_by`.
11640    ///
11641    /// Field 1: `group_values`
11642    pub group_values: ::buffa::RepeatedView<'a, KvReducedValueView<'a>>,
11643    /// Parallel to `group_values`; false when the corresponding group value is
11644    /// NULL (the proto value is a default zero, but should be treated as absent).
11645    ///
11646    /// Field 2: `group_values_present`
11647    pub group_values_present: ::buffa::RepeatedView<'a, bool>,
11648    /// Reducer results for this group, in the same order as
11649    /// `ReduceParams.reducers`.
11650    ///
11651    /// Field 3: `results`
11652    pub results: ::buffa::RepeatedView<'a, RangeReduceResultView<'a>>,
11653    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
11654}
11655impl<'a> RangeReduceGroupView<'a> {
11656    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
11657    ///
11658    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
11659    /// and by generated sub-message decode arms with `depth - 1`.
11660    ///
11661    /// **Not part of the public API.** Named with a leading underscore to
11662    /// signal that it is for generated-code use only.
11663    #[doc(hidden)]
11664    pub fn _decode_depth(
11665        buf: &'a [u8],
11666        depth: u32,
11667    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11668        let mut view = Self::default();
11669        view._merge_into_view(buf, depth)?;
11670        ::core::result::Result::Ok(view)
11671    }
11672    /// Merge fields from `buf` into this view (proto merge semantics).
11673    ///
11674    /// Repeated fields append; singular fields last-wins; singular
11675    /// MESSAGE fields merge recursively. Used by sub-message decode
11676    /// arms when the same field appears multiple times on the wire.
11677    ///
11678    /// **Not part of the public API.**
11679    #[doc(hidden)]
11680    pub fn _merge_into_view(
11681        &mut self,
11682        buf: &'a [u8],
11683        depth: u32,
11684    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11685        let _ = depth;
11686        #[allow(unused_variables)]
11687        let view = self;
11688        let mut cur: &'a [u8] = buf;
11689        while !cur.is_empty() {
11690            let before_tag = cur;
11691            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
11692            match tag.field_number() {
11693                1u32 => {
11694                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
11695                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
11696                            field_number: 1u32,
11697                            expected: 2u8,
11698                            actual: tag.wire_type() as u8,
11699                        });
11700                    }
11701                    if depth == 0 {
11702                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
11703                    }
11704                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
11705                    view.group_values
11706                        .push(KvReducedValueView::_decode_depth(sub, depth - 1)?);
11707                }
11708                2u32 => {
11709                    if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
11710                        let payload = ::buffa::types::borrow_bytes(&mut cur)?;
11711                        let mut pcur: &[u8] = payload;
11712                        while !pcur.is_empty() {
11713                            view.group_values_present
11714                                .push(::buffa::types::decode_bool(&mut pcur)?);
11715                        }
11716                    } else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
11717                        view.group_values_present
11718                            .push(::buffa::types::decode_bool(&mut cur)?);
11719                    } else {
11720                        return Err(::buffa::DecodeError::WireTypeMismatch {
11721                            field_number: 2u32,
11722                            expected: 2u8,
11723                            actual: tag.wire_type() as u8,
11724                        });
11725                    }
11726                }
11727                3u32 => {
11728                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
11729                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
11730                            field_number: 3u32,
11731                            expected: 2u8,
11732                            actual: tag.wire_type() as u8,
11733                        });
11734                    }
11735                    if depth == 0 {
11736                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
11737                    }
11738                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
11739                    view.results
11740                        .push(RangeReduceResultView::_decode_depth(sub, depth - 1)?);
11741                }
11742                _ => {
11743                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
11744                    let span_len = before_tag.len() - cur.len();
11745                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
11746                }
11747            }
11748        }
11749        ::core::result::Result::Ok(())
11750    }
11751}
11752impl<'a> ::buffa::MessageView<'a> for RangeReduceGroupView<'a> {
11753    type Owned = RangeReduceGroup;
11754    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11755        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
11756    }
11757    fn decode_view_with_limit(
11758        buf: &'a [u8],
11759        depth: u32,
11760    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11761        Self::_decode_depth(buf, depth)
11762    }
11763    /// Convert this view to the owned message type.
11764    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
11765    fn to_owned_message(&self) -> RangeReduceGroup {
11766        #[allow(unused_imports)]
11767        use ::buffa::alloc::string::ToString as _;
11768        RangeReduceGroup {
11769            group_values: self
11770                .group_values
11771                .iter()
11772                .map(|v| v.to_owned_message())
11773                .collect(),
11774            group_values_present: self.group_values_present.to_vec(),
11775            results: self.results.iter().map(|v| v.to_owned_message()).collect(),
11776            __buffa_unknown_fields: self
11777                .__buffa_unknown_fields
11778                .to_owned()
11779                .unwrap_or_default()
11780                .into(),
11781            ..::core::default::Default::default()
11782        }
11783    }
11784}
11785unsafe impl ::buffa::DefaultViewInstance for RangeReduceGroupView<'static> {
11786    fn default_view_instance() -> &'static Self {
11787        static VALUE: ::buffa::__private::OnceBox<RangeReduceGroupView<'static>> = ::buffa::__private::OnceBox::new();
11788        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
11789    }
11790}
11791unsafe impl<'a> ::buffa::HasDefaultViewInstance for RangeReduceGroupView<'a> {
11792    type Static = RangeReduceGroupView<'static>;
11793}
11794/// Point lookup request for a single key.
11795#[derive(Clone, PartialEq, Default)]
11796#[derive(::serde::Serialize, ::serde::Deserialize)]
11797#[serde(default)]
11798pub struct GetRequest {
11799    /// The key to look up (max 254 bytes).
11800    ///
11801    /// Field 1: `key`
11802    #[serde(
11803        rename = "key",
11804        with = "::buffa::json_helpers::bytes",
11805        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
11806    )]
11807    pub key: ::buffa::alloc::vec::Vec<u8>,
11808    /// Optional freshness gate. See service-level comment.
11809    ///
11810    /// Field 2: `min_sequence_number`
11811    #[serde(
11812        rename = "minSequenceNumber",
11813        alias = "min_sequence_number",
11814        with = "::buffa::json_helpers::opt_uint64",
11815        skip_serializing_if = "Option::is_none"
11816    )]
11817    pub min_sequence_number: Option<u64>,
11818    #[serde(skip)]
11819    #[doc(hidden)]
11820    pub __buffa_unknown_fields: ::buffa::UnknownFields,
11821    #[doc(hidden)]
11822    #[serde(skip)]
11823    pub __buffa_cached_size: ::buffa::__private::CachedSize,
11824}
11825impl ::core::fmt::Debug for GetRequest {
11826    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11827        f.debug_struct("GetRequest")
11828            .field("key", &self.key)
11829            .field("min_sequence_number", &self.min_sequence_number)
11830            .finish()
11831    }
11832}
11833impl GetRequest {
11834    /// Protobuf type URL for this message, for use with `Any::pack` and
11835    /// `Any::unpack_if`.
11836    ///
11837    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
11838    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.GetRequest";
11839}
11840unsafe impl ::buffa::DefaultInstance for GetRequest {
11841    fn default_instance() -> &'static Self {
11842        static VALUE: ::buffa::__private::OnceBox<GetRequest> = ::buffa::__private::OnceBox::new();
11843        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
11844    }
11845}
11846impl ::buffa::Message for GetRequest {
11847    /// Returns the total encoded size in bytes.
11848    ///
11849    /// The result is a `u32`; the protobuf specification requires all
11850    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
11851    /// compliant message will never overflow this type.
11852    fn compute_size(&self) -> u32 {
11853        #[allow(unused_imports)]
11854        use ::buffa::Enumeration as _;
11855        let mut size = 0u32;
11856        if !self.key.is_empty() {
11857            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.key) as u32;
11858        }
11859        if let Some(v) = self.min_sequence_number {
11860            size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
11861        }
11862        size += self.__buffa_unknown_fields.encoded_len() as u32;
11863        self.__buffa_cached_size.set(size);
11864        size
11865    }
11866    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
11867        #[allow(unused_imports)]
11868        use ::buffa::Enumeration as _;
11869        if !self.key.is_empty() {
11870            ::buffa::encoding::Tag::new(
11871                    1u32,
11872                    ::buffa::encoding::WireType::LengthDelimited,
11873                )
11874                .encode(buf);
11875            ::buffa::types::encode_bytes(&self.key, buf);
11876        }
11877        if let Some(v) = self.min_sequence_number {
11878            ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
11879                .encode(buf);
11880            ::buffa::types::encode_uint64(v, buf);
11881        }
11882        self.__buffa_unknown_fields.write_to(buf);
11883    }
11884    fn merge_field(
11885        &mut self,
11886        tag: ::buffa::encoding::Tag,
11887        buf: &mut impl ::buffa::bytes::Buf,
11888        depth: u32,
11889    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
11890        #[allow(unused_imports)]
11891        use ::buffa::bytes::Buf as _;
11892        #[allow(unused_imports)]
11893        use ::buffa::Enumeration as _;
11894        match tag.field_number() {
11895            1u32 => {
11896                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
11897                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
11898                        field_number: 1u32,
11899                        expected: 2u8,
11900                        actual: tag.wire_type() as u8,
11901                    });
11902                }
11903                ::buffa::types::merge_bytes(&mut self.key, buf)?;
11904            }
11905            2u32 => {
11906                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
11907                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
11908                        field_number: 2u32,
11909                        expected: 0u8,
11910                        actual: tag.wire_type() as u8,
11911                    });
11912                }
11913                self.min_sequence_number = ::core::option::Option::Some(
11914                    ::buffa::types::decode_uint64(buf)?,
11915                );
11916            }
11917            _ => {
11918                self.__buffa_unknown_fields
11919                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
11920            }
11921        }
11922        ::core::result::Result::Ok(())
11923    }
11924    fn cached_size(&self) -> u32 {
11925        self.__buffa_cached_size.get()
11926    }
11927    fn clear(&mut self) {
11928        self.key.clear();
11929        self.min_sequence_number = ::core::option::Option::None;
11930        self.__buffa_unknown_fields.clear();
11931        self.__buffa_cached_size.set(0);
11932    }
11933}
11934impl ::buffa::ExtensionSet for GetRequest {
11935    const PROTO_FQN: &'static str = "store.query.v1.GetRequest";
11936    fn unknown_fields(&self) -> &::buffa::UnknownFields {
11937        &self.__buffa_unknown_fields
11938    }
11939    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
11940        &mut self.__buffa_unknown_fields
11941    }
11942}
11943impl ::buffa::json_helpers::ProtoElemJson for GetRequest {
11944    fn serialize_proto_json<S: ::serde::Serializer>(
11945        v: &Self,
11946        s: S,
11947    ) -> ::core::result::Result<S::Ok, S::Error> {
11948        ::serde::Serialize::serialize(v, s)
11949    }
11950    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
11951        d: D,
11952    ) -> ::core::result::Result<Self, D::Error> {
11953        <Self as ::serde::Deserialize>::deserialize(d)
11954    }
11955}
11956#[doc(hidden)]
11957pub const __GET_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
11958    type_url: "type.googleapis.com/store.query.v1.GetRequest",
11959    to_json: ::buffa::type_registry::any_to_json::<GetRequest>,
11960    from_json: ::buffa::type_registry::any_from_json::<GetRequest>,
11961    is_wkt: false,
11962};
11963/// Point lookup request for a single key.
11964#[derive(Clone, Debug, Default)]
11965pub struct GetRequestView<'a> {
11966    /// The key to look up (max 254 bytes).
11967    ///
11968    /// Field 1: `key`
11969    pub key: &'a [u8],
11970    /// Optional freshness gate. See service-level comment.
11971    ///
11972    /// Field 2: `min_sequence_number`
11973    pub min_sequence_number: ::core::option::Option<u64>,
11974    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
11975}
11976impl<'a> GetRequestView<'a> {
11977    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
11978    ///
11979    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
11980    /// and by generated sub-message decode arms with `depth - 1`.
11981    ///
11982    /// **Not part of the public API.** Named with a leading underscore to
11983    /// signal that it is for generated-code use only.
11984    #[doc(hidden)]
11985    pub fn _decode_depth(
11986        buf: &'a [u8],
11987        depth: u32,
11988    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
11989        let mut view = Self::default();
11990        view._merge_into_view(buf, depth)?;
11991        ::core::result::Result::Ok(view)
11992    }
11993    /// Merge fields from `buf` into this view (proto merge semantics).
11994    ///
11995    /// Repeated fields append; singular fields last-wins; singular
11996    /// MESSAGE fields merge recursively. Used by sub-message decode
11997    /// arms when the same field appears multiple times on the wire.
11998    ///
11999    /// **Not part of the public API.**
12000    #[doc(hidden)]
12001    pub fn _merge_into_view(
12002        &mut self,
12003        buf: &'a [u8],
12004        depth: u32,
12005    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12006        let _ = depth;
12007        #[allow(unused_variables)]
12008        let view = self;
12009        let mut cur: &'a [u8] = buf;
12010        while !cur.is_empty() {
12011            let before_tag = cur;
12012            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
12013            match tag.field_number() {
12014                1u32 => {
12015                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12016                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12017                            field_number: 1u32,
12018                            expected: 2u8,
12019                            actual: tag.wire_type() as u8,
12020                        });
12021                    }
12022                    view.key = ::buffa::types::borrow_bytes(&mut cur)?;
12023                }
12024                2u32 => {
12025                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
12026                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12027                            field_number: 2u32,
12028                            expected: 0u8,
12029                            actual: tag.wire_type() as u8,
12030                        });
12031                    }
12032                    view.min_sequence_number = Some(
12033                        ::buffa::types::decode_uint64(&mut cur)?,
12034                    );
12035                }
12036                _ => {
12037                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
12038                    let span_len = before_tag.len() - cur.len();
12039                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
12040                }
12041            }
12042        }
12043        ::core::result::Result::Ok(())
12044    }
12045}
12046impl<'a> ::buffa::MessageView<'a> for GetRequestView<'a> {
12047    type Owned = GetRequest;
12048    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12049        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
12050    }
12051    fn decode_view_with_limit(
12052        buf: &'a [u8],
12053        depth: u32,
12054    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12055        Self::_decode_depth(buf, depth)
12056    }
12057    /// Convert this view to the owned message type.
12058    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
12059    fn to_owned_message(&self) -> GetRequest {
12060        #[allow(unused_imports)]
12061        use ::buffa::alloc::string::ToString as _;
12062        GetRequest {
12063            key: (self.key).to_vec(),
12064            min_sequence_number: self.min_sequence_number,
12065            __buffa_unknown_fields: self
12066                .__buffa_unknown_fields
12067                .to_owned()
12068                .unwrap_or_default()
12069                .into(),
12070            ..::core::default::Default::default()
12071        }
12072    }
12073}
12074unsafe impl ::buffa::DefaultViewInstance for GetRequestView<'static> {
12075    fn default_view_instance() -> &'static Self {
12076        static VALUE: ::buffa::__private::OnceBox<GetRequestView<'static>> = ::buffa::__private::OnceBox::new();
12077        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
12078    }
12079}
12080unsafe impl<'a> ::buffa::HasDefaultViewInstance for GetRequestView<'a> {
12081    type Static = GetRequestView<'static>;
12082}
12083/// Point lookup response.
12084#[derive(Clone, PartialEq, Default)]
12085#[derive(::serde::Serialize, ::serde::Deserialize)]
12086#[serde(default)]
12087pub struct GetResponse {
12088    /// The value associated with the key; absent when the key does not exist.
12089    ///
12090    /// Field 2: `value`
12091    #[serde(
12092        rename = "value",
12093        with = "::buffa::json_helpers::opt_bytes",
12094        skip_serializing_if = "Option::is_none"
12095    )]
12096    pub value: Option<::buffa::alloc::vec::Vec<u8>>,
12097    #[serde(skip)]
12098    #[doc(hidden)]
12099    pub __buffa_unknown_fields: ::buffa::UnknownFields,
12100    #[doc(hidden)]
12101    #[serde(skip)]
12102    pub __buffa_cached_size: ::buffa::__private::CachedSize,
12103}
12104impl ::core::fmt::Debug for GetResponse {
12105    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12106        f.debug_struct("GetResponse").field("value", &self.value).finish()
12107    }
12108}
12109impl GetResponse {
12110    /// Protobuf type URL for this message, for use with `Any::pack` and
12111    /// `Any::unpack_if`.
12112    ///
12113    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12114    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.GetResponse";
12115}
12116unsafe impl ::buffa::DefaultInstance for GetResponse {
12117    fn default_instance() -> &'static Self {
12118        static VALUE: ::buffa::__private::OnceBox<GetResponse> = ::buffa::__private::OnceBox::new();
12119        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
12120    }
12121}
12122impl ::buffa::Message for GetResponse {
12123    /// Returns the total encoded size in bytes.
12124    ///
12125    /// The result is a `u32`; the protobuf specification requires all
12126    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
12127    /// compliant message will never overflow this type.
12128    fn compute_size(&self) -> u32 {
12129        #[allow(unused_imports)]
12130        use ::buffa::Enumeration as _;
12131        let mut size = 0u32;
12132        if let Some(ref v) = self.value {
12133            size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
12134        }
12135        size += self.__buffa_unknown_fields.encoded_len() as u32;
12136        self.__buffa_cached_size.set(size);
12137        size
12138    }
12139    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
12140        #[allow(unused_imports)]
12141        use ::buffa::Enumeration as _;
12142        if let Some(ref v) = self.value {
12143            ::buffa::encoding::Tag::new(
12144                    2u32,
12145                    ::buffa::encoding::WireType::LengthDelimited,
12146                )
12147                .encode(buf);
12148            ::buffa::types::encode_bytes(v, buf);
12149        }
12150        self.__buffa_unknown_fields.write_to(buf);
12151    }
12152    fn merge_field(
12153        &mut self,
12154        tag: ::buffa::encoding::Tag,
12155        buf: &mut impl ::buffa::bytes::Buf,
12156        depth: u32,
12157    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12158        #[allow(unused_imports)]
12159        use ::buffa::bytes::Buf as _;
12160        #[allow(unused_imports)]
12161        use ::buffa::Enumeration as _;
12162        match tag.field_number() {
12163            2u32 => {
12164                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12165                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12166                        field_number: 2u32,
12167                        expected: 2u8,
12168                        actual: tag.wire_type() as u8,
12169                    });
12170                }
12171                ::buffa::types::merge_bytes(
12172                    self.value.get_or_insert_with(::buffa::alloc::vec::Vec::new),
12173                    buf,
12174                )?;
12175            }
12176            _ => {
12177                self.__buffa_unknown_fields
12178                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
12179            }
12180        }
12181        ::core::result::Result::Ok(())
12182    }
12183    fn cached_size(&self) -> u32 {
12184        self.__buffa_cached_size.get()
12185    }
12186    fn clear(&mut self) {
12187        self.value = ::core::option::Option::None;
12188        self.__buffa_unknown_fields.clear();
12189        self.__buffa_cached_size.set(0);
12190    }
12191}
12192impl ::buffa::ExtensionSet for GetResponse {
12193    const PROTO_FQN: &'static str = "store.query.v1.GetResponse";
12194    fn unknown_fields(&self) -> &::buffa::UnknownFields {
12195        &self.__buffa_unknown_fields
12196    }
12197    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12198        &mut self.__buffa_unknown_fields
12199    }
12200}
12201impl ::buffa::json_helpers::ProtoElemJson for GetResponse {
12202    fn serialize_proto_json<S: ::serde::Serializer>(
12203        v: &Self,
12204        s: S,
12205    ) -> ::core::result::Result<S::Ok, S::Error> {
12206        ::serde::Serialize::serialize(v, s)
12207    }
12208    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
12209        d: D,
12210    ) -> ::core::result::Result<Self, D::Error> {
12211        <Self as ::serde::Deserialize>::deserialize(d)
12212    }
12213}
12214#[doc(hidden)]
12215pub const __GET_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
12216    type_url: "type.googleapis.com/store.query.v1.GetResponse",
12217    to_json: ::buffa::type_registry::any_to_json::<GetResponse>,
12218    from_json: ::buffa::type_registry::any_from_json::<GetResponse>,
12219    is_wkt: false,
12220};
12221/// Point lookup response.
12222#[derive(Clone, Debug, Default)]
12223pub struct GetResponseView<'a> {
12224    /// The value associated with the key; absent when the key does not exist.
12225    ///
12226    /// Field 2: `value`
12227    pub value: ::core::option::Option<&'a [u8]>,
12228    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
12229}
12230impl<'a> GetResponseView<'a> {
12231    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
12232    ///
12233    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
12234    /// and by generated sub-message decode arms with `depth - 1`.
12235    ///
12236    /// **Not part of the public API.** Named with a leading underscore to
12237    /// signal that it is for generated-code use only.
12238    #[doc(hidden)]
12239    pub fn _decode_depth(
12240        buf: &'a [u8],
12241        depth: u32,
12242    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12243        let mut view = Self::default();
12244        view._merge_into_view(buf, depth)?;
12245        ::core::result::Result::Ok(view)
12246    }
12247    /// Merge fields from `buf` into this view (proto merge semantics).
12248    ///
12249    /// Repeated fields append; singular fields last-wins; singular
12250    /// MESSAGE fields merge recursively. Used by sub-message decode
12251    /// arms when the same field appears multiple times on the wire.
12252    ///
12253    /// **Not part of the public API.**
12254    #[doc(hidden)]
12255    pub fn _merge_into_view(
12256        &mut self,
12257        buf: &'a [u8],
12258        depth: u32,
12259    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12260        let _ = depth;
12261        #[allow(unused_variables)]
12262        let view = self;
12263        let mut cur: &'a [u8] = buf;
12264        while !cur.is_empty() {
12265            let before_tag = cur;
12266            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
12267            match tag.field_number() {
12268                2u32 => {
12269                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12270                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12271                            field_number: 2u32,
12272                            expected: 2u8,
12273                            actual: tag.wire_type() as u8,
12274                        });
12275                    }
12276                    view.value = Some(::buffa::types::borrow_bytes(&mut cur)?);
12277                }
12278                _ => {
12279                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
12280                    let span_len = before_tag.len() - cur.len();
12281                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
12282                }
12283            }
12284        }
12285        ::core::result::Result::Ok(())
12286    }
12287}
12288impl<'a> ::buffa::MessageView<'a> for GetResponseView<'a> {
12289    type Owned = GetResponse;
12290    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12291        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
12292    }
12293    fn decode_view_with_limit(
12294        buf: &'a [u8],
12295        depth: u32,
12296    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12297        Self::_decode_depth(buf, depth)
12298    }
12299    /// Convert this view to the owned message type.
12300    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
12301    fn to_owned_message(&self) -> GetResponse {
12302        #[allow(unused_imports)]
12303        use ::buffa::alloc::string::ToString as _;
12304        GetResponse {
12305            value: self.value.map(|b| (b).to_vec()),
12306            __buffa_unknown_fields: self
12307                .__buffa_unknown_fields
12308                .to_owned()
12309                .unwrap_or_default()
12310                .into(),
12311            ..::core::default::Default::default()
12312        }
12313    }
12314}
12315unsafe impl ::buffa::DefaultViewInstance for GetResponseView<'static> {
12316    fn default_view_instance() -> &'static Self {
12317        static VALUE: ::buffa::__private::OnceBox<GetResponseView<'static>> = ::buffa::__private::OnceBox::new();
12318        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
12319    }
12320}
12321unsafe impl<'a> ::buffa::HasDefaultViewInstance for GetResponseView<'a> {
12322    type Static = GetResponseView<'static>;
12323}
12324/// GetMany performs batch point lookups. Results stream back as frames, each
12325/// containing one or more entries. Each entry includes its key so results may
12326/// arrive in any order. Missing keys have `value` absent.
12327#[derive(Clone, PartialEq, Default)]
12328#[derive(::serde::Serialize, ::serde::Deserialize)]
12329#[serde(default)]
12330pub struct GetManyRequest {
12331    /// Field 1: `keys`
12332    #[serde(
12333        rename = "keys",
12334        with = "::buffa::json_helpers::proto_seq",
12335        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
12336    )]
12337    pub keys: ::buffa::alloc::vec::Vec<::buffa::alloc::vec::Vec<u8>>,
12338    /// Field 2: `min_sequence_number`
12339    #[serde(
12340        rename = "minSequenceNumber",
12341        alias = "min_sequence_number",
12342        with = "::buffa::json_helpers::opt_uint64",
12343        skip_serializing_if = "Option::is_none"
12344    )]
12345    pub min_sequence_number: Option<u64>,
12346    /// Field 3: `batch_size`
12347    #[serde(
12348        rename = "batchSize",
12349        alias = "batch_size",
12350        with = "::buffa::json_helpers::uint32",
12351        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
12352    )]
12353    pub batch_size: u32,
12354    #[serde(skip)]
12355    #[doc(hidden)]
12356    pub __buffa_unknown_fields: ::buffa::UnknownFields,
12357    #[doc(hidden)]
12358    #[serde(skip)]
12359    pub __buffa_cached_size: ::buffa::__private::CachedSize,
12360}
12361impl ::core::fmt::Debug for GetManyRequest {
12362    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12363        f.debug_struct("GetManyRequest")
12364            .field("keys", &self.keys)
12365            .field("min_sequence_number", &self.min_sequence_number)
12366            .field("batch_size", &self.batch_size)
12367            .finish()
12368    }
12369}
12370impl GetManyRequest {
12371    /// Protobuf type URL for this message, for use with `Any::pack` and
12372    /// `Any::unpack_if`.
12373    ///
12374    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12375    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.GetManyRequest";
12376}
12377unsafe impl ::buffa::DefaultInstance for GetManyRequest {
12378    fn default_instance() -> &'static Self {
12379        static VALUE: ::buffa::__private::OnceBox<GetManyRequest> = ::buffa::__private::OnceBox::new();
12380        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
12381    }
12382}
12383impl ::buffa::Message for GetManyRequest {
12384    /// Returns the total encoded size in bytes.
12385    ///
12386    /// The result is a `u32`; the protobuf specification requires all
12387    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
12388    /// compliant message will never overflow this type.
12389    fn compute_size(&self) -> u32 {
12390        #[allow(unused_imports)]
12391        use ::buffa::Enumeration as _;
12392        let mut size = 0u32;
12393        if let Some(v) = self.min_sequence_number {
12394            size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
12395        }
12396        if self.batch_size != 0u32 {
12397            size += 1u32 + ::buffa::types::uint32_encoded_len(self.batch_size) as u32;
12398        }
12399        for v in &self.keys {
12400            size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
12401        }
12402        size += self.__buffa_unknown_fields.encoded_len() as u32;
12403        self.__buffa_cached_size.set(size);
12404        size
12405    }
12406    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
12407        #[allow(unused_imports)]
12408        use ::buffa::Enumeration as _;
12409        if let Some(v) = self.min_sequence_number {
12410            ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
12411                .encode(buf);
12412            ::buffa::types::encode_uint64(v, buf);
12413        }
12414        if self.batch_size != 0u32 {
12415            ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
12416                .encode(buf);
12417            ::buffa::types::encode_uint32(self.batch_size, buf);
12418        }
12419        for v in &self.keys {
12420            ::buffa::encoding::Tag::new(
12421                    1u32,
12422                    ::buffa::encoding::WireType::LengthDelimited,
12423                )
12424                .encode(buf);
12425            ::buffa::types::encode_bytes(v, buf);
12426        }
12427        self.__buffa_unknown_fields.write_to(buf);
12428    }
12429    fn merge_field(
12430        &mut self,
12431        tag: ::buffa::encoding::Tag,
12432        buf: &mut impl ::buffa::bytes::Buf,
12433        depth: u32,
12434    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12435        #[allow(unused_imports)]
12436        use ::buffa::bytes::Buf as _;
12437        #[allow(unused_imports)]
12438        use ::buffa::Enumeration as _;
12439        match tag.field_number() {
12440            2u32 => {
12441                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
12442                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12443                        field_number: 2u32,
12444                        expected: 0u8,
12445                        actual: tag.wire_type() as u8,
12446                    });
12447                }
12448                self.min_sequence_number = ::core::option::Option::Some(
12449                    ::buffa::types::decode_uint64(buf)?,
12450                );
12451            }
12452            3u32 => {
12453                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
12454                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12455                        field_number: 3u32,
12456                        expected: 0u8,
12457                        actual: tag.wire_type() as u8,
12458                    });
12459                }
12460                self.batch_size = ::buffa::types::decode_uint32(buf)?;
12461            }
12462            1u32 => {
12463                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12464                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12465                        field_number: 1u32,
12466                        expected: 2u8,
12467                        actual: tag.wire_type() as u8,
12468                    });
12469                }
12470                self.keys.push(::buffa::types::decode_bytes(buf)?);
12471            }
12472            _ => {
12473                self.__buffa_unknown_fields
12474                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
12475            }
12476        }
12477        ::core::result::Result::Ok(())
12478    }
12479    fn cached_size(&self) -> u32 {
12480        self.__buffa_cached_size.get()
12481    }
12482    fn clear(&mut self) {
12483        self.min_sequence_number = ::core::option::Option::None;
12484        self.batch_size = 0u32;
12485        self.keys.clear();
12486        self.__buffa_unknown_fields.clear();
12487        self.__buffa_cached_size.set(0);
12488    }
12489}
12490impl ::buffa::ExtensionSet for GetManyRequest {
12491    const PROTO_FQN: &'static str = "store.query.v1.GetManyRequest";
12492    fn unknown_fields(&self) -> &::buffa::UnknownFields {
12493        &self.__buffa_unknown_fields
12494    }
12495    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12496        &mut self.__buffa_unknown_fields
12497    }
12498}
12499impl ::buffa::json_helpers::ProtoElemJson for GetManyRequest {
12500    fn serialize_proto_json<S: ::serde::Serializer>(
12501        v: &Self,
12502        s: S,
12503    ) -> ::core::result::Result<S::Ok, S::Error> {
12504        ::serde::Serialize::serialize(v, s)
12505    }
12506    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
12507        d: D,
12508    ) -> ::core::result::Result<Self, D::Error> {
12509        <Self as ::serde::Deserialize>::deserialize(d)
12510    }
12511}
12512#[doc(hidden)]
12513pub const __GET_MANY_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
12514    type_url: "type.googleapis.com/store.query.v1.GetManyRequest",
12515    to_json: ::buffa::type_registry::any_to_json::<GetManyRequest>,
12516    from_json: ::buffa::type_registry::any_from_json::<GetManyRequest>,
12517    is_wkt: false,
12518};
12519/// GetMany performs batch point lookups. Results stream back as frames, each
12520/// containing one or more entries. Each entry includes its key so results may
12521/// arrive in any order. Missing keys have `value` absent.
12522#[derive(Clone, Debug, Default)]
12523pub struct GetManyRequestView<'a> {
12524    /// Field 1: `keys`
12525    pub keys: ::buffa::RepeatedView<'a, &'a [u8]>,
12526    /// Field 2: `min_sequence_number`
12527    pub min_sequence_number: ::core::option::Option<u64>,
12528    /// Field 3: `batch_size`
12529    pub batch_size: u32,
12530    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
12531}
12532impl<'a> GetManyRequestView<'a> {
12533    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
12534    ///
12535    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
12536    /// and by generated sub-message decode arms with `depth - 1`.
12537    ///
12538    /// **Not part of the public API.** Named with a leading underscore to
12539    /// signal that it is for generated-code use only.
12540    #[doc(hidden)]
12541    pub fn _decode_depth(
12542        buf: &'a [u8],
12543        depth: u32,
12544    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12545        let mut view = Self::default();
12546        view._merge_into_view(buf, depth)?;
12547        ::core::result::Result::Ok(view)
12548    }
12549    /// Merge fields from `buf` into this view (proto merge semantics).
12550    ///
12551    /// Repeated fields append; singular fields last-wins; singular
12552    /// MESSAGE fields merge recursively. Used by sub-message decode
12553    /// arms when the same field appears multiple times on the wire.
12554    ///
12555    /// **Not part of the public API.**
12556    #[doc(hidden)]
12557    pub fn _merge_into_view(
12558        &mut self,
12559        buf: &'a [u8],
12560        depth: u32,
12561    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12562        let _ = depth;
12563        #[allow(unused_variables)]
12564        let view = self;
12565        let mut cur: &'a [u8] = buf;
12566        while !cur.is_empty() {
12567            let before_tag = cur;
12568            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
12569            match tag.field_number() {
12570                2u32 => {
12571                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
12572                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12573                            field_number: 2u32,
12574                            expected: 0u8,
12575                            actual: tag.wire_type() as u8,
12576                        });
12577                    }
12578                    view.min_sequence_number = Some(
12579                        ::buffa::types::decode_uint64(&mut cur)?,
12580                    );
12581                }
12582                3u32 => {
12583                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
12584                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12585                            field_number: 3u32,
12586                            expected: 0u8,
12587                            actual: tag.wire_type() as u8,
12588                        });
12589                    }
12590                    view.batch_size = ::buffa::types::decode_uint32(&mut cur)?;
12591                }
12592                1u32 => {
12593                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12594                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12595                            field_number: 1u32,
12596                            expected: 2u8,
12597                            actual: tag.wire_type() as u8,
12598                        });
12599                    }
12600                    view.keys.push(::buffa::types::borrow_bytes(&mut cur)?);
12601                }
12602                _ => {
12603                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
12604                    let span_len = before_tag.len() - cur.len();
12605                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
12606                }
12607            }
12608        }
12609        ::core::result::Result::Ok(())
12610    }
12611}
12612impl<'a> ::buffa::MessageView<'a> for GetManyRequestView<'a> {
12613    type Owned = GetManyRequest;
12614    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12615        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
12616    }
12617    fn decode_view_with_limit(
12618        buf: &'a [u8],
12619        depth: u32,
12620    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12621        Self::_decode_depth(buf, depth)
12622    }
12623    /// Convert this view to the owned message type.
12624    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
12625    fn to_owned_message(&self) -> GetManyRequest {
12626        #[allow(unused_imports)]
12627        use ::buffa::alloc::string::ToString as _;
12628        GetManyRequest {
12629            keys: self.keys.iter().map(|b| (b).to_vec()).collect(),
12630            min_sequence_number: self.min_sequence_number,
12631            batch_size: self.batch_size,
12632            __buffa_unknown_fields: self
12633                .__buffa_unknown_fields
12634                .to_owned()
12635                .unwrap_or_default()
12636                .into(),
12637            ..::core::default::Default::default()
12638        }
12639    }
12640}
12641unsafe impl ::buffa::DefaultViewInstance for GetManyRequestView<'static> {
12642    fn default_view_instance() -> &'static Self {
12643        static VALUE: ::buffa::__private::OnceBox<GetManyRequestView<'static>> = ::buffa::__private::OnceBox::new();
12644        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
12645    }
12646}
12647unsafe impl<'a> ::buffa::HasDefaultViewInstance for GetManyRequestView<'a> {
12648    type Static = GetManyRequestView<'static>;
12649}
12650/// A single entry in a GetMany response frame.
12651#[derive(Clone, PartialEq, Default)]
12652#[derive(::serde::Serialize, ::serde::Deserialize)]
12653#[serde(default)]
12654pub struct GetManyEntry {
12655    /// The looked-up key.
12656    ///
12657    /// Field 1: `key`
12658    #[serde(
12659        rename = "key",
12660        with = "::buffa::json_helpers::bytes",
12661        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
12662    )]
12663    pub key: ::buffa::alloc::vec::Vec<u8>,
12664    /// The value if the key exists; absent for missing keys.
12665    ///
12666    /// Field 2: `value`
12667    #[serde(
12668        rename = "value",
12669        with = "::buffa::json_helpers::opt_bytes",
12670        skip_serializing_if = "Option::is_none"
12671    )]
12672    pub value: Option<::buffa::alloc::vec::Vec<u8>>,
12673    #[serde(skip)]
12674    #[doc(hidden)]
12675    pub __buffa_unknown_fields: ::buffa::UnknownFields,
12676    #[doc(hidden)]
12677    #[serde(skip)]
12678    pub __buffa_cached_size: ::buffa::__private::CachedSize,
12679}
12680impl ::core::fmt::Debug for GetManyEntry {
12681    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12682        f.debug_struct("GetManyEntry")
12683            .field("key", &self.key)
12684            .field("value", &self.value)
12685            .finish()
12686    }
12687}
12688impl GetManyEntry {
12689    /// Protobuf type URL for this message, for use with `Any::pack` and
12690    /// `Any::unpack_if`.
12691    ///
12692    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12693    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.GetManyEntry";
12694}
12695unsafe impl ::buffa::DefaultInstance for GetManyEntry {
12696    fn default_instance() -> &'static Self {
12697        static VALUE: ::buffa::__private::OnceBox<GetManyEntry> = ::buffa::__private::OnceBox::new();
12698        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
12699    }
12700}
12701impl ::buffa::Message for GetManyEntry {
12702    /// Returns the total encoded size in bytes.
12703    ///
12704    /// The result is a `u32`; the protobuf specification requires all
12705    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
12706    /// compliant message will never overflow this type.
12707    fn compute_size(&self) -> u32 {
12708        #[allow(unused_imports)]
12709        use ::buffa::Enumeration as _;
12710        let mut size = 0u32;
12711        if !self.key.is_empty() {
12712            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.key) as u32;
12713        }
12714        if let Some(ref v) = self.value {
12715            size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
12716        }
12717        size += self.__buffa_unknown_fields.encoded_len() as u32;
12718        self.__buffa_cached_size.set(size);
12719        size
12720    }
12721    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
12722        #[allow(unused_imports)]
12723        use ::buffa::Enumeration as _;
12724        if !self.key.is_empty() {
12725            ::buffa::encoding::Tag::new(
12726                    1u32,
12727                    ::buffa::encoding::WireType::LengthDelimited,
12728                )
12729                .encode(buf);
12730            ::buffa::types::encode_bytes(&self.key, buf);
12731        }
12732        if let Some(ref v) = self.value {
12733            ::buffa::encoding::Tag::new(
12734                    2u32,
12735                    ::buffa::encoding::WireType::LengthDelimited,
12736                )
12737                .encode(buf);
12738            ::buffa::types::encode_bytes(v, buf);
12739        }
12740        self.__buffa_unknown_fields.write_to(buf);
12741    }
12742    fn merge_field(
12743        &mut self,
12744        tag: ::buffa::encoding::Tag,
12745        buf: &mut impl ::buffa::bytes::Buf,
12746        depth: u32,
12747    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12748        #[allow(unused_imports)]
12749        use ::buffa::bytes::Buf as _;
12750        #[allow(unused_imports)]
12751        use ::buffa::Enumeration as _;
12752        match tag.field_number() {
12753            1u32 => {
12754                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12755                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12756                        field_number: 1u32,
12757                        expected: 2u8,
12758                        actual: tag.wire_type() as u8,
12759                    });
12760                }
12761                ::buffa::types::merge_bytes(&mut self.key, buf)?;
12762            }
12763            2u32 => {
12764                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12765                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12766                        field_number: 2u32,
12767                        expected: 2u8,
12768                        actual: tag.wire_type() as u8,
12769                    });
12770                }
12771                ::buffa::types::merge_bytes(
12772                    self.value.get_or_insert_with(::buffa::alloc::vec::Vec::new),
12773                    buf,
12774                )?;
12775            }
12776            _ => {
12777                self.__buffa_unknown_fields
12778                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
12779            }
12780        }
12781        ::core::result::Result::Ok(())
12782    }
12783    fn cached_size(&self) -> u32 {
12784        self.__buffa_cached_size.get()
12785    }
12786    fn clear(&mut self) {
12787        self.key.clear();
12788        self.value = ::core::option::Option::None;
12789        self.__buffa_unknown_fields.clear();
12790        self.__buffa_cached_size.set(0);
12791    }
12792}
12793impl ::buffa::ExtensionSet for GetManyEntry {
12794    const PROTO_FQN: &'static str = "store.query.v1.GetManyEntry";
12795    fn unknown_fields(&self) -> &::buffa::UnknownFields {
12796        &self.__buffa_unknown_fields
12797    }
12798    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
12799        &mut self.__buffa_unknown_fields
12800    }
12801}
12802impl ::buffa::json_helpers::ProtoElemJson for GetManyEntry {
12803    fn serialize_proto_json<S: ::serde::Serializer>(
12804        v: &Self,
12805        s: S,
12806    ) -> ::core::result::Result<S::Ok, S::Error> {
12807        ::serde::Serialize::serialize(v, s)
12808    }
12809    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
12810        d: D,
12811    ) -> ::core::result::Result<Self, D::Error> {
12812        <Self as ::serde::Deserialize>::deserialize(d)
12813    }
12814}
12815#[doc(hidden)]
12816pub const __GET_MANY_ENTRY_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
12817    type_url: "type.googleapis.com/store.query.v1.GetManyEntry",
12818    to_json: ::buffa::type_registry::any_to_json::<GetManyEntry>,
12819    from_json: ::buffa::type_registry::any_from_json::<GetManyEntry>,
12820    is_wkt: false,
12821};
12822/// A single entry in a GetMany response frame.
12823#[derive(Clone, Debug, Default)]
12824pub struct GetManyEntryView<'a> {
12825    /// The looked-up key.
12826    ///
12827    /// Field 1: `key`
12828    pub key: &'a [u8],
12829    /// The value if the key exists; absent for missing keys.
12830    ///
12831    /// Field 2: `value`
12832    pub value: ::core::option::Option<&'a [u8]>,
12833    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
12834}
12835impl<'a> GetManyEntryView<'a> {
12836    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
12837    ///
12838    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
12839    /// and by generated sub-message decode arms with `depth - 1`.
12840    ///
12841    /// **Not part of the public API.** Named with a leading underscore to
12842    /// signal that it is for generated-code use only.
12843    #[doc(hidden)]
12844    pub fn _decode_depth(
12845        buf: &'a [u8],
12846        depth: u32,
12847    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12848        let mut view = Self::default();
12849        view._merge_into_view(buf, depth)?;
12850        ::core::result::Result::Ok(view)
12851    }
12852    /// Merge fields from `buf` into this view (proto merge semantics).
12853    ///
12854    /// Repeated fields append; singular fields last-wins; singular
12855    /// MESSAGE fields merge recursively. Used by sub-message decode
12856    /// arms when the same field appears multiple times on the wire.
12857    ///
12858    /// **Not part of the public API.**
12859    #[doc(hidden)]
12860    pub fn _merge_into_view(
12861        &mut self,
12862        buf: &'a [u8],
12863        depth: u32,
12864    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
12865        let _ = depth;
12866        #[allow(unused_variables)]
12867        let view = self;
12868        let mut cur: &'a [u8] = buf;
12869        while !cur.is_empty() {
12870            let before_tag = cur;
12871            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
12872            match tag.field_number() {
12873                1u32 => {
12874                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12875                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12876                            field_number: 1u32,
12877                            expected: 2u8,
12878                            actual: tag.wire_type() as u8,
12879                        });
12880                    }
12881                    view.key = ::buffa::types::borrow_bytes(&mut cur)?;
12882                }
12883                2u32 => {
12884                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
12885                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
12886                            field_number: 2u32,
12887                            expected: 2u8,
12888                            actual: tag.wire_type() as u8,
12889                        });
12890                    }
12891                    view.value = Some(::buffa::types::borrow_bytes(&mut cur)?);
12892                }
12893                _ => {
12894                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
12895                    let span_len = before_tag.len() - cur.len();
12896                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
12897                }
12898            }
12899        }
12900        ::core::result::Result::Ok(())
12901    }
12902}
12903impl<'a> ::buffa::MessageView<'a> for GetManyEntryView<'a> {
12904    type Owned = GetManyEntry;
12905    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12906        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
12907    }
12908    fn decode_view_with_limit(
12909        buf: &'a [u8],
12910        depth: u32,
12911    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
12912        Self::_decode_depth(buf, depth)
12913    }
12914    /// Convert this view to the owned message type.
12915    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
12916    fn to_owned_message(&self) -> GetManyEntry {
12917        #[allow(unused_imports)]
12918        use ::buffa::alloc::string::ToString as _;
12919        GetManyEntry {
12920            key: (self.key).to_vec(),
12921            value: self.value.map(|b| (b).to_vec()),
12922            __buffa_unknown_fields: self
12923                .__buffa_unknown_fields
12924                .to_owned()
12925                .unwrap_or_default()
12926                .into(),
12927            ..::core::default::Default::default()
12928        }
12929    }
12930}
12931unsafe impl ::buffa::DefaultViewInstance for GetManyEntryView<'static> {
12932    fn default_view_instance() -> &'static Self {
12933        static VALUE: ::buffa::__private::OnceBox<GetManyEntryView<'static>> = ::buffa::__private::OnceBox::new();
12934        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
12935    }
12936}
12937unsafe impl<'a> ::buffa::HasDefaultViewInstance for GetManyEntryView<'a> {
12938    type Static = GetManyEntryView<'static>;
12939}
12940/// A batch of GetMany lookup results.
12941#[derive(Clone, PartialEq, Default)]
12942#[derive(::serde::Serialize, ::serde::Deserialize)]
12943#[serde(default)]
12944pub struct GetManyFrame {
12945    /// Field 1: `results`
12946    #[serde(
12947        rename = "results",
12948        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
12949        deserialize_with = "::buffa::json_helpers::null_as_default"
12950    )]
12951    pub results: ::buffa::alloc::vec::Vec<GetManyEntry>,
12952    #[serde(skip)]
12953    #[doc(hidden)]
12954    pub __buffa_unknown_fields: ::buffa::UnknownFields,
12955    #[doc(hidden)]
12956    #[serde(skip)]
12957    pub __buffa_cached_size: ::buffa::__private::CachedSize,
12958}
12959impl ::core::fmt::Debug for GetManyFrame {
12960    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12961        f.debug_struct("GetManyFrame").field("results", &self.results).finish()
12962    }
12963}
12964impl GetManyFrame {
12965    /// Protobuf type URL for this message, for use with `Any::pack` and
12966    /// `Any::unpack_if`.
12967    ///
12968    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
12969    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.GetManyFrame";
12970}
12971unsafe impl ::buffa::DefaultInstance for GetManyFrame {
12972    fn default_instance() -> &'static Self {
12973        static VALUE: ::buffa::__private::OnceBox<GetManyFrame> = ::buffa::__private::OnceBox::new();
12974        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
12975    }
12976}
12977impl ::buffa::Message for GetManyFrame {
12978    /// Returns the total encoded size in bytes.
12979    ///
12980    /// The result is a `u32`; the protobuf specification requires all
12981    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
12982    /// compliant message will never overflow this type.
12983    fn compute_size(&self) -> u32 {
12984        #[allow(unused_imports)]
12985        use ::buffa::Enumeration as _;
12986        let mut size = 0u32;
12987        for v in &self.results {
12988            let inner_size = v.compute_size();
12989            size
12990                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
12991                    + inner_size;
12992        }
12993        size += self.__buffa_unknown_fields.encoded_len() as u32;
12994        self.__buffa_cached_size.set(size);
12995        size
12996    }
12997    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
12998        #[allow(unused_imports)]
12999        use ::buffa::Enumeration as _;
13000        for v in &self.results {
13001            ::buffa::encoding::Tag::new(
13002                    1u32,
13003                    ::buffa::encoding::WireType::LengthDelimited,
13004                )
13005                .encode(buf);
13006            ::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
13007            v.write_to(buf);
13008        }
13009        self.__buffa_unknown_fields.write_to(buf);
13010    }
13011    fn merge_field(
13012        &mut self,
13013        tag: ::buffa::encoding::Tag,
13014        buf: &mut impl ::buffa::bytes::Buf,
13015        depth: u32,
13016    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13017        #[allow(unused_imports)]
13018        use ::buffa::bytes::Buf as _;
13019        #[allow(unused_imports)]
13020        use ::buffa::Enumeration as _;
13021        match tag.field_number() {
13022            1u32 => {
13023                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13024                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13025                        field_number: 1u32,
13026                        expected: 2u8,
13027                        actual: tag.wire_type() as u8,
13028                    });
13029                }
13030                let mut elem = ::core::default::Default::default();
13031                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
13032                self.results.push(elem);
13033            }
13034            _ => {
13035                self.__buffa_unknown_fields
13036                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
13037            }
13038        }
13039        ::core::result::Result::Ok(())
13040    }
13041    fn cached_size(&self) -> u32 {
13042        self.__buffa_cached_size.get()
13043    }
13044    fn clear(&mut self) {
13045        self.results.clear();
13046        self.__buffa_unknown_fields.clear();
13047        self.__buffa_cached_size.set(0);
13048    }
13049}
13050impl ::buffa::ExtensionSet for GetManyFrame {
13051    const PROTO_FQN: &'static str = "store.query.v1.GetManyFrame";
13052    fn unknown_fields(&self) -> &::buffa::UnknownFields {
13053        &self.__buffa_unknown_fields
13054    }
13055    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
13056        &mut self.__buffa_unknown_fields
13057    }
13058}
13059impl ::buffa::json_helpers::ProtoElemJson for GetManyFrame {
13060    fn serialize_proto_json<S: ::serde::Serializer>(
13061        v: &Self,
13062        s: S,
13063    ) -> ::core::result::Result<S::Ok, S::Error> {
13064        ::serde::Serialize::serialize(v, s)
13065    }
13066    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
13067        d: D,
13068    ) -> ::core::result::Result<Self, D::Error> {
13069        <Self as ::serde::Deserialize>::deserialize(d)
13070    }
13071}
13072#[doc(hidden)]
13073pub const __GET_MANY_FRAME_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
13074    type_url: "type.googleapis.com/store.query.v1.GetManyFrame",
13075    to_json: ::buffa::type_registry::any_to_json::<GetManyFrame>,
13076    from_json: ::buffa::type_registry::any_from_json::<GetManyFrame>,
13077    is_wkt: false,
13078};
13079/// A batch of GetMany lookup results.
13080#[derive(Clone, Debug, Default)]
13081pub struct GetManyFrameView<'a> {
13082    /// Field 1: `results`
13083    pub results: ::buffa::RepeatedView<'a, GetManyEntryView<'a>>,
13084    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
13085}
13086impl<'a> GetManyFrameView<'a> {
13087    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
13088    ///
13089    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
13090    /// and by generated sub-message decode arms with `depth - 1`.
13091    ///
13092    /// **Not part of the public API.** Named with a leading underscore to
13093    /// signal that it is for generated-code use only.
13094    #[doc(hidden)]
13095    pub fn _decode_depth(
13096        buf: &'a [u8],
13097        depth: u32,
13098    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13099        let mut view = Self::default();
13100        view._merge_into_view(buf, depth)?;
13101        ::core::result::Result::Ok(view)
13102    }
13103    /// Merge fields from `buf` into this view (proto merge semantics).
13104    ///
13105    /// Repeated fields append; singular fields last-wins; singular
13106    /// MESSAGE fields merge recursively. Used by sub-message decode
13107    /// arms when the same field appears multiple times on the wire.
13108    ///
13109    /// **Not part of the public API.**
13110    #[doc(hidden)]
13111    pub fn _merge_into_view(
13112        &mut self,
13113        buf: &'a [u8],
13114        depth: u32,
13115    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13116        let _ = depth;
13117        #[allow(unused_variables)]
13118        let view = self;
13119        let mut cur: &'a [u8] = buf;
13120        while !cur.is_empty() {
13121            let before_tag = cur;
13122            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
13123            match tag.field_number() {
13124                1u32 => {
13125                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13126                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13127                            field_number: 1u32,
13128                            expected: 2u8,
13129                            actual: tag.wire_type() as u8,
13130                        });
13131                    }
13132                    if depth == 0 {
13133                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
13134                    }
13135                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
13136                    view.results.push(GetManyEntryView::_decode_depth(sub, depth - 1)?);
13137                }
13138                _ => {
13139                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
13140                    let span_len = before_tag.len() - cur.len();
13141                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
13142                }
13143            }
13144        }
13145        ::core::result::Result::Ok(())
13146    }
13147}
13148impl<'a> ::buffa::MessageView<'a> for GetManyFrameView<'a> {
13149    type Owned = GetManyFrame;
13150    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13151        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
13152    }
13153    fn decode_view_with_limit(
13154        buf: &'a [u8],
13155        depth: u32,
13156    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13157        Self::_decode_depth(buf, depth)
13158    }
13159    /// Convert this view to the owned message type.
13160    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
13161    fn to_owned_message(&self) -> GetManyFrame {
13162        #[allow(unused_imports)]
13163        use ::buffa::alloc::string::ToString as _;
13164        GetManyFrame {
13165            results: self.results.iter().map(|v| v.to_owned_message()).collect(),
13166            __buffa_unknown_fields: self
13167                .__buffa_unknown_fields
13168                .to_owned()
13169                .unwrap_or_default()
13170                .into(),
13171            ..::core::default::Default::default()
13172        }
13173    }
13174}
13175unsafe impl ::buffa::DefaultViewInstance for GetManyFrameView<'static> {
13176    fn default_view_instance() -> &'static Self {
13177        static VALUE: ::buffa::__private::OnceBox<GetManyFrameView<'static>> = ::buffa::__private::OnceBox::new();
13178        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
13179    }
13180}
13181unsafe impl<'a> ::buffa::HasDefaultViewInstance for GetManyFrameView<'a> {
13182    type Static = GetManyFrameView<'static>;
13183}
13184/// Range reads keys in lexicographic order over raw `bytes` keys.
13185///
13186/// Semantics match `StoreEngine::range_scan`: keys satisfy `start <= key <= end` when `end` is
13187/// non-empty (inclusive upper bound). When `end` is empty, the upper bound is unbounded (all keys
13188/// `>= start`). For prefix scans, pass the lexicographic maximum key of the prefix as `end`, or
13189/// use an empty `end` when scanning through the end of the keyspace is intended.
13190#[derive(Clone, PartialEq, Default)]
13191#[derive(::serde::Serialize, ::serde::Deserialize)]
13192#[serde(default)]
13193pub struct RangeRequest {
13194    /// Field 1: `start`
13195    #[serde(
13196        rename = "start",
13197        with = "::buffa::json_helpers::bytes",
13198        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
13199    )]
13200    pub start: ::buffa::alloc::vec::Vec<u8>,
13201    /// Empty means unbounded above.
13202    ///
13203    /// Field 2: `end`
13204    #[serde(
13205        rename = "end",
13206        with = "::buffa::json_helpers::bytes",
13207        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
13208    )]
13209    pub end: ::buffa::alloc::vec::Vec<u8>,
13210    /// Field 3: `limit`
13211    #[serde(
13212        rename = "limit",
13213        with = "::buffa::json_helpers::opt_uint32",
13214        skip_serializing_if = "Option::is_none"
13215    )]
13216    pub limit: Option<u32>,
13217    /// Field 4: `batch_size`
13218    #[serde(
13219        rename = "batchSize",
13220        alias = "batch_size",
13221        with = "::buffa::json_helpers::uint32",
13222        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
13223    )]
13224    pub batch_size: u32,
13225    /// Field 5: `mode`
13226    #[serde(
13227        rename = "mode",
13228        with = "::buffa::json_helpers::proto_enum",
13229        skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
13230    )]
13231    pub mode: ::buffa::EnumValue<TraversalMode>,
13232    /// Field 6: `min_sequence_number`
13233    #[serde(
13234        rename = "minSequenceNumber",
13235        alias = "min_sequence_number",
13236        with = "::buffa::json_helpers::opt_uint64",
13237        skip_serializing_if = "Option::is_none"
13238    )]
13239    pub min_sequence_number: Option<u64>,
13240    #[serde(skip)]
13241    #[doc(hidden)]
13242    pub __buffa_unknown_fields: ::buffa::UnknownFields,
13243    #[doc(hidden)]
13244    #[serde(skip)]
13245    pub __buffa_cached_size: ::buffa::__private::CachedSize,
13246}
13247impl ::core::fmt::Debug for RangeRequest {
13248    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13249        f.debug_struct("RangeRequest")
13250            .field("start", &self.start)
13251            .field("end", &self.end)
13252            .field("limit", &self.limit)
13253            .field("batch_size", &self.batch_size)
13254            .field("mode", &self.mode)
13255            .field("min_sequence_number", &self.min_sequence_number)
13256            .finish()
13257    }
13258}
13259impl RangeRequest {
13260    /// Protobuf type URL for this message, for use with `Any::pack` and
13261    /// `Any::unpack_if`.
13262    ///
13263    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
13264    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.RangeRequest";
13265}
13266unsafe impl ::buffa::DefaultInstance for RangeRequest {
13267    fn default_instance() -> &'static Self {
13268        static VALUE: ::buffa::__private::OnceBox<RangeRequest> = ::buffa::__private::OnceBox::new();
13269        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
13270    }
13271}
13272impl ::buffa::Message for RangeRequest {
13273    /// Returns the total encoded size in bytes.
13274    ///
13275    /// The result is a `u32`; the protobuf specification requires all
13276    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
13277    /// compliant message will never overflow this type.
13278    fn compute_size(&self) -> u32 {
13279        #[allow(unused_imports)]
13280        use ::buffa::Enumeration as _;
13281        let mut size = 0u32;
13282        if !self.start.is_empty() {
13283            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.start) as u32;
13284        }
13285        if !self.end.is_empty() {
13286            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.end) as u32;
13287        }
13288        if let Some(v) = self.limit {
13289            size += 1u32 + ::buffa::types::uint32_encoded_len(v) as u32;
13290        }
13291        if self.batch_size != 0u32 {
13292            size += 1u32 + ::buffa::types::uint32_encoded_len(self.batch_size) as u32;
13293        }
13294        {
13295            let val = self.mode.to_i32();
13296            if val != 0 {
13297                size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
13298            }
13299        }
13300        if let Some(v) = self.min_sequence_number {
13301            size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
13302        }
13303        size += self.__buffa_unknown_fields.encoded_len() as u32;
13304        self.__buffa_cached_size.set(size);
13305        size
13306    }
13307    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
13308        #[allow(unused_imports)]
13309        use ::buffa::Enumeration as _;
13310        if !self.start.is_empty() {
13311            ::buffa::encoding::Tag::new(
13312                    1u32,
13313                    ::buffa::encoding::WireType::LengthDelimited,
13314                )
13315                .encode(buf);
13316            ::buffa::types::encode_bytes(&self.start, buf);
13317        }
13318        if !self.end.is_empty() {
13319            ::buffa::encoding::Tag::new(
13320                    2u32,
13321                    ::buffa::encoding::WireType::LengthDelimited,
13322                )
13323                .encode(buf);
13324            ::buffa::types::encode_bytes(&self.end, buf);
13325        }
13326        if let Some(v) = self.limit {
13327            ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
13328                .encode(buf);
13329            ::buffa::types::encode_uint32(v, buf);
13330        }
13331        if self.batch_size != 0u32 {
13332            ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
13333                .encode(buf);
13334            ::buffa::types::encode_uint32(self.batch_size, buf);
13335        }
13336        {
13337            let val = self.mode.to_i32();
13338            if val != 0 {
13339                ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
13340                    .encode(buf);
13341                ::buffa::types::encode_int32(val, buf);
13342            }
13343        }
13344        if let Some(v) = self.min_sequence_number {
13345            ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
13346                .encode(buf);
13347            ::buffa::types::encode_uint64(v, buf);
13348        }
13349        self.__buffa_unknown_fields.write_to(buf);
13350    }
13351    fn merge_field(
13352        &mut self,
13353        tag: ::buffa::encoding::Tag,
13354        buf: &mut impl ::buffa::bytes::Buf,
13355        depth: u32,
13356    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13357        #[allow(unused_imports)]
13358        use ::buffa::bytes::Buf as _;
13359        #[allow(unused_imports)]
13360        use ::buffa::Enumeration as _;
13361        match tag.field_number() {
13362            1u32 => {
13363                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13364                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13365                        field_number: 1u32,
13366                        expected: 2u8,
13367                        actual: tag.wire_type() as u8,
13368                    });
13369                }
13370                ::buffa::types::merge_bytes(&mut self.start, buf)?;
13371            }
13372            2u32 => {
13373                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13374                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13375                        field_number: 2u32,
13376                        expected: 2u8,
13377                        actual: tag.wire_type() as u8,
13378                    });
13379                }
13380                ::buffa::types::merge_bytes(&mut self.end, buf)?;
13381            }
13382            3u32 => {
13383                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13384                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13385                        field_number: 3u32,
13386                        expected: 0u8,
13387                        actual: tag.wire_type() as u8,
13388                    });
13389                }
13390                self.limit = ::core::option::Option::Some(
13391                    ::buffa::types::decode_uint32(buf)?,
13392                );
13393            }
13394            4u32 => {
13395                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13396                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13397                        field_number: 4u32,
13398                        expected: 0u8,
13399                        actual: tag.wire_type() as u8,
13400                    });
13401                }
13402                self.batch_size = ::buffa::types::decode_uint32(buf)?;
13403            }
13404            5u32 => {
13405                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13406                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13407                        field_number: 5u32,
13408                        expected: 0u8,
13409                        actual: tag.wire_type() as u8,
13410                    });
13411                }
13412                self.mode = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
13413            }
13414            6u32 => {
13415                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13416                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13417                        field_number: 6u32,
13418                        expected: 0u8,
13419                        actual: tag.wire_type() as u8,
13420                    });
13421                }
13422                self.min_sequence_number = ::core::option::Option::Some(
13423                    ::buffa::types::decode_uint64(buf)?,
13424                );
13425            }
13426            _ => {
13427                self.__buffa_unknown_fields
13428                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
13429            }
13430        }
13431        ::core::result::Result::Ok(())
13432    }
13433    fn cached_size(&self) -> u32 {
13434        self.__buffa_cached_size.get()
13435    }
13436    fn clear(&mut self) {
13437        self.start.clear();
13438        self.end.clear();
13439        self.limit = ::core::option::Option::None;
13440        self.batch_size = 0u32;
13441        self.mode = ::buffa::EnumValue::from(0);
13442        self.min_sequence_number = ::core::option::Option::None;
13443        self.__buffa_unknown_fields.clear();
13444        self.__buffa_cached_size.set(0);
13445    }
13446}
13447impl ::buffa::ExtensionSet for RangeRequest {
13448    const PROTO_FQN: &'static str = "store.query.v1.RangeRequest";
13449    fn unknown_fields(&self) -> &::buffa::UnknownFields {
13450        &self.__buffa_unknown_fields
13451    }
13452    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
13453        &mut self.__buffa_unknown_fields
13454    }
13455}
13456impl ::buffa::json_helpers::ProtoElemJson for RangeRequest {
13457    fn serialize_proto_json<S: ::serde::Serializer>(
13458        v: &Self,
13459        s: S,
13460    ) -> ::core::result::Result<S::Ok, S::Error> {
13461        ::serde::Serialize::serialize(v, s)
13462    }
13463    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
13464        d: D,
13465    ) -> ::core::result::Result<Self, D::Error> {
13466        <Self as ::serde::Deserialize>::deserialize(d)
13467    }
13468}
13469#[doc(hidden)]
13470pub const __RANGE_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
13471    type_url: "type.googleapis.com/store.query.v1.RangeRequest",
13472    to_json: ::buffa::type_registry::any_to_json::<RangeRequest>,
13473    from_json: ::buffa::type_registry::any_from_json::<RangeRequest>,
13474    is_wkt: false,
13475};
13476/// Range reads keys in lexicographic order over raw `bytes` keys.
13477///
13478/// Semantics match `StoreEngine::range_scan`: keys satisfy `start <= key <= end` when `end` is
13479/// non-empty (inclusive upper bound). When `end` is empty, the upper bound is unbounded (all keys
13480/// `>= start`). For prefix scans, pass the lexicographic maximum key of the prefix as `end`, or
13481/// use an empty `end` when scanning through the end of the keyspace is intended.
13482#[derive(Clone, Debug, Default)]
13483pub struct RangeRequestView<'a> {
13484    /// Field 1: `start`
13485    pub start: &'a [u8],
13486    /// Empty means unbounded above.
13487    ///
13488    /// Field 2: `end`
13489    pub end: &'a [u8],
13490    /// Field 3: `limit`
13491    pub limit: ::core::option::Option<u32>,
13492    /// Field 4: `batch_size`
13493    pub batch_size: u32,
13494    /// Field 5: `mode`
13495    pub mode: ::buffa::EnumValue<TraversalMode>,
13496    /// Field 6: `min_sequence_number`
13497    pub min_sequence_number: ::core::option::Option<u64>,
13498    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
13499}
13500impl<'a> RangeRequestView<'a> {
13501    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
13502    ///
13503    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
13504    /// and by generated sub-message decode arms with `depth - 1`.
13505    ///
13506    /// **Not part of the public API.** Named with a leading underscore to
13507    /// signal that it is for generated-code use only.
13508    #[doc(hidden)]
13509    pub fn _decode_depth(
13510        buf: &'a [u8],
13511        depth: u32,
13512    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13513        let mut view = Self::default();
13514        view._merge_into_view(buf, depth)?;
13515        ::core::result::Result::Ok(view)
13516    }
13517    /// Merge fields from `buf` into this view (proto merge semantics).
13518    ///
13519    /// Repeated fields append; singular fields last-wins; singular
13520    /// MESSAGE fields merge recursively. Used by sub-message decode
13521    /// arms when the same field appears multiple times on the wire.
13522    ///
13523    /// **Not part of the public API.**
13524    #[doc(hidden)]
13525    pub fn _merge_into_view(
13526        &mut self,
13527        buf: &'a [u8],
13528        depth: u32,
13529    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13530        let _ = depth;
13531        #[allow(unused_variables)]
13532        let view = self;
13533        let mut cur: &'a [u8] = buf;
13534        while !cur.is_empty() {
13535            let before_tag = cur;
13536            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
13537            match tag.field_number() {
13538                1u32 => {
13539                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13540                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13541                            field_number: 1u32,
13542                            expected: 2u8,
13543                            actual: tag.wire_type() as u8,
13544                        });
13545                    }
13546                    view.start = ::buffa::types::borrow_bytes(&mut cur)?;
13547                }
13548                2u32 => {
13549                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13550                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13551                            field_number: 2u32,
13552                            expected: 2u8,
13553                            actual: tag.wire_type() as u8,
13554                        });
13555                    }
13556                    view.end = ::buffa::types::borrow_bytes(&mut cur)?;
13557                }
13558                3u32 => {
13559                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13560                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13561                            field_number: 3u32,
13562                            expected: 0u8,
13563                            actual: tag.wire_type() as u8,
13564                        });
13565                    }
13566                    view.limit = Some(::buffa::types::decode_uint32(&mut cur)?);
13567                }
13568                4u32 => {
13569                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13570                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13571                            field_number: 4u32,
13572                            expected: 0u8,
13573                            actual: tag.wire_type() as u8,
13574                        });
13575                    }
13576                    view.batch_size = ::buffa::types::decode_uint32(&mut cur)?;
13577                }
13578                5u32 => {
13579                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13580                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13581                            field_number: 5u32,
13582                            expected: 0u8,
13583                            actual: tag.wire_type() as u8,
13584                        });
13585                    }
13586                    view.mode = ::buffa::EnumValue::from(
13587                        ::buffa::types::decode_int32(&mut cur)?,
13588                    );
13589                }
13590                6u32 => {
13591                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
13592                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13593                            field_number: 6u32,
13594                            expected: 0u8,
13595                            actual: tag.wire_type() as u8,
13596                        });
13597                    }
13598                    view.min_sequence_number = Some(
13599                        ::buffa::types::decode_uint64(&mut cur)?,
13600                    );
13601                }
13602                _ => {
13603                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
13604                    let span_len = before_tag.len() - cur.len();
13605                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
13606                }
13607            }
13608        }
13609        ::core::result::Result::Ok(())
13610    }
13611}
13612impl<'a> ::buffa::MessageView<'a> for RangeRequestView<'a> {
13613    type Owned = RangeRequest;
13614    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13615        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
13616    }
13617    fn decode_view_with_limit(
13618        buf: &'a [u8],
13619        depth: u32,
13620    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13621        Self::_decode_depth(buf, depth)
13622    }
13623    /// Convert this view to the owned message type.
13624    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
13625    fn to_owned_message(&self) -> RangeRequest {
13626        #[allow(unused_imports)]
13627        use ::buffa::alloc::string::ToString as _;
13628        RangeRequest {
13629            start: (self.start).to_vec(),
13630            end: (self.end).to_vec(),
13631            limit: self.limit,
13632            batch_size: self.batch_size,
13633            mode: self.mode,
13634            min_sequence_number: self.min_sequence_number,
13635            __buffa_unknown_fields: self
13636                .__buffa_unknown_fields
13637                .to_owned()
13638                .unwrap_or_default()
13639                .into(),
13640            ..::core::default::Default::default()
13641        }
13642    }
13643}
13644unsafe impl ::buffa::DefaultViewInstance for RangeRequestView<'static> {
13645    fn default_view_instance() -> &'static Self {
13646        static VALUE: ::buffa::__private::OnceBox<RangeRequestView<'static>> = ::buffa::__private::OnceBox::new();
13647        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
13648    }
13649}
13650unsafe impl<'a> ::buffa::HasDefaultViewInstance for RangeRequestView<'a> {
13651    type Static = RangeRequestView<'static>;
13652}
13653/// Each stream message is a batch of rows; the stream ends at HTTP END_STREAM.
13654/// `Detail` (sequence + read_stats) is carried only in trailers (`x-store-query-detail-bin`).
13655#[derive(Clone, PartialEq, Default)]
13656#[derive(::serde::Serialize, ::serde::Deserialize)]
13657#[serde(default)]
13658pub struct RangeFrame {
13659    /// Field 1: `results`
13660    #[serde(
13661        rename = "results",
13662        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
13663        deserialize_with = "::buffa::json_helpers::null_as_default"
13664    )]
13665    pub results: ::buffa::alloc::vec::Vec<super::super::common::v1::KvEntry>,
13666    #[serde(skip)]
13667    #[doc(hidden)]
13668    pub __buffa_unknown_fields: ::buffa::UnknownFields,
13669    #[doc(hidden)]
13670    #[serde(skip)]
13671    pub __buffa_cached_size: ::buffa::__private::CachedSize,
13672}
13673impl ::core::fmt::Debug for RangeFrame {
13674    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13675        f.debug_struct("RangeFrame").field("results", &self.results).finish()
13676    }
13677}
13678impl RangeFrame {
13679    /// Protobuf type URL for this message, for use with `Any::pack` and
13680    /// `Any::unpack_if`.
13681    ///
13682    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
13683    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.RangeFrame";
13684}
13685unsafe impl ::buffa::DefaultInstance for RangeFrame {
13686    fn default_instance() -> &'static Self {
13687        static VALUE: ::buffa::__private::OnceBox<RangeFrame> = ::buffa::__private::OnceBox::new();
13688        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
13689    }
13690}
13691impl ::buffa::Message for RangeFrame {
13692    /// Returns the total encoded size in bytes.
13693    ///
13694    /// The result is a `u32`; the protobuf specification requires all
13695    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
13696    /// compliant message will never overflow this type.
13697    fn compute_size(&self) -> u32 {
13698        #[allow(unused_imports)]
13699        use ::buffa::Enumeration as _;
13700        let mut size = 0u32;
13701        for v in &self.results {
13702            let inner_size = v.compute_size();
13703            size
13704                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
13705                    + inner_size;
13706        }
13707        size += self.__buffa_unknown_fields.encoded_len() as u32;
13708        self.__buffa_cached_size.set(size);
13709        size
13710    }
13711    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
13712        #[allow(unused_imports)]
13713        use ::buffa::Enumeration as _;
13714        for v in &self.results {
13715            ::buffa::encoding::Tag::new(
13716                    1u32,
13717                    ::buffa::encoding::WireType::LengthDelimited,
13718                )
13719                .encode(buf);
13720            ::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
13721            v.write_to(buf);
13722        }
13723        self.__buffa_unknown_fields.write_to(buf);
13724    }
13725    fn merge_field(
13726        &mut self,
13727        tag: ::buffa::encoding::Tag,
13728        buf: &mut impl ::buffa::bytes::Buf,
13729        depth: u32,
13730    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13731        #[allow(unused_imports)]
13732        use ::buffa::bytes::Buf as _;
13733        #[allow(unused_imports)]
13734        use ::buffa::Enumeration as _;
13735        match tag.field_number() {
13736            1u32 => {
13737                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13738                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13739                        field_number: 1u32,
13740                        expected: 2u8,
13741                        actual: tag.wire_type() as u8,
13742                    });
13743                }
13744                let mut elem = ::core::default::Default::default();
13745                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
13746                self.results.push(elem);
13747            }
13748            _ => {
13749                self.__buffa_unknown_fields
13750                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
13751            }
13752        }
13753        ::core::result::Result::Ok(())
13754    }
13755    fn cached_size(&self) -> u32 {
13756        self.__buffa_cached_size.get()
13757    }
13758    fn clear(&mut self) {
13759        self.results.clear();
13760        self.__buffa_unknown_fields.clear();
13761        self.__buffa_cached_size.set(0);
13762    }
13763}
13764impl ::buffa::ExtensionSet for RangeFrame {
13765    const PROTO_FQN: &'static str = "store.query.v1.RangeFrame";
13766    fn unknown_fields(&self) -> &::buffa::UnknownFields {
13767        &self.__buffa_unknown_fields
13768    }
13769    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
13770        &mut self.__buffa_unknown_fields
13771    }
13772}
13773impl ::buffa::json_helpers::ProtoElemJson for RangeFrame {
13774    fn serialize_proto_json<S: ::serde::Serializer>(
13775        v: &Self,
13776        s: S,
13777    ) -> ::core::result::Result<S::Ok, S::Error> {
13778        ::serde::Serialize::serialize(v, s)
13779    }
13780    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
13781        d: D,
13782    ) -> ::core::result::Result<Self, D::Error> {
13783        <Self as ::serde::Deserialize>::deserialize(d)
13784    }
13785}
13786#[doc(hidden)]
13787pub const __RANGE_FRAME_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
13788    type_url: "type.googleapis.com/store.query.v1.RangeFrame",
13789    to_json: ::buffa::type_registry::any_to_json::<RangeFrame>,
13790    from_json: ::buffa::type_registry::any_from_json::<RangeFrame>,
13791    is_wkt: false,
13792};
13793/// Each stream message is a batch of rows; the stream ends at HTTP END_STREAM.
13794/// `Detail` (sequence + read_stats) is carried only in trailers (`x-store-query-detail-bin`).
13795#[derive(Clone, Debug, Default)]
13796pub struct RangeFrameView<'a> {
13797    /// Field 1: `results`
13798    pub results: ::buffa::RepeatedView<'a, super::super::common::v1::KvEntryView<'a>>,
13799    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
13800}
13801impl<'a> RangeFrameView<'a> {
13802    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
13803    ///
13804    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
13805    /// and by generated sub-message decode arms with `depth - 1`.
13806    ///
13807    /// **Not part of the public API.** Named with a leading underscore to
13808    /// signal that it is for generated-code use only.
13809    #[doc(hidden)]
13810    pub fn _decode_depth(
13811        buf: &'a [u8],
13812        depth: u32,
13813    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13814        let mut view = Self::default();
13815        view._merge_into_view(buf, depth)?;
13816        ::core::result::Result::Ok(view)
13817    }
13818    /// Merge fields from `buf` into this view (proto merge semantics).
13819    ///
13820    /// Repeated fields append; singular fields last-wins; singular
13821    /// MESSAGE fields merge recursively. Used by sub-message decode
13822    /// arms when the same field appears multiple times on the wire.
13823    ///
13824    /// **Not part of the public API.**
13825    #[doc(hidden)]
13826    pub fn _merge_into_view(
13827        &mut self,
13828        buf: &'a [u8],
13829        depth: u32,
13830    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
13831        let _ = depth;
13832        #[allow(unused_variables)]
13833        let view = self;
13834        let mut cur: &'a [u8] = buf;
13835        while !cur.is_empty() {
13836            let before_tag = cur;
13837            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
13838            match tag.field_number() {
13839                1u32 => {
13840                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
13841                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
13842                            field_number: 1u32,
13843                            expected: 2u8,
13844                            actual: tag.wire_type() as u8,
13845                        });
13846                    }
13847                    if depth == 0 {
13848                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
13849                    }
13850                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
13851                    view.results
13852                        .push(
13853                            super::super::common::v1::KvEntryView::_decode_depth(
13854                                sub,
13855                                depth - 1,
13856                            )?,
13857                        );
13858                }
13859                _ => {
13860                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
13861                    let span_len = before_tag.len() - cur.len();
13862                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
13863                }
13864            }
13865        }
13866        ::core::result::Result::Ok(())
13867    }
13868}
13869impl<'a> ::buffa::MessageView<'a> for RangeFrameView<'a> {
13870    type Owned = RangeFrame;
13871    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13872        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
13873    }
13874    fn decode_view_with_limit(
13875        buf: &'a [u8],
13876        depth: u32,
13877    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
13878        Self::_decode_depth(buf, depth)
13879    }
13880    /// Convert this view to the owned message type.
13881    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
13882    fn to_owned_message(&self) -> RangeFrame {
13883        #[allow(unused_imports)]
13884        use ::buffa::alloc::string::ToString as _;
13885        RangeFrame {
13886            results: self.results.iter().map(|v| v.to_owned_message()).collect(),
13887            __buffa_unknown_fields: self
13888                .__buffa_unknown_fields
13889                .to_owned()
13890                .unwrap_or_default()
13891                .into(),
13892            ..::core::default::Default::default()
13893        }
13894    }
13895}
13896unsafe impl ::buffa::DefaultViewInstance for RangeFrameView<'static> {
13897    fn default_view_instance() -> &'static Self {
13898        static VALUE: ::buffa::__private::OnceBox<RangeFrameView<'static>> = ::buffa::__private::OnceBox::new();
13899        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
13900    }
13901}
13902unsafe impl<'a> ::buffa::HasDefaultViewInstance for RangeFrameView<'a> {
13903    type Static = RangeFrameView<'static>;
13904}
13905/// Same key-range semantics as `RangeRequest`: inclusive `[start, end]` over raw bytes when `end` is
13906/// non-empty; empty `end` means unbounded above.
13907#[derive(Clone, PartialEq, Default)]
13908#[derive(::serde::Serialize, ::serde::Deserialize)]
13909#[serde(default)]
13910pub struct ReduceRequest {
13911    /// Field 1: `start`
13912    #[serde(
13913        rename = "start",
13914        with = "::buffa::json_helpers::bytes",
13915        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
13916    )]
13917    pub start: ::buffa::alloc::vec::Vec<u8>,
13918    /// Empty means unbounded above.
13919    ///
13920    /// Field 2: `end`
13921    #[serde(
13922        rename = "end",
13923        with = "::buffa::json_helpers::bytes",
13924        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
13925    )]
13926    pub end: ::buffa::alloc::vec::Vec<u8>,
13927    /// Field 3: `params`
13928    #[serde(
13929        rename = "params",
13930        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
13931    )]
13932    pub params: ::buffa::MessageField<ReduceParams>,
13933    /// Field 4: `min_sequence_number`
13934    #[serde(
13935        rename = "minSequenceNumber",
13936        alias = "min_sequence_number",
13937        with = "::buffa::json_helpers::opt_uint64",
13938        skip_serializing_if = "Option::is_none"
13939    )]
13940    pub min_sequence_number: Option<u64>,
13941    #[serde(skip)]
13942    #[doc(hidden)]
13943    pub __buffa_unknown_fields: ::buffa::UnknownFields,
13944    #[doc(hidden)]
13945    #[serde(skip)]
13946    pub __buffa_cached_size: ::buffa::__private::CachedSize,
13947}
13948impl ::core::fmt::Debug for ReduceRequest {
13949    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13950        f.debug_struct("ReduceRequest")
13951            .field("start", &self.start)
13952            .field("end", &self.end)
13953            .field("params", &self.params)
13954            .field("min_sequence_number", &self.min_sequence_number)
13955            .finish()
13956    }
13957}
13958impl ReduceRequest {
13959    /// Protobuf type URL for this message, for use with `Any::pack` and
13960    /// `Any::unpack_if`.
13961    ///
13962    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
13963    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.ReduceRequest";
13964}
13965unsafe impl ::buffa::DefaultInstance for ReduceRequest {
13966    fn default_instance() -> &'static Self {
13967        static VALUE: ::buffa::__private::OnceBox<ReduceRequest> = ::buffa::__private::OnceBox::new();
13968        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
13969    }
13970}
13971impl ::buffa::Message for ReduceRequest {
13972    /// Returns the total encoded size in bytes.
13973    ///
13974    /// The result is a `u32`; the protobuf specification requires all
13975    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
13976    /// compliant message will never overflow this type.
13977    fn compute_size(&self) -> u32 {
13978        #[allow(unused_imports)]
13979        use ::buffa::Enumeration as _;
13980        let mut size = 0u32;
13981        if !self.start.is_empty() {
13982            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.start) as u32;
13983        }
13984        if !self.end.is_empty() {
13985            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.end) as u32;
13986        }
13987        if self.params.is_set() {
13988            let inner_size = self.params.compute_size();
13989            size
13990                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
13991                    + inner_size;
13992        }
13993        if let Some(v) = self.min_sequence_number {
13994            size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
13995        }
13996        size += self.__buffa_unknown_fields.encoded_len() as u32;
13997        self.__buffa_cached_size.set(size);
13998        size
13999    }
14000    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
14001        #[allow(unused_imports)]
14002        use ::buffa::Enumeration as _;
14003        if !self.start.is_empty() {
14004            ::buffa::encoding::Tag::new(
14005                    1u32,
14006                    ::buffa::encoding::WireType::LengthDelimited,
14007                )
14008                .encode(buf);
14009            ::buffa::types::encode_bytes(&self.start, buf);
14010        }
14011        if !self.end.is_empty() {
14012            ::buffa::encoding::Tag::new(
14013                    2u32,
14014                    ::buffa::encoding::WireType::LengthDelimited,
14015                )
14016                .encode(buf);
14017            ::buffa::types::encode_bytes(&self.end, buf);
14018        }
14019        if self.params.is_set() {
14020            ::buffa::encoding::Tag::new(
14021                    3u32,
14022                    ::buffa::encoding::WireType::LengthDelimited,
14023                )
14024                .encode(buf);
14025            ::buffa::encoding::encode_varint(self.params.cached_size() as u64, buf);
14026            self.params.write_to(buf);
14027        }
14028        if let Some(v) = self.min_sequence_number {
14029            ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
14030                .encode(buf);
14031            ::buffa::types::encode_uint64(v, buf);
14032        }
14033        self.__buffa_unknown_fields.write_to(buf);
14034    }
14035    fn merge_field(
14036        &mut self,
14037        tag: ::buffa::encoding::Tag,
14038        buf: &mut impl ::buffa::bytes::Buf,
14039        depth: u32,
14040    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
14041        #[allow(unused_imports)]
14042        use ::buffa::bytes::Buf as _;
14043        #[allow(unused_imports)]
14044        use ::buffa::Enumeration as _;
14045        match tag.field_number() {
14046            1u32 => {
14047                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14048                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14049                        field_number: 1u32,
14050                        expected: 2u8,
14051                        actual: tag.wire_type() as u8,
14052                    });
14053                }
14054                ::buffa::types::merge_bytes(&mut self.start, buf)?;
14055            }
14056            2u32 => {
14057                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14058                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14059                        field_number: 2u32,
14060                        expected: 2u8,
14061                        actual: tag.wire_type() as u8,
14062                    });
14063                }
14064                ::buffa::types::merge_bytes(&mut self.end, buf)?;
14065            }
14066            3u32 => {
14067                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14068                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14069                        field_number: 3u32,
14070                        expected: 2u8,
14071                        actual: tag.wire_type() as u8,
14072                    });
14073                }
14074                ::buffa::Message::merge_length_delimited(
14075                    self.params.get_or_insert_default(),
14076                    buf,
14077                    depth,
14078                )?;
14079            }
14080            4u32 => {
14081                if tag.wire_type() != ::buffa::encoding::WireType::Varint {
14082                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14083                        field_number: 4u32,
14084                        expected: 0u8,
14085                        actual: tag.wire_type() as u8,
14086                    });
14087                }
14088                self.min_sequence_number = ::core::option::Option::Some(
14089                    ::buffa::types::decode_uint64(buf)?,
14090                );
14091            }
14092            _ => {
14093                self.__buffa_unknown_fields
14094                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
14095            }
14096        }
14097        ::core::result::Result::Ok(())
14098    }
14099    fn cached_size(&self) -> u32 {
14100        self.__buffa_cached_size.get()
14101    }
14102    fn clear(&mut self) {
14103        self.start.clear();
14104        self.end.clear();
14105        self.params = ::buffa::MessageField::none();
14106        self.min_sequence_number = ::core::option::Option::None;
14107        self.__buffa_unknown_fields.clear();
14108        self.__buffa_cached_size.set(0);
14109    }
14110}
14111impl ::buffa::ExtensionSet for ReduceRequest {
14112    const PROTO_FQN: &'static str = "store.query.v1.ReduceRequest";
14113    fn unknown_fields(&self) -> &::buffa::UnknownFields {
14114        &self.__buffa_unknown_fields
14115    }
14116    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
14117        &mut self.__buffa_unknown_fields
14118    }
14119}
14120impl ::buffa::json_helpers::ProtoElemJson for ReduceRequest {
14121    fn serialize_proto_json<S: ::serde::Serializer>(
14122        v: &Self,
14123        s: S,
14124    ) -> ::core::result::Result<S::Ok, S::Error> {
14125        ::serde::Serialize::serialize(v, s)
14126    }
14127    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14128        d: D,
14129    ) -> ::core::result::Result<Self, D::Error> {
14130        <Self as ::serde::Deserialize>::deserialize(d)
14131    }
14132}
14133#[doc(hidden)]
14134pub const __REDUCE_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
14135    type_url: "type.googleapis.com/store.query.v1.ReduceRequest",
14136    to_json: ::buffa::type_registry::any_to_json::<ReduceRequest>,
14137    from_json: ::buffa::type_registry::any_from_json::<ReduceRequest>,
14138    is_wkt: false,
14139};
14140/// Same key-range semantics as `RangeRequest`: inclusive `[start, end]` over raw bytes when `end` is
14141/// non-empty; empty `end` means unbounded above.
14142#[derive(Clone, Debug, Default)]
14143pub struct ReduceRequestView<'a> {
14144    /// Field 1: `start`
14145    pub start: &'a [u8],
14146    /// Empty means unbounded above.
14147    ///
14148    /// Field 2: `end`
14149    pub end: &'a [u8],
14150    /// Field 3: `params`
14151    pub params: ::buffa::MessageFieldView<ReduceParamsView<'a>>,
14152    /// Field 4: `min_sequence_number`
14153    pub min_sequence_number: ::core::option::Option<u64>,
14154    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
14155}
14156impl<'a> ReduceRequestView<'a> {
14157    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
14158    ///
14159    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
14160    /// and by generated sub-message decode arms with `depth - 1`.
14161    ///
14162    /// **Not part of the public API.** Named with a leading underscore to
14163    /// signal that it is for generated-code use only.
14164    #[doc(hidden)]
14165    pub fn _decode_depth(
14166        buf: &'a [u8],
14167        depth: u32,
14168    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14169        let mut view = Self::default();
14170        view._merge_into_view(buf, depth)?;
14171        ::core::result::Result::Ok(view)
14172    }
14173    /// Merge fields from `buf` into this view (proto merge semantics).
14174    ///
14175    /// Repeated fields append; singular fields last-wins; singular
14176    /// MESSAGE fields merge recursively. Used by sub-message decode
14177    /// arms when the same field appears multiple times on the wire.
14178    ///
14179    /// **Not part of the public API.**
14180    #[doc(hidden)]
14181    pub fn _merge_into_view(
14182        &mut self,
14183        buf: &'a [u8],
14184        depth: u32,
14185    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
14186        let _ = depth;
14187        #[allow(unused_variables)]
14188        let view = self;
14189        let mut cur: &'a [u8] = buf;
14190        while !cur.is_empty() {
14191            let before_tag = cur;
14192            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
14193            match tag.field_number() {
14194                1u32 => {
14195                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14196                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14197                            field_number: 1u32,
14198                            expected: 2u8,
14199                            actual: tag.wire_type() as u8,
14200                        });
14201                    }
14202                    view.start = ::buffa::types::borrow_bytes(&mut cur)?;
14203                }
14204                2u32 => {
14205                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14206                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14207                            field_number: 2u32,
14208                            expected: 2u8,
14209                            actual: tag.wire_type() as u8,
14210                        });
14211                    }
14212                    view.end = ::buffa::types::borrow_bytes(&mut cur)?;
14213                }
14214                3u32 => {
14215                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14216                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14217                            field_number: 3u32,
14218                            expected: 2u8,
14219                            actual: tag.wire_type() as u8,
14220                        });
14221                    }
14222                    if depth == 0 {
14223                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
14224                    }
14225                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
14226                    match view.params.as_mut() {
14227                        Some(existing) => existing._merge_into_view(sub, depth - 1)?,
14228                        None => {
14229                            view.params = ::buffa::MessageFieldView::set(
14230                                ReduceParamsView::_decode_depth(sub, depth - 1)?,
14231                            );
14232                        }
14233                    }
14234                }
14235                4u32 => {
14236                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
14237                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14238                            field_number: 4u32,
14239                            expected: 0u8,
14240                            actual: tag.wire_type() as u8,
14241                        });
14242                    }
14243                    view.min_sequence_number = Some(
14244                        ::buffa::types::decode_uint64(&mut cur)?,
14245                    );
14246                }
14247                _ => {
14248                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
14249                    let span_len = before_tag.len() - cur.len();
14250                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
14251                }
14252            }
14253        }
14254        ::core::result::Result::Ok(())
14255    }
14256}
14257impl<'a> ::buffa::MessageView<'a> for ReduceRequestView<'a> {
14258    type Owned = ReduceRequest;
14259    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14260        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
14261    }
14262    fn decode_view_with_limit(
14263        buf: &'a [u8],
14264        depth: u32,
14265    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14266        Self::_decode_depth(buf, depth)
14267    }
14268    /// Convert this view to the owned message type.
14269    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
14270    fn to_owned_message(&self) -> ReduceRequest {
14271        #[allow(unused_imports)]
14272        use ::buffa::alloc::string::ToString as _;
14273        ReduceRequest {
14274            start: (self.start).to_vec(),
14275            end: (self.end).to_vec(),
14276            params: match self.params.as_option() {
14277                Some(v) => {
14278                    ::buffa::MessageField::<ReduceParams>::some(v.to_owned_message())
14279                }
14280                None => ::buffa::MessageField::none(),
14281            },
14282            min_sequence_number: self.min_sequence_number,
14283            __buffa_unknown_fields: self
14284                .__buffa_unknown_fields
14285                .to_owned()
14286                .unwrap_or_default()
14287                .into(),
14288            ..::core::default::Default::default()
14289        }
14290    }
14291}
14292unsafe impl ::buffa::DefaultViewInstance for ReduceRequestView<'static> {
14293    fn default_view_instance() -> &'static Self {
14294        static VALUE: ::buffa::__private::OnceBox<ReduceRequestView<'static>> = ::buffa::__private::OnceBox::new();
14295        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
14296    }
14297}
14298unsafe impl<'a> ::buffa::HasDefaultViewInstance for ReduceRequestView<'a> {
14299    type Static = ReduceRequestView<'static>;
14300}
14301/// Response from a Reduce RPC. Exactly one of `results` or `groups` is
14302/// populated depending on whether `ReduceParams.group_by` was empty.
14303#[derive(Clone, PartialEq, Default)]
14304#[derive(::serde::Serialize, ::serde::Deserialize)]
14305#[serde(default)]
14306pub struct ReduceResponse {
14307    /// Scalar reducer results (one per `ReduceParams.reducers` entry). Populated
14308    /// only when `group_by` is empty.
14309    ///
14310    /// Field 1: `results`
14311    #[serde(
14312        rename = "results",
14313        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
14314        deserialize_with = "::buffa::json_helpers::null_as_default"
14315    )]
14316    pub results: ::buffa::alloc::vec::Vec<RangeReduceResult>,
14317    /// Per-group reducer results. Populated only when `group_by` is non-empty.
14318    ///
14319    /// Field 2: `groups`
14320    #[serde(
14321        rename = "groups",
14322        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
14323        deserialize_with = "::buffa::json_helpers::null_as_default"
14324    )]
14325    pub groups: ::buffa::alloc::vec::Vec<RangeReduceGroup>,
14326    #[serde(skip)]
14327    #[doc(hidden)]
14328    pub __buffa_unknown_fields: ::buffa::UnknownFields,
14329    #[doc(hidden)]
14330    #[serde(skip)]
14331    pub __buffa_cached_size: ::buffa::__private::CachedSize,
14332}
14333impl ::core::fmt::Debug for ReduceResponse {
14334    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
14335        f.debug_struct("ReduceResponse")
14336            .field("results", &self.results)
14337            .field("groups", &self.groups)
14338            .finish()
14339    }
14340}
14341impl ReduceResponse {
14342    /// Protobuf type URL for this message, for use with `Any::pack` and
14343    /// `Any::unpack_if`.
14344    ///
14345    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
14346    pub const TYPE_URL: &'static str = "type.googleapis.com/store.query.v1.ReduceResponse";
14347}
14348unsafe impl ::buffa::DefaultInstance for ReduceResponse {
14349    fn default_instance() -> &'static Self {
14350        static VALUE: ::buffa::__private::OnceBox<ReduceResponse> = ::buffa::__private::OnceBox::new();
14351        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
14352    }
14353}
14354impl ::buffa::Message for ReduceResponse {
14355    /// Returns the total encoded size in bytes.
14356    ///
14357    /// The result is a `u32`; the protobuf specification requires all
14358    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
14359    /// compliant message will never overflow this type.
14360    fn compute_size(&self) -> u32 {
14361        #[allow(unused_imports)]
14362        use ::buffa::Enumeration as _;
14363        let mut size = 0u32;
14364        for v in &self.results {
14365            let inner_size = v.compute_size();
14366            size
14367                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
14368                    + inner_size;
14369        }
14370        for v in &self.groups {
14371            let inner_size = v.compute_size();
14372            size
14373                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
14374                    + inner_size;
14375        }
14376        size += self.__buffa_unknown_fields.encoded_len() as u32;
14377        self.__buffa_cached_size.set(size);
14378        size
14379    }
14380    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
14381        #[allow(unused_imports)]
14382        use ::buffa::Enumeration as _;
14383        for v in &self.results {
14384            ::buffa::encoding::Tag::new(
14385                    1u32,
14386                    ::buffa::encoding::WireType::LengthDelimited,
14387                )
14388                .encode(buf);
14389            ::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
14390            v.write_to(buf);
14391        }
14392        for v in &self.groups {
14393            ::buffa::encoding::Tag::new(
14394                    2u32,
14395                    ::buffa::encoding::WireType::LengthDelimited,
14396                )
14397                .encode(buf);
14398            ::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
14399            v.write_to(buf);
14400        }
14401        self.__buffa_unknown_fields.write_to(buf);
14402    }
14403    fn merge_field(
14404        &mut self,
14405        tag: ::buffa::encoding::Tag,
14406        buf: &mut impl ::buffa::bytes::Buf,
14407        depth: u32,
14408    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
14409        #[allow(unused_imports)]
14410        use ::buffa::bytes::Buf as _;
14411        #[allow(unused_imports)]
14412        use ::buffa::Enumeration as _;
14413        match tag.field_number() {
14414            1u32 => {
14415                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14416                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14417                        field_number: 1u32,
14418                        expected: 2u8,
14419                        actual: tag.wire_type() as u8,
14420                    });
14421                }
14422                let mut elem = ::core::default::Default::default();
14423                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
14424                self.results.push(elem);
14425            }
14426            2u32 => {
14427                if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14428                    return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14429                        field_number: 2u32,
14430                        expected: 2u8,
14431                        actual: tag.wire_type() as u8,
14432                    });
14433                }
14434                let mut elem = ::core::default::Default::default();
14435                ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
14436                self.groups.push(elem);
14437            }
14438            _ => {
14439                self.__buffa_unknown_fields
14440                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
14441            }
14442        }
14443        ::core::result::Result::Ok(())
14444    }
14445    fn cached_size(&self) -> u32 {
14446        self.__buffa_cached_size.get()
14447    }
14448    fn clear(&mut self) {
14449        self.results.clear();
14450        self.groups.clear();
14451        self.__buffa_unknown_fields.clear();
14452        self.__buffa_cached_size.set(0);
14453    }
14454}
14455impl ::buffa::ExtensionSet for ReduceResponse {
14456    const PROTO_FQN: &'static str = "store.query.v1.ReduceResponse";
14457    fn unknown_fields(&self) -> &::buffa::UnknownFields {
14458        &self.__buffa_unknown_fields
14459    }
14460    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
14461        &mut self.__buffa_unknown_fields
14462    }
14463}
14464impl ::buffa::json_helpers::ProtoElemJson for ReduceResponse {
14465    fn serialize_proto_json<S: ::serde::Serializer>(
14466        v: &Self,
14467        s: S,
14468    ) -> ::core::result::Result<S::Ok, S::Error> {
14469        ::serde::Serialize::serialize(v, s)
14470    }
14471    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
14472        d: D,
14473    ) -> ::core::result::Result<Self, D::Error> {
14474        <Self as ::serde::Deserialize>::deserialize(d)
14475    }
14476}
14477#[doc(hidden)]
14478pub const __REDUCE_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
14479    type_url: "type.googleapis.com/store.query.v1.ReduceResponse",
14480    to_json: ::buffa::type_registry::any_to_json::<ReduceResponse>,
14481    from_json: ::buffa::type_registry::any_from_json::<ReduceResponse>,
14482    is_wkt: false,
14483};
14484/// Response from a Reduce RPC. Exactly one of `results` or `groups` is
14485/// populated depending on whether `ReduceParams.group_by` was empty.
14486#[derive(Clone, Debug, Default)]
14487pub struct ReduceResponseView<'a> {
14488    /// Scalar reducer results (one per `ReduceParams.reducers` entry). Populated
14489    /// only when `group_by` is empty.
14490    ///
14491    /// Field 1: `results`
14492    pub results: ::buffa::RepeatedView<'a, RangeReduceResultView<'a>>,
14493    /// Per-group reducer results. Populated only when `group_by` is non-empty.
14494    ///
14495    /// Field 2: `groups`
14496    pub groups: ::buffa::RepeatedView<'a, RangeReduceGroupView<'a>>,
14497    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
14498}
14499impl<'a> ReduceResponseView<'a> {
14500    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
14501    ///
14502    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
14503    /// and by generated sub-message decode arms with `depth - 1`.
14504    ///
14505    /// **Not part of the public API.** Named with a leading underscore to
14506    /// signal that it is for generated-code use only.
14507    #[doc(hidden)]
14508    pub fn _decode_depth(
14509        buf: &'a [u8],
14510        depth: u32,
14511    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14512        let mut view = Self::default();
14513        view._merge_into_view(buf, depth)?;
14514        ::core::result::Result::Ok(view)
14515    }
14516    /// Merge fields from `buf` into this view (proto merge semantics).
14517    ///
14518    /// Repeated fields append; singular fields last-wins; singular
14519    /// MESSAGE fields merge recursively. Used by sub-message decode
14520    /// arms when the same field appears multiple times on the wire.
14521    ///
14522    /// **Not part of the public API.**
14523    #[doc(hidden)]
14524    pub fn _merge_into_view(
14525        &mut self,
14526        buf: &'a [u8],
14527        depth: u32,
14528    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
14529        let _ = depth;
14530        #[allow(unused_variables)]
14531        let view = self;
14532        let mut cur: &'a [u8] = buf;
14533        while !cur.is_empty() {
14534            let before_tag = cur;
14535            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
14536            match tag.field_number() {
14537                1u32 => {
14538                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14539                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14540                            field_number: 1u32,
14541                            expected: 2u8,
14542                            actual: tag.wire_type() as u8,
14543                        });
14544                    }
14545                    if depth == 0 {
14546                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
14547                    }
14548                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
14549                    view.results
14550                        .push(RangeReduceResultView::_decode_depth(sub, depth - 1)?);
14551                }
14552                2u32 => {
14553                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
14554                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
14555                            field_number: 2u32,
14556                            expected: 2u8,
14557                            actual: tag.wire_type() as u8,
14558                        });
14559                    }
14560                    if depth == 0 {
14561                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
14562                    }
14563                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
14564                    view.groups
14565                        .push(RangeReduceGroupView::_decode_depth(sub, depth - 1)?);
14566                }
14567                _ => {
14568                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
14569                    let span_len = before_tag.len() - cur.len();
14570                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
14571                }
14572            }
14573        }
14574        ::core::result::Result::Ok(())
14575    }
14576}
14577impl<'a> ::buffa::MessageView<'a> for ReduceResponseView<'a> {
14578    type Owned = ReduceResponse;
14579    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14580        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
14581    }
14582    fn decode_view_with_limit(
14583        buf: &'a [u8],
14584        depth: u32,
14585    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
14586        Self::_decode_depth(buf, depth)
14587    }
14588    /// Convert this view to the owned message type.
14589    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
14590    fn to_owned_message(&self) -> ReduceResponse {
14591        #[allow(unused_imports)]
14592        use ::buffa::alloc::string::ToString as _;
14593        ReduceResponse {
14594            results: self.results.iter().map(|v| v.to_owned_message()).collect(),
14595            groups: self.groups.iter().map(|v| v.to_owned_message()).collect(),
14596            __buffa_unknown_fields: self
14597                .__buffa_unknown_fields
14598                .to_owned()
14599                .unwrap_or_default()
14600                .into(),
14601            ..::core::default::Default::default()
14602        }
14603    }
14604}
14605unsafe impl ::buffa::DefaultViewInstance for ReduceResponseView<'static> {
14606    fn default_view_instance() -> &'static Self {
14607        static VALUE: ::buffa::__private::OnceBox<ReduceResponseView<'static>> = ::buffa::__private::OnceBox::new();
14608        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
14609    }
14610}
14611unsafe impl<'a> ::buffa::HasDefaultViewInstance for ReduceResponseView<'a> {
14612    type Static = ReduceResponseView<'static>;
14613}
14614
14615/// Full service name for this service.
14616pub const SERVICE_SERVICE_NAME: &str = "store.query.v1.Service";
14617/// Server trait for Service.
14618///
14619/// # Implementing handlers
14620///
14621/// Handlers receive requests as `OwnedView<FooView<'static>>`, which gives
14622/// zero-copy borrowed access to fields (e.g. `request.name` is a `&str`
14623/// into the decoded buffer). The view can be held across `.await` points.
14624///
14625/// Implement methods with plain `async fn`; the returned future satisfies
14626/// the `Send` bound automatically. See the
14627/// [buffa user guide](https://github.com/anthropics/buffa/blob/main/docs/guide.md#ownedview-in-async-trait-implementations)
14628/// for zero-copy access patterns and when `to_owned_message()` is needed.
14629#[allow(clippy::type_complexity)]
14630pub trait Service: Send + Sync + 'static {
14631    /// Point lookup of a single key.
14632    fn get(
14633        &self,
14634        ctx: ::connectrpc::Context,
14635        request: ::buffa::view::OwnedView<GetRequestView<'static>>,
14636    ) -> impl ::std::future::Future<
14637        Output = Result<(GetResponse, ::connectrpc::Context), ::connectrpc::ConnectError>,
14638    > + Send;
14639    /// Batch point lookup of multiple keys, streamed back in frames.
14640    fn get_many(
14641        &self,
14642        ctx: ::connectrpc::Context,
14643        request: ::buffa::view::OwnedView<GetManyRequestView<'static>>,
14644    ) -> impl ::std::future::Future<
14645        Output = Result<
14646            (
14647                ::std::pin::Pin<
14648                    Box<
14649                        dyn ::futures::Stream<
14650                            Item = Result<GetManyFrame, ::connectrpc::ConnectError>,
14651                        > + Send,
14652                    >,
14653                >,
14654                ::connectrpc::Context,
14655            ),
14656            ::connectrpc::ConnectError,
14657        >,
14658    > + Send;
14659    /// Lexicographic range scan, streamed back in batched frames.
14660    fn range(
14661        &self,
14662        ctx: ::connectrpc::Context,
14663        request: ::buffa::view::OwnedView<RangeRequestView<'static>>,
14664    ) -> impl ::std::future::Future<
14665        Output = Result<
14666            (
14667                ::std::pin::Pin<
14668                    Box<
14669                        dyn ::futures::Stream<
14670                            Item = Result<RangeFrame, ::connectrpc::ConnectError>,
14671                        > + Send,
14672                    >,
14673                >,
14674                ::connectrpc::Context,
14675            ),
14676            ::connectrpc::ConnectError,
14677        >,
14678    > + Send;
14679    /// Server-side aggregation over a key range with optional grouping and
14680    /// filtering.
14681    fn reduce(
14682        &self,
14683        ctx: ::connectrpc::Context,
14684        request: ::buffa::view::OwnedView<ReduceRequestView<'static>>,
14685    ) -> impl ::std::future::Future<
14686        Output = Result<
14687            (ReduceResponse, ::connectrpc::Context),
14688            ::connectrpc::ConnectError,
14689        >,
14690    > + Send;
14691}
14692/// Extension trait for registering a service implementation with a Router.
14693///
14694/// This trait is automatically implemented for all types that implement the service trait.
14695///
14696/// # Example
14697///
14698/// ```rust,ignore
14699/// use std::sync::Arc;
14700///
14701/// let service = Arc::new(MyServiceImpl);
14702/// let router = service.register(Router::new());
14703/// ```
14704pub trait ServiceExt: Service {
14705    /// Register this service implementation with a Router.
14706    ///
14707    /// Takes ownership of the `Arc<Self>` and returns a new Router with
14708    /// this service's methods registered.
14709    fn register(
14710        self: ::std::sync::Arc<Self>,
14711        router: ::connectrpc::Router,
14712    ) -> ::connectrpc::Router;
14713}
14714impl<S: Service> ServiceExt for S {
14715    fn register(
14716        self: ::std::sync::Arc<Self>,
14717        router: ::connectrpc::Router,
14718    ) -> ::connectrpc::Router {
14719        router
14720            .route_view_idempotent(
14721                SERVICE_SERVICE_NAME,
14722                "Get",
14723                {
14724                    let svc = ::std::sync::Arc::clone(&self);
14725                    ::connectrpc::view_handler_fn(move |ctx, req| {
14726                        let svc = ::std::sync::Arc::clone(&svc);
14727                        async move { svc.get(ctx, req).await }
14728                    })
14729                },
14730            )
14731            .route_view_server_stream(
14732                SERVICE_SERVICE_NAME,
14733                "GetMany",
14734                ::connectrpc::view_streaming_handler_fn({
14735                    let svc = ::std::sync::Arc::clone(&self);
14736                    move |ctx, req| {
14737                        let svc = ::std::sync::Arc::clone(&svc);
14738                        async move { svc.get_many(ctx, req).await }
14739                    }
14740                }),
14741            )
14742            .route_view_server_stream(
14743                SERVICE_SERVICE_NAME,
14744                "Range",
14745                ::connectrpc::view_streaming_handler_fn({
14746                    let svc = ::std::sync::Arc::clone(&self);
14747                    move |ctx, req| {
14748                        let svc = ::std::sync::Arc::clone(&svc);
14749                        async move { svc.range(ctx, req).await }
14750                    }
14751                }),
14752            )
14753            .route_view_idempotent(
14754                SERVICE_SERVICE_NAME,
14755                "Reduce",
14756                {
14757                    let svc = ::std::sync::Arc::clone(&self);
14758                    ::connectrpc::view_handler_fn(move |ctx, req| {
14759                        let svc = ::std::sync::Arc::clone(&svc);
14760                        async move { svc.reduce(ctx, req).await }
14761                    })
14762                },
14763            )
14764    }
14765}
14766/// Monomorphic dispatcher for `Service`.
14767///
14768/// Unlike `.register(Router)` which type-erases each method into an `Arc<dyn ErasedHandler>` stored in a `HashMap`, this struct dispatches via a compile-time `match` on method name: no vtable, no hash lookup.
14769///
14770/// # Example
14771///
14772/// ```rust,ignore
14773/// use connectrpc::ConnectRpcService;
14774///
14775/// let server = ServiceServer::new(MyImpl);
14776/// let service = ConnectRpcService::new(server);
14777/// // hand `service` to axum/hyper as a fallback_service
14778/// ```
14779pub struct ServiceServer<T> {
14780    inner: ::std::sync::Arc<T>,
14781}
14782impl<T: Service> ServiceServer<T> {
14783    /// Wrap a service implementation in a monomorphic dispatcher.
14784    pub fn new(service: T) -> Self {
14785        Self {
14786            inner: ::std::sync::Arc::new(service),
14787        }
14788    }
14789    /// Wrap an already-`Arc`'d service implementation.
14790    pub fn from_arc(inner: ::std::sync::Arc<T>) -> Self {
14791        Self { inner }
14792    }
14793}
14794impl<T> Clone for ServiceServer<T> {
14795    fn clone(&self) -> Self {
14796        Self {
14797            inner: ::std::sync::Arc::clone(&self.inner),
14798        }
14799    }
14800}
14801impl<T: Service> ::connectrpc::Dispatcher for ServiceServer<T> {
14802    #[inline]
14803    fn lookup(
14804        &self,
14805        path: &str,
14806    ) -> Option<::connectrpc::dispatcher::codegen::MethodDescriptor> {
14807        let method = path.strip_prefix("store.query.v1.Service/")?;
14808        match method {
14809            "Get" => {
14810                Some(::connectrpc::dispatcher::codegen::MethodDescriptor::unary(true))
14811            }
14812            "GetMany" => {
14813                Some(
14814                    ::connectrpc::dispatcher::codegen::MethodDescriptor::server_streaming(),
14815                )
14816            }
14817            "Range" => {
14818                Some(
14819                    ::connectrpc::dispatcher::codegen::MethodDescriptor::server_streaming(),
14820                )
14821            }
14822            "Reduce" => {
14823                Some(::connectrpc::dispatcher::codegen::MethodDescriptor::unary(true))
14824            }
14825            _ => None,
14826        }
14827    }
14828    fn call_unary(
14829        &self,
14830        path: &str,
14831        ctx: ::connectrpc::Context,
14832        request: ::buffa::bytes::Bytes,
14833        format: ::connectrpc::CodecFormat,
14834    ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
14835        let Some(method) = path.strip_prefix("store.query.v1.Service/") else {
14836            return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
14837        };
14838        let _ = (&ctx, &request, &format);
14839        match method {
14840            "Get" => {
14841                let svc = ::std::sync::Arc::clone(&self.inner);
14842                Box::pin(async move {
14843                    let req = ::connectrpc::dispatcher::codegen::decode_request_view::<
14844                        GetRequestView,
14845                    >(request, format)?;
14846                    let (res, ctx) = svc.get(ctx, req).await?;
14847                    let bytes = ::connectrpc::dispatcher::codegen::encode_response(
14848                        &res,
14849                        format,
14850                    )?;
14851                    Ok((bytes, ctx))
14852                })
14853            }
14854            "Reduce" => {
14855                let svc = ::std::sync::Arc::clone(&self.inner);
14856                Box::pin(async move {
14857                    let req = ::connectrpc::dispatcher::codegen::decode_request_view::<
14858                        ReduceRequestView,
14859                    >(request, format)?;
14860                    let (res, ctx) = svc.reduce(ctx, req).await?;
14861                    let bytes = ::connectrpc::dispatcher::codegen::encode_response(
14862                        &res,
14863                        format,
14864                    )?;
14865                    Ok((bytes, ctx))
14866                })
14867            }
14868            _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
14869        }
14870    }
14871    fn call_server_streaming(
14872        &self,
14873        path: &str,
14874        ctx: ::connectrpc::Context,
14875        request: ::buffa::bytes::Bytes,
14876        format: ::connectrpc::CodecFormat,
14877    ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
14878        let Some(method) = path.strip_prefix("store.query.v1.Service/") else {
14879            return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
14880        };
14881        let _ = (&ctx, &request, &format);
14882        match method {
14883            "GetMany" => {
14884                let svc = ::std::sync::Arc::clone(&self.inner);
14885                Box::pin(async move {
14886                    let req = ::connectrpc::dispatcher::codegen::decode_request_view::<
14887                        GetManyRequestView,
14888                    >(request, format)?;
14889                    let (resp_stream, ctx) = svc.get_many(ctx, req).await?;
14890                    Ok((
14891                        ::connectrpc::dispatcher::codegen::encode_response_stream(
14892                            resp_stream,
14893                            format,
14894                        ),
14895                        ctx,
14896                    ))
14897                })
14898            }
14899            "Range" => {
14900                let svc = ::std::sync::Arc::clone(&self.inner);
14901                Box::pin(async move {
14902                    let req = ::connectrpc::dispatcher::codegen::decode_request_view::<
14903                        RangeRequestView,
14904                    >(request, format)?;
14905                    let (resp_stream, ctx) = svc.range(ctx, req).await?;
14906                    Ok((
14907                        ::connectrpc::dispatcher::codegen::encode_response_stream(
14908                            resp_stream,
14909                            format,
14910                        ),
14911                        ctx,
14912                    ))
14913                })
14914            }
14915            _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
14916        }
14917    }
14918    fn call_client_streaming(
14919        &self,
14920        path: &str,
14921        ctx: ::connectrpc::Context,
14922        requests: ::connectrpc::dispatcher::codegen::RequestStream,
14923        format: ::connectrpc::CodecFormat,
14924    ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
14925        let Some(method) = path.strip_prefix("store.query.v1.Service/") else {
14926            return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
14927        };
14928        let _ = (&ctx, &requests, &format);
14929        match method {
14930            _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
14931        }
14932    }
14933    fn call_bidi_streaming(
14934        &self,
14935        path: &str,
14936        ctx: ::connectrpc::Context,
14937        requests: ::connectrpc::dispatcher::codegen::RequestStream,
14938        format: ::connectrpc::CodecFormat,
14939    ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
14940        let Some(method) = path.strip_prefix("store.query.v1.Service/") else {
14941            return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
14942        };
14943        let _ = (&ctx, &requests, &format);
14944        match method {
14945            _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
14946        }
14947    }
14948}
14949/// Client for this service.
14950///
14951/// Generic over `T: ClientTransport`. For **gRPC** (HTTP/2), use
14952/// `Http2Connection` — it has honest `poll_ready` and composes with
14953/// `tower::balance` for multi-connection load balancing. For **Connect
14954/// over HTTP/1.1** (or unknown protocol), use `HttpClient`.
14955///
14956/// # Example (gRPC / HTTP/2)
14957///
14958/// ```rust,ignore
14959/// use connectrpc::client::{Http2Connection, ClientConfig};
14960/// use connectrpc::Protocol;
14961///
14962/// let uri: http::Uri = "http://localhost:8080".parse()?;
14963/// let conn = Http2Connection::connect_plaintext(uri.clone()).await?.shared(1024);
14964/// let config = ClientConfig::new(uri).protocol(Protocol::Grpc);
14965///
14966/// let client = ServiceClient::new(conn, config);
14967/// let response = client.get(request).await?;
14968/// ```
14969///
14970/// # Example (Connect / HTTP/1.1 or ALPN)
14971///
14972/// ```rust,ignore
14973/// use connectrpc::client::{HttpClient, ClientConfig};
14974///
14975/// let http = HttpClient::plaintext();  // cleartext http:// only
14976/// let config = ClientConfig::new("http://localhost:8080".parse()?);
14977///
14978/// let client = ServiceClient::new(http, config);
14979/// let response = client.get(request).await?;
14980/// ```
14981///
14982/// # Working with the response
14983///
14984/// Unary calls return [`UnaryResponse<OwnedView<FooView>>`](::connectrpc::client::UnaryResponse).
14985/// The `OwnedView` derefs to the view, so field access is zero-copy:
14986///
14987/// ```rust,ignore
14988/// let resp = client.get(request).await?.into_view();
14989/// let name: &str = resp.name;  // borrow into the response buffer
14990/// ```
14991///
14992/// If you need the owned struct (e.g. to store or pass by value), use
14993/// [`into_owned()`](::connectrpc::client::UnaryResponse::into_owned):
14994///
14995/// ```rust,ignore
14996/// let owned = client.get(request).await?.into_owned();
14997/// ```
14998#[derive(Clone)]
14999pub struct ServiceClient<T> {
15000    transport: T,
15001    config: ::connectrpc::client::ClientConfig,
15002}
15003impl<T> ServiceClient<T>
15004where
15005    T: ::connectrpc::client::ClientTransport,
15006    <T::ResponseBody as ::http_body::Body>::Error: ::std::fmt::Display,
15007{
15008    /// Create a new client with the given transport and configuration.
15009    pub fn new(transport: T, config: ::connectrpc::client::ClientConfig) -> Self {
15010        Self { transport, config }
15011    }
15012    /// Get the client configuration.
15013    pub fn config(&self) -> &::connectrpc::client::ClientConfig {
15014        &self.config
15015    }
15016    /// Get a mutable reference to the client configuration.
15017    pub fn config_mut(&mut self) -> &mut ::connectrpc::client::ClientConfig {
15018        &mut self.config
15019    }
15020    /// Call the Get RPC. Sends a request to /store.query.v1.Service/Get.
15021    pub async fn get(
15022        &self,
15023        request: GetRequest,
15024    ) -> Result<
15025        ::connectrpc::client::UnaryResponse<
15026            ::buffa::view::OwnedView<GetResponseView<'static>>,
15027        >,
15028        ::connectrpc::ConnectError,
15029    > {
15030        self.get_with_options(request, ::connectrpc::client::CallOptions::default())
15031            .await
15032    }
15033    /// Call the Get RPC with explicit per-call options. Options override [`connectrpc::client::ClientConfig`] defaults.
15034    pub async fn get_with_options(
15035        &self,
15036        request: GetRequest,
15037        options: ::connectrpc::client::CallOptions,
15038    ) -> Result<
15039        ::connectrpc::client::UnaryResponse<
15040            ::buffa::view::OwnedView<GetResponseView<'static>>,
15041        >,
15042        ::connectrpc::ConnectError,
15043    > {
15044        ::connectrpc::client::call_unary(
15045                &self.transport,
15046                &self.config,
15047                SERVICE_SERVICE_NAME,
15048                "Get",
15049                request,
15050                options,
15051            )
15052            .await
15053    }
15054    /// Call the GetMany RPC. Sends a request to /store.query.v1.Service/GetMany.
15055    pub async fn get_many(
15056        &self,
15057        request: GetManyRequest,
15058    ) -> Result<
15059        ::connectrpc::client::ServerStream<T::ResponseBody, GetManyFrameView<'static>>,
15060        ::connectrpc::ConnectError,
15061    > {
15062        self.get_many_with_options(request, ::connectrpc::client::CallOptions::default())
15063            .await
15064    }
15065    /// Call the GetMany RPC with explicit per-call options. Options override [`connectrpc::client::ClientConfig`] defaults.
15066    pub async fn get_many_with_options(
15067        &self,
15068        request: GetManyRequest,
15069        options: ::connectrpc::client::CallOptions,
15070    ) -> Result<
15071        ::connectrpc::client::ServerStream<T::ResponseBody, GetManyFrameView<'static>>,
15072        ::connectrpc::ConnectError,
15073    > {
15074        ::connectrpc::client::call_server_stream(
15075                &self.transport,
15076                &self.config,
15077                SERVICE_SERVICE_NAME,
15078                "GetMany",
15079                request,
15080                options,
15081            )
15082            .await
15083    }
15084    /// Call the Range RPC. Sends a request to /store.query.v1.Service/Range.
15085    pub async fn range(
15086        &self,
15087        request: RangeRequest,
15088    ) -> Result<
15089        ::connectrpc::client::ServerStream<T::ResponseBody, RangeFrameView<'static>>,
15090        ::connectrpc::ConnectError,
15091    > {
15092        self.range_with_options(request, ::connectrpc::client::CallOptions::default())
15093            .await
15094    }
15095    /// Call the Range RPC with explicit per-call options. Options override [`connectrpc::client::ClientConfig`] defaults.
15096    pub async fn range_with_options(
15097        &self,
15098        request: RangeRequest,
15099        options: ::connectrpc::client::CallOptions,
15100    ) -> Result<
15101        ::connectrpc::client::ServerStream<T::ResponseBody, RangeFrameView<'static>>,
15102        ::connectrpc::ConnectError,
15103    > {
15104        ::connectrpc::client::call_server_stream(
15105                &self.transport,
15106                &self.config,
15107                SERVICE_SERVICE_NAME,
15108                "Range",
15109                request,
15110                options,
15111            )
15112            .await
15113    }
15114    /// Call the Reduce RPC. Sends a request to /store.query.v1.Service/Reduce.
15115    pub async fn reduce(
15116        &self,
15117        request: ReduceRequest,
15118    ) -> Result<
15119        ::connectrpc::client::UnaryResponse<
15120            ::buffa::view::OwnedView<ReduceResponseView<'static>>,
15121        >,
15122        ::connectrpc::ConnectError,
15123    > {
15124        self.reduce_with_options(request, ::connectrpc::client::CallOptions::default())
15125            .await
15126    }
15127    /// Call the Reduce RPC with explicit per-call options. Options override [`connectrpc::client::ClientConfig`] defaults.
15128    pub async fn reduce_with_options(
15129        &self,
15130        request: ReduceRequest,
15131        options: ::connectrpc::client::CallOptions,
15132    ) -> Result<
15133        ::connectrpc::client::UnaryResponse<
15134            ::buffa::view::OwnedView<ReduceResponseView<'static>>,
15135        >,
15136        ::connectrpc::ConnectError,
15137    > {
15138        ::connectrpc::client::call_unary(
15139                &self.transport,
15140                &self.config,
15141                SERVICE_SERVICE_NAME,
15142                "Reduce",
15143                request,
15144                options,
15145            )
15146            .await
15147    }
15148}