Skip to main content

polyester/gen/buffa/
tradews.v1.rs

1// @generated by buffa-codegen. DO NOT EDIT.
2
3/// ClientFrame is the protobuf write-websocket envelope. Its payloads reuse the
4/// public Orders API request contracts so every transport shares one order model.
5#[derive(Clone, PartialEq, Default)]
6#[derive(::serde::Serialize)]
7#[serde(default)]
8pub struct ClientFrame {
9    /// Monotonic per-connection client sequence number, starting at 1.
10    ///
11    /// Field 1: `seq`
12    #[serde(
13        rename = "seq",
14        with = "::buffa::json_helpers::uint64",
15        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
16    )]
17    pub seq: u64,
18    /// Client correlation token echoed in every server response.
19    ///
20    /// Field 2: `correlation_id`
21    #[serde(
22        rename = "correlationId",
23        alias = "correlation_id",
24        with = "::buffa::json_helpers::proto_string",
25        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
26    )]
27    pub correlation_id: ::buffa::alloc::string::String,
28    #[serde(flatten)]
29    pub payload: ::core::option::Option<__buffa::oneof::client_frame::Payload>,
30    #[serde(skip)]
31    #[doc(hidden)]
32    pub __buffa_unknown_fields: ::buffa::UnknownFields,
33}
34impl ::core::fmt::Debug for ClientFrame {
35    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
36        f.debug_struct("ClientFrame")
37            .field("seq", &self.seq)
38            .field("correlation_id", &self.correlation_id)
39            .field("payload", &self.payload)
40            .finish()
41    }
42}
43impl ClientFrame {
44    /// Protobuf type URL for this message, for use with `Any::pack` and
45    /// `Any::unpack_if`.
46    ///
47    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
48    pub const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.ClientFrame";
49}
50::buffa::impl_default_instance!(ClientFrame);
51impl ::buffa::MessageName for ClientFrame {
52    const PACKAGE: &'static str = "tradews.v1";
53    const NAME: &'static str = "ClientFrame";
54    const FULL_NAME: &'static str = "tradews.v1.ClientFrame";
55    const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.ClientFrame";
56}
57impl ::buffa::Message for ClientFrame {
58    /// Returns the total encoded size in bytes.
59    ///
60    /// The result is a `u32`; the protobuf specification requires all
61    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
62    /// compliant message will never overflow this type.
63    #[allow(clippy::let_and_return)]
64    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
65        #[allow(unused_imports)]
66        use ::buffa::Enumeration as _;
67        let mut size = 0u32;
68        if self.seq != 0u64 {
69            size += 1u32 + ::buffa::types::uint64_encoded_len(self.seq) as u32;
70        }
71        if !self.correlation_id.is_empty() {
72            size
73                += 1u32
74                    + ::buffa::types::string_encoded_len(&self.correlation_id) as u32;
75        }
76        if let ::core::option::Option::Some(ref v) = self.payload {
77            match v {
78                __buffa::oneof::client_frame::Payload::Ping(x) => {
79                    let __slot = __cache.reserve();
80                    let inner = x.compute_size(__cache);
81                    __cache.set(__slot, inner);
82                    size
83                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
84                            + inner;
85                }
86                __buffa::oneof::client_frame::Payload::CreateOrder(x) => {
87                    let __slot = __cache.reserve();
88                    let inner = x.compute_size(__cache);
89                    __cache.set(__slot, inner);
90                    size
91                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
92                            + inner;
93                }
94                __buffa::oneof::client_frame::Payload::CancelOrder(x) => {
95                    let __slot = __cache.reserve();
96                    let inner = x.compute_size(__cache);
97                    __cache.set(__slot, inner);
98                    size
99                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
100                            + inner;
101                }
102                __buffa::oneof::client_frame::Payload::ModifyOrder(x) => {
103                    let __slot = __cache.reserve();
104                    let inner = x.compute_size(__cache);
105                    __cache.set(__slot, inner);
106                    size
107                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
108                            + inner;
109                }
110                __buffa::oneof::client_frame::Payload::CancelAllOrders(x) => {
111                    let __slot = __cache.reserve();
112                    let inner = x.compute_size(__cache);
113                    __cache.set(__slot, inner);
114                    size
115                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
116                            + inner;
117                }
118            }
119        }
120        size += self.__buffa_unknown_fields.encoded_len() as u32;
121        size
122    }
123    fn write_to(
124        &self,
125        __cache: &mut ::buffa::SizeCache,
126        buf: &mut impl ::buffa::bytes::BufMut,
127    ) {
128        #[allow(unused_imports)]
129        use ::buffa::Enumeration as _;
130        if self.seq != 0u64 {
131            ::buffa::types::put_uint64_field(1u32, self.seq, buf);
132        }
133        if !self.correlation_id.is_empty() {
134            ::buffa::types::put_string_field(2u32, &self.correlation_id, buf);
135        }
136        if let ::core::option::Option::Some(ref v) = self.payload {
137            match v {
138                __buffa::oneof::client_frame::Payload::Ping(x) => {
139                    ::buffa::types::put_len_delimited_header(
140                        10u32,
141                        __cache.consume_next(),
142                        buf,
143                    );
144                    x.write_to(__cache, buf);
145                }
146                __buffa::oneof::client_frame::Payload::CreateOrder(x) => {
147                    ::buffa::types::put_len_delimited_header(
148                        11u32,
149                        __cache.consume_next(),
150                        buf,
151                    );
152                    x.write_to(__cache, buf);
153                }
154                __buffa::oneof::client_frame::Payload::CancelOrder(x) => {
155                    ::buffa::types::put_len_delimited_header(
156                        12u32,
157                        __cache.consume_next(),
158                        buf,
159                    );
160                    x.write_to(__cache, buf);
161                }
162                __buffa::oneof::client_frame::Payload::ModifyOrder(x) => {
163                    ::buffa::types::put_len_delimited_header(
164                        13u32,
165                        __cache.consume_next(),
166                        buf,
167                    );
168                    x.write_to(__cache, buf);
169                }
170                __buffa::oneof::client_frame::Payload::CancelAllOrders(x) => {
171                    ::buffa::types::put_len_delimited_header(
172                        14u32,
173                        __cache.consume_next(),
174                        buf,
175                    );
176                    x.write_to(__cache, buf);
177                }
178            }
179        }
180        self.__buffa_unknown_fields.write_to(buf);
181    }
182    fn merge_field(
183        &mut self,
184        tag: ::buffa::encoding::Tag,
185        buf: &mut impl ::buffa::bytes::Buf,
186        ctx: ::buffa::DecodeContext<'_>,
187    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
188        #[allow(unused_imports)]
189        use ::buffa::bytes::Buf as _;
190        #[allow(unused_imports)]
191        use ::buffa::Enumeration as _;
192        match tag.field_number() {
193            1u32 => {
194                ::buffa::encoding::check_wire_type(
195                    tag,
196                    ::buffa::encoding::WireType::Varint,
197                )?;
198                self.seq = ::buffa::types::decode_uint64(buf)?;
199            }
200            2u32 => {
201                ::buffa::encoding::check_wire_type(
202                    tag,
203                    ::buffa::encoding::WireType::LengthDelimited,
204                )?;
205                ::buffa::types::merge_string(&mut self.correlation_id, buf)?;
206            }
207            10u32 => {
208                ::buffa::encoding::check_wire_type(
209                    tag,
210                    ::buffa::encoding::WireType::LengthDelimited,
211                )?;
212                if let ::core::option::Option::Some(
213                    __buffa::oneof::client_frame::Payload::Ping(ref mut existing),
214                ) = self.payload
215                {
216                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
217                } else {
218                    let mut val = ::core::default::Default::default();
219                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
220                    self.payload = ::core::option::Option::Some(
221                        __buffa::oneof::client_frame::Payload::Ping(
222                            ::buffa::alloc::boxed::Box::new(val),
223                        ),
224                    );
225                }
226            }
227            11u32 => {
228                ::buffa::encoding::check_wire_type(
229                    tag,
230                    ::buffa::encoding::WireType::LengthDelimited,
231                )?;
232                if let ::core::option::Option::Some(
233                    __buffa::oneof::client_frame::Payload::CreateOrder(ref mut existing),
234                ) = self.payload
235                {
236                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
237                } else {
238                    let mut val = ::core::default::Default::default();
239                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
240                    self.payload = ::core::option::Option::Some(
241                        __buffa::oneof::client_frame::Payload::CreateOrder(
242                            ::buffa::alloc::boxed::Box::new(val),
243                        ),
244                    );
245                }
246            }
247            12u32 => {
248                ::buffa::encoding::check_wire_type(
249                    tag,
250                    ::buffa::encoding::WireType::LengthDelimited,
251                )?;
252                if let ::core::option::Option::Some(
253                    __buffa::oneof::client_frame::Payload::CancelOrder(ref mut existing),
254                ) = self.payload
255                {
256                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
257                } else {
258                    let mut val = ::core::default::Default::default();
259                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
260                    self.payload = ::core::option::Option::Some(
261                        __buffa::oneof::client_frame::Payload::CancelOrder(
262                            ::buffa::alloc::boxed::Box::new(val),
263                        ),
264                    );
265                }
266            }
267            13u32 => {
268                ::buffa::encoding::check_wire_type(
269                    tag,
270                    ::buffa::encoding::WireType::LengthDelimited,
271                )?;
272                if let ::core::option::Option::Some(
273                    __buffa::oneof::client_frame::Payload::ModifyOrder(ref mut existing),
274                ) = self.payload
275                {
276                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
277                } else {
278                    let mut val = ::core::default::Default::default();
279                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
280                    self.payload = ::core::option::Option::Some(
281                        __buffa::oneof::client_frame::Payload::ModifyOrder(
282                            ::buffa::alloc::boxed::Box::new(val),
283                        ),
284                    );
285                }
286            }
287            14u32 => {
288                ::buffa::encoding::check_wire_type(
289                    tag,
290                    ::buffa::encoding::WireType::LengthDelimited,
291                )?;
292                if let ::core::option::Option::Some(
293                    __buffa::oneof::client_frame::Payload::CancelAllOrders(
294                        ref mut existing,
295                    ),
296                ) = self.payload
297                {
298                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
299                } else {
300                    let mut val = ::core::default::Default::default();
301                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
302                    self.payload = ::core::option::Option::Some(
303                        __buffa::oneof::client_frame::Payload::CancelAllOrders(
304                            ::buffa::alloc::boxed::Box::new(val),
305                        ),
306                    );
307                }
308            }
309            _ => {
310                self.__buffa_unknown_fields
311                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
312            }
313        }
314        ::core::result::Result::Ok(())
315    }
316    fn clear(&mut self) {
317        self.seq = 0u64;
318        self.correlation_id.clear();
319        self.payload = ::core::option::Option::None;
320        self.__buffa_unknown_fields.clear();
321    }
322}
323impl ::buffa::ExtensionSet for ClientFrame {
324    const PROTO_FQN: &'static str = "tradews.v1.ClientFrame";
325    fn unknown_fields(&self) -> &::buffa::UnknownFields {
326        &self.__buffa_unknown_fields
327    }
328    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
329        &mut self.__buffa_unknown_fields
330    }
331}
332impl<'de> serde::Deserialize<'de> for ClientFrame {
333    fn deserialize<D: serde::Deserializer<'de>>(
334        d: D,
335    ) -> ::core::result::Result<Self, D::Error> {
336        struct _V;
337        impl<'de> serde::de::Visitor<'de> for _V {
338            type Value = ClientFrame;
339            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
340                f.write_str("struct ClientFrame")
341            }
342            #[allow(clippy::field_reassign_with_default)]
343            fn visit_map<A: serde::de::MapAccess<'de>>(
344                self,
345                mut map: A,
346            ) -> ::core::result::Result<ClientFrame, A::Error> {
347                let mut __f_seq: ::core::option::Option<u64> = None;
348                let mut __f_correlation_id: ::core::option::Option<
349                    ::buffa::alloc::string::String,
350                > = None;
351                let mut __oneof_payload: ::core::option::Option<
352                    __buffa::oneof::client_frame::Payload,
353                > = None;
354                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
355                    match key.as_str() {
356                        "seq" => {
357                            __f_seq = Some({
358                                struct _S;
359                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
360                                    type Value = u64;
361                                    fn deserialize<D: serde::Deserializer<'de>>(
362                                        self,
363                                        d: D,
364                                    ) -> ::core::result::Result<u64, D::Error> {
365                                        ::buffa::json_helpers::uint64::deserialize(d)
366                                    }
367                                }
368                                map.next_value_seed(_S)?
369                            });
370                        }
371                        "correlationId" | "correlation_id" => {
372                            __f_correlation_id = Some({
373                                struct _S;
374                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
375                                    type Value = ::buffa::alloc::string::String;
376                                    fn deserialize<D: serde::Deserializer<'de>>(
377                                        self,
378                                        d: D,
379                                    ) -> ::core::result::Result<
380                                        ::buffa::alloc::string::String,
381                                        D::Error,
382                                    > {
383                                        ::buffa::json_helpers::proto_string::deserialize(d)
384                                    }
385                                }
386                                map.next_value_seed(_S)?
387                            });
388                        }
389                        "ping" => {
390                            let v: ::core::option::Option<PingRequest> = map
391                                .next_value_seed(
392                                    ::buffa::json_helpers::NullableDeserializeSeed(
393                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
394                                            PingRequest,
395                                        >::new(),
396                                    ),
397                                )?;
398                            if let Some(v) = v {
399                                if __oneof_payload.is_some() {
400                                    return Err(
401                                        serde::de::Error::custom(
402                                            "multiple oneof fields set for 'payload'",
403                                        ),
404                                    );
405                                }
406                                __oneof_payload = Some(
407                                    __buffa::oneof::client_frame::Payload::Ping(
408                                        ::buffa::alloc::boxed::Box::new(v),
409                                    ),
410                                );
411                            }
412                        }
413                        "createOrder" | "create_order" => {
414                            let v: ::core::option::Option<
415                                super::super::orders::v1::CreateOrderRequest,
416                            > = map
417                                .next_value_seed(
418                                    ::buffa::json_helpers::NullableDeserializeSeed(
419                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
420                                            super::super::orders::v1::CreateOrderRequest,
421                                        >::new(),
422                                    ),
423                                )?;
424                            if let Some(v) = v {
425                                if __oneof_payload.is_some() {
426                                    return Err(
427                                        serde::de::Error::custom(
428                                            "multiple oneof fields set for 'payload'",
429                                        ),
430                                    );
431                                }
432                                __oneof_payload = Some(
433                                    __buffa::oneof::client_frame::Payload::CreateOrder(
434                                        ::buffa::alloc::boxed::Box::new(v),
435                                    ),
436                                );
437                            }
438                        }
439                        "cancelOrder" | "cancel_order" => {
440                            let v: ::core::option::Option<
441                                super::super::orders::v1::CancelOrderRequest,
442                            > = map
443                                .next_value_seed(
444                                    ::buffa::json_helpers::NullableDeserializeSeed(
445                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
446                                            super::super::orders::v1::CancelOrderRequest,
447                                        >::new(),
448                                    ),
449                                )?;
450                            if let Some(v) = v {
451                                if __oneof_payload.is_some() {
452                                    return Err(
453                                        serde::de::Error::custom(
454                                            "multiple oneof fields set for 'payload'",
455                                        ),
456                                    );
457                                }
458                                __oneof_payload = Some(
459                                    __buffa::oneof::client_frame::Payload::CancelOrder(
460                                        ::buffa::alloc::boxed::Box::new(v),
461                                    ),
462                                );
463                            }
464                        }
465                        "modifyOrder" | "modify_order" => {
466                            let v: ::core::option::Option<
467                                super::super::orders::v1::ModifyOrderRequest,
468                            > = map
469                                .next_value_seed(
470                                    ::buffa::json_helpers::NullableDeserializeSeed(
471                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
472                                            super::super::orders::v1::ModifyOrderRequest,
473                                        >::new(),
474                                    ),
475                                )?;
476                            if let Some(v) = v {
477                                if __oneof_payload.is_some() {
478                                    return Err(
479                                        serde::de::Error::custom(
480                                            "multiple oneof fields set for 'payload'",
481                                        ),
482                                    );
483                                }
484                                __oneof_payload = Some(
485                                    __buffa::oneof::client_frame::Payload::ModifyOrder(
486                                        ::buffa::alloc::boxed::Box::new(v),
487                                    ),
488                                );
489                            }
490                        }
491                        "cancelAllOrders" | "cancel_all_orders" => {
492                            let v: ::core::option::Option<
493                                super::super::orders::v1::CancelAllOrdersRequest,
494                            > = map
495                                .next_value_seed(
496                                    ::buffa::json_helpers::NullableDeserializeSeed(
497                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
498                                            super::super::orders::v1::CancelAllOrdersRequest,
499                                        >::new(),
500                                    ),
501                                )?;
502                            if let Some(v) = v {
503                                if __oneof_payload.is_some() {
504                                    return Err(
505                                        serde::de::Error::custom(
506                                            "multiple oneof fields set for 'payload'",
507                                        ),
508                                    );
509                                }
510                                __oneof_payload = Some(
511                                    __buffa::oneof::client_frame::Payload::CancelAllOrders(
512                                        ::buffa::alloc::boxed::Box::new(v),
513                                    ),
514                                );
515                            }
516                        }
517                        _ => {
518                            map.next_value::<serde::de::IgnoredAny>()?;
519                        }
520                    }
521                }
522                let mut __r = <ClientFrame as ::core::default::Default>::default();
523                if let ::core::option::Option::Some(v) = __f_seq {
524                    __r.seq = v;
525                }
526                if let ::core::option::Option::Some(v) = __f_correlation_id {
527                    __r.correlation_id = v;
528                }
529                __r.payload = __oneof_payload;
530                Ok(__r)
531            }
532        }
533        d.deserialize_map(_V)
534    }
535}
536impl ::buffa::json_helpers::ProtoElemJson for ClientFrame {
537    fn serialize_proto_json<S: ::serde::Serializer>(
538        v: &Self,
539        s: S,
540    ) -> ::core::result::Result<S::Ok, S::Error> {
541        ::serde::Serialize::serialize(v, s)
542    }
543    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
544        d: D,
545    ) -> ::core::result::Result<Self, D::Error> {
546        <Self as ::serde::Deserialize>::deserialize(d)
547    }
548}
549#[doc(hidden)]
550pub const __CLIENT_FRAME_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
551    type_url: "type.googleapis.com/tradews.v1.ClientFrame",
552    to_json: ::buffa::type_registry::any_to_json::<ClientFrame>,
553    from_json: ::buffa::type_registry::any_from_json::<ClientFrame>,
554    is_wkt: false,
555};
556pub mod client_frame {
557    #[allow(unused_imports)]
558    use super::*;
559    #[doc(inline)]
560    pub use super::__buffa::oneof::client_frame::Payload;
561    #[doc(inline)]
562    pub use super::__buffa::view::oneof::client_frame::Payload as PayloadView;
563}
564/// PingRequest carries an opaque payload that is echoed by PongResponse.
565#[derive(Clone, PartialEq, Default)]
566#[derive(::serde::Serialize, ::serde::Deserialize)]
567#[serde(default)]
568pub struct PingRequest {
569    /// Opaque client payload echoed by the server.
570    ///
571    /// Field 1: `payload`
572    #[serde(
573        rename = "payload",
574        with = "::buffa::json_helpers::bytes",
575        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
576    )]
577    pub payload: ::buffa::alloc::vec::Vec<u8>,
578    #[serde(skip)]
579    #[doc(hidden)]
580    pub __buffa_unknown_fields: ::buffa::UnknownFields,
581}
582impl ::core::fmt::Debug for PingRequest {
583    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
584        f.debug_struct("PingRequest").field("payload", &self.payload).finish()
585    }
586}
587impl PingRequest {
588    /// Protobuf type URL for this message, for use with `Any::pack` and
589    /// `Any::unpack_if`.
590    ///
591    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
592    pub const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.PingRequest";
593}
594::buffa::impl_default_instance!(PingRequest);
595impl ::buffa::MessageName for PingRequest {
596    const PACKAGE: &'static str = "tradews.v1";
597    const NAME: &'static str = "PingRequest";
598    const FULL_NAME: &'static str = "tradews.v1.PingRequest";
599    const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.PingRequest";
600}
601impl ::buffa::Message for PingRequest {
602    /// Returns the total encoded size in bytes.
603    ///
604    /// The result is a `u32`; the protobuf specification requires all
605    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
606    /// compliant message will never overflow this type.
607    #[allow(clippy::let_and_return)]
608    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
609        #[allow(unused_imports)]
610        use ::buffa::Enumeration as _;
611        let mut size = 0u32;
612        if !self.payload.is_empty() {
613            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.payload) as u32;
614        }
615        size += self.__buffa_unknown_fields.encoded_len() as u32;
616        size
617    }
618    fn write_to(
619        &self,
620        _cache: &mut ::buffa::SizeCache,
621        buf: &mut impl ::buffa::bytes::BufMut,
622    ) {
623        #[allow(unused_imports)]
624        use ::buffa::Enumeration as _;
625        if !self.payload.is_empty() {
626            ::buffa::types::put_bytes_field(1u32, &self.payload, buf);
627        }
628        self.__buffa_unknown_fields.write_to(buf);
629    }
630    fn merge_field(
631        &mut self,
632        tag: ::buffa::encoding::Tag,
633        buf: &mut impl ::buffa::bytes::Buf,
634        ctx: ::buffa::DecodeContext<'_>,
635    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
636        #[allow(unused_imports)]
637        use ::buffa::bytes::Buf as _;
638        #[allow(unused_imports)]
639        use ::buffa::Enumeration as _;
640        match tag.field_number() {
641            1u32 => {
642                ::buffa::encoding::check_wire_type(
643                    tag,
644                    ::buffa::encoding::WireType::LengthDelimited,
645                )?;
646                ::buffa::types::merge_bytes(&mut self.payload, buf)?;
647            }
648            _ => {
649                self.__buffa_unknown_fields
650                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
651            }
652        }
653        ::core::result::Result::Ok(())
654    }
655    fn clear(&mut self) {
656        self.payload.clear();
657        self.__buffa_unknown_fields.clear();
658    }
659}
660impl ::buffa::ExtensionSet for PingRequest {
661    const PROTO_FQN: &'static str = "tradews.v1.PingRequest";
662    fn unknown_fields(&self) -> &::buffa::UnknownFields {
663        &self.__buffa_unknown_fields
664    }
665    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
666        &mut self.__buffa_unknown_fields
667    }
668}
669impl ::buffa::json_helpers::ProtoElemJson for PingRequest {
670    fn serialize_proto_json<S: ::serde::Serializer>(
671        v: &Self,
672        s: S,
673    ) -> ::core::result::Result<S::Ok, S::Error> {
674        ::serde::Serialize::serialize(v, s)
675    }
676    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
677        d: D,
678    ) -> ::core::result::Result<Self, D::Error> {
679        <Self as ::serde::Deserialize>::deserialize(d)
680    }
681}
682#[doc(hidden)]
683pub const __PING_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
684    type_url: "type.googleapis.com/tradews.v1.PingRequest",
685    to_json: ::buffa::type_registry::any_to_json::<PingRequest>,
686    from_json: ::buffa::type_registry::any_from_json::<PingRequest>,
687    is_wkt: false,
688};
689/// ServerFrame is the protobuf write-websocket response envelope.
690#[derive(Clone, PartialEq, Default)]
691#[derive(::serde::Serialize)]
692#[serde(default)]
693pub struct ServerFrame {
694    /// Client sequence number copied from the accepted or rejected frame.
695    ///
696    /// Field 1: `seq`
697    #[serde(
698        rename = "seq",
699        with = "::buffa::json_helpers::uint64",
700        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
701    )]
702    pub seq: u64,
703    /// Client correlation token copied from the accepted or rejected frame.
704    ///
705    /// Field 2: `correlation_id`
706    #[serde(
707        rename = "correlationId",
708        alias = "correlation_id",
709        with = "::buffa::json_helpers::proto_string",
710        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
711    )]
712    pub correlation_id: ::buffa::alloc::string::String,
713    #[serde(flatten)]
714    pub payload: ::core::option::Option<__buffa::oneof::server_frame::Payload>,
715    #[serde(skip)]
716    #[doc(hidden)]
717    pub __buffa_unknown_fields: ::buffa::UnknownFields,
718}
719impl ::core::fmt::Debug for ServerFrame {
720    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
721        f.debug_struct("ServerFrame")
722            .field("seq", &self.seq)
723            .field("correlation_id", &self.correlation_id)
724            .field("payload", &self.payload)
725            .finish()
726    }
727}
728impl ServerFrame {
729    /// Protobuf type URL for this message, for use with `Any::pack` and
730    /// `Any::unpack_if`.
731    ///
732    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
733    pub const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.ServerFrame";
734}
735::buffa::impl_default_instance!(ServerFrame);
736impl ::buffa::MessageName for ServerFrame {
737    const PACKAGE: &'static str = "tradews.v1";
738    const NAME: &'static str = "ServerFrame";
739    const FULL_NAME: &'static str = "tradews.v1.ServerFrame";
740    const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.ServerFrame";
741}
742impl ::buffa::Message for ServerFrame {
743    /// Returns the total encoded size in bytes.
744    ///
745    /// The result is a `u32`; the protobuf specification requires all
746    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
747    /// compliant message will never overflow this type.
748    #[allow(clippy::let_and_return)]
749    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
750        #[allow(unused_imports)]
751        use ::buffa::Enumeration as _;
752        let mut size = 0u32;
753        if self.seq != 0u64 {
754            size += 1u32 + ::buffa::types::uint64_encoded_len(self.seq) as u32;
755        }
756        if !self.correlation_id.is_empty() {
757            size
758                += 1u32
759                    + ::buffa::types::string_encoded_len(&self.correlation_id) as u32;
760        }
761        if let ::core::option::Option::Some(ref v) = self.payload {
762            match v {
763                __buffa::oneof::server_frame::Payload::Pong(x) => {
764                    let __slot = __cache.reserve();
765                    let inner = x.compute_size(__cache);
766                    __cache.set(__slot, inner);
767                    size
768                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
769                            + inner;
770                }
771                __buffa::oneof::server_frame::Payload::Ack(x) => {
772                    let __slot = __cache.reserve();
773                    let inner = x.compute_size(__cache);
774                    __cache.set(__slot, inner);
775                    size
776                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
777                            + inner;
778                }
779                __buffa::oneof::server_frame::Payload::Reject(x) => {
780                    let __slot = __cache.reserve();
781                    let inner = x.compute_size(__cache);
782                    __cache.set(__slot, inner);
783                    size
784                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
785                            + inner;
786                }
787                __buffa::oneof::server_frame::Payload::Overload(x) => {
788                    let __slot = __cache.reserve();
789                    let inner = x.compute_size(__cache);
790                    __cache.set(__slot, inner);
791                    size
792                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
793                            + inner;
794                }
795                __buffa::oneof::server_frame::Payload::Terminal(x) => {
796                    let __slot = __cache.reserve();
797                    let inner = x.compute_size(__cache);
798                    __cache.set(__slot, inner);
799                    size
800                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
801                            + inner;
802                }
803            }
804        }
805        size += self.__buffa_unknown_fields.encoded_len() as u32;
806        size
807    }
808    fn write_to(
809        &self,
810        __cache: &mut ::buffa::SizeCache,
811        buf: &mut impl ::buffa::bytes::BufMut,
812    ) {
813        #[allow(unused_imports)]
814        use ::buffa::Enumeration as _;
815        if self.seq != 0u64 {
816            ::buffa::types::put_uint64_field(1u32, self.seq, buf);
817        }
818        if !self.correlation_id.is_empty() {
819            ::buffa::types::put_string_field(2u32, &self.correlation_id, buf);
820        }
821        if let ::core::option::Option::Some(ref v) = self.payload {
822            match v {
823                __buffa::oneof::server_frame::Payload::Pong(x) => {
824                    ::buffa::types::put_len_delimited_header(
825                        10u32,
826                        __cache.consume_next(),
827                        buf,
828                    );
829                    x.write_to(__cache, buf);
830                }
831                __buffa::oneof::server_frame::Payload::Ack(x) => {
832                    ::buffa::types::put_len_delimited_header(
833                        11u32,
834                        __cache.consume_next(),
835                        buf,
836                    );
837                    x.write_to(__cache, buf);
838                }
839                __buffa::oneof::server_frame::Payload::Reject(x) => {
840                    ::buffa::types::put_len_delimited_header(
841                        12u32,
842                        __cache.consume_next(),
843                        buf,
844                    );
845                    x.write_to(__cache, buf);
846                }
847                __buffa::oneof::server_frame::Payload::Overload(x) => {
848                    ::buffa::types::put_len_delimited_header(
849                        13u32,
850                        __cache.consume_next(),
851                        buf,
852                    );
853                    x.write_to(__cache, buf);
854                }
855                __buffa::oneof::server_frame::Payload::Terminal(x) => {
856                    ::buffa::types::put_len_delimited_header(
857                        14u32,
858                        __cache.consume_next(),
859                        buf,
860                    );
861                    x.write_to(__cache, buf);
862                }
863            }
864        }
865        self.__buffa_unknown_fields.write_to(buf);
866    }
867    fn merge_field(
868        &mut self,
869        tag: ::buffa::encoding::Tag,
870        buf: &mut impl ::buffa::bytes::Buf,
871        ctx: ::buffa::DecodeContext<'_>,
872    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
873        #[allow(unused_imports)]
874        use ::buffa::bytes::Buf as _;
875        #[allow(unused_imports)]
876        use ::buffa::Enumeration as _;
877        match tag.field_number() {
878            1u32 => {
879                ::buffa::encoding::check_wire_type(
880                    tag,
881                    ::buffa::encoding::WireType::Varint,
882                )?;
883                self.seq = ::buffa::types::decode_uint64(buf)?;
884            }
885            2u32 => {
886                ::buffa::encoding::check_wire_type(
887                    tag,
888                    ::buffa::encoding::WireType::LengthDelimited,
889                )?;
890                ::buffa::types::merge_string(&mut self.correlation_id, buf)?;
891            }
892            10u32 => {
893                ::buffa::encoding::check_wire_type(
894                    tag,
895                    ::buffa::encoding::WireType::LengthDelimited,
896                )?;
897                if let ::core::option::Option::Some(
898                    __buffa::oneof::server_frame::Payload::Pong(ref mut existing),
899                ) = self.payload
900                {
901                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
902                } else {
903                    let mut val = ::core::default::Default::default();
904                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
905                    self.payload = ::core::option::Option::Some(
906                        __buffa::oneof::server_frame::Payload::Pong(
907                            ::buffa::alloc::boxed::Box::new(val),
908                        ),
909                    );
910                }
911            }
912            11u32 => {
913                ::buffa::encoding::check_wire_type(
914                    tag,
915                    ::buffa::encoding::WireType::LengthDelimited,
916                )?;
917                if let ::core::option::Option::Some(
918                    __buffa::oneof::server_frame::Payload::Ack(ref mut existing),
919                ) = self.payload
920                {
921                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
922                } else {
923                    let mut val = ::core::default::Default::default();
924                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
925                    self.payload = ::core::option::Option::Some(
926                        __buffa::oneof::server_frame::Payload::Ack(
927                            ::buffa::alloc::boxed::Box::new(val),
928                        ),
929                    );
930                }
931            }
932            12u32 => {
933                ::buffa::encoding::check_wire_type(
934                    tag,
935                    ::buffa::encoding::WireType::LengthDelimited,
936                )?;
937                if let ::core::option::Option::Some(
938                    __buffa::oneof::server_frame::Payload::Reject(ref mut existing),
939                ) = self.payload
940                {
941                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
942                } else {
943                    let mut val = ::core::default::Default::default();
944                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
945                    self.payload = ::core::option::Option::Some(
946                        __buffa::oneof::server_frame::Payload::Reject(
947                            ::buffa::alloc::boxed::Box::new(val),
948                        ),
949                    );
950                }
951            }
952            13u32 => {
953                ::buffa::encoding::check_wire_type(
954                    tag,
955                    ::buffa::encoding::WireType::LengthDelimited,
956                )?;
957                if let ::core::option::Option::Some(
958                    __buffa::oneof::server_frame::Payload::Overload(ref mut existing),
959                ) = self.payload
960                {
961                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
962                } else {
963                    let mut val = ::core::default::Default::default();
964                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
965                    self.payload = ::core::option::Option::Some(
966                        __buffa::oneof::server_frame::Payload::Overload(
967                            ::buffa::alloc::boxed::Box::new(val),
968                        ),
969                    );
970                }
971            }
972            14u32 => {
973                ::buffa::encoding::check_wire_type(
974                    tag,
975                    ::buffa::encoding::WireType::LengthDelimited,
976                )?;
977                if let ::core::option::Option::Some(
978                    __buffa::oneof::server_frame::Payload::Terminal(ref mut existing),
979                ) = self.payload
980                {
981                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
982                } else {
983                    let mut val = ::core::default::Default::default();
984                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
985                    self.payload = ::core::option::Option::Some(
986                        __buffa::oneof::server_frame::Payload::Terminal(
987                            ::buffa::alloc::boxed::Box::new(val),
988                        ),
989                    );
990                }
991            }
992            _ => {
993                self.__buffa_unknown_fields
994                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
995            }
996        }
997        ::core::result::Result::Ok(())
998    }
999    fn clear(&mut self) {
1000        self.seq = 0u64;
1001        self.correlation_id.clear();
1002        self.payload = ::core::option::Option::None;
1003        self.__buffa_unknown_fields.clear();
1004    }
1005}
1006impl ::buffa::ExtensionSet for ServerFrame {
1007    const PROTO_FQN: &'static str = "tradews.v1.ServerFrame";
1008    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1009        &self.__buffa_unknown_fields
1010    }
1011    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1012        &mut self.__buffa_unknown_fields
1013    }
1014}
1015impl<'de> serde::Deserialize<'de> for ServerFrame {
1016    fn deserialize<D: serde::Deserializer<'de>>(
1017        d: D,
1018    ) -> ::core::result::Result<Self, D::Error> {
1019        struct _V;
1020        impl<'de> serde::de::Visitor<'de> for _V {
1021            type Value = ServerFrame;
1022            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1023                f.write_str("struct ServerFrame")
1024            }
1025            #[allow(clippy::field_reassign_with_default)]
1026            fn visit_map<A: serde::de::MapAccess<'de>>(
1027                self,
1028                mut map: A,
1029            ) -> ::core::result::Result<ServerFrame, A::Error> {
1030                let mut __f_seq: ::core::option::Option<u64> = None;
1031                let mut __f_correlation_id: ::core::option::Option<
1032                    ::buffa::alloc::string::String,
1033                > = None;
1034                let mut __oneof_payload: ::core::option::Option<
1035                    __buffa::oneof::server_frame::Payload,
1036                > = None;
1037                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
1038                    match key.as_str() {
1039                        "seq" => {
1040                            __f_seq = Some({
1041                                struct _S;
1042                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
1043                                    type Value = u64;
1044                                    fn deserialize<D: serde::Deserializer<'de>>(
1045                                        self,
1046                                        d: D,
1047                                    ) -> ::core::result::Result<u64, D::Error> {
1048                                        ::buffa::json_helpers::uint64::deserialize(d)
1049                                    }
1050                                }
1051                                map.next_value_seed(_S)?
1052                            });
1053                        }
1054                        "correlationId" | "correlation_id" => {
1055                            __f_correlation_id = Some({
1056                                struct _S;
1057                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
1058                                    type Value = ::buffa::alloc::string::String;
1059                                    fn deserialize<D: serde::Deserializer<'de>>(
1060                                        self,
1061                                        d: D,
1062                                    ) -> ::core::result::Result<
1063                                        ::buffa::alloc::string::String,
1064                                        D::Error,
1065                                    > {
1066                                        ::buffa::json_helpers::proto_string::deserialize(d)
1067                                    }
1068                                }
1069                                map.next_value_seed(_S)?
1070                            });
1071                        }
1072                        "pong" => {
1073                            let v: ::core::option::Option<PongResponse> = map
1074                                .next_value_seed(
1075                                    ::buffa::json_helpers::NullableDeserializeSeed(
1076                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
1077                                            PongResponse,
1078                                        >::new(),
1079                                    ),
1080                                )?;
1081                            if let Some(v) = v {
1082                                if __oneof_payload.is_some() {
1083                                    return Err(
1084                                        serde::de::Error::custom(
1085                                            "multiple oneof fields set for 'payload'",
1086                                        ),
1087                                    );
1088                                }
1089                                __oneof_payload = Some(
1090                                    __buffa::oneof::server_frame::Payload::Pong(
1091                                        ::buffa::alloc::boxed::Box::new(v),
1092                                    ),
1093                                );
1094                            }
1095                        }
1096                        "ack" => {
1097                            let v: ::core::option::Option<AckResponse> = map
1098                                .next_value_seed(
1099                                    ::buffa::json_helpers::NullableDeserializeSeed(
1100                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
1101                                            AckResponse,
1102                                        >::new(),
1103                                    ),
1104                                )?;
1105                            if let Some(v) = v {
1106                                if __oneof_payload.is_some() {
1107                                    return Err(
1108                                        serde::de::Error::custom(
1109                                            "multiple oneof fields set for 'payload'",
1110                                        ),
1111                                    );
1112                                }
1113                                __oneof_payload = Some(
1114                                    __buffa::oneof::server_frame::Payload::Ack(
1115                                        ::buffa::alloc::boxed::Box::new(v),
1116                                    ),
1117                                );
1118                            }
1119                        }
1120                        "reject" => {
1121                            let v: ::core::option::Option<CommandReject> = map
1122                                .next_value_seed(
1123                                    ::buffa::json_helpers::NullableDeserializeSeed(
1124                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
1125                                            CommandReject,
1126                                        >::new(),
1127                                    ),
1128                                )?;
1129                            if let Some(v) = v {
1130                                if __oneof_payload.is_some() {
1131                                    return Err(
1132                                        serde::de::Error::custom(
1133                                            "multiple oneof fields set for 'payload'",
1134                                        ),
1135                                    );
1136                                }
1137                                __oneof_payload = Some(
1138                                    __buffa::oneof::server_frame::Payload::Reject(
1139                                        ::buffa::alloc::boxed::Box::new(v),
1140                                    ),
1141                                );
1142                            }
1143                        }
1144                        "overload" => {
1145                            let v: ::core::option::Option<OverloadResponse> = map
1146                                .next_value_seed(
1147                                    ::buffa::json_helpers::NullableDeserializeSeed(
1148                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
1149                                            OverloadResponse,
1150                                        >::new(),
1151                                    ),
1152                                )?;
1153                            if let Some(v) = v {
1154                                if __oneof_payload.is_some() {
1155                                    return Err(
1156                                        serde::de::Error::custom(
1157                                            "multiple oneof fields set for 'payload'",
1158                                        ),
1159                                    );
1160                                }
1161                                __oneof_payload = Some(
1162                                    __buffa::oneof::server_frame::Payload::Overload(
1163                                        ::buffa::alloc::boxed::Box::new(v),
1164                                    ),
1165                                );
1166                            }
1167                        }
1168                        "terminal" => {
1169                            let v: ::core::option::Option<TerminalSessionEvent> = map
1170                                .next_value_seed(
1171                                    ::buffa::json_helpers::NullableDeserializeSeed(
1172                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
1173                                            TerminalSessionEvent,
1174                                        >::new(),
1175                                    ),
1176                                )?;
1177                            if let Some(v) = v {
1178                                if __oneof_payload.is_some() {
1179                                    return Err(
1180                                        serde::de::Error::custom(
1181                                            "multiple oneof fields set for 'payload'",
1182                                        ),
1183                                    );
1184                                }
1185                                __oneof_payload = Some(
1186                                    __buffa::oneof::server_frame::Payload::Terminal(
1187                                        ::buffa::alloc::boxed::Box::new(v),
1188                                    ),
1189                                );
1190                            }
1191                        }
1192                        _ => {
1193                            map.next_value::<serde::de::IgnoredAny>()?;
1194                        }
1195                    }
1196                }
1197                let mut __r = <ServerFrame as ::core::default::Default>::default();
1198                if let ::core::option::Option::Some(v) = __f_seq {
1199                    __r.seq = v;
1200                }
1201                if let ::core::option::Option::Some(v) = __f_correlation_id {
1202                    __r.correlation_id = v;
1203                }
1204                __r.payload = __oneof_payload;
1205                Ok(__r)
1206            }
1207        }
1208        d.deserialize_map(_V)
1209    }
1210}
1211impl ::buffa::json_helpers::ProtoElemJson for ServerFrame {
1212    fn serialize_proto_json<S: ::serde::Serializer>(
1213        v: &Self,
1214        s: S,
1215    ) -> ::core::result::Result<S::Ok, S::Error> {
1216        ::serde::Serialize::serialize(v, s)
1217    }
1218    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1219        d: D,
1220    ) -> ::core::result::Result<Self, D::Error> {
1221        <Self as ::serde::Deserialize>::deserialize(d)
1222    }
1223}
1224#[doc(hidden)]
1225pub const __SERVER_FRAME_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1226    type_url: "type.googleapis.com/tradews.v1.ServerFrame",
1227    to_json: ::buffa::type_registry::any_to_json::<ServerFrame>,
1228    from_json: ::buffa::type_registry::any_from_json::<ServerFrame>,
1229    is_wkt: false,
1230};
1231pub mod server_frame {
1232    #[allow(unused_imports)]
1233    use super::*;
1234    #[doc(inline)]
1235    pub use super::__buffa::oneof::server_frame::Payload;
1236    #[doc(inline)]
1237    pub use super::__buffa::view::oneof::server_frame::Payload as PayloadView;
1238}
1239/// PongResponse echoes a PingRequest payload.
1240#[derive(Clone, PartialEq, Default)]
1241#[derive(::serde::Serialize, ::serde::Deserialize)]
1242#[serde(default)]
1243pub struct PongResponse {
1244    /// Opaque payload copied from PingRequest.
1245    ///
1246    /// Field 1: `payload`
1247    #[serde(
1248        rename = "payload",
1249        with = "::buffa::json_helpers::bytes",
1250        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
1251    )]
1252    pub payload: ::buffa::alloc::vec::Vec<u8>,
1253    #[serde(skip)]
1254    #[doc(hidden)]
1255    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1256}
1257impl ::core::fmt::Debug for PongResponse {
1258    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1259        f.debug_struct("PongResponse").field("payload", &self.payload).finish()
1260    }
1261}
1262impl PongResponse {
1263    /// Protobuf type URL for this message, for use with `Any::pack` and
1264    /// `Any::unpack_if`.
1265    ///
1266    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1267    pub const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.PongResponse";
1268}
1269::buffa::impl_default_instance!(PongResponse);
1270impl ::buffa::MessageName for PongResponse {
1271    const PACKAGE: &'static str = "tradews.v1";
1272    const NAME: &'static str = "PongResponse";
1273    const FULL_NAME: &'static str = "tradews.v1.PongResponse";
1274    const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.PongResponse";
1275}
1276impl ::buffa::Message for PongResponse {
1277    /// Returns the total encoded size in bytes.
1278    ///
1279    /// The result is a `u32`; the protobuf specification requires all
1280    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1281    /// compliant message will never overflow this type.
1282    #[allow(clippy::let_and_return)]
1283    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1284        #[allow(unused_imports)]
1285        use ::buffa::Enumeration as _;
1286        let mut size = 0u32;
1287        if !self.payload.is_empty() {
1288            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.payload) as u32;
1289        }
1290        size += self.__buffa_unknown_fields.encoded_len() as u32;
1291        size
1292    }
1293    fn write_to(
1294        &self,
1295        _cache: &mut ::buffa::SizeCache,
1296        buf: &mut impl ::buffa::bytes::BufMut,
1297    ) {
1298        #[allow(unused_imports)]
1299        use ::buffa::Enumeration as _;
1300        if !self.payload.is_empty() {
1301            ::buffa::types::put_bytes_field(1u32, &self.payload, buf);
1302        }
1303        self.__buffa_unknown_fields.write_to(buf);
1304    }
1305    fn merge_field(
1306        &mut self,
1307        tag: ::buffa::encoding::Tag,
1308        buf: &mut impl ::buffa::bytes::Buf,
1309        ctx: ::buffa::DecodeContext<'_>,
1310    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1311        #[allow(unused_imports)]
1312        use ::buffa::bytes::Buf as _;
1313        #[allow(unused_imports)]
1314        use ::buffa::Enumeration as _;
1315        match tag.field_number() {
1316            1u32 => {
1317                ::buffa::encoding::check_wire_type(
1318                    tag,
1319                    ::buffa::encoding::WireType::LengthDelimited,
1320                )?;
1321                ::buffa::types::merge_bytes(&mut self.payload, buf)?;
1322            }
1323            _ => {
1324                self.__buffa_unknown_fields
1325                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1326            }
1327        }
1328        ::core::result::Result::Ok(())
1329    }
1330    fn clear(&mut self) {
1331        self.payload.clear();
1332        self.__buffa_unknown_fields.clear();
1333    }
1334}
1335impl ::buffa::ExtensionSet for PongResponse {
1336    const PROTO_FQN: &'static str = "tradews.v1.PongResponse";
1337    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1338        &self.__buffa_unknown_fields
1339    }
1340    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1341        &mut self.__buffa_unknown_fields
1342    }
1343}
1344impl ::buffa::json_helpers::ProtoElemJson for PongResponse {
1345    fn serialize_proto_json<S: ::serde::Serializer>(
1346        v: &Self,
1347        s: S,
1348    ) -> ::core::result::Result<S::Ok, S::Error> {
1349        ::serde::Serialize::serialize(v, s)
1350    }
1351    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1352        d: D,
1353    ) -> ::core::result::Result<Self, D::Error> {
1354        <Self as ::serde::Deserialize>::deserialize(d)
1355    }
1356}
1357#[doc(hidden)]
1358pub const __PONG_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1359    type_url: "type.googleapis.com/tradews.v1.PongResponse",
1360    to_json: ::buffa::type_registry::any_to_json::<PongResponse>,
1361    from_json: ::buffa::type_registry::any_from_json::<PongResponse>,
1362    is_wkt: false,
1363};
1364/// AckResponse carries the command-specific public Orders API acknowledgement.
1365#[derive(Clone, PartialEq, Default)]
1366#[derive(::serde::Serialize)]
1367#[serde(default)]
1368pub struct AckResponse {
1369    #[serde(flatten)]
1370    pub result: ::core::option::Option<__buffa::oneof::ack_response::Result>,
1371    #[serde(skip)]
1372    #[doc(hidden)]
1373    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1374}
1375impl ::core::fmt::Debug for AckResponse {
1376    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1377        f.debug_struct("AckResponse").field("result", &self.result).finish()
1378    }
1379}
1380impl AckResponse {
1381    /// Protobuf type URL for this message, for use with `Any::pack` and
1382    /// `Any::unpack_if`.
1383    ///
1384    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1385    pub const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.AckResponse";
1386}
1387::buffa::impl_default_instance!(AckResponse);
1388impl ::buffa::MessageName for AckResponse {
1389    const PACKAGE: &'static str = "tradews.v1";
1390    const NAME: &'static str = "AckResponse";
1391    const FULL_NAME: &'static str = "tradews.v1.AckResponse";
1392    const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.AckResponse";
1393}
1394impl ::buffa::Message for AckResponse {
1395    /// Returns the total encoded size in bytes.
1396    ///
1397    /// The result is a `u32`; the protobuf specification requires all
1398    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1399    /// compliant message will never overflow this type.
1400    #[allow(clippy::let_and_return)]
1401    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1402        #[allow(unused_imports)]
1403        use ::buffa::Enumeration as _;
1404        let mut size = 0u32;
1405        if let ::core::option::Option::Some(ref v) = self.result {
1406            match v {
1407                __buffa::oneof::ack_response::Result::CreateOrder(x) => {
1408                    let __slot = __cache.reserve();
1409                    let inner = x.compute_size(__cache);
1410                    __cache.set(__slot, inner);
1411                    size
1412                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
1413                            + inner;
1414                }
1415                __buffa::oneof::ack_response::Result::CancelOrder(x) => {
1416                    let __slot = __cache.reserve();
1417                    let inner = x.compute_size(__cache);
1418                    __cache.set(__slot, inner);
1419                    size
1420                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
1421                            + inner;
1422                }
1423                __buffa::oneof::ack_response::Result::ModifyOrder(x) => {
1424                    let __slot = __cache.reserve();
1425                    let inner = x.compute_size(__cache);
1426                    __cache.set(__slot, inner);
1427                    size
1428                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
1429                            + inner;
1430                }
1431                __buffa::oneof::ack_response::Result::CancelAllOrders(x) => {
1432                    let __slot = __cache.reserve();
1433                    let inner = x.compute_size(__cache);
1434                    __cache.set(__slot, inner);
1435                    size
1436                        += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
1437                            + inner;
1438                }
1439            }
1440        }
1441        size += self.__buffa_unknown_fields.encoded_len() as u32;
1442        size
1443    }
1444    fn write_to(
1445        &self,
1446        __cache: &mut ::buffa::SizeCache,
1447        buf: &mut impl ::buffa::bytes::BufMut,
1448    ) {
1449        #[allow(unused_imports)]
1450        use ::buffa::Enumeration as _;
1451        if let ::core::option::Option::Some(ref v) = self.result {
1452            match v {
1453                __buffa::oneof::ack_response::Result::CreateOrder(x) => {
1454                    ::buffa::types::put_len_delimited_header(
1455                        1u32,
1456                        __cache.consume_next(),
1457                        buf,
1458                    );
1459                    x.write_to(__cache, buf);
1460                }
1461                __buffa::oneof::ack_response::Result::CancelOrder(x) => {
1462                    ::buffa::types::put_len_delimited_header(
1463                        2u32,
1464                        __cache.consume_next(),
1465                        buf,
1466                    );
1467                    x.write_to(__cache, buf);
1468                }
1469                __buffa::oneof::ack_response::Result::ModifyOrder(x) => {
1470                    ::buffa::types::put_len_delimited_header(
1471                        3u32,
1472                        __cache.consume_next(),
1473                        buf,
1474                    );
1475                    x.write_to(__cache, buf);
1476                }
1477                __buffa::oneof::ack_response::Result::CancelAllOrders(x) => {
1478                    ::buffa::types::put_len_delimited_header(
1479                        4u32,
1480                        __cache.consume_next(),
1481                        buf,
1482                    );
1483                    x.write_to(__cache, buf);
1484                }
1485            }
1486        }
1487        self.__buffa_unknown_fields.write_to(buf);
1488    }
1489    fn merge_field(
1490        &mut self,
1491        tag: ::buffa::encoding::Tag,
1492        buf: &mut impl ::buffa::bytes::Buf,
1493        ctx: ::buffa::DecodeContext<'_>,
1494    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1495        #[allow(unused_imports)]
1496        use ::buffa::bytes::Buf as _;
1497        #[allow(unused_imports)]
1498        use ::buffa::Enumeration as _;
1499        match tag.field_number() {
1500            1u32 => {
1501                ::buffa::encoding::check_wire_type(
1502                    tag,
1503                    ::buffa::encoding::WireType::LengthDelimited,
1504                )?;
1505                if let ::core::option::Option::Some(
1506                    __buffa::oneof::ack_response::Result::CreateOrder(ref mut existing),
1507                ) = self.result
1508                {
1509                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
1510                } else {
1511                    let mut val = ::core::default::Default::default();
1512                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
1513                    self.result = ::core::option::Option::Some(
1514                        __buffa::oneof::ack_response::Result::CreateOrder(
1515                            ::buffa::alloc::boxed::Box::new(val),
1516                        ),
1517                    );
1518                }
1519            }
1520            2u32 => {
1521                ::buffa::encoding::check_wire_type(
1522                    tag,
1523                    ::buffa::encoding::WireType::LengthDelimited,
1524                )?;
1525                if let ::core::option::Option::Some(
1526                    __buffa::oneof::ack_response::Result::CancelOrder(ref mut existing),
1527                ) = self.result
1528                {
1529                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
1530                } else {
1531                    let mut val = ::core::default::Default::default();
1532                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
1533                    self.result = ::core::option::Option::Some(
1534                        __buffa::oneof::ack_response::Result::CancelOrder(
1535                            ::buffa::alloc::boxed::Box::new(val),
1536                        ),
1537                    );
1538                }
1539            }
1540            3u32 => {
1541                ::buffa::encoding::check_wire_type(
1542                    tag,
1543                    ::buffa::encoding::WireType::LengthDelimited,
1544                )?;
1545                if let ::core::option::Option::Some(
1546                    __buffa::oneof::ack_response::Result::ModifyOrder(ref mut existing),
1547                ) = self.result
1548                {
1549                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
1550                } else {
1551                    let mut val = ::core::default::Default::default();
1552                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
1553                    self.result = ::core::option::Option::Some(
1554                        __buffa::oneof::ack_response::Result::ModifyOrder(
1555                            ::buffa::alloc::boxed::Box::new(val),
1556                        ),
1557                    );
1558                }
1559            }
1560            4u32 => {
1561                ::buffa::encoding::check_wire_type(
1562                    tag,
1563                    ::buffa::encoding::WireType::LengthDelimited,
1564                )?;
1565                if let ::core::option::Option::Some(
1566                    __buffa::oneof::ack_response::Result::CancelAllOrders(
1567                        ref mut existing,
1568                    ),
1569                ) = self.result
1570                {
1571                    ::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
1572                } else {
1573                    let mut val = ::core::default::Default::default();
1574                    ::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
1575                    self.result = ::core::option::Option::Some(
1576                        __buffa::oneof::ack_response::Result::CancelAllOrders(
1577                            ::buffa::alloc::boxed::Box::new(val),
1578                        ),
1579                    );
1580                }
1581            }
1582            _ => {
1583                self.__buffa_unknown_fields
1584                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1585            }
1586        }
1587        ::core::result::Result::Ok(())
1588    }
1589    fn clear(&mut self) {
1590        self.result = ::core::option::Option::None;
1591        self.__buffa_unknown_fields.clear();
1592    }
1593}
1594impl ::buffa::ExtensionSet for AckResponse {
1595    const PROTO_FQN: &'static str = "tradews.v1.AckResponse";
1596    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1597        &self.__buffa_unknown_fields
1598    }
1599    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1600        &mut self.__buffa_unknown_fields
1601    }
1602}
1603impl<'de> serde::Deserialize<'de> for AckResponse {
1604    fn deserialize<D: serde::Deserializer<'de>>(
1605        d: D,
1606    ) -> ::core::result::Result<Self, D::Error> {
1607        struct _V;
1608        impl<'de> serde::de::Visitor<'de> for _V {
1609            type Value = AckResponse;
1610            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1611                f.write_str("struct AckResponse")
1612            }
1613            #[allow(clippy::field_reassign_with_default)]
1614            fn visit_map<A: serde::de::MapAccess<'de>>(
1615                self,
1616                mut map: A,
1617            ) -> ::core::result::Result<AckResponse, A::Error> {
1618                let mut __oneof_result: ::core::option::Option<
1619                    __buffa::oneof::ack_response::Result,
1620                > = None;
1621                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
1622                    match key.as_str() {
1623                        "createOrder" | "create_order" => {
1624                            let v: ::core::option::Option<
1625                                super::super::orders::v1::CreateOrderResponse,
1626                            > = map
1627                                .next_value_seed(
1628                                    ::buffa::json_helpers::NullableDeserializeSeed(
1629                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
1630                                            super::super::orders::v1::CreateOrderResponse,
1631                                        >::new(),
1632                                    ),
1633                                )?;
1634                            if let Some(v) = v {
1635                                if __oneof_result.is_some() {
1636                                    return Err(
1637                                        serde::de::Error::custom(
1638                                            "multiple oneof fields set for 'result'",
1639                                        ),
1640                                    );
1641                                }
1642                                __oneof_result = Some(
1643                                    __buffa::oneof::ack_response::Result::CreateOrder(
1644                                        ::buffa::alloc::boxed::Box::new(v),
1645                                    ),
1646                                );
1647                            }
1648                        }
1649                        "cancelOrder" | "cancel_order" => {
1650                            let v: ::core::option::Option<
1651                                super::super::orders::v1::CancelOrderResponse,
1652                            > = map
1653                                .next_value_seed(
1654                                    ::buffa::json_helpers::NullableDeserializeSeed(
1655                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
1656                                            super::super::orders::v1::CancelOrderResponse,
1657                                        >::new(),
1658                                    ),
1659                                )?;
1660                            if let Some(v) = v {
1661                                if __oneof_result.is_some() {
1662                                    return Err(
1663                                        serde::de::Error::custom(
1664                                            "multiple oneof fields set for 'result'",
1665                                        ),
1666                                    );
1667                                }
1668                                __oneof_result = Some(
1669                                    __buffa::oneof::ack_response::Result::CancelOrder(
1670                                        ::buffa::alloc::boxed::Box::new(v),
1671                                    ),
1672                                );
1673                            }
1674                        }
1675                        "modifyOrder" | "modify_order" => {
1676                            let v: ::core::option::Option<
1677                                super::super::orders::v1::ModifyOrderResponse,
1678                            > = map
1679                                .next_value_seed(
1680                                    ::buffa::json_helpers::NullableDeserializeSeed(
1681                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
1682                                            super::super::orders::v1::ModifyOrderResponse,
1683                                        >::new(),
1684                                    ),
1685                                )?;
1686                            if let Some(v) = v {
1687                                if __oneof_result.is_some() {
1688                                    return Err(
1689                                        serde::de::Error::custom(
1690                                            "multiple oneof fields set for 'result'",
1691                                        ),
1692                                    );
1693                                }
1694                                __oneof_result = Some(
1695                                    __buffa::oneof::ack_response::Result::ModifyOrder(
1696                                        ::buffa::alloc::boxed::Box::new(v),
1697                                    ),
1698                                );
1699                            }
1700                        }
1701                        "cancelAllOrders" | "cancel_all_orders" => {
1702                            let v: ::core::option::Option<
1703                                super::super::orders::v1::CancelAllOrdersResponse,
1704                            > = map
1705                                .next_value_seed(
1706                                    ::buffa::json_helpers::NullableDeserializeSeed(
1707                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
1708                                            super::super::orders::v1::CancelAllOrdersResponse,
1709                                        >::new(),
1710                                    ),
1711                                )?;
1712                            if let Some(v) = v {
1713                                if __oneof_result.is_some() {
1714                                    return Err(
1715                                        serde::de::Error::custom(
1716                                            "multiple oneof fields set for 'result'",
1717                                        ),
1718                                    );
1719                                }
1720                                __oneof_result = Some(
1721                                    __buffa::oneof::ack_response::Result::CancelAllOrders(
1722                                        ::buffa::alloc::boxed::Box::new(v),
1723                                    ),
1724                                );
1725                            }
1726                        }
1727                        _ => {
1728                            map.next_value::<serde::de::IgnoredAny>()?;
1729                        }
1730                    }
1731                }
1732                let mut __r = <AckResponse as ::core::default::Default>::default();
1733                __r.result = __oneof_result;
1734                Ok(__r)
1735            }
1736        }
1737        d.deserialize_map(_V)
1738    }
1739}
1740impl ::buffa::json_helpers::ProtoElemJson for AckResponse {
1741    fn serialize_proto_json<S: ::serde::Serializer>(
1742        v: &Self,
1743        s: S,
1744    ) -> ::core::result::Result<S::Ok, S::Error> {
1745        ::serde::Serialize::serialize(v, s)
1746    }
1747    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1748        d: D,
1749    ) -> ::core::result::Result<Self, D::Error> {
1750        <Self as ::serde::Deserialize>::deserialize(d)
1751    }
1752}
1753#[doc(hidden)]
1754pub const __ACK_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1755    type_url: "type.googleapis.com/tradews.v1.AckResponse",
1756    to_json: ::buffa::type_registry::any_to_json::<AckResponse>,
1757    from_json: ::buffa::type_registry::any_from_json::<AckResponse>,
1758    is_wkt: false,
1759};
1760pub mod ack_response {
1761    #[allow(unused_imports)]
1762    use super::*;
1763    #[doc(inline)]
1764    pub use super::__buffa::oneof::ack_response::Result;
1765    #[doc(inline)]
1766    pub use super::__buffa::view::oneof::ack_response::Result as ResultView;
1767}
1768/// CommandReject reports a command-level failure without closing the session.
1769#[derive(Clone, PartialEq, Default)]
1770#[derive(::serde::Serialize, ::serde::Deserialize)]
1771#[serde(default)]
1772pub struct CommandReject {
1773    /// Stable machine-readable reject code.
1774    ///
1775    /// Field 1: `code`
1776    #[serde(
1777        rename = "code",
1778        with = "::buffa::json_helpers::proto_string",
1779        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1780    )]
1781    pub code: ::buffa::alloc::string::String,
1782    /// Client-safe diagnostic detail.
1783    ///
1784    /// Field 2: `detail`
1785    #[serde(
1786        rename = "detail",
1787        with = "::buffa::json_helpers::proto_string",
1788        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1789    )]
1790    pub detail: ::buffa::alloc::string::String,
1791    /// Structured error details, including retry guidance for rate-limit rejections.
1792    ///
1793    /// Field 3: `error`
1794    #[serde(
1795        rename = "error",
1796        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
1797    )]
1798    pub error: ::buffa::MessageField<super::super::orders::v1::ErrorDetail>,
1799    #[serde(skip)]
1800    #[doc(hidden)]
1801    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1802}
1803impl ::core::fmt::Debug for CommandReject {
1804    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1805        f.debug_struct("CommandReject")
1806            .field("code", &self.code)
1807            .field("detail", &self.detail)
1808            .field("error", &self.error)
1809            .finish()
1810    }
1811}
1812impl CommandReject {
1813    /// Protobuf type URL for this message, for use with `Any::pack` and
1814    /// `Any::unpack_if`.
1815    ///
1816    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1817    pub const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.CommandReject";
1818}
1819::buffa::impl_default_instance!(CommandReject);
1820impl ::buffa::MessageName for CommandReject {
1821    const PACKAGE: &'static str = "tradews.v1";
1822    const NAME: &'static str = "CommandReject";
1823    const FULL_NAME: &'static str = "tradews.v1.CommandReject";
1824    const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.CommandReject";
1825}
1826impl ::buffa::Message for CommandReject {
1827    /// Returns the total encoded size in bytes.
1828    ///
1829    /// The result is a `u32`; the protobuf specification requires all
1830    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
1831    /// compliant message will never overflow this type.
1832    #[allow(clippy::let_and_return)]
1833    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1834        #[allow(unused_imports)]
1835        use ::buffa::Enumeration as _;
1836        let mut size = 0u32;
1837        if !self.code.is_empty() {
1838            size += 1u32 + ::buffa::types::string_encoded_len(&self.code) as u32;
1839        }
1840        if !self.detail.is_empty() {
1841            size += 1u32 + ::buffa::types::string_encoded_len(&self.detail) as u32;
1842        }
1843        if self.error.is_set() {
1844            let __slot = __cache.reserve();
1845            let inner_size = self.error.compute_size(__cache);
1846            __cache.set(__slot, inner_size);
1847            size
1848                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1849                    + inner_size;
1850        }
1851        size += self.__buffa_unknown_fields.encoded_len() as u32;
1852        size
1853    }
1854    fn write_to(
1855        &self,
1856        __cache: &mut ::buffa::SizeCache,
1857        buf: &mut impl ::buffa::bytes::BufMut,
1858    ) {
1859        #[allow(unused_imports)]
1860        use ::buffa::Enumeration as _;
1861        if !self.code.is_empty() {
1862            ::buffa::types::put_string_field(1u32, &self.code, buf);
1863        }
1864        if !self.detail.is_empty() {
1865            ::buffa::types::put_string_field(2u32, &self.detail, buf);
1866        }
1867        if self.error.is_set() {
1868            ::buffa::types::put_len_delimited_header(3u32, __cache.consume_next(), buf);
1869            self.error.write_to(__cache, buf);
1870        }
1871        self.__buffa_unknown_fields.write_to(buf);
1872    }
1873    fn merge_field(
1874        &mut self,
1875        tag: ::buffa::encoding::Tag,
1876        buf: &mut impl ::buffa::bytes::Buf,
1877        ctx: ::buffa::DecodeContext<'_>,
1878    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1879        #[allow(unused_imports)]
1880        use ::buffa::bytes::Buf as _;
1881        #[allow(unused_imports)]
1882        use ::buffa::Enumeration as _;
1883        match tag.field_number() {
1884            1u32 => {
1885                ::buffa::encoding::check_wire_type(
1886                    tag,
1887                    ::buffa::encoding::WireType::LengthDelimited,
1888                )?;
1889                ::buffa::types::merge_string(&mut self.code, buf)?;
1890            }
1891            2u32 => {
1892                ::buffa::encoding::check_wire_type(
1893                    tag,
1894                    ::buffa::encoding::WireType::LengthDelimited,
1895                )?;
1896                ::buffa::types::merge_string(&mut self.detail, buf)?;
1897            }
1898            3u32 => {
1899                ::buffa::encoding::check_wire_type(
1900                    tag,
1901                    ::buffa::encoding::WireType::LengthDelimited,
1902                )?;
1903                ::buffa::Message::merge_length_delimited(
1904                    self.error.get_or_insert_default(),
1905                    buf,
1906                    ctx,
1907                )?;
1908            }
1909            _ => {
1910                self.__buffa_unknown_fields
1911                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1912            }
1913        }
1914        ::core::result::Result::Ok(())
1915    }
1916    fn clear(&mut self) {
1917        self.code.clear();
1918        self.detail.clear();
1919        self.error = ::buffa::MessageField::none();
1920        self.__buffa_unknown_fields.clear();
1921    }
1922}
1923impl ::buffa::ExtensionSet for CommandReject {
1924    const PROTO_FQN: &'static str = "tradews.v1.CommandReject";
1925    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1926        &self.__buffa_unknown_fields
1927    }
1928    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1929        &mut self.__buffa_unknown_fields
1930    }
1931}
1932impl ::buffa::json_helpers::ProtoElemJson for CommandReject {
1933    fn serialize_proto_json<S: ::serde::Serializer>(
1934        v: &Self,
1935        s: S,
1936    ) -> ::core::result::Result<S::Ok, S::Error> {
1937        ::serde::Serialize::serialize(v, s)
1938    }
1939    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1940        d: D,
1941    ) -> ::core::result::Result<Self, D::Error> {
1942        <Self as ::serde::Deserialize>::deserialize(d)
1943    }
1944}
1945#[doc(hidden)]
1946pub const __COMMAND_REJECT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1947    type_url: "type.googleapis.com/tradews.v1.CommandReject",
1948    to_json: ::buffa::type_registry::any_to_json::<CommandReject>,
1949    from_json: ::buffa::type_registry::any_from_json::<CommandReject>,
1950    is_wkt: false,
1951};
1952/// OverloadResponse reports that the session exceeded server admission limits.
1953#[derive(Clone, PartialEq, Default)]
1954#[derive(::serde::Serialize, ::serde::Deserialize)]
1955#[serde(default)]
1956pub struct OverloadResponse {
1957    /// Stable machine-readable overload code.
1958    ///
1959    /// Field 1: `code`
1960    #[serde(
1961        rename = "code",
1962        with = "::buffa::json_helpers::proto_string",
1963        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1964    )]
1965    pub code: ::buffa::alloc::string::String,
1966    /// Client-safe diagnostic detail.
1967    ///
1968    /// Field 2: `detail`
1969    #[serde(
1970        rename = "detail",
1971        with = "::buffa::json_helpers::proto_string",
1972        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1973    )]
1974    pub detail: ::buffa::alloc::string::String,
1975    #[serde(skip)]
1976    #[doc(hidden)]
1977    pub __buffa_unknown_fields: ::buffa::UnknownFields,
1978}
1979impl ::core::fmt::Debug for OverloadResponse {
1980    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1981        f.debug_struct("OverloadResponse")
1982            .field("code", &self.code)
1983            .field("detail", &self.detail)
1984            .finish()
1985    }
1986}
1987impl OverloadResponse {
1988    /// Protobuf type URL for this message, for use with `Any::pack` and
1989    /// `Any::unpack_if`.
1990    ///
1991    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
1992    pub const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.OverloadResponse";
1993}
1994::buffa::impl_default_instance!(OverloadResponse);
1995impl ::buffa::MessageName for OverloadResponse {
1996    const PACKAGE: &'static str = "tradews.v1";
1997    const NAME: &'static str = "OverloadResponse";
1998    const FULL_NAME: &'static str = "tradews.v1.OverloadResponse";
1999    const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.OverloadResponse";
2000}
2001impl ::buffa::Message for OverloadResponse {
2002    /// Returns the total encoded size in bytes.
2003    ///
2004    /// The result is a `u32`; the protobuf specification requires all
2005    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2006    /// compliant message will never overflow this type.
2007    #[allow(clippy::let_and_return)]
2008    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2009        #[allow(unused_imports)]
2010        use ::buffa::Enumeration as _;
2011        let mut size = 0u32;
2012        if !self.code.is_empty() {
2013            size += 1u32 + ::buffa::types::string_encoded_len(&self.code) as u32;
2014        }
2015        if !self.detail.is_empty() {
2016            size += 1u32 + ::buffa::types::string_encoded_len(&self.detail) as u32;
2017        }
2018        size += self.__buffa_unknown_fields.encoded_len() as u32;
2019        size
2020    }
2021    fn write_to(
2022        &self,
2023        _cache: &mut ::buffa::SizeCache,
2024        buf: &mut impl ::buffa::bytes::BufMut,
2025    ) {
2026        #[allow(unused_imports)]
2027        use ::buffa::Enumeration as _;
2028        if !self.code.is_empty() {
2029            ::buffa::types::put_string_field(1u32, &self.code, buf);
2030        }
2031        if !self.detail.is_empty() {
2032            ::buffa::types::put_string_field(2u32, &self.detail, buf);
2033        }
2034        self.__buffa_unknown_fields.write_to(buf);
2035    }
2036    fn merge_field(
2037        &mut self,
2038        tag: ::buffa::encoding::Tag,
2039        buf: &mut impl ::buffa::bytes::Buf,
2040        ctx: ::buffa::DecodeContext<'_>,
2041    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2042        #[allow(unused_imports)]
2043        use ::buffa::bytes::Buf as _;
2044        #[allow(unused_imports)]
2045        use ::buffa::Enumeration as _;
2046        match tag.field_number() {
2047            1u32 => {
2048                ::buffa::encoding::check_wire_type(
2049                    tag,
2050                    ::buffa::encoding::WireType::LengthDelimited,
2051                )?;
2052                ::buffa::types::merge_string(&mut self.code, buf)?;
2053            }
2054            2u32 => {
2055                ::buffa::encoding::check_wire_type(
2056                    tag,
2057                    ::buffa::encoding::WireType::LengthDelimited,
2058                )?;
2059                ::buffa::types::merge_string(&mut self.detail, buf)?;
2060            }
2061            _ => {
2062                self.__buffa_unknown_fields
2063                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2064            }
2065        }
2066        ::core::result::Result::Ok(())
2067    }
2068    fn clear(&mut self) {
2069        self.code.clear();
2070        self.detail.clear();
2071        self.__buffa_unknown_fields.clear();
2072    }
2073}
2074impl ::buffa::ExtensionSet for OverloadResponse {
2075    const PROTO_FQN: &'static str = "tradews.v1.OverloadResponse";
2076    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2077        &self.__buffa_unknown_fields
2078    }
2079    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2080        &mut self.__buffa_unknown_fields
2081    }
2082}
2083impl ::buffa::json_helpers::ProtoElemJson for OverloadResponse {
2084    fn serialize_proto_json<S: ::serde::Serializer>(
2085        v: &Self,
2086        s: S,
2087    ) -> ::core::result::Result<S::Ok, S::Error> {
2088        ::serde::Serialize::serialize(v, s)
2089    }
2090    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2091        d: D,
2092    ) -> ::core::result::Result<Self, D::Error> {
2093        <Self as ::serde::Deserialize>::deserialize(d)
2094    }
2095}
2096#[doc(hidden)]
2097pub const __OVERLOAD_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2098    type_url: "type.googleapis.com/tradews.v1.OverloadResponse",
2099    to_json: ::buffa::type_registry::any_to_json::<OverloadResponse>,
2100    from_json: ::buffa::type_registry::any_from_json::<OverloadResponse>,
2101    is_wkt: false,
2102};
2103/// TerminalSessionEvent reports a terminal session condition.
2104#[derive(Clone, PartialEq, Default)]
2105#[derive(::serde::Serialize, ::serde::Deserialize)]
2106#[serde(default)]
2107pub struct TerminalSessionEvent {
2108    /// Stable machine-readable terminal code.
2109    ///
2110    /// Field 1: `code`
2111    #[serde(
2112        rename = "code",
2113        with = "::buffa::json_helpers::proto_string",
2114        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2115    )]
2116    pub code: ::buffa::alloc::string::String,
2117    /// Client-safe diagnostic detail.
2118    ///
2119    /// Field 2: `detail`
2120    #[serde(
2121        rename = "detail",
2122        with = "::buffa::json_helpers::proto_string",
2123        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2124    )]
2125    pub detail: ::buffa::alloc::string::String,
2126    #[serde(skip)]
2127    #[doc(hidden)]
2128    pub __buffa_unknown_fields: ::buffa::UnknownFields,
2129}
2130impl ::core::fmt::Debug for TerminalSessionEvent {
2131    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2132        f.debug_struct("TerminalSessionEvent")
2133            .field("code", &self.code)
2134            .field("detail", &self.detail)
2135            .finish()
2136    }
2137}
2138impl TerminalSessionEvent {
2139    /// Protobuf type URL for this message, for use with `Any::pack` and
2140    /// `Any::unpack_if`.
2141    ///
2142    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
2143    pub const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.TerminalSessionEvent";
2144}
2145::buffa::impl_default_instance!(TerminalSessionEvent);
2146impl ::buffa::MessageName for TerminalSessionEvent {
2147    const PACKAGE: &'static str = "tradews.v1";
2148    const NAME: &'static str = "TerminalSessionEvent";
2149    const FULL_NAME: &'static str = "tradews.v1.TerminalSessionEvent";
2150    const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.TerminalSessionEvent";
2151}
2152impl ::buffa::Message for TerminalSessionEvent {
2153    /// Returns the total encoded size in bytes.
2154    ///
2155    /// The result is a `u32`; the protobuf specification requires all
2156    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
2157    /// compliant message will never overflow this type.
2158    #[allow(clippy::let_and_return)]
2159    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2160        #[allow(unused_imports)]
2161        use ::buffa::Enumeration as _;
2162        let mut size = 0u32;
2163        if !self.code.is_empty() {
2164            size += 1u32 + ::buffa::types::string_encoded_len(&self.code) as u32;
2165        }
2166        if !self.detail.is_empty() {
2167            size += 1u32 + ::buffa::types::string_encoded_len(&self.detail) as u32;
2168        }
2169        size += self.__buffa_unknown_fields.encoded_len() as u32;
2170        size
2171    }
2172    fn write_to(
2173        &self,
2174        _cache: &mut ::buffa::SizeCache,
2175        buf: &mut impl ::buffa::bytes::BufMut,
2176    ) {
2177        #[allow(unused_imports)]
2178        use ::buffa::Enumeration as _;
2179        if !self.code.is_empty() {
2180            ::buffa::types::put_string_field(1u32, &self.code, buf);
2181        }
2182        if !self.detail.is_empty() {
2183            ::buffa::types::put_string_field(2u32, &self.detail, buf);
2184        }
2185        self.__buffa_unknown_fields.write_to(buf);
2186    }
2187    fn merge_field(
2188        &mut self,
2189        tag: ::buffa::encoding::Tag,
2190        buf: &mut impl ::buffa::bytes::Buf,
2191        ctx: ::buffa::DecodeContext<'_>,
2192    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2193        #[allow(unused_imports)]
2194        use ::buffa::bytes::Buf as _;
2195        #[allow(unused_imports)]
2196        use ::buffa::Enumeration as _;
2197        match tag.field_number() {
2198            1u32 => {
2199                ::buffa::encoding::check_wire_type(
2200                    tag,
2201                    ::buffa::encoding::WireType::LengthDelimited,
2202                )?;
2203                ::buffa::types::merge_string(&mut self.code, buf)?;
2204            }
2205            2u32 => {
2206                ::buffa::encoding::check_wire_type(
2207                    tag,
2208                    ::buffa::encoding::WireType::LengthDelimited,
2209                )?;
2210                ::buffa::types::merge_string(&mut self.detail, buf)?;
2211            }
2212            _ => {
2213                self.__buffa_unknown_fields
2214                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2215            }
2216        }
2217        ::core::result::Result::Ok(())
2218    }
2219    fn clear(&mut self) {
2220        self.code.clear();
2221        self.detail.clear();
2222        self.__buffa_unknown_fields.clear();
2223    }
2224}
2225impl ::buffa::ExtensionSet for TerminalSessionEvent {
2226    const PROTO_FQN: &'static str = "tradews.v1.TerminalSessionEvent";
2227    fn unknown_fields(&self) -> &::buffa::UnknownFields {
2228        &self.__buffa_unknown_fields
2229    }
2230    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2231        &mut self.__buffa_unknown_fields
2232    }
2233}
2234impl ::buffa::json_helpers::ProtoElemJson for TerminalSessionEvent {
2235    fn serialize_proto_json<S: ::serde::Serializer>(
2236        v: &Self,
2237        s: S,
2238    ) -> ::core::result::Result<S::Ok, S::Error> {
2239        ::serde::Serialize::serialize(v, s)
2240    }
2241    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2242        d: D,
2243    ) -> ::core::result::Result<Self, D::Error> {
2244        <Self as ::serde::Deserialize>::deserialize(d)
2245    }
2246}
2247#[doc(hidden)]
2248pub const __TERMINAL_SESSION_EVENT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2249    type_url: "type.googleapis.com/tradews.v1.TerminalSessionEvent",
2250    to_json: ::buffa::type_registry::any_to_json::<TerminalSessionEvent>,
2251    from_json: ::buffa::type_registry::any_from_json::<TerminalSessionEvent>,
2252    is_wkt: false,
2253};
2254#[allow(
2255    non_camel_case_types,
2256    dead_code,
2257    unused_imports,
2258    unused_qualifications,
2259    clippy::derivable_impls,
2260    clippy::match_single_binding,
2261    clippy::uninlined_format_args,
2262    clippy::doc_lazy_continuation,
2263    clippy::module_inception
2264)]
2265pub mod __buffa {
2266    #[allow(unused_imports)]
2267    use super::*;
2268    pub mod view {
2269        #[allow(unused_imports)]
2270        use super::*;
2271        /// ClientFrame is the protobuf write-websocket envelope. Its payloads reuse the
2272        /// public Orders API request contracts so every transport shares one order model.
2273        #[derive(Clone, Debug, Default)]
2274        pub struct ClientFrameView<'a> {
2275            /// Monotonic per-connection client sequence number, starting at 1.
2276            ///
2277            /// Field 1: `seq`
2278            pub seq: u64,
2279            /// Client correlation token echoed in every server response.
2280            ///
2281            /// Field 2: `correlation_id`
2282            pub correlation_id: &'a str,
2283            pub payload: ::core::option::Option<
2284                super::super::__buffa::view::oneof::client_frame::Payload<'a>,
2285            >,
2286            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2287        }
2288        impl<'a> ::buffa::MessageView<'a> for ClientFrameView<'a> {
2289            type Owned = super::super::ClientFrame;
2290            fn decode_view(
2291                buf: &'a [u8],
2292            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2293                let __limit = ::core::cell::Cell::new(
2294                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
2295                );
2296                <Self as ::buffa::MessageView>::decode_view_ctx(
2297                    buf,
2298                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
2299                )
2300            }
2301            fn decode_view_with_ctx(
2302                buf: &'a [u8],
2303                ctx: ::buffa::DecodeContext<'_>,
2304            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2305                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
2306            }
2307            fn merge_view_field(
2308                &mut self,
2309                tag: ::buffa::encoding::Tag,
2310                cur: &'a [u8],
2311                before_tag: &'a [u8],
2312                ctx: ::buffa::DecodeContext<'_>,
2313            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
2314                let _ = ctx;
2315                #[allow(unused_variables)]
2316                let view = self;
2317                let mut cur = cur;
2318                match tag.field_number() {
2319                    1u32 => {
2320                        ::buffa::encoding::check_wire_type(
2321                            tag,
2322                            ::buffa::encoding::WireType::Varint,
2323                        )?;
2324                        view.seq = ::buffa::types::decode_uint64(&mut cur)?;
2325                    }
2326                    2u32 => {
2327                        ::buffa::encoding::check_wire_type(
2328                            tag,
2329                            ::buffa::encoding::WireType::LengthDelimited,
2330                        )?;
2331                        view.correlation_id = ::buffa::types::borrow_str(&mut cur)?;
2332                    }
2333                    10u32 => {
2334                        ::buffa::encoding::check_wire_type(
2335                            tag,
2336                            ::buffa::encoding::WireType::LengthDelimited,
2337                        )?;
2338                        let __sub_ctx = ctx.descend()?;
2339                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
2340                        if let Some(
2341                            super::super::__buffa::view::oneof::client_frame::Payload::Ping(
2342                                ref mut existing,
2343                            ),
2344                        ) = view.payload
2345                        {
2346                            ::buffa::MessageView::merge_into_view(
2347                                &mut **existing,
2348                                sub,
2349                                __sub_ctx,
2350                            )?;
2351                        } else {
2352                            view.payload = Some(
2353                                super::super::__buffa::view::oneof::client_frame::Payload::Ping(
2354                                    ::buffa::alloc::boxed::Box::new(
2355                                        <super::super::__buffa::view::PingRequestView as ::buffa::MessageView>::decode_view_ctx(
2356                                            sub,
2357                                            __sub_ctx,
2358                                        )?,
2359                                    ),
2360                                ),
2361                            );
2362                        }
2363                    }
2364                    11u32 => {
2365                        ::buffa::encoding::check_wire_type(
2366                            tag,
2367                            ::buffa::encoding::WireType::LengthDelimited,
2368                        )?;
2369                        let __sub_ctx = ctx.descend()?;
2370                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
2371                        if let Some(
2372                            super::super::__buffa::view::oneof::client_frame::Payload::CreateOrder(
2373                                ref mut existing,
2374                            ),
2375                        ) = view.payload
2376                        {
2377                            ::buffa::MessageView::merge_into_view(
2378                                &mut **existing,
2379                                sub,
2380                                __sub_ctx,
2381                            )?;
2382                        } else {
2383                            view.payload = Some(
2384                                super::super::__buffa::view::oneof::client_frame::Payload::CreateOrder(
2385                                    ::buffa::alloc::boxed::Box::new(
2386                                        <super::super::super::super::orders::v1::__buffa::view::CreateOrderRequestView as ::buffa::MessageView>::decode_view_ctx(
2387                                            sub,
2388                                            __sub_ctx,
2389                                        )?,
2390                                    ),
2391                                ),
2392                            );
2393                        }
2394                    }
2395                    12u32 => {
2396                        ::buffa::encoding::check_wire_type(
2397                            tag,
2398                            ::buffa::encoding::WireType::LengthDelimited,
2399                        )?;
2400                        let __sub_ctx = ctx.descend()?;
2401                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
2402                        if let Some(
2403                            super::super::__buffa::view::oneof::client_frame::Payload::CancelOrder(
2404                                ref mut existing,
2405                            ),
2406                        ) = view.payload
2407                        {
2408                            ::buffa::MessageView::merge_into_view(
2409                                &mut **existing,
2410                                sub,
2411                                __sub_ctx,
2412                            )?;
2413                        } else {
2414                            view.payload = Some(
2415                                super::super::__buffa::view::oneof::client_frame::Payload::CancelOrder(
2416                                    ::buffa::alloc::boxed::Box::new(
2417                                        <super::super::super::super::orders::v1::__buffa::view::CancelOrderRequestView as ::buffa::MessageView>::decode_view_ctx(
2418                                            sub,
2419                                            __sub_ctx,
2420                                        )?,
2421                                    ),
2422                                ),
2423                            );
2424                        }
2425                    }
2426                    13u32 => {
2427                        ::buffa::encoding::check_wire_type(
2428                            tag,
2429                            ::buffa::encoding::WireType::LengthDelimited,
2430                        )?;
2431                        let __sub_ctx = ctx.descend()?;
2432                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
2433                        if let Some(
2434                            super::super::__buffa::view::oneof::client_frame::Payload::ModifyOrder(
2435                                ref mut existing,
2436                            ),
2437                        ) = view.payload
2438                        {
2439                            ::buffa::MessageView::merge_into_view(
2440                                &mut **existing,
2441                                sub,
2442                                __sub_ctx,
2443                            )?;
2444                        } else {
2445                            view.payload = Some(
2446                                super::super::__buffa::view::oneof::client_frame::Payload::ModifyOrder(
2447                                    ::buffa::alloc::boxed::Box::new(
2448                                        <super::super::super::super::orders::v1::__buffa::view::ModifyOrderRequestView as ::buffa::MessageView>::decode_view_ctx(
2449                                            sub,
2450                                            __sub_ctx,
2451                                        )?,
2452                                    ),
2453                                ),
2454                            );
2455                        }
2456                    }
2457                    14u32 => {
2458                        ::buffa::encoding::check_wire_type(
2459                            tag,
2460                            ::buffa::encoding::WireType::LengthDelimited,
2461                        )?;
2462                        let __sub_ctx = ctx.descend()?;
2463                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
2464                        if let Some(
2465                            super::super::__buffa::view::oneof::client_frame::Payload::CancelAllOrders(
2466                                ref mut existing,
2467                            ),
2468                        ) = view.payload
2469                        {
2470                            ::buffa::MessageView::merge_into_view(
2471                                &mut **existing,
2472                                sub,
2473                                __sub_ctx,
2474                            )?;
2475                        } else {
2476                            view.payload = Some(
2477                                super::super::__buffa::view::oneof::client_frame::Payload::CancelAllOrders(
2478                                    ::buffa::alloc::boxed::Box::new(
2479                                        <super::super::super::super::orders::v1::__buffa::view::CancelAllOrdersRequestView as ::buffa::MessageView>::decode_view_ctx(
2480                                            sub,
2481                                            __sub_ctx,
2482                                        )?,
2483                                    ),
2484                                ),
2485                            );
2486                        }
2487                    }
2488                    _ => {
2489                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
2490                        let span_len = before_tag.len() - cur.len();
2491                        view.__buffa_unknown_fields
2492                            .push_record(before_tag, span_len, ctx)?;
2493                    }
2494                }
2495                ::core::result::Result::Ok(cur)
2496            }
2497            fn to_owned_message(
2498                &self,
2499            ) -> ::core::result::Result<
2500                super::super::ClientFrame,
2501                ::buffa::DecodeError,
2502            > {
2503                self.to_owned_from_source(None)
2504            }
2505            #[allow(clippy::useless_conversion, clippy::needless_update)]
2506            fn to_owned_from_source(
2507                &self,
2508                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
2509            ) -> ::core::result::Result<
2510                super::super::ClientFrame,
2511                ::buffa::DecodeError,
2512            > {
2513                #[allow(unused_imports)]
2514                use ::buffa::alloc::string::ToString as _;
2515                let _ = __buffa_src;
2516                ::core::result::Result::Ok(super::super::ClientFrame {
2517                    seq: self.seq,
2518                    correlation_id: self.correlation_id.to_string(),
2519                    payload: match self.payload.as_ref() {
2520                        ::core::option::Option::Some(v) => {
2521                            ::core::option::Option::Some(
2522                                match v {
2523                                    super::super::__buffa::view::oneof::client_frame::Payload::Ping(
2524                                        v,
2525                                    ) => {
2526                                        super::super::__buffa::oneof::client_frame::Payload::Ping(
2527                                            ::buffa::alloc::boxed::Box::new(
2528                                                v.to_owned_from_source(__buffa_src)?,
2529                                            ),
2530                                        )
2531                                    }
2532                                    super::super::__buffa::view::oneof::client_frame::Payload::CreateOrder(
2533                                        v,
2534                                    ) => {
2535                                        super::super::__buffa::oneof::client_frame::Payload::CreateOrder(
2536                                            ::buffa::alloc::boxed::Box::new(
2537                                                v.to_owned_from_source(__buffa_src)?,
2538                                            ),
2539                                        )
2540                                    }
2541                                    super::super::__buffa::view::oneof::client_frame::Payload::CancelOrder(
2542                                        v,
2543                                    ) => {
2544                                        super::super::__buffa::oneof::client_frame::Payload::CancelOrder(
2545                                            ::buffa::alloc::boxed::Box::new(
2546                                                v.to_owned_from_source(__buffa_src)?,
2547                                            ),
2548                                        )
2549                                    }
2550                                    super::super::__buffa::view::oneof::client_frame::Payload::ModifyOrder(
2551                                        v,
2552                                    ) => {
2553                                        super::super::__buffa::oneof::client_frame::Payload::ModifyOrder(
2554                                            ::buffa::alloc::boxed::Box::new(
2555                                                v.to_owned_from_source(__buffa_src)?,
2556                                            ),
2557                                        )
2558                                    }
2559                                    super::super::__buffa::view::oneof::client_frame::Payload::CancelAllOrders(
2560                                        v,
2561                                    ) => {
2562                                        super::super::__buffa::oneof::client_frame::Payload::CancelAllOrders(
2563                                            ::buffa::alloc::boxed::Box::new(
2564                                                v.to_owned_from_source(__buffa_src)?,
2565                                            ),
2566                                        )
2567                                    }
2568                                },
2569                            )
2570                        }
2571                        ::core::option::Option::None => ::core::option::Option::None,
2572                    },
2573                    __buffa_unknown_fields: self
2574                        .__buffa_unknown_fields
2575                        .to_owned()?
2576                        .into(),
2577                    ..::core::default::Default::default()
2578                })
2579            }
2580        }
2581        impl<'a> ::buffa::ViewEncode<'a> for ClientFrameView<'a> {
2582            #[allow(clippy::needless_borrow, clippy::let_and_return)]
2583            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2584                #[allow(unused_imports)]
2585                use ::buffa::Enumeration as _;
2586                let mut size = 0u32;
2587                if self.seq != 0u64 {
2588                    size += 1u32 + ::buffa::types::uint64_encoded_len(self.seq) as u32;
2589                }
2590                if !self.correlation_id.is_empty() {
2591                    size
2592                        += 1u32
2593                            + ::buffa::types::string_encoded_len(&self.correlation_id)
2594                                as u32;
2595                }
2596                if let ::core::option::Option::Some(ref v) = self.payload {
2597                    match v {
2598                        super::super::__buffa::view::oneof::client_frame::Payload::Ping(
2599                            x,
2600                        ) => {
2601                            let __slot = __cache.reserve();
2602                            let inner = x.compute_size(__cache);
2603                            __cache.set(__slot, inner);
2604                            size
2605                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
2606                                    + inner;
2607                        }
2608                        super::super::__buffa::view::oneof::client_frame::Payload::CreateOrder(
2609                            x,
2610                        ) => {
2611                            let __slot = __cache.reserve();
2612                            let inner = x.compute_size(__cache);
2613                            __cache.set(__slot, inner);
2614                            size
2615                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
2616                                    + inner;
2617                        }
2618                        super::super::__buffa::view::oneof::client_frame::Payload::CancelOrder(
2619                            x,
2620                        ) => {
2621                            let __slot = __cache.reserve();
2622                            let inner = x.compute_size(__cache);
2623                            __cache.set(__slot, inner);
2624                            size
2625                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
2626                                    + inner;
2627                        }
2628                        super::super::__buffa::view::oneof::client_frame::Payload::ModifyOrder(
2629                            x,
2630                        ) => {
2631                            let __slot = __cache.reserve();
2632                            let inner = x.compute_size(__cache);
2633                            __cache.set(__slot, inner);
2634                            size
2635                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
2636                                    + inner;
2637                        }
2638                        super::super::__buffa::view::oneof::client_frame::Payload::CancelAllOrders(
2639                            x,
2640                        ) => {
2641                            let __slot = __cache.reserve();
2642                            let inner = x.compute_size(__cache);
2643                            __cache.set(__slot, inner);
2644                            size
2645                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
2646                                    + inner;
2647                        }
2648                    }
2649                }
2650                size += self.__buffa_unknown_fields.encoded_len() as u32;
2651                size
2652            }
2653            #[allow(clippy::needless_borrow)]
2654            fn write_to(
2655                &self,
2656                __cache: &mut ::buffa::SizeCache,
2657                buf: &mut impl ::buffa::bytes::BufMut,
2658            ) {
2659                #[allow(unused_imports)]
2660                use ::buffa::Enumeration as _;
2661                if self.seq != 0u64 {
2662                    ::buffa::types::put_uint64_field(1u32, self.seq, buf);
2663                }
2664                if !self.correlation_id.is_empty() {
2665                    ::buffa::types::put_string_field(2u32, &self.correlation_id, buf);
2666                }
2667                if let ::core::option::Option::Some(ref v) = self.payload {
2668                    match v {
2669                        super::super::__buffa::view::oneof::client_frame::Payload::Ping(
2670                            x,
2671                        ) => {
2672                            ::buffa::types::put_len_delimited_header(
2673                                10u32,
2674                                __cache.consume_next(),
2675                                buf,
2676                            );
2677                            x.write_to(__cache, buf);
2678                        }
2679                        super::super::__buffa::view::oneof::client_frame::Payload::CreateOrder(
2680                            x,
2681                        ) => {
2682                            ::buffa::types::put_len_delimited_header(
2683                                11u32,
2684                                __cache.consume_next(),
2685                                buf,
2686                            );
2687                            x.write_to(__cache, buf);
2688                        }
2689                        super::super::__buffa::view::oneof::client_frame::Payload::CancelOrder(
2690                            x,
2691                        ) => {
2692                            ::buffa::types::put_len_delimited_header(
2693                                12u32,
2694                                __cache.consume_next(),
2695                                buf,
2696                            );
2697                            x.write_to(__cache, buf);
2698                        }
2699                        super::super::__buffa::view::oneof::client_frame::Payload::ModifyOrder(
2700                            x,
2701                        ) => {
2702                            ::buffa::types::put_len_delimited_header(
2703                                13u32,
2704                                __cache.consume_next(),
2705                                buf,
2706                            );
2707                            x.write_to(__cache, buf);
2708                        }
2709                        super::super::__buffa::view::oneof::client_frame::Payload::CancelAllOrders(
2710                            x,
2711                        ) => {
2712                            ::buffa::types::put_len_delimited_header(
2713                                14u32,
2714                                __cache.consume_next(),
2715                                buf,
2716                            );
2717                            x.write_to(__cache, buf);
2718                        }
2719                    }
2720                }
2721                self.__buffa_unknown_fields.write_to(buf);
2722            }
2723        }
2724        /// Serializes this view as protobuf JSON.
2725        ///
2726        /// Implicit-presence fields with default values are omitted, `required`
2727        /// fields are always emitted, explicit-presence (`optional`) fields are
2728        /// emitted only when set, bytes fields are base64-encoded, and enum
2729        /// values are their proto name strings.
2730        ///
2731        /// This impl uses `serialize_map(None)` because the number of emitted
2732        /// fields depends on default-omission rules; serializers that require
2733        /// known map lengths (e.g. `bincode`) will return a runtime error.
2734        /// Use the owned message type for those formats.
2735        impl<'__a> ::serde::Serialize for ClientFrameView<'__a> {
2736            fn serialize<__S: ::serde::Serializer>(
2737                &self,
2738                __s: __S,
2739            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2740                use ::serde::ser::SerializeMap as _;
2741                let mut __map = __s.serialize_map(::core::option::Option::None)?;
2742                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.seq) {
2743                    __map
2744                        .serialize_entry(
2745                            "seq",
2746                            &::buffa::json_helpers::ProtoJson(&self.seq),
2747                        )?;
2748                }
2749                if !::buffa::json_helpers::skip_if::is_empty_str(self.correlation_id) {
2750                    __map.serialize_entry("correlationId", self.correlation_id)?;
2751                }
2752                if let ::core::option::Option::Some(ref __ov) = self.payload {
2753                    match __ov {
2754                        super::super::__buffa::view::oneof::client_frame::Payload::Ping(
2755                            v,
2756                        ) => {
2757                            __map.serialize_entry("ping", v)?;
2758                        }
2759                        super::super::__buffa::view::oneof::client_frame::Payload::CreateOrder(
2760                            v,
2761                        ) => {
2762                            __map.serialize_entry("createOrder", v)?;
2763                        }
2764                        super::super::__buffa::view::oneof::client_frame::Payload::CancelOrder(
2765                            v,
2766                        ) => {
2767                            __map.serialize_entry("cancelOrder", v)?;
2768                        }
2769                        super::super::__buffa::view::oneof::client_frame::Payload::ModifyOrder(
2770                            v,
2771                        ) => {
2772                            __map.serialize_entry("modifyOrder", v)?;
2773                        }
2774                        super::super::__buffa::view::oneof::client_frame::Payload::CancelAllOrders(
2775                            v,
2776                        ) => {
2777                            __map.serialize_entry("cancelAllOrders", v)?;
2778                        }
2779                    }
2780                }
2781                __map.end()
2782            }
2783        }
2784        impl<'a> ::buffa::MessageName for ClientFrameView<'a> {
2785            const PACKAGE: &'static str = "tradews.v1";
2786            const NAME: &'static str = "ClientFrame";
2787            const FULL_NAME: &'static str = "tradews.v1.ClientFrame";
2788            const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.ClientFrame";
2789        }
2790        ::buffa::impl_default_view_instance!(ClientFrameView);
2791        ::buffa::impl_view_reborrow!(ClientFrameView);
2792        /** Self-contained, `'static` owned view of a `ClientFrame` message.
2793
2794 Wraps [`::buffa::OwnedView`]`<`[`ClientFrameView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
2795
2796 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ClientFrameView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
2797        #[derive(Clone, Debug)]
2798        pub struct ClientFrameOwnedView(::buffa::OwnedView<ClientFrameView<'static>>);
2799        impl ClientFrameOwnedView {
2800            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
2801            ///
2802            /// The view borrows directly from the buffer's data; the buffer is
2803            /// retained inside the returned handle.
2804            ///
2805            /// # Errors
2806            ///
2807            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
2808            /// protobuf data.
2809            pub fn decode(
2810                bytes: ::buffa::bytes::Bytes,
2811            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2812                ::core::result::Result::Ok(
2813                    ClientFrameOwnedView(::buffa::OwnedView::decode(bytes)?),
2814                )
2815            }
2816            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
2817            /// max message size).
2818            ///
2819            /// # Errors
2820            ///
2821            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
2822            /// exceeds the configured limits.
2823            pub fn decode_with_options(
2824                bytes: ::buffa::bytes::Bytes,
2825                opts: &::buffa::DecodeOptions,
2826            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2827                ::core::result::Result::Ok(
2828                    ClientFrameOwnedView(
2829                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
2830                    ),
2831                )
2832            }
2833            /// Build from an owned message via an encode → decode round-trip.
2834            ///
2835            /// # Errors
2836            ///
2837            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
2838            /// somehow invalid (should not happen for well-formed messages).
2839            pub fn from_owned(
2840                msg: &super::super::ClientFrame,
2841            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2842                ::core::result::Result::Ok(
2843                    ClientFrameOwnedView(::buffa::OwnedView::from_owned(msg)?),
2844                )
2845            }
2846            /// Borrow the full [`ClientFrameView`] with its lifetime tied to `&self`.
2847            #[must_use]
2848            pub fn view(&self) -> &ClientFrameView<'_> {
2849                self.0.reborrow()
2850            }
2851            /// Convert to the owned message type.
2852            ///
2853            /// # Errors
2854            ///
2855            /// Returns an error if re-materializing preserved unknown fields
2856            /// fails (e.g. the unknown-field limit is exceeded).
2857            pub fn to_owned_message(
2858                &self,
2859            ) -> ::core::result::Result<
2860                super::super::ClientFrame,
2861                ::buffa::DecodeError,
2862            > {
2863                self.0.to_owned_message()
2864            }
2865            /// The underlying bytes buffer.
2866            #[must_use]
2867            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
2868                self.0.bytes()
2869            }
2870            /// Consume the handle, returning the underlying bytes buffer.
2871            #[must_use]
2872            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
2873                self.0.into_bytes()
2874            }
2875            /// Monotonic per-connection client sequence number, starting at 1.
2876            ///
2877            /// Field 1: `seq`
2878            #[must_use]
2879            pub fn seq(&self) -> u64 {
2880                self.0.reborrow().seq
2881            }
2882            /// Client correlation token echoed in every server response.
2883            ///
2884            /// Field 2: `correlation_id`
2885            #[must_use]
2886            pub fn correlation_id(&self) -> &'_ str {
2887                self.0.reborrow().correlation_id
2888            }
2889            /// Oneof `payload`.
2890            #[must_use]
2891            pub fn payload(
2892                &self,
2893            ) -> ::core::option::Option<
2894                &super::super::__buffa::view::oneof::client_frame::Payload<'_>,
2895            > {
2896                self.0.reborrow().payload.as_ref()
2897            }
2898        }
2899        impl ::core::convert::From<::buffa::OwnedView<ClientFrameView<'static>>>
2900        for ClientFrameOwnedView {
2901            fn from(inner: ::buffa::OwnedView<ClientFrameView<'static>>) -> Self {
2902                ClientFrameOwnedView(inner)
2903            }
2904        }
2905        impl ::core::convert::From<ClientFrameOwnedView>
2906        for ::buffa::OwnedView<ClientFrameView<'static>> {
2907            fn from(wrapper: ClientFrameOwnedView) -> Self {
2908                wrapper.0
2909            }
2910        }
2911        impl ::core::convert::AsRef<::buffa::OwnedView<ClientFrameView<'static>>>
2912        for ClientFrameOwnedView {
2913            fn as_ref(&self) -> &::buffa::OwnedView<ClientFrameView<'static>> {
2914                &self.0
2915            }
2916        }
2917        impl ::buffa::HasMessageView for super::super::ClientFrame {
2918            type View<'a> = ClientFrameView<'a>;
2919            type ViewHandle = ClientFrameOwnedView;
2920        }
2921        impl ::serde::Serialize for ClientFrameOwnedView {
2922            fn serialize<__S: ::serde::Serializer>(
2923                &self,
2924                __s: __S,
2925            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2926                ::serde::Serialize::serialize(&self.0, __s)
2927            }
2928        }
2929        /// PingRequest carries an opaque payload that is echoed by PongResponse.
2930        #[derive(Clone, Debug, Default)]
2931        pub struct PingRequestView<'a> {
2932            /// Opaque client payload echoed by the server.
2933            ///
2934            /// Field 1: `payload`
2935            pub payload: &'a [u8],
2936            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2937        }
2938        impl<'a> ::buffa::MessageView<'a> for PingRequestView<'a> {
2939            type Owned = super::super::PingRequest;
2940            fn decode_view(
2941                buf: &'a [u8],
2942            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2943                let __limit = ::core::cell::Cell::new(
2944                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
2945                );
2946                <Self as ::buffa::MessageView>::decode_view_ctx(
2947                    buf,
2948                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
2949                )
2950            }
2951            fn decode_view_with_ctx(
2952                buf: &'a [u8],
2953                ctx: ::buffa::DecodeContext<'_>,
2954            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2955                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
2956            }
2957            fn merge_view_field(
2958                &mut self,
2959                tag: ::buffa::encoding::Tag,
2960                cur: &'a [u8],
2961                before_tag: &'a [u8],
2962                ctx: ::buffa::DecodeContext<'_>,
2963            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
2964                let _ = ctx;
2965                #[allow(unused_variables)]
2966                let view = self;
2967                let mut cur = cur;
2968                match tag.field_number() {
2969                    1u32 => {
2970                        ::buffa::encoding::check_wire_type(
2971                            tag,
2972                            ::buffa::encoding::WireType::LengthDelimited,
2973                        )?;
2974                        view.payload = ::buffa::types::borrow_bytes(&mut cur)?;
2975                    }
2976                    _ => {
2977                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
2978                        let span_len = before_tag.len() - cur.len();
2979                        view.__buffa_unknown_fields
2980                            .push_record(before_tag, span_len, ctx)?;
2981                    }
2982                }
2983                ::core::result::Result::Ok(cur)
2984            }
2985            fn to_owned_message(
2986                &self,
2987            ) -> ::core::result::Result<
2988                super::super::PingRequest,
2989                ::buffa::DecodeError,
2990            > {
2991                self.to_owned_from_source(None)
2992            }
2993            #[allow(clippy::useless_conversion, clippy::needless_update)]
2994            fn to_owned_from_source(
2995                &self,
2996                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
2997            ) -> ::core::result::Result<
2998                super::super::PingRequest,
2999                ::buffa::DecodeError,
3000            > {
3001                #[allow(unused_imports)]
3002                use ::buffa::alloc::string::ToString as _;
3003                let _ = __buffa_src;
3004                ::core::result::Result::Ok(super::super::PingRequest {
3005                    payload: (self.payload).to_vec(),
3006                    __buffa_unknown_fields: self
3007                        .__buffa_unknown_fields
3008                        .to_owned()?
3009                        .into(),
3010                    ..::core::default::Default::default()
3011                })
3012            }
3013        }
3014        impl<'a> ::buffa::ViewEncode<'a> for PingRequestView<'a> {
3015            #[allow(clippy::needless_borrow, clippy::let_and_return)]
3016            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3017                #[allow(unused_imports)]
3018                use ::buffa::Enumeration as _;
3019                let mut size = 0u32;
3020                if !self.payload.is_empty() {
3021                    size
3022                        += 1u32
3023                            + ::buffa::types::bytes_encoded_len(&self.payload) as u32;
3024                }
3025                size += self.__buffa_unknown_fields.encoded_len() as u32;
3026                size
3027            }
3028            #[allow(clippy::needless_borrow)]
3029            fn write_to(
3030                &self,
3031                _cache: &mut ::buffa::SizeCache,
3032                buf: &mut impl ::buffa::bytes::BufMut,
3033            ) {
3034                #[allow(unused_imports)]
3035                use ::buffa::Enumeration as _;
3036                if !self.payload.is_empty() {
3037                    ::buffa::types::put_bytes_field(1u32, &self.payload, buf);
3038                }
3039                self.__buffa_unknown_fields.write_to(buf);
3040            }
3041        }
3042        /// Serializes this view as protobuf JSON.
3043        ///
3044        /// Implicit-presence fields with default values are omitted, `required`
3045        /// fields are always emitted, explicit-presence (`optional`) fields are
3046        /// emitted only when set, bytes fields are base64-encoded, and enum
3047        /// values are their proto name strings.
3048        ///
3049        /// This impl uses `serialize_map(None)` because the number of emitted
3050        /// fields depends on default-omission rules; serializers that require
3051        /// known map lengths (e.g. `bincode`) will return a runtime error.
3052        /// Use the owned message type for those formats.
3053        impl<'__a> ::serde::Serialize for PingRequestView<'__a> {
3054            fn serialize<__S: ::serde::Serializer>(
3055                &self,
3056                __s: __S,
3057            ) -> ::core::result::Result<__S::Ok, __S::Error> {
3058                use ::serde::ser::SerializeMap as _;
3059                let mut __map = __s.serialize_map(::core::option::Option::None)?;
3060                if !::buffa::json_helpers::skip_if::is_empty_bytes(self.payload) {
3061                    __map
3062                        .serialize_entry(
3063                            "payload",
3064                            &::buffa::json_helpers::BytesJson(self.payload),
3065                        )?;
3066                }
3067                __map.end()
3068            }
3069        }
3070        impl<'a> ::buffa::MessageName for PingRequestView<'a> {
3071            const PACKAGE: &'static str = "tradews.v1";
3072            const NAME: &'static str = "PingRequest";
3073            const FULL_NAME: &'static str = "tradews.v1.PingRequest";
3074            const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.PingRequest";
3075        }
3076        ::buffa::impl_default_view_instance!(PingRequestView);
3077        ::buffa::impl_view_reborrow!(PingRequestView);
3078        /** Self-contained, `'static` owned view of a `PingRequest` message.
3079
3080 Wraps [`::buffa::OwnedView`]`<`[`PingRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
3081
3082 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`PingRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
3083        #[derive(Clone, Debug)]
3084        pub struct PingRequestOwnedView(::buffa::OwnedView<PingRequestView<'static>>);
3085        impl PingRequestOwnedView {
3086            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
3087            ///
3088            /// The view borrows directly from the buffer's data; the buffer is
3089            /// retained inside the returned handle.
3090            ///
3091            /// # Errors
3092            ///
3093            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
3094            /// protobuf data.
3095            pub fn decode(
3096                bytes: ::buffa::bytes::Bytes,
3097            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3098                ::core::result::Result::Ok(
3099                    PingRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
3100                )
3101            }
3102            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
3103            /// max message size).
3104            ///
3105            /// # Errors
3106            ///
3107            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
3108            /// exceeds the configured limits.
3109            pub fn decode_with_options(
3110                bytes: ::buffa::bytes::Bytes,
3111                opts: &::buffa::DecodeOptions,
3112            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3113                ::core::result::Result::Ok(
3114                    PingRequestOwnedView(
3115                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
3116                    ),
3117                )
3118            }
3119            /// Build from an owned message via an encode → decode round-trip.
3120            ///
3121            /// # Errors
3122            ///
3123            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
3124            /// somehow invalid (should not happen for well-formed messages).
3125            pub fn from_owned(
3126                msg: &super::super::PingRequest,
3127            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3128                ::core::result::Result::Ok(
3129                    PingRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
3130                )
3131            }
3132            /// Borrow the full [`PingRequestView`] with its lifetime tied to `&self`.
3133            #[must_use]
3134            pub fn view(&self) -> &PingRequestView<'_> {
3135                self.0.reborrow()
3136            }
3137            /// Convert to the owned message type.
3138            ///
3139            /// # Errors
3140            ///
3141            /// Returns an error if re-materializing preserved unknown fields
3142            /// fails (e.g. the unknown-field limit is exceeded).
3143            pub fn to_owned_message(
3144                &self,
3145            ) -> ::core::result::Result<
3146                super::super::PingRequest,
3147                ::buffa::DecodeError,
3148            > {
3149                self.0.to_owned_message()
3150            }
3151            /// The underlying bytes buffer.
3152            #[must_use]
3153            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3154                self.0.bytes()
3155            }
3156            /// Consume the handle, returning the underlying bytes buffer.
3157            #[must_use]
3158            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3159                self.0.into_bytes()
3160            }
3161            /// Opaque client payload echoed by the server.
3162            ///
3163            /// Field 1: `payload`
3164            #[must_use]
3165            pub fn payload(&self) -> &'_ [u8] {
3166                self.0.reborrow().payload
3167            }
3168        }
3169        impl ::core::convert::From<::buffa::OwnedView<PingRequestView<'static>>>
3170        for PingRequestOwnedView {
3171            fn from(inner: ::buffa::OwnedView<PingRequestView<'static>>) -> Self {
3172                PingRequestOwnedView(inner)
3173            }
3174        }
3175        impl ::core::convert::From<PingRequestOwnedView>
3176        for ::buffa::OwnedView<PingRequestView<'static>> {
3177            fn from(wrapper: PingRequestOwnedView) -> Self {
3178                wrapper.0
3179            }
3180        }
3181        impl ::core::convert::AsRef<::buffa::OwnedView<PingRequestView<'static>>>
3182        for PingRequestOwnedView {
3183            fn as_ref(&self) -> &::buffa::OwnedView<PingRequestView<'static>> {
3184                &self.0
3185            }
3186        }
3187        impl ::buffa::HasMessageView for super::super::PingRequest {
3188            type View<'a> = PingRequestView<'a>;
3189            type ViewHandle = PingRequestOwnedView;
3190        }
3191        impl ::serde::Serialize for PingRequestOwnedView {
3192            fn serialize<__S: ::serde::Serializer>(
3193                &self,
3194                __s: __S,
3195            ) -> ::core::result::Result<__S::Ok, __S::Error> {
3196                ::serde::Serialize::serialize(&self.0, __s)
3197            }
3198        }
3199        /// ServerFrame is the protobuf write-websocket response envelope.
3200        #[derive(Clone, Debug, Default)]
3201        pub struct ServerFrameView<'a> {
3202            /// Client sequence number copied from the accepted or rejected frame.
3203            ///
3204            /// Field 1: `seq`
3205            pub seq: u64,
3206            /// Client correlation token copied from the accepted or rejected frame.
3207            ///
3208            /// Field 2: `correlation_id`
3209            pub correlation_id: &'a str,
3210            pub payload: ::core::option::Option<
3211                super::super::__buffa::view::oneof::server_frame::Payload<'a>,
3212            >,
3213            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3214        }
3215        impl<'a> ::buffa::MessageView<'a> for ServerFrameView<'a> {
3216            type Owned = super::super::ServerFrame;
3217            fn decode_view(
3218                buf: &'a [u8],
3219            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3220                let __limit = ::core::cell::Cell::new(
3221                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
3222                );
3223                <Self as ::buffa::MessageView>::decode_view_ctx(
3224                    buf,
3225                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
3226                )
3227            }
3228            fn decode_view_with_ctx(
3229                buf: &'a [u8],
3230                ctx: ::buffa::DecodeContext<'_>,
3231            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3232                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
3233            }
3234            fn merge_view_field(
3235                &mut self,
3236                tag: ::buffa::encoding::Tag,
3237                cur: &'a [u8],
3238                before_tag: &'a [u8],
3239                ctx: ::buffa::DecodeContext<'_>,
3240            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
3241                let _ = ctx;
3242                #[allow(unused_variables)]
3243                let view = self;
3244                let mut cur = cur;
3245                match tag.field_number() {
3246                    1u32 => {
3247                        ::buffa::encoding::check_wire_type(
3248                            tag,
3249                            ::buffa::encoding::WireType::Varint,
3250                        )?;
3251                        view.seq = ::buffa::types::decode_uint64(&mut cur)?;
3252                    }
3253                    2u32 => {
3254                        ::buffa::encoding::check_wire_type(
3255                            tag,
3256                            ::buffa::encoding::WireType::LengthDelimited,
3257                        )?;
3258                        view.correlation_id = ::buffa::types::borrow_str(&mut cur)?;
3259                    }
3260                    10u32 => {
3261                        ::buffa::encoding::check_wire_type(
3262                            tag,
3263                            ::buffa::encoding::WireType::LengthDelimited,
3264                        )?;
3265                        let __sub_ctx = ctx.descend()?;
3266                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
3267                        if let Some(
3268                            super::super::__buffa::view::oneof::server_frame::Payload::Pong(
3269                                ref mut existing,
3270                            ),
3271                        ) = view.payload
3272                        {
3273                            ::buffa::MessageView::merge_into_view(
3274                                &mut **existing,
3275                                sub,
3276                                __sub_ctx,
3277                            )?;
3278                        } else {
3279                            view.payload = Some(
3280                                super::super::__buffa::view::oneof::server_frame::Payload::Pong(
3281                                    ::buffa::alloc::boxed::Box::new(
3282                                        <super::super::__buffa::view::PongResponseView as ::buffa::MessageView>::decode_view_ctx(
3283                                            sub,
3284                                            __sub_ctx,
3285                                        )?,
3286                                    ),
3287                                ),
3288                            );
3289                        }
3290                    }
3291                    11u32 => {
3292                        ::buffa::encoding::check_wire_type(
3293                            tag,
3294                            ::buffa::encoding::WireType::LengthDelimited,
3295                        )?;
3296                        let __sub_ctx = ctx.descend()?;
3297                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
3298                        if let Some(
3299                            super::super::__buffa::view::oneof::server_frame::Payload::Ack(
3300                                ref mut existing,
3301                            ),
3302                        ) = view.payload
3303                        {
3304                            ::buffa::MessageView::merge_into_view(
3305                                &mut **existing,
3306                                sub,
3307                                __sub_ctx,
3308                            )?;
3309                        } else {
3310                            view.payload = Some(
3311                                super::super::__buffa::view::oneof::server_frame::Payload::Ack(
3312                                    ::buffa::alloc::boxed::Box::new(
3313                                        <super::super::__buffa::view::AckResponseView as ::buffa::MessageView>::decode_view_ctx(
3314                                            sub,
3315                                            __sub_ctx,
3316                                        )?,
3317                                    ),
3318                                ),
3319                            );
3320                        }
3321                    }
3322                    12u32 => {
3323                        ::buffa::encoding::check_wire_type(
3324                            tag,
3325                            ::buffa::encoding::WireType::LengthDelimited,
3326                        )?;
3327                        let __sub_ctx = ctx.descend()?;
3328                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
3329                        if let Some(
3330                            super::super::__buffa::view::oneof::server_frame::Payload::Reject(
3331                                ref mut existing,
3332                            ),
3333                        ) = view.payload
3334                        {
3335                            ::buffa::MessageView::merge_into_view(
3336                                &mut **existing,
3337                                sub,
3338                                __sub_ctx,
3339                            )?;
3340                        } else {
3341                            view.payload = Some(
3342                                super::super::__buffa::view::oneof::server_frame::Payload::Reject(
3343                                    ::buffa::alloc::boxed::Box::new(
3344                                        <super::super::__buffa::view::CommandRejectView as ::buffa::MessageView>::decode_view_ctx(
3345                                            sub,
3346                                            __sub_ctx,
3347                                        )?,
3348                                    ),
3349                                ),
3350                            );
3351                        }
3352                    }
3353                    13u32 => {
3354                        ::buffa::encoding::check_wire_type(
3355                            tag,
3356                            ::buffa::encoding::WireType::LengthDelimited,
3357                        )?;
3358                        let __sub_ctx = ctx.descend()?;
3359                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
3360                        if let Some(
3361                            super::super::__buffa::view::oneof::server_frame::Payload::Overload(
3362                                ref mut existing,
3363                            ),
3364                        ) = view.payload
3365                        {
3366                            ::buffa::MessageView::merge_into_view(
3367                                &mut **existing,
3368                                sub,
3369                                __sub_ctx,
3370                            )?;
3371                        } else {
3372                            view.payload = Some(
3373                                super::super::__buffa::view::oneof::server_frame::Payload::Overload(
3374                                    ::buffa::alloc::boxed::Box::new(
3375                                        <super::super::__buffa::view::OverloadResponseView as ::buffa::MessageView>::decode_view_ctx(
3376                                            sub,
3377                                            __sub_ctx,
3378                                        )?,
3379                                    ),
3380                                ),
3381                            );
3382                        }
3383                    }
3384                    14u32 => {
3385                        ::buffa::encoding::check_wire_type(
3386                            tag,
3387                            ::buffa::encoding::WireType::LengthDelimited,
3388                        )?;
3389                        let __sub_ctx = ctx.descend()?;
3390                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
3391                        if let Some(
3392                            super::super::__buffa::view::oneof::server_frame::Payload::Terminal(
3393                                ref mut existing,
3394                            ),
3395                        ) = view.payload
3396                        {
3397                            ::buffa::MessageView::merge_into_view(
3398                                &mut **existing,
3399                                sub,
3400                                __sub_ctx,
3401                            )?;
3402                        } else {
3403                            view.payload = Some(
3404                                super::super::__buffa::view::oneof::server_frame::Payload::Terminal(
3405                                    ::buffa::alloc::boxed::Box::new(
3406                                        <super::super::__buffa::view::TerminalSessionEventView as ::buffa::MessageView>::decode_view_ctx(
3407                                            sub,
3408                                            __sub_ctx,
3409                                        )?,
3410                                    ),
3411                                ),
3412                            );
3413                        }
3414                    }
3415                    _ => {
3416                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
3417                        let span_len = before_tag.len() - cur.len();
3418                        view.__buffa_unknown_fields
3419                            .push_record(before_tag, span_len, ctx)?;
3420                    }
3421                }
3422                ::core::result::Result::Ok(cur)
3423            }
3424            fn to_owned_message(
3425                &self,
3426            ) -> ::core::result::Result<
3427                super::super::ServerFrame,
3428                ::buffa::DecodeError,
3429            > {
3430                self.to_owned_from_source(None)
3431            }
3432            #[allow(clippy::useless_conversion, clippy::needless_update)]
3433            fn to_owned_from_source(
3434                &self,
3435                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3436            ) -> ::core::result::Result<
3437                super::super::ServerFrame,
3438                ::buffa::DecodeError,
3439            > {
3440                #[allow(unused_imports)]
3441                use ::buffa::alloc::string::ToString as _;
3442                let _ = __buffa_src;
3443                ::core::result::Result::Ok(super::super::ServerFrame {
3444                    seq: self.seq,
3445                    correlation_id: self.correlation_id.to_string(),
3446                    payload: match self.payload.as_ref() {
3447                        ::core::option::Option::Some(v) => {
3448                            ::core::option::Option::Some(
3449                                match v {
3450                                    super::super::__buffa::view::oneof::server_frame::Payload::Pong(
3451                                        v,
3452                                    ) => {
3453                                        super::super::__buffa::oneof::server_frame::Payload::Pong(
3454                                            ::buffa::alloc::boxed::Box::new(
3455                                                v.to_owned_from_source(__buffa_src)?,
3456                                            ),
3457                                        )
3458                                    }
3459                                    super::super::__buffa::view::oneof::server_frame::Payload::Ack(
3460                                        v,
3461                                    ) => {
3462                                        super::super::__buffa::oneof::server_frame::Payload::Ack(
3463                                            ::buffa::alloc::boxed::Box::new(
3464                                                v.to_owned_from_source(__buffa_src)?,
3465                                            ),
3466                                        )
3467                                    }
3468                                    super::super::__buffa::view::oneof::server_frame::Payload::Reject(
3469                                        v,
3470                                    ) => {
3471                                        super::super::__buffa::oneof::server_frame::Payload::Reject(
3472                                            ::buffa::alloc::boxed::Box::new(
3473                                                v.to_owned_from_source(__buffa_src)?,
3474                                            ),
3475                                        )
3476                                    }
3477                                    super::super::__buffa::view::oneof::server_frame::Payload::Overload(
3478                                        v,
3479                                    ) => {
3480                                        super::super::__buffa::oneof::server_frame::Payload::Overload(
3481                                            ::buffa::alloc::boxed::Box::new(
3482                                                v.to_owned_from_source(__buffa_src)?,
3483                                            ),
3484                                        )
3485                                    }
3486                                    super::super::__buffa::view::oneof::server_frame::Payload::Terminal(
3487                                        v,
3488                                    ) => {
3489                                        super::super::__buffa::oneof::server_frame::Payload::Terminal(
3490                                            ::buffa::alloc::boxed::Box::new(
3491                                                v.to_owned_from_source(__buffa_src)?,
3492                                            ),
3493                                        )
3494                                    }
3495                                },
3496                            )
3497                        }
3498                        ::core::option::Option::None => ::core::option::Option::None,
3499                    },
3500                    __buffa_unknown_fields: self
3501                        .__buffa_unknown_fields
3502                        .to_owned()?
3503                        .into(),
3504                    ..::core::default::Default::default()
3505                })
3506            }
3507        }
3508        impl<'a> ::buffa::ViewEncode<'a> for ServerFrameView<'a> {
3509            #[allow(clippy::needless_borrow, clippy::let_and_return)]
3510            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
3511                #[allow(unused_imports)]
3512                use ::buffa::Enumeration as _;
3513                let mut size = 0u32;
3514                if self.seq != 0u64 {
3515                    size += 1u32 + ::buffa::types::uint64_encoded_len(self.seq) as u32;
3516                }
3517                if !self.correlation_id.is_empty() {
3518                    size
3519                        += 1u32
3520                            + ::buffa::types::string_encoded_len(&self.correlation_id)
3521                                as u32;
3522                }
3523                if let ::core::option::Option::Some(ref v) = self.payload {
3524                    match v {
3525                        super::super::__buffa::view::oneof::server_frame::Payload::Pong(
3526                            x,
3527                        ) => {
3528                            let __slot = __cache.reserve();
3529                            let inner = x.compute_size(__cache);
3530                            __cache.set(__slot, inner);
3531                            size
3532                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3533                                    + inner;
3534                        }
3535                        super::super::__buffa::view::oneof::server_frame::Payload::Ack(
3536                            x,
3537                        ) => {
3538                            let __slot = __cache.reserve();
3539                            let inner = x.compute_size(__cache);
3540                            __cache.set(__slot, inner);
3541                            size
3542                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3543                                    + inner;
3544                        }
3545                        super::super::__buffa::view::oneof::server_frame::Payload::Reject(
3546                            x,
3547                        ) => {
3548                            let __slot = __cache.reserve();
3549                            let inner = x.compute_size(__cache);
3550                            __cache.set(__slot, inner);
3551                            size
3552                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3553                                    + inner;
3554                        }
3555                        super::super::__buffa::view::oneof::server_frame::Payload::Overload(
3556                            x,
3557                        ) => {
3558                            let __slot = __cache.reserve();
3559                            let inner = x.compute_size(__cache);
3560                            __cache.set(__slot, inner);
3561                            size
3562                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3563                                    + inner;
3564                        }
3565                        super::super::__buffa::view::oneof::server_frame::Payload::Terminal(
3566                            x,
3567                        ) => {
3568                            let __slot = __cache.reserve();
3569                            let inner = x.compute_size(__cache);
3570                            __cache.set(__slot, inner);
3571                            size
3572                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
3573                                    + inner;
3574                        }
3575                    }
3576                }
3577                size += self.__buffa_unknown_fields.encoded_len() as u32;
3578                size
3579            }
3580            #[allow(clippy::needless_borrow)]
3581            fn write_to(
3582                &self,
3583                __cache: &mut ::buffa::SizeCache,
3584                buf: &mut impl ::buffa::bytes::BufMut,
3585            ) {
3586                #[allow(unused_imports)]
3587                use ::buffa::Enumeration as _;
3588                if self.seq != 0u64 {
3589                    ::buffa::types::put_uint64_field(1u32, self.seq, buf);
3590                }
3591                if !self.correlation_id.is_empty() {
3592                    ::buffa::types::put_string_field(2u32, &self.correlation_id, buf);
3593                }
3594                if let ::core::option::Option::Some(ref v) = self.payload {
3595                    match v {
3596                        super::super::__buffa::view::oneof::server_frame::Payload::Pong(
3597                            x,
3598                        ) => {
3599                            ::buffa::types::put_len_delimited_header(
3600                                10u32,
3601                                __cache.consume_next(),
3602                                buf,
3603                            );
3604                            x.write_to(__cache, buf);
3605                        }
3606                        super::super::__buffa::view::oneof::server_frame::Payload::Ack(
3607                            x,
3608                        ) => {
3609                            ::buffa::types::put_len_delimited_header(
3610                                11u32,
3611                                __cache.consume_next(),
3612                                buf,
3613                            );
3614                            x.write_to(__cache, buf);
3615                        }
3616                        super::super::__buffa::view::oneof::server_frame::Payload::Reject(
3617                            x,
3618                        ) => {
3619                            ::buffa::types::put_len_delimited_header(
3620                                12u32,
3621                                __cache.consume_next(),
3622                                buf,
3623                            );
3624                            x.write_to(__cache, buf);
3625                        }
3626                        super::super::__buffa::view::oneof::server_frame::Payload::Overload(
3627                            x,
3628                        ) => {
3629                            ::buffa::types::put_len_delimited_header(
3630                                13u32,
3631                                __cache.consume_next(),
3632                                buf,
3633                            );
3634                            x.write_to(__cache, buf);
3635                        }
3636                        super::super::__buffa::view::oneof::server_frame::Payload::Terminal(
3637                            x,
3638                        ) => {
3639                            ::buffa::types::put_len_delimited_header(
3640                                14u32,
3641                                __cache.consume_next(),
3642                                buf,
3643                            );
3644                            x.write_to(__cache, buf);
3645                        }
3646                    }
3647                }
3648                self.__buffa_unknown_fields.write_to(buf);
3649            }
3650        }
3651        /// Serializes this view as protobuf JSON.
3652        ///
3653        /// Implicit-presence fields with default values are omitted, `required`
3654        /// fields are always emitted, explicit-presence (`optional`) fields are
3655        /// emitted only when set, bytes fields are base64-encoded, and enum
3656        /// values are their proto name strings.
3657        ///
3658        /// This impl uses `serialize_map(None)` because the number of emitted
3659        /// fields depends on default-omission rules; serializers that require
3660        /// known map lengths (e.g. `bincode`) will return a runtime error.
3661        /// Use the owned message type for those formats.
3662        impl<'__a> ::serde::Serialize for ServerFrameView<'__a> {
3663            fn serialize<__S: ::serde::Serializer>(
3664                &self,
3665                __s: __S,
3666            ) -> ::core::result::Result<__S::Ok, __S::Error> {
3667                use ::serde::ser::SerializeMap as _;
3668                let mut __map = __s.serialize_map(::core::option::Option::None)?;
3669                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.seq) {
3670                    __map
3671                        .serialize_entry(
3672                            "seq",
3673                            &::buffa::json_helpers::ProtoJson(&self.seq),
3674                        )?;
3675                }
3676                if !::buffa::json_helpers::skip_if::is_empty_str(self.correlation_id) {
3677                    __map.serialize_entry("correlationId", self.correlation_id)?;
3678                }
3679                if let ::core::option::Option::Some(ref __ov) = self.payload {
3680                    match __ov {
3681                        super::super::__buffa::view::oneof::server_frame::Payload::Pong(
3682                            v,
3683                        ) => {
3684                            __map.serialize_entry("pong", v)?;
3685                        }
3686                        super::super::__buffa::view::oneof::server_frame::Payload::Ack(
3687                            v,
3688                        ) => {
3689                            __map.serialize_entry("ack", v)?;
3690                        }
3691                        super::super::__buffa::view::oneof::server_frame::Payload::Reject(
3692                            v,
3693                        ) => {
3694                            __map.serialize_entry("reject", v)?;
3695                        }
3696                        super::super::__buffa::view::oneof::server_frame::Payload::Overload(
3697                            v,
3698                        ) => {
3699                            __map.serialize_entry("overload", v)?;
3700                        }
3701                        super::super::__buffa::view::oneof::server_frame::Payload::Terminal(
3702                            v,
3703                        ) => {
3704                            __map.serialize_entry("terminal", v)?;
3705                        }
3706                    }
3707                }
3708                __map.end()
3709            }
3710        }
3711        impl<'a> ::buffa::MessageName for ServerFrameView<'a> {
3712            const PACKAGE: &'static str = "tradews.v1";
3713            const NAME: &'static str = "ServerFrame";
3714            const FULL_NAME: &'static str = "tradews.v1.ServerFrame";
3715            const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.ServerFrame";
3716        }
3717        ::buffa::impl_default_view_instance!(ServerFrameView);
3718        ::buffa::impl_view_reborrow!(ServerFrameView);
3719        /** Self-contained, `'static` owned view of a `ServerFrame` message.
3720
3721 Wraps [`::buffa::OwnedView`]`<`[`ServerFrameView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
3722
3723 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ServerFrameView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
3724        #[derive(Clone, Debug)]
3725        pub struct ServerFrameOwnedView(::buffa::OwnedView<ServerFrameView<'static>>);
3726        impl ServerFrameOwnedView {
3727            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
3728            ///
3729            /// The view borrows directly from the buffer's data; the buffer is
3730            /// retained inside the returned handle.
3731            ///
3732            /// # Errors
3733            ///
3734            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
3735            /// protobuf data.
3736            pub fn decode(
3737                bytes: ::buffa::bytes::Bytes,
3738            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3739                ::core::result::Result::Ok(
3740                    ServerFrameOwnedView(::buffa::OwnedView::decode(bytes)?),
3741                )
3742            }
3743            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
3744            /// max message size).
3745            ///
3746            /// # Errors
3747            ///
3748            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
3749            /// exceeds the configured limits.
3750            pub fn decode_with_options(
3751                bytes: ::buffa::bytes::Bytes,
3752                opts: &::buffa::DecodeOptions,
3753            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3754                ::core::result::Result::Ok(
3755                    ServerFrameOwnedView(
3756                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
3757                    ),
3758                )
3759            }
3760            /// Build from an owned message via an encode → decode round-trip.
3761            ///
3762            /// # Errors
3763            ///
3764            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
3765            /// somehow invalid (should not happen for well-formed messages).
3766            pub fn from_owned(
3767                msg: &super::super::ServerFrame,
3768            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3769                ::core::result::Result::Ok(
3770                    ServerFrameOwnedView(::buffa::OwnedView::from_owned(msg)?),
3771                )
3772            }
3773            /// Borrow the full [`ServerFrameView`] with its lifetime tied to `&self`.
3774            #[must_use]
3775            pub fn view(&self) -> &ServerFrameView<'_> {
3776                self.0.reborrow()
3777            }
3778            /// Convert to the owned message type.
3779            ///
3780            /// # Errors
3781            ///
3782            /// Returns an error if re-materializing preserved unknown fields
3783            /// fails (e.g. the unknown-field limit is exceeded).
3784            pub fn to_owned_message(
3785                &self,
3786            ) -> ::core::result::Result<
3787                super::super::ServerFrame,
3788                ::buffa::DecodeError,
3789            > {
3790                self.0.to_owned_message()
3791            }
3792            /// The underlying bytes buffer.
3793            #[must_use]
3794            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3795                self.0.bytes()
3796            }
3797            /// Consume the handle, returning the underlying bytes buffer.
3798            #[must_use]
3799            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3800                self.0.into_bytes()
3801            }
3802            /// Client sequence number copied from the accepted or rejected frame.
3803            ///
3804            /// Field 1: `seq`
3805            #[must_use]
3806            pub fn seq(&self) -> u64 {
3807                self.0.reborrow().seq
3808            }
3809            /// Client correlation token copied from the accepted or rejected frame.
3810            ///
3811            /// Field 2: `correlation_id`
3812            #[must_use]
3813            pub fn correlation_id(&self) -> &'_ str {
3814                self.0.reborrow().correlation_id
3815            }
3816            /// Oneof `payload`.
3817            #[must_use]
3818            pub fn payload(
3819                &self,
3820            ) -> ::core::option::Option<
3821                &super::super::__buffa::view::oneof::server_frame::Payload<'_>,
3822            > {
3823                self.0.reborrow().payload.as_ref()
3824            }
3825        }
3826        impl ::core::convert::From<::buffa::OwnedView<ServerFrameView<'static>>>
3827        for ServerFrameOwnedView {
3828            fn from(inner: ::buffa::OwnedView<ServerFrameView<'static>>) -> Self {
3829                ServerFrameOwnedView(inner)
3830            }
3831        }
3832        impl ::core::convert::From<ServerFrameOwnedView>
3833        for ::buffa::OwnedView<ServerFrameView<'static>> {
3834            fn from(wrapper: ServerFrameOwnedView) -> Self {
3835                wrapper.0
3836            }
3837        }
3838        impl ::core::convert::AsRef<::buffa::OwnedView<ServerFrameView<'static>>>
3839        for ServerFrameOwnedView {
3840            fn as_ref(&self) -> &::buffa::OwnedView<ServerFrameView<'static>> {
3841                &self.0
3842            }
3843        }
3844        impl ::buffa::HasMessageView for super::super::ServerFrame {
3845            type View<'a> = ServerFrameView<'a>;
3846            type ViewHandle = ServerFrameOwnedView;
3847        }
3848        impl ::serde::Serialize for ServerFrameOwnedView {
3849            fn serialize<__S: ::serde::Serializer>(
3850                &self,
3851                __s: __S,
3852            ) -> ::core::result::Result<__S::Ok, __S::Error> {
3853                ::serde::Serialize::serialize(&self.0, __s)
3854            }
3855        }
3856        /// PongResponse echoes a PingRequest payload.
3857        #[derive(Clone, Debug, Default)]
3858        pub struct PongResponseView<'a> {
3859            /// Opaque payload copied from PingRequest.
3860            ///
3861            /// Field 1: `payload`
3862            pub payload: &'a [u8],
3863            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3864        }
3865        impl<'a> ::buffa::MessageView<'a> for PongResponseView<'a> {
3866            type Owned = super::super::PongResponse;
3867            fn decode_view(
3868                buf: &'a [u8],
3869            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3870                let __limit = ::core::cell::Cell::new(
3871                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
3872                );
3873                <Self as ::buffa::MessageView>::decode_view_ctx(
3874                    buf,
3875                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
3876                )
3877            }
3878            fn decode_view_with_ctx(
3879                buf: &'a [u8],
3880                ctx: ::buffa::DecodeContext<'_>,
3881            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3882                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
3883            }
3884            fn merge_view_field(
3885                &mut self,
3886                tag: ::buffa::encoding::Tag,
3887                cur: &'a [u8],
3888                before_tag: &'a [u8],
3889                ctx: ::buffa::DecodeContext<'_>,
3890            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
3891                let _ = ctx;
3892                #[allow(unused_variables)]
3893                let view = self;
3894                let mut cur = cur;
3895                match tag.field_number() {
3896                    1u32 => {
3897                        ::buffa::encoding::check_wire_type(
3898                            tag,
3899                            ::buffa::encoding::WireType::LengthDelimited,
3900                        )?;
3901                        view.payload = ::buffa::types::borrow_bytes(&mut cur)?;
3902                    }
3903                    _ => {
3904                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
3905                        let span_len = before_tag.len() - cur.len();
3906                        view.__buffa_unknown_fields
3907                            .push_record(before_tag, span_len, ctx)?;
3908                    }
3909                }
3910                ::core::result::Result::Ok(cur)
3911            }
3912            fn to_owned_message(
3913                &self,
3914            ) -> ::core::result::Result<
3915                super::super::PongResponse,
3916                ::buffa::DecodeError,
3917            > {
3918                self.to_owned_from_source(None)
3919            }
3920            #[allow(clippy::useless_conversion, clippy::needless_update)]
3921            fn to_owned_from_source(
3922                &self,
3923                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3924            ) -> ::core::result::Result<
3925                super::super::PongResponse,
3926                ::buffa::DecodeError,
3927            > {
3928                #[allow(unused_imports)]
3929                use ::buffa::alloc::string::ToString as _;
3930                let _ = __buffa_src;
3931                ::core::result::Result::Ok(super::super::PongResponse {
3932                    payload: (self.payload).to_vec(),
3933                    __buffa_unknown_fields: self
3934                        .__buffa_unknown_fields
3935                        .to_owned()?
3936                        .into(),
3937                    ..::core::default::Default::default()
3938                })
3939            }
3940        }
3941        impl<'a> ::buffa::ViewEncode<'a> for PongResponseView<'a> {
3942            #[allow(clippy::needless_borrow, clippy::let_and_return)]
3943            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3944                #[allow(unused_imports)]
3945                use ::buffa::Enumeration as _;
3946                let mut size = 0u32;
3947                if !self.payload.is_empty() {
3948                    size
3949                        += 1u32
3950                            + ::buffa::types::bytes_encoded_len(&self.payload) as u32;
3951                }
3952                size += self.__buffa_unknown_fields.encoded_len() as u32;
3953                size
3954            }
3955            #[allow(clippy::needless_borrow)]
3956            fn write_to(
3957                &self,
3958                _cache: &mut ::buffa::SizeCache,
3959                buf: &mut impl ::buffa::bytes::BufMut,
3960            ) {
3961                #[allow(unused_imports)]
3962                use ::buffa::Enumeration as _;
3963                if !self.payload.is_empty() {
3964                    ::buffa::types::put_bytes_field(1u32, &self.payload, buf);
3965                }
3966                self.__buffa_unknown_fields.write_to(buf);
3967            }
3968        }
3969        /// Serializes this view as protobuf JSON.
3970        ///
3971        /// Implicit-presence fields with default values are omitted, `required`
3972        /// fields are always emitted, explicit-presence (`optional`) fields are
3973        /// emitted only when set, bytes fields are base64-encoded, and enum
3974        /// values are their proto name strings.
3975        ///
3976        /// This impl uses `serialize_map(None)` because the number of emitted
3977        /// fields depends on default-omission rules; serializers that require
3978        /// known map lengths (e.g. `bincode`) will return a runtime error.
3979        /// Use the owned message type for those formats.
3980        impl<'__a> ::serde::Serialize for PongResponseView<'__a> {
3981            fn serialize<__S: ::serde::Serializer>(
3982                &self,
3983                __s: __S,
3984            ) -> ::core::result::Result<__S::Ok, __S::Error> {
3985                use ::serde::ser::SerializeMap as _;
3986                let mut __map = __s.serialize_map(::core::option::Option::None)?;
3987                if !::buffa::json_helpers::skip_if::is_empty_bytes(self.payload) {
3988                    __map
3989                        .serialize_entry(
3990                            "payload",
3991                            &::buffa::json_helpers::BytesJson(self.payload),
3992                        )?;
3993                }
3994                __map.end()
3995            }
3996        }
3997        impl<'a> ::buffa::MessageName for PongResponseView<'a> {
3998            const PACKAGE: &'static str = "tradews.v1";
3999            const NAME: &'static str = "PongResponse";
4000            const FULL_NAME: &'static str = "tradews.v1.PongResponse";
4001            const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.PongResponse";
4002        }
4003        ::buffa::impl_default_view_instance!(PongResponseView);
4004        ::buffa::impl_view_reborrow!(PongResponseView);
4005        /** Self-contained, `'static` owned view of a `PongResponse` message.
4006
4007 Wraps [`::buffa::OwnedView`]`<`[`PongResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
4008
4009 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`PongResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
4010        #[derive(Clone, Debug)]
4011        pub struct PongResponseOwnedView(::buffa::OwnedView<PongResponseView<'static>>);
4012        impl PongResponseOwnedView {
4013            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
4014            ///
4015            /// The view borrows directly from the buffer's data; the buffer is
4016            /// retained inside the returned handle.
4017            ///
4018            /// # Errors
4019            ///
4020            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
4021            /// protobuf data.
4022            pub fn decode(
4023                bytes: ::buffa::bytes::Bytes,
4024            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4025                ::core::result::Result::Ok(
4026                    PongResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
4027                )
4028            }
4029            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
4030            /// max message size).
4031            ///
4032            /// # Errors
4033            ///
4034            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
4035            /// exceeds the configured limits.
4036            pub fn decode_with_options(
4037                bytes: ::buffa::bytes::Bytes,
4038                opts: &::buffa::DecodeOptions,
4039            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4040                ::core::result::Result::Ok(
4041                    PongResponseOwnedView(
4042                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4043                    ),
4044                )
4045            }
4046            /// Build from an owned message via an encode → decode round-trip.
4047            ///
4048            /// # Errors
4049            ///
4050            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
4051            /// somehow invalid (should not happen for well-formed messages).
4052            pub fn from_owned(
4053                msg: &super::super::PongResponse,
4054            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4055                ::core::result::Result::Ok(
4056                    PongResponseOwnedView(::buffa::OwnedView::from_owned(msg)?),
4057                )
4058            }
4059            /// Borrow the full [`PongResponseView`] with its lifetime tied to `&self`.
4060            #[must_use]
4061            pub fn view(&self) -> &PongResponseView<'_> {
4062                self.0.reborrow()
4063            }
4064            /// Convert to the owned message type.
4065            ///
4066            /// # Errors
4067            ///
4068            /// Returns an error if re-materializing preserved unknown fields
4069            /// fails (e.g. the unknown-field limit is exceeded).
4070            pub fn to_owned_message(
4071                &self,
4072            ) -> ::core::result::Result<
4073                super::super::PongResponse,
4074                ::buffa::DecodeError,
4075            > {
4076                self.0.to_owned_message()
4077            }
4078            /// The underlying bytes buffer.
4079            #[must_use]
4080            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4081                self.0.bytes()
4082            }
4083            /// Consume the handle, returning the underlying bytes buffer.
4084            #[must_use]
4085            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4086                self.0.into_bytes()
4087            }
4088            /// Opaque payload copied from PingRequest.
4089            ///
4090            /// Field 1: `payload`
4091            #[must_use]
4092            pub fn payload(&self) -> &'_ [u8] {
4093                self.0.reborrow().payload
4094            }
4095        }
4096        impl ::core::convert::From<::buffa::OwnedView<PongResponseView<'static>>>
4097        for PongResponseOwnedView {
4098            fn from(inner: ::buffa::OwnedView<PongResponseView<'static>>) -> Self {
4099                PongResponseOwnedView(inner)
4100            }
4101        }
4102        impl ::core::convert::From<PongResponseOwnedView>
4103        for ::buffa::OwnedView<PongResponseView<'static>> {
4104            fn from(wrapper: PongResponseOwnedView) -> Self {
4105                wrapper.0
4106            }
4107        }
4108        impl ::core::convert::AsRef<::buffa::OwnedView<PongResponseView<'static>>>
4109        for PongResponseOwnedView {
4110            fn as_ref(&self) -> &::buffa::OwnedView<PongResponseView<'static>> {
4111                &self.0
4112            }
4113        }
4114        impl ::buffa::HasMessageView for super::super::PongResponse {
4115            type View<'a> = PongResponseView<'a>;
4116            type ViewHandle = PongResponseOwnedView;
4117        }
4118        impl ::serde::Serialize for PongResponseOwnedView {
4119            fn serialize<__S: ::serde::Serializer>(
4120                &self,
4121                __s: __S,
4122            ) -> ::core::result::Result<__S::Ok, __S::Error> {
4123                ::serde::Serialize::serialize(&self.0, __s)
4124            }
4125        }
4126        /// AckResponse carries the command-specific public Orders API acknowledgement.
4127        #[derive(Clone, Debug, Default)]
4128        pub struct AckResponseView<'a> {
4129            pub result: ::core::option::Option<
4130                super::super::__buffa::view::oneof::ack_response::Result<'a>,
4131            >,
4132            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4133        }
4134        impl<'a> ::buffa::MessageView<'a> for AckResponseView<'a> {
4135            type Owned = super::super::AckResponse;
4136            fn decode_view(
4137                buf: &'a [u8],
4138            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4139                let __limit = ::core::cell::Cell::new(
4140                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
4141                );
4142                <Self as ::buffa::MessageView>::decode_view_ctx(
4143                    buf,
4144                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
4145                )
4146            }
4147            fn decode_view_with_ctx(
4148                buf: &'a [u8],
4149                ctx: ::buffa::DecodeContext<'_>,
4150            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4151                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
4152            }
4153            fn merge_view_field(
4154                &mut self,
4155                tag: ::buffa::encoding::Tag,
4156                cur: &'a [u8],
4157                before_tag: &'a [u8],
4158                ctx: ::buffa::DecodeContext<'_>,
4159            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
4160                let _ = ctx;
4161                #[allow(unused_variables)]
4162                let view = self;
4163                let mut cur = cur;
4164                match tag.field_number() {
4165                    1u32 => {
4166                        ::buffa::encoding::check_wire_type(
4167                            tag,
4168                            ::buffa::encoding::WireType::LengthDelimited,
4169                        )?;
4170                        let __sub_ctx = ctx.descend()?;
4171                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4172                        if let Some(
4173                            super::super::__buffa::view::oneof::ack_response::Result::CreateOrder(
4174                                ref mut existing,
4175                            ),
4176                        ) = view.result
4177                        {
4178                            ::buffa::MessageView::merge_into_view(
4179                                &mut **existing,
4180                                sub,
4181                                __sub_ctx,
4182                            )?;
4183                        } else {
4184                            view.result = Some(
4185                                super::super::__buffa::view::oneof::ack_response::Result::CreateOrder(
4186                                    ::buffa::alloc::boxed::Box::new(
4187                                        <super::super::super::super::orders::v1::__buffa::view::CreateOrderResponseView as ::buffa::MessageView>::decode_view_ctx(
4188                                            sub,
4189                                            __sub_ctx,
4190                                        )?,
4191                                    ),
4192                                ),
4193                            );
4194                        }
4195                    }
4196                    2u32 => {
4197                        ::buffa::encoding::check_wire_type(
4198                            tag,
4199                            ::buffa::encoding::WireType::LengthDelimited,
4200                        )?;
4201                        let __sub_ctx = ctx.descend()?;
4202                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4203                        if let Some(
4204                            super::super::__buffa::view::oneof::ack_response::Result::CancelOrder(
4205                                ref mut existing,
4206                            ),
4207                        ) = view.result
4208                        {
4209                            ::buffa::MessageView::merge_into_view(
4210                                &mut **existing,
4211                                sub,
4212                                __sub_ctx,
4213                            )?;
4214                        } else {
4215                            view.result = Some(
4216                                super::super::__buffa::view::oneof::ack_response::Result::CancelOrder(
4217                                    ::buffa::alloc::boxed::Box::new(
4218                                        <super::super::super::super::orders::v1::__buffa::view::CancelOrderResponseView as ::buffa::MessageView>::decode_view_ctx(
4219                                            sub,
4220                                            __sub_ctx,
4221                                        )?,
4222                                    ),
4223                                ),
4224                            );
4225                        }
4226                    }
4227                    3u32 => {
4228                        ::buffa::encoding::check_wire_type(
4229                            tag,
4230                            ::buffa::encoding::WireType::LengthDelimited,
4231                        )?;
4232                        let __sub_ctx = ctx.descend()?;
4233                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4234                        if let Some(
4235                            super::super::__buffa::view::oneof::ack_response::Result::ModifyOrder(
4236                                ref mut existing,
4237                            ),
4238                        ) = view.result
4239                        {
4240                            ::buffa::MessageView::merge_into_view(
4241                                &mut **existing,
4242                                sub,
4243                                __sub_ctx,
4244                            )?;
4245                        } else {
4246                            view.result = Some(
4247                                super::super::__buffa::view::oneof::ack_response::Result::ModifyOrder(
4248                                    ::buffa::alloc::boxed::Box::new(
4249                                        <super::super::super::super::orders::v1::__buffa::view::ModifyOrderResponseView as ::buffa::MessageView>::decode_view_ctx(
4250                                            sub,
4251                                            __sub_ctx,
4252                                        )?,
4253                                    ),
4254                                ),
4255                            );
4256                        }
4257                    }
4258                    4u32 => {
4259                        ::buffa::encoding::check_wire_type(
4260                            tag,
4261                            ::buffa::encoding::WireType::LengthDelimited,
4262                        )?;
4263                        let __sub_ctx = ctx.descend()?;
4264                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4265                        if let Some(
4266                            super::super::__buffa::view::oneof::ack_response::Result::CancelAllOrders(
4267                                ref mut existing,
4268                            ),
4269                        ) = view.result
4270                        {
4271                            ::buffa::MessageView::merge_into_view(
4272                                &mut **existing,
4273                                sub,
4274                                __sub_ctx,
4275                            )?;
4276                        } else {
4277                            view.result = Some(
4278                                super::super::__buffa::view::oneof::ack_response::Result::CancelAllOrders(
4279                                    ::buffa::alloc::boxed::Box::new(
4280                                        <super::super::super::super::orders::v1::__buffa::view::CancelAllOrdersResponseView as ::buffa::MessageView>::decode_view_ctx(
4281                                            sub,
4282                                            __sub_ctx,
4283                                        )?,
4284                                    ),
4285                                ),
4286                            );
4287                        }
4288                    }
4289                    _ => {
4290                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
4291                        let span_len = before_tag.len() - cur.len();
4292                        view.__buffa_unknown_fields
4293                            .push_record(before_tag, span_len, ctx)?;
4294                    }
4295                }
4296                ::core::result::Result::Ok(cur)
4297            }
4298            fn to_owned_message(
4299                &self,
4300            ) -> ::core::result::Result<
4301                super::super::AckResponse,
4302                ::buffa::DecodeError,
4303            > {
4304                self.to_owned_from_source(None)
4305            }
4306            #[allow(clippy::useless_conversion, clippy::needless_update)]
4307            fn to_owned_from_source(
4308                &self,
4309                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4310            ) -> ::core::result::Result<
4311                super::super::AckResponse,
4312                ::buffa::DecodeError,
4313            > {
4314                #[allow(unused_imports)]
4315                use ::buffa::alloc::string::ToString as _;
4316                let _ = __buffa_src;
4317                ::core::result::Result::Ok(super::super::AckResponse {
4318                    result: match self.result.as_ref() {
4319                        ::core::option::Option::Some(v) => {
4320                            ::core::option::Option::Some(
4321                                match v {
4322                                    super::super::__buffa::view::oneof::ack_response::Result::CreateOrder(
4323                                        v,
4324                                    ) => {
4325                                        super::super::__buffa::oneof::ack_response::Result::CreateOrder(
4326                                            ::buffa::alloc::boxed::Box::new(
4327                                                v.to_owned_from_source(__buffa_src)?,
4328                                            ),
4329                                        )
4330                                    }
4331                                    super::super::__buffa::view::oneof::ack_response::Result::CancelOrder(
4332                                        v,
4333                                    ) => {
4334                                        super::super::__buffa::oneof::ack_response::Result::CancelOrder(
4335                                            ::buffa::alloc::boxed::Box::new(
4336                                                v.to_owned_from_source(__buffa_src)?,
4337                                            ),
4338                                        )
4339                                    }
4340                                    super::super::__buffa::view::oneof::ack_response::Result::ModifyOrder(
4341                                        v,
4342                                    ) => {
4343                                        super::super::__buffa::oneof::ack_response::Result::ModifyOrder(
4344                                            ::buffa::alloc::boxed::Box::new(
4345                                                v.to_owned_from_source(__buffa_src)?,
4346                                            ),
4347                                        )
4348                                    }
4349                                    super::super::__buffa::view::oneof::ack_response::Result::CancelAllOrders(
4350                                        v,
4351                                    ) => {
4352                                        super::super::__buffa::oneof::ack_response::Result::CancelAllOrders(
4353                                            ::buffa::alloc::boxed::Box::new(
4354                                                v.to_owned_from_source(__buffa_src)?,
4355                                            ),
4356                                        )
4357                                    }
4358                                },
4359                            )
4360                        }
4361                        ::core::option::Option::None => ::core::option::Option::None,
4362                    },
4363                    __buffa_unknown_fields: self
4364                        .__buffa_unknown_fields
4365                        .to_owned()?
4366                        .into(),
4367                    ..::core::default::Default::default()
4368                })
4369            }
4370        }
4371        impl<'a> ::buffa::ViewEncode<'a> for AckResponseView<'a> {
4372            #[allow(clippy::needless_borrow, clippy::let_and_return)]
4373            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4374                #[allow(unused_imports)]
4375                use ::buffa::Enumeration as _;
4376                let mut size = 0u32;
4377                if let ::core::option::Option::Some(ref v) = self.result {
4378                    match v {
4379                        super::super::__buffa::view::oneof::ack_response::Result::CreateOrder(
4380                            x,
4381                        ) => {
4382                            let __slot = __cache.reserve();
4383                            let inner = x.compute_size(__cache);
4384                            __cache.set(__slot, inner);
4385                            size
4386                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
4387                                    + inner;
4388                        }
4389                        super::super::__buffa::view::oneof::ack_response::Result::CancelOrder(
4390                            x,
4391                        ) => {
4392                            let __slot = __cache.reserve();
4393                            let inner = x.compute_size(__cache);
4394                            __cache.set(__slot, inner);
4395                            size
4396                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
4397                                    + inner;
4398                        }
4399                        super::super::__buffa::view::oneof::ack_response::Result::ModifyOrder(
4400                            x,
4401                        ) => {
4402                            let __slot = __cache.reserve();
4403                            let inner = x.compute_size(__cache);
4404                            __cache.set(__slot, inner);
4405                            size
4406                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
4407                                    + inner;
4408                        }
4409                        super::super::__buffa::view::oneof::ack_response::Result::CancelAllOrders(
4410                            x,
4411                        ) => {
4412                            let __slot = __cache.reserve();
4413                            let inner = x.compute_size(__cache);
4414                            __cache.set(__slot, inner);
4415                            size
4416                                += 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
4417                                    + inner;
4418                        }
4419                    }
4420                }
4421                size += self.__buffa_unknown_fields.encoded_len() as u32;
4422                size
4423            }
4424            #[allow(clippy::needless_borrow)]
4425            fn write_to(
4426                &self,
4427                __cache: &mut ::buffa::SizeCache,
4428                buf: &mut impl ::buffa::bytes::BufMut,
4429            ) {
4430                #[allow(unused_imports)]
4431                use ::buffa::Enumeration as _;
4432                if let ::core::option::Option::Some(ref v) = self.result {
4433                    match v {
4434                        super::super::__buffa::view::oneof::ack_response::Result::CreateOrder(
4435                            x,
4436                        ) => {
4437                            ::buffa::types::put_len_delimited_header(
4438                                1u32,
4439                                __cache.consume_next(),
4440                                buf,
4441                            );
4442                            x.write_to(__cache, buf);
4443                        }
4444                        super::super::__buffa::view::oneof::ack_response::Result::CancelOrder(
4445                            x,
4446                        ) => {
4447                            ::buffa::types::put_len_delimited_header(
4448                                2u32,
4449                                __cache.consume_next(),
4450                                buf,
4451                            );
4452                            x.write_to(__cache, buf);
4453                        }
4454                        super::super::__buffa::view::oneof::ack_response::Result::ModifyOrder(
4455                            x,
4456                        ) => {
4457                            ::buffa::types::put_len_delimited_header(
4458                                3u32,
4459                                __cache.consume_next(),
4460                                buf,
4461                            );
4462                            x.write_to(__cache, buf);
4463                        }
4464                        super::super::__buffa::view::oneof::ack_response::Result::CancelAllOrders(
4465                            x,
4466                        ) => {
4467                            ::buffa::types::put_len_delimited_header(
4468                                4u32,
4469                                __cache.consume_next(),
4470                                buf,
4471                            );
4472                            x.write_to(__cache, buf);
4473                        }
4474                    }
4475                }
4476                self.__buffa_unknown_fields.write_to(buf);
4477            }
4478        }
4479        /// Serializes this view as protobuf JSON.
4480        ///
4481        /// Implicit-presence fields with default values are omitted, `required`
4482        /// fields are always emitted, explicit-presence (`optional`) fields are
4483        /// emitted only when set, bytes fields are base64-encoded, and enum
4484        /// values are their proto name strings.
4485        ///
4486        /// This impl uses `serialize_map(None)` because the number of emitted
4487        /// fields depends on default-omission rules; serializers that require
4488        /// known map lengths (e.g. `bincode`) will return a runtime error.
4489        /// Use the owned message type for those formats.
4490        impl<'__a> ::serde::Serialize for AckResponseView<'__a> {
4491            fn serialize<__S: ::serde::Serializer>(
4492                &self,
4493                __s: __S,
4494            ) -> ::core::result::Result<__S::Ok, __S::Error> {
4495                use ::serde::ser::SerializeMap as _;
4496                let mut __map = __s.serialize_map(::core::option::Option::None)?;
4497                if let ::core::option::Option::Some(ref __ov) = self.result {
4498                    match __ov {
4499                        super::super::__buffa::view::oneof::ack_response::Result::CreateOrder(
4500                            v,
4501                        ) => {
4502                            __map.serialize_entry("createOrder", v)?;
4503                        }
4504                        super::super::__buffa::view::oneof::ack_response::Result::CancelOrder(
4505                            v,
4506                        ) => {
4507                            __map.serialize_entry("cancelOrder", v)?;
4508                        }
4509                        super::super::__buffa::view::oneof::ack_response::Result::ModifyOrder(
4510                            v,
4511                        ) => {
4512                            __map.serialize_entry("modifyOrder", v)?;
4513                        }
4514                        super::super::__buffa::view::oneof::ack_response::Result::CancelAllOrders(
4515                            v,
4516                        ) => {
4517                            __map.serialize_entry("cancelAllOrders", v)?;
4518                        }
4519                    }
4520                }
4521                __map.end()
4522            }
4523        }
4524        impl<'a> ::buffa::MessageName for AckResponseView<'a> {
4525            const PACKAGE: &'static str = "tradews.v1";
4526            const NAME: &'static str = "AckResponse";
4527            const FULL_NAME: &'static str = "tradews.v1.AckResponse";
4528            const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.AckResponse";
4529        }
4530        ::buffa::impl_default_view_instance!(AckResponseView);
4531        ::buffa::impl_view_reborrow!(AckResponseView);
4532        /** Self-contained, `'static` owned view of a `AckResponse` message.
4533
4534 Wraps [`::buffa::OwnedView`]`<`[`AckResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
4535
4536 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`AckResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
4537        #[derive(Clone, Debug)]
4538        pub struct AckResponseOwnedView(::buffa::OwnedView<AckResponseView<'static>>);
4539        impl AckResponseOwnedView {
4540            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
4541            ///
4542            /// The view borrows directly from the buffer's data; the buffer is
4543            /// retained inside the returned handle.
4544            ///
4545            /// # Errors
4546            ///
4547            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
4548            /// protobuf data.
4549            pub fn decode(
4550                bytes: ::buffa::bytes::Bytes,
4551            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4552                ::core::result::Result::Ok(
4553                    AckResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
4554                )
4555            }
4556            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
4557            /// max message size).
4558            ///
4559            /// # Errors
4560            ///
4561            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
4562            /// exceeds the configured limits.
4563            pub fn decode_with_options(
4564                bytes: ::buffa::bytes::Bytes,
4565                opts: &::buffa::DecodeOptions,
4566            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4567                ::core::result::Result::Ok(
4568                    AckResponseOwnedView(
4569                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4570                    ),
4571                )
4572            }
4573            /// Build from an owned message via an encode → decode round-trip.
4574            ///
4575            /// # Errors
4576            ///
4577            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
4578            /// somehow invalid (should not happen for well-formed messages).
4579            pub fn from_owned(
4580                msg: &super::super::AckResponse,
4581            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4582                ::core::result::Result::Ok(
4583                    AckResponseOwnedView(::buffa::OwnedView::from_owned(msg)?),
4584                )
4585            }
4586            /// Borrow the full [`AckResponseView`] with its lifetime tied to `&self`.
4587            #[must_use]
4588            pub fn view(&self) -> &AckResponseView<'_> {
4589                self.0.reborrow()
4590            }
4591            /// Convert to the owned message type.
4592            ///
4593            /// # Errors
4594            ///
4595            /// Returns an error if re-materializing preserved unknown fields
4596            /// fails (e.g. the unknown-field limit is exceeded).
4597            pub fn to_owned_message(
4598                &self,
4599            ) -> ::core::result::Result<
4600                super::super::AckResponse,
4601                ::buffa::DecodeError,
4602            > {
4603                self.0.to_owned_message()
4604            }
4605            /// The underlying bytes buffer.
4606            #[must_use]
4607            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4608                self.0.bytes()
4609            }
4610            /// Consume the handle, returning the underlying bytes buffer.
4611            #[must_use]
4612            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4613                self.0.into_bytes()
4614            }
4615            /// Oneof `result`.
4616            #[must_use]
4617            pub fn result(
4618                &self,
4619            ) -> ::core::option::Option<
4620                &super::super::__buffa::view::oneof::ack_response::Result<'_>,
4621            > {
4622                self.0.reborrow().result.as_ref()
4623            }
4624        }
4625        impl ::core::convert::From<::buffa::OwnedView<AckResponseView<'static>>>
4626        for AckResponseOwnedView {
4627            fn from(inner: ::buffa::OwnedView<AckResponseView<'static>>) -> Self {
4628                AckResponseOwnedView(inner)
4629            }
4630        }
4631        impl ::core::convert::From<AckResponseOwnedView>
4632        for ::buffa::OwnedView<AckResponseView<'static>> {
4633            fn from(wrapper: AckResponseOwnedView) -> Self {
4634                wrapper.0
4635            }
4636        }
4637        impl ::core::convert::AsRef<::buffa::OwnedView<AckResponseView<'static>>>
4638        for AckResponseOwnedView {
4639            fn as_ref(&self) -> &::buffa::OwnedView<AckResponseView<'static>> {
4640                &self.0
4641            }
4642        }
4643        impl ::buffa::HasMessageView for super::super::AckResponse {
4644            type View<'a> = AckResponseView<'a>;
4645            type ViewHandle = AckResponseOwnedView;
4646        }
4647        impl ::serde::Serialize for AckResponseOwnedView {
4648            fn serialize<__S: ::serde::Serializer>(
4649                &self,
4650                __s: __S,
4651            ) -> ::core::result::Result<__S::Ok, __S::Error> {
4652                ::serde::Serialize::serialize(&self.0, __s)
4653            }
4654        }
4655        /// CommandReject reports a command-level failure without closing the session.
4656        #[derive(Clone, Debug, Default)]
4657        pub struct CommandRejectView<'a> {
4658            /// Stable machine-readable reject code.
4659            ///
4660            /// Field 1: `code`
4661            pub code: &'a str,
4662            /// Client-safe diagnostic detail.
4663            ///
4664            /// Field 2: `detail`
4665            pub detail: &'a str,
4666            /// Structured error details, including retry guidance for rate-limit rejections.
4667            ///
4668            /// Field 3: `error`
4669            pub error: ::buffa::MessageFieldView<
4670                super::super::super::super::orders::v1::__buffa::view::ErrorDetailView<
4671                    'a,
4672                >,
4673            >,
4674            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4675        }
4676        impl<'a> ::buffa::MessageView<'a> for CommandRejectView<'a> {
4677            type Owned = super::super::CommandReject;
4678            fn decode_view(
4679                buf: &'a [u8],
4680            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4681                let __limit = ::core::cell::Cell::new(
4682                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
4683                );
4684                <Self as ::buffa::MessageView>::decode_view_ctx(
4685                    buf,
4686                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
4687                )
4688            }
4689            fn decode_view_with_ctx(
4690                buf: &'a [u8],
4691                ctx: ::buffa::DecodeContext<'_>,
4692            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4693                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
4694            }
4695            fn merge_view_field(
4696                &mut self,
4697                tag: ::buffa::encoding::Tag,
4698                cur: &'a [u8],
4699                before_tag: &'a [u8],
4700                ctx: ::buffa::DecodeContext<'_>,
4701            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
4702                let _ = ctx;
4703                #[allow(unused_variables)]
4704                let view = self;
4705                let mut cur = cur;
4706                match tag.field_number() {
4707                    1u32 => {
4708                        ::buffa::encoding::check_wire_type(
4709                            tag,
4710                            ::buffa::encoding::WireType::LengthDelimited,
4711                        )?;
4712                        view.code = ::buffa::types::borrow_str(&mut cur)?;
4713                    }
4714                    2u32 => {
4715                        ::buffa::encoding::check_wire_type(
4716                            tag,
4717                            ::buffa::encoding::WireType::LengthDelimited,
4718                        )?;
4719                        view.detail = ::buffa::types::borrow_str(&mut cur)?;
4720                    }
4721                    3u32 => {
4722                        ::buffa::encoding::check_wire_type(
4723                            tag,
4724                            ::buffa::encoding::WireType::LengthDelimited,
4725                        )?;
4726                        let __sub_ctx = ctx.descend()?;
4727                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4728                        match view.error.as_mut() {
4729                            Some(existing) => {
4730                                ::buffa::MessageView::merge_into_view(
4731                                    existing,
4732                                    sub,
4733                                    __sub_ctx,
4734                                )?
4735                            }
4736                            None => {
4737                                view.error = ::buffa::MessageFieldView::set(
4738                                    <super::super::super::super::orders::v1::__buffa::view::ErrorDetailView as ::buffa::MessageView>::decode_view_ctx(
4739                                        sub,
4740                                        __sub_ctx,
4741                                    )?,
4742                                );
4743                            }
4744                        }
4745                    }
4746                    _ => {
4747                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
4748                        let span_len = before_tag.len() - cur.len();
4749                        view.__buffa_unknown_fields
4750                            .push_record(before_tag, span_len, ctx)?;
4751                    }
4752                }
4753                ::core::result::Result::Ok(cur)
4754            }
4755            fn to_owned_message(
4756                &self,
4757            ) -> ::core::result::Result<
4758                super::super::CommandReject,
4759                ::buffa::DecodeError,
4760            > {
4761                self.to_owned_from_source(None)
4762            }
4763            #[allow(clippy::useless_conversion, clippy::needless_update)]
4764            fn to_owned_from_source(
4765                &self,
4766                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4767            ) -> ::core::result::Result<
4768                super::super::CommandReject,
4769                ::buffa::DecodeError,
4770            > {
4771                #[allow(unused_imports)]
4772                use ::buffa::alloc::string::ToString as _;
4773                let _ = __buffa_src;
4774                ::core::result::Result::Ok(super::super::CommandReject {
4775                    code: self.code.to_string(),
4776                    detail: self.detail.to_string(),
4777                    error: match self.error.as_option() {
4778                        Some(v) => {
4779                            ::buffa::MessageField::<
4780                                super::super::super::super::orders::v1::ErrorDetail,
4781                            >::some(v.to_owned_from_source(__buffa_src)?)
4782                        }
4783                        None => ::buffa::MessageField::none(),
4784                    },
4785                    __buffa_unknown_fields: self
4786                        .__buffa_unknown_fields
4787                        .to_owned()?
4788                        .into(),
4789                    ..::core::default::Default::default()
4790                })
4791            }
4792        }
4793        impl<'a> ::buffa::ViewEncode<'a> for CommandRejectView<'a> {
4794            #[allow(clippy::needless_borrow, clippy::let_and_return)]
4795            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4796                #[allow(unused_imports)]
4797                use ::buffa::Enumeration as _;
4798                let mut size = 0u32;
4799                if !self.code.is_empty() {
4800                    size += 1u32 + ::buffa::types::string_encoded_len(&self.code) as u32;
4801                }
4802                if !self.detail.is_empty() {
4803                    size
4804                        += 1u32
4805                            + ::buffa::types::string_encoded_len(&self.detail) as u32;
4806                }
4807                if self.error.is_set() {
4808                    let __slot = __cache.reserve();
4809                    let inner_size = self.error.compute_size(__cache);
4810                    __cache.set(__slot, inner_size);
4811                    size
4812                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4813                            + inner_size;
4814                }
4815                size += self.__buffa_unknown_fields.encoded_len() as u32;
4816                size
4817            }
4818            #[allow(clippy::needless_borrow)]
4819            fn write_to(
4820                &self,
4821                __cache: &mut ::buffa::SizeCache,
4822                buf: &mut impl ::buffa::bytes::BufMut,
4823            ) {
4824                #[allow(unused_imports)]
4825                use ::buffa::Enumeration as _;
4826                if !self.code.is_empty() {
4827                    ::buffa::types::put_string_field(1u32, &self.code, buf);
4828                }
4829                if !self.detail.is_empty() {
4830                    ::buffa::types::put_string_field(2u32, &self.detail, buf);
4831                }
4832                if self.error.is_set() {
4833                    ::buffa::types::put_len_delimited_header(
4834                        3u32,
4835                        __cache.consume_next(),
4836                        buf,
4837                    );
4838                    self.error.write_to(__cache, buf);
4839                }
4840                self.__buffa_unknown_fields.write_to(buf);
4841            }
4842        }
4843        /// Serializes this view as protobuf JSON.
4844        ///
4845        /// Implicit-presence fields with default values are omitted, `required`
4846        /// fields are always emitted, explicit-presence (`optional`) fields are
4847        /// emitted only when set, bytes fields are base64-encoded, and enum
4848        /// values are their proto name strings.
4849        ///
4850        /// This impl uses `serialize_map(None)` because the number of emitted
4851        /// fields depends on default-omission rules; serializers that require
4852        /// known map lengths (e.g. `bincode`) will return a runtime error.
4853        /// Use the owned message type for those formats.
4854        impl<'__a> ::serde::Serialize for CommandRejectView<'__a> {
4855            fn serialize<__S: ::serde::Serializer>(
4856                &self,
4857                __s: __S,
4858            ) -> ::core::result::Result<__S::Ok, __S::Error> {
4859                use ::serde::ser::SerializeMap as _;
4860                let mut __map = __s.serialize_map(::core::option::Option::None)?;
4861                if !::buffa::json_helpers::skip_if::is_empty_str(self.code) {
4862                    __map.serialize_entry("code", self.code)?;
4863                }
4864                if !::buffa::json_helpers::skip_if::is_empty_str(self.detail) {
4865                    __map.serialize_entry("detail", self.detail)?;
4866                }
4867                {
4868                    if let ::core::option::Option::Some(__v) = self.error.as_option() {
4869                        __map.serialize_entry("error", __v)?;
4870                    }
4871                }
4872                __map.end()
4873            }
4874        }
4875        impl<'a> ::buffa::MessageName for CommandRejectView<'a> {
4876            const PACKAGE: &'static str = "tradews.v1";
4877            const NAME: &'static str = "CommandReject";
4878            const FULL_NAME: &'static str = "tradews.v1.CommandReject";
4879            const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.CommandReject";
4880        }
4881        ::buffa::impl_default_view_instance!(CommandRejectView);
4882        ::buffa::impl_view_reborrow!(CommandRejectView);
4883        /** Self-contained, `'static` owned view of a `CommandReject` message.
4884
4885 Wraps [`::buffa::OwnedView`]`<`[`CommandRejectView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
4886
4887 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`CommandRejectView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
4888        #[derive(Clone, Debug)]
4889        pub struct CommandRejectOwnedView(
4890            ::buffa::OwnedView<CommandRejectView<'static>>,
4891        );
4892        impl CommandRejectOwnedView {
4893            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
4894            ///
4895            /// The view borrows directly from the buffer's data; the buffer is
4896            /// retained inside the returned handle.
4897            ///
4898            /// # Errors
4899            ///
4900            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
4901            /// protobuf data.
4902            pub fn decode(
4903                bytes: ::buffa::bytes::Bytes,
4904            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4905                ::core::result::Result::Ok(
4906                    CommandRejectOwnedView(::buffa::OwnedView::decode(bytes)?),
4907                )
4908            }
4909            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
4910            /// max message size).
4911            ///
4912            /// # Errors
4913            ///
4914            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
4915            /// exceeds the configured limits.
4916            pub fn decode_with_options(
4917                bytes: ::buffa::bytes::Bytes,
4918                opts: &::buffa::DecodeOptions,
4919            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4920                ::core::result::Result::Ok(
4921                    CommandRejectOwnedView(
4922                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4923                    ),
4924                )
4925            }
4926            /// Build from an owned message via an encode → decode round-trip.
4927            ///
4928            /// # Errors
4929            ///
4930            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
4931            /// somehow invalid (should not happen for well-formed messages).
4932            pub fn from_owned(
4933                msg: &super::super::CommandReject,
4934            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4935                ::core::result::Result::Ok(
4936                    CommandRejectOwnedView(::buffa::OwnedView::from_owned(msg)?),
4937                )
4938            }
4939            /// Borrow the full [`CommandRejectView`] with its lifetime tied to `&self`.
4940            #[must_use]
4941            pub fn view(&self) -> &CommandRejectView<'_> {
4942                self.0.reborrow()
4943            }
4944            /// Convert to the owned message type.
4945            ///
4946            /// # Errors
4947            ///
4948            /// Returns an error if re-materializing preserved unknown fields
4949            /// fails (e.g. the unknown-field limit is exceeded).
4950            pub fn to_owned_message(
4951                &self,
4952            ) -> ::core::result::Result<
4953                super::super::CommandReject,
4954                ::buffa::DecodeError,
4955            > {
4956                self.0.to_owned_message()
4957            }
4958            /// The underlying bytes buffer.
4959            #[must_use]
4960            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4961                self.0.bytes()
4962            }
4963            /// Consume the handle, returning the underlying bytes buffer.
4964            #[must_use]
4965            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4966                self.0.into_bytes()
4967            }
4968            /// Stable machine-readable reject code.
4969            ///
4970            /// Field 1: `code`
4971            #[must_use]
4972            pub fn code(&self) -> &'_ str {
4973                self.0.reborrow().code
4974            }
4975            /// Client-safe diagnostic detail.
4976            ///
4977            /// Field 2: `detail`
4978            #[must_use]
4979            pub fn detail(&self) -> &'_ str {
4980                self.0.reborrow().detail
4981            }
4982            /// Structured error details, including retry guidance for rate-limit rejections.
4983            ///
4984            /// Field 3: `error`
4985            #[must_use]
4986            pub fn error(
4987                &self,
4988            ) -> &::buffa::MessageFieldView<
4989                super::super::super::super::orders::v1::__buffa::view::ErrorDetailView<
4990                    '_,
4991                >,
4992            > {
4993                &self.0.reborrow().error
4994            }
4995        }
4996        impl ::core::convert::From<::buffa::OwnedView<CommandRejectView<'static>>>
4997        for CommandRejectOwnedView {
4998            fn from(inner: ::buffa::OwnedView<CommandRejectView<'static>>) -> Self {
4999                CommandRejectOwnedView(inner)
5000            }
5001        }
5002        impl ::core::convert::From<CommandRejectOwnedView>
5003        for ::buffa::OwnedView<CommandRejectView<'static>> {
5004            fn from(wrapper: CommandRejectOwnedView) -> Self {
5005                wrapper.0
5006            }
5007        }
5008        impl ::core::convert::AsRef<::buffa::OwnedView<CommandRejectView<'static>>>
5009        for CommandRejectOwnedView {
5010            fn as_ref(&self) -> &::buffa::OwnedView<CommandRejectView<'static>> {
5011                &self.0
5012            }
5013        }
5014        impl ::buffa::HasMessageView for super::super::CommandReject {
5015            type View<'a> = CommandRejectView<'a>;
5016            type ViewHandle = CommandRejectOwnedView;
5017        }
5018        impl ::serde::Serialize for CommandRejectOwnedView {
5019            fn serialize<__S: ::serde::Serializer>(
5020                &self,
5021                __s: __S,
5022            ) -> ::core::result::Result<__S::Ok, __S::Error> {
5023                ::serde::Serialize::serialize(&self.0, __s)
5024            }
5025        }
5026        /// OverloadResponse reports that the session exceeded server admission limits.
5027        #[derive(Clone, Debug, Default)]
5028        pub struct OverloadResponseView<'a> {
5029            /// Stable machine-readable overload code.
5030            ///
5031            /// Field 1: `code`
5032            pub code: &'a str,
5033            /// Client-safe diagnostic detail.
5034            ///
5035            /// Field 2: `detail`
5036            pub detail: &'a str,
5037            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5038        }
5039        impl<'a> ::buffa::MessageView<'a> for OverloadResponseView<'a> {
5040            type Owned = super::super::OverloadResponse;
5041            fn decode_view(
5042                buf: &'a [u8],
5043            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5044                let __limit = ::core::cell::Cell::new(
5045                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
5046                );
5047                <Self as ::buffa::MessageView>::decode_view_ctx(
5048                    buf,
5049                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
5050                )
5051            }
5052            fn decode_view_with_ctx(
5053                buf: &'a [u8],
5054                ctx: ::buffa::DecodeContext<'_>,
5055            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5056                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
5057            }
5058            fn merge_view_field(
5059                &mut self,
5060                tag: ::buffa::encoding::Tag,
5061                cur: &'a [u8],
5062                before_tag: &'a [u8],
5063                ctx: ::buffa::DecodeContext<'_>,
5064            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
5065                let _ = ctx;
5066                #[allow(unused_variables)]
5067                let view = self;
5068                let mut cur = cur;
5069                match tag.field_number() {
5070                    1u32 => {
5071                        ::buffa::encoding::check_wire_type(
5072                            tag,
5073                            ::buffa::encoding::WireType::LengthDelimited,
5074                        )?;
5075                        view.code = ::buffa::types::borrow_str(&mut cur)?;
5076                    }
5077                    2u32 => {
5078                        ::buffa::encoding::check_wire_type(
5079                            tag,
5080                            ::buffa::encoding::WireType::LengthDelimited,
5081                        )?;
5082                        view.detail = ::buffa::types::borrow_str(&mut cur)?;
5083                    }
5084                    _ => {
5085                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
5086                        let span_len = before_tag.len() - cur.len();
5087                        view.__buffa_unknown_fields
5088                            .push_record(before_tag, span_len, ctx)?;
5089                    }
5090                }
5091                ::core::result::Result::Ok(cur)
5092            }
5093            fn to_owned_message(
5094                &self,
5095            ) -> ::core::result::Result<
5096                super::super::OverloadResponse,
5097                ::buffa::DecodeError,
5098            > {
5099                self.to_owned_from_source(None)
5100            }
5101            #[allow(clippy::useless_conversion, clippy::needless_update)]
5102            fn to_owned_from_source(
5103                &self,
5104                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
5105            ) -> ::core::result::Result<
5106                super::super::OverloadResponse,
5107                ::buffa::DecodeError,
5108            > {
5109                #[allow(unused_imports)]
5110                use ::buffa::alloc::string::ToString as _;
5111                let _ = __buffa_src;
5112                ::core::result::Result::Ok(super::super::OverloadResponse {
5113                    code: self.code.to_string(),
5114                    detail: self.detail.to_string(),
5115                    __buffa_unknown_fields: self
5116                        .__buffa_unknown_fields
5117                        .to_owned()?
5118                        .into(),
5119                    ..::core::default::Default::default()
5120                })
5121            }
5122        }
5123        impl<'a> ::buffa::ViewEncode<'a> for OverloadResponseView<'a> {
5124            #[allow(clippy::needless_borrow, clippy::let_and_return)]
5125            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5126                #[allow(unused_imports)]
5127                use ::buffa::Enumeration as _;
5128                let mut size = 0u32;
5129                if !self.code.is_empty() {
5130                    size += 1u32 + ::buffa::types::string_encoded_len(&self.code) as u32;
5131                }
5132                if !self.detail.is_empty() {
5133                    size
5134                        += 1u32
5135                            + ::buffa::types::string_encoded_len(&self.detail) as u32;
5136                }
5137                size += self.__buffa_unknown_fields.encoded_len() as u32;
5138                size
5139            }
5140            #[allow(clippy::needless_borrow)]
5141            fn write_to(
5142                &self,
5143                _cache: &mut ::buffa::SizeCache,
5144                buf: &mut impl ::buffa::bytes::BufMut,
5145            ) {
5146                #[allow(unused_imports)]
5147                use ::buffa::Enumeration as _;
5148                if !self.code.is_empty() {
5149                    ::buffa::types::put_string_field(1u32, &self.code, buf);
5150                }
5151                if !self.detail.is_empty() {
5152                    ::buffa::types::put_string_field(2u32, &self.detail, buf);
5153                }
5154                self.__buffa_unknown_fields.write_to(buf);
5155            }
5156        }
5157        /// Serializes this view as protobuf JSON.
5158        ///
5159        /// Implicit-presence fields with default values are omitted, `required`
5160        /// fields are always emitted, explicit-presence (`optional`) fields are
5161        /// emitted only when set, bytes fields are base64-encoded, and enum
5162        /// values are their proto name strings.
5163        ///
5164        /// This impl uses `serialize_map(None)` because the number of emitted
5165        /// fields depends on default-omission rules; serializers that require
5166        /// known map lengths (e.g. `bincode`) will return a runtime error.
5167        /// Use the owned message type for those formats.
5168        impl<'__a> ::serde::Serialize for OverloadResponseView<'__a> {
5169            fn serialize<__S: ::serde::Serializer>(
5170                &self,
5171                __s: __S,
5172            ) -> ::core::result::Result<__S::Ok, __S::Error> {
5173                use ::serde::ser::SerializeMap as _;
5174                let mut __map = __s.serialize_map(::core::option::Option::None)?;
5175                if !::buffa::json_helpers::skip_if::is_empty_str(self.code) {
5176                    __map.serialize_entry("code", self.code)?;
5177                }
5178                if !::buffa::json_helpers::skip_if::is_empty_str(self.detail) {
5179                    __map.serialize_entry("detail", self.detail)?;
5180                }
5181                __map.end()
5182            }
5183        }
5184        impl<'a> ::buffa::MessageName for OverloadResponseView<'a> {
5185            const PACKAGE: &'static str = "tradews.v1";
5186            const NAME: &'static str = "OverloadResponse";
5187            const FULL_NAME: &'static str = "tradews.v1.OverloadResponse";
5188            const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.OverloadResponse";
5189        }
5190        ::buffa::impl_default_view_instance!(OverloadResponseView);
5191        ::buffa::impl_view_reborrow!(OverloadResponseView);
5192        /** Self-contained, `'static` owned view of a `OverloadResponse` message.
5193
5194 Wraps [`::buffa::OwnedView`]`<`[`OverloadResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
5195
5196 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`OverloadResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
5197        #[derive(Clone, Debug)]
5198        pub struct OverloadResponseOwnedView(
5199            ::buffa::OwnedView<OverloadResponseView<'static>>,
5200        );
5201        impl OverloadResponseOwnedView {
5202            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
5203            ///
5204            /// The view borrows directly from the buffer's data; the buffer is
5205            /// retained inside the returned handle.
5206            ///
5207            /// # Errors
5208            ///
5209            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
5210            /// protobuf data.
5211            pub fn decode(
5212                bytes: ::buffa::bytes::Bytes,
5213            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5214                ::core::result::Result::Ok(
5215                    OverloadResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
5216                )
5217            }
5218            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
5219            /// max message size).
5220            ///
5221            /// # Errors
5222            ///
5223            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
5224            /// exceeds the configured limits.
5225            pub fn decode_with_options(
5226                bytes: ::buffa::bytes::Bytes,
5227                opts: &::buffa::DecodeOptions,
5228            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5229                ::core::result::Result::Ok(
5230                    OverloadResponseOwnedView(
5231                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5232                    ),
5233                )
5234            }
5235            /// Build from an owned message via an encode → decode round-trip.
5236            ///
5237            /// # Errors
5238            ///
5239            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
5240            /// somehow invalid (should not happen for well-formed messages).
5241            pub fn from_owned(
5242                msg: &super::super::OverloadResponse,
5243            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5244                ::core::result::Result::Ok(
5245                    OverloadResponseOwnedView(::buffa::OwnedView::from_owned(msg)?),
5246                )
5247            }
5248            /// Borrow the full [`OverloadResponseView`] with its lifetime tied to `&self`.
5249            #[must_use]
5250            pub fn view(&self) -> &OverloadResponseView<'_> {
5251                self.0.reborrow()
5252            }
5253            /// Convert to the owned message type.
5254            ///
5255            /// # Errors
5256            ///
5257            /// Returns an error if re-materializing preserved unknown fields
5258            /// fails (e.g. the unknown-field limit is exceeded).
5259            pub fn to_owned_message(
5260                &self,
5261            ) -> ::core::result::Result<
5262                super::super::OverloadResponse,
5263                ::buffa::DecodeError,
5264            > {
5265                self.0.to_owned_message()
5266            }
5267            /// The underlying bytes buffer.
5268            #[must_use]
5269            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5270                self.0.bytes()
5271            }
5272            /// Consume the handle, returning the underlying bytes buffer.
5273            #[must_use]
5274            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5275                self.0.into_bytes()
5276            }
5277            /// Stable machine-readable overload code.
5278            ///
5279            /// Field 1: `code`
5280            #[must_use]
5281            pub fn code(&self) -> &'_ str {
5282                self.0.reborrow().code
5283            }
5284            /// Client-safe diagnostic detail.
5285            ///
5286            /// Field 2: `detail`
5287            #[must_use]
5288            pub fn detail(&self) -> &'_ str {
5289                self.0.reborrow().detail
5290            }
5291        }
5292        impl ::core::convert::From<::buffa::OwnedView<OverloadResponseView<'static>>>
5293        for OverloadResponseOwnedView {
5294            fn from(inner: ::buffa::OwnedView<OverloadResponseView<'static>>) -> Self {
5295                OverloadResponseOwnedView(inner)
5296            }
5297        }
5298        impl ::core::convert::From<OverloadResponseOwnedView>
5299        for ::buffa::OwnedView<OverloadResponseView<'static>> {
5300            fn from(wrapper: OverloadResponseOwnedView) -> Self {
5301                wrapper.0
5302            }
5303        }
5304        impl ::core::convert::AsRef<::buffa::OwnedView<OverloadResponseView<'static>>>
5305        for OverloadResponseOwnedView {
5306            fn as_ref(&self) -> &::buffa::OwnedView<OverloadResponseView<'static>> {
5307                &self.0
5308            }
5309        }
5310        impl ::buffa::HasMessageView for super::super::OverloadResponse {
5311            type View<'a> = OverloadResponseView<'a>;
5312            type ViewHandle = OverloadResponseOwnedView;
5313        }
5314        impl ::serde::Serialize for OverloadResponseOwnedView {
5315            fn serialize<__S: ::serde::Serializer>(
5316                &self,
5317                __s: __S,
5318            ) -> ::core::result::Result<__S::Ok, __S::Error> {
5319                ::serde::Serialize::serialize(&self.0, __s)
5320            }
5321        }
5322        /// TerminalSessionEvent reports a terminal session condition.
5323        #[derive(Clone, Debug, Default)]
5324        pub struct TerminalSessionEventView<'a> {
5325            /// Stable machine-readable terminal code.
5326            ///
5327            /// Field 1: `code`
5328            pub code: &'a str,
5329            /// Client-safe diagnostic detail.
5330            ///
5331            /// Field 2: `detail`
5332            pub detail: &'a str,
5333            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5334        }
5335        impl<'a> ::buffa::MessageView<'a> for TerminalSessionEventView<'a> {
5336            type Owned = super::super::TerminalSessionEvent;
5337            fn decode_view(
5338                buf: &'a [u8],
5339            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5340                let __limit = ::core::cell::Cell::new(
5341                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
5342                );
5343                <Self as ::buffa::MessageView>::decode_view_ctx(
5344                    buf,
5345                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
5346                )
5347            }
5348            fn decode_view_with_ctx(
5349                buf: &'a [u8],
5350                ctx: ::buffa::DecodeContext<'_>,
5351            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5352                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
5353            }
5354            fn merge_view_field(
5355                &mut self,
5356                tag: ::buffa::encoding::Tag,
5357                cur: &'a [u8],
5358                before_tag: &'a [u8],
5359                ctx: ::buffa::DecodeContext<'_>,
5360            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
5361                let _ = ctx;
5362                #[allow(unused_variables)]
5363                let view = self;
5364                let mut cur = cur;
5365                match tag.field_number() {
5366                    1u32 => {
5367                        ::buffa::encoding::check_wire_type(
5368                            tag,
5369                            ::buffa::encoding::WireType::LengthDelimited,
5370                        )?;
5371                        view.code = ::buffa::types::borrow_str(&mut cur)?;
5372                    }
5373                    2u32 => {
5374                        ::buffa::encoding::check_wire_type(
5375                            tag,
5376                            ::buffa::encoding::WireType::LengthDelimited,
5377                        )?;
5378                        view.detail = ::buffa::types::borrow_str(&mut cur)?;
5379                    }
5380                    _ => {
5381                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
5382                        let span_len = before_tag.len() - cur.len();
5383                        view.__buffa_unknown_fields
5384                            .push_record(before_tag, span_len, ctx)?;
5385                    }
5386                }
5387                ::core::result::Result::Ok(cur)
5388            }
5389            fn to_owned_message(
5390                &self,
5391            ) -> ::core::result::Result<
5392                super::super::TerminalSessionEvent,
5393                ::buffa::DecodeError,
5394            > {
5395                self.to_owned_from_source(None)
5396            }
5397            #[allow(clippy::useless_conversion, clippy::needless_update)]
5398            fn to_owned_from_source(
5399                &self,
5400                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
5401            ) -> ::core::result::Result<
5402                super::super::TerminalSessionEvent,
5403                ::buffa::DecodeError,
5404            > {
5405                #[allow(unused_imports)]
5406                use ::buffa::alloc::string::ToString as _;
5407                let _ = __buffa_src;
5408                ::core::result::Result::Ok(super::super::TerminalSessionEvent {
5409                    code: self.code.to_string(),
5410                    detail: self.detail.to_string(),
5411                    __buffa_unknown_fields: self
5412                        .__buffa_unknown_fields
5413                        .to_owned()?
5414                        .into(),
5415                    ..::core::default::Default::default()
5416                })
5417            }
5418        }
5419        impl<'a> ::buffa::ViewEncode<'a> for TerminalSessionEventView<'a> {
5420            #[allow(clippy::needless_borrow, clippy::let_and_return)]
5421            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5422                #[allow(unused_imports)]
5423                use ::buffa::Enumeration as _;
5424                let mut size = 0u32;
5425                if !self.code.is_empty() {
5426                    size += 1u32 + ::buffa::types::string_encoded_len(&self.code) as u32;
5427                }
5428                if !self.detail.is_empty() {
5429                    size
5430                        += 1u32
5431                            + ::buffa::types::string_encoded_len(&self.detail) as u32;
5432                }
5433                size += self.__buffa_unknown_fields.encoded_len() as u32;
5434                size
5435            }
5436            #[allow(clippy::needless_borrow)]
5437            fn write_to(
5438                &self,
5439                _cache: &mut ::buffa::SizeCache,
5440                buf: &mut impl ::buffa::bytes::BufMut,
5441            ) {
5442                #[allow(unused_imports)]
5443                use ::buffa::Enumeration as _;
5444                if !self.code.is_empty() {
5445                    ::buffa::types::put_string_field(1u32, &self.code, buf);
5446                }
5447                if !self.detail.is_empty() {
5448                    ::buffa::types::put_string_field(2u32, &self.detail, buf);
5449                }
5450                self.__buffa_unknown_fields.write_to(buf);
5451            }
5452        }
5453        /// Serializes this view as protobuf JSON.
5454        ///
5455        /// Implicit-presence fields with default values are omitted, `required`
5456        /// fields are always emitted, explicit-presence (`optional`) fields are
5457        /// emitted only when set, bytes fields are base64-encoded, and enum
5458        /// values are their proto name strings.
5459        ///
5460        /// This impl uses `serialize_map(None)` because the number of emitted
5461        /// fields depends on default-omission rules; serializers that require
5462        /// known map lengths (e.g. `bincode`) will return a runtime error.
5463        /// Use the owned message type for those formats.
5464        impl<'__a> ::serde::Serialize for TerminalSessionEventView<'__a> {
5465            fn serialize<__S: ::serde::Serializer>(
5466                &self,
5467                __s: __S,
5468            ) -> ::core::result::Result<__S::Ok, __S::Error> {
5469                use ::serde::ser::SerializeMap as _;
5470                let mut __map = __s.serialize_map(::core::option::Option::None)?;
5471                if !::buffa::json_helpers::skip_if::is_empty_str(self.code) {
5472                    __map.serialize_entry("code", self.code)?;
5473                }
5474                if !::buffa::json_helpers::skip_if::is_empty_str(self.detail) {
5475                    __map.serialize_entry("detail", self.detail)?;
5476                }
5477                __map.end()
5478            }
5479        }
5480        impl<'a> ::buffa::MessageName for TerminalSessionEventView<'a> {
5481            const PACKAGE: &'static str = "tradews.v1";
5482            const NAME: &'static str = "TerminalSessionEvent";
5483            const FULL_NAME: &'static str = "tradews.v1.TerminalSessionEvent";
5484            const TYPE_URL: &'static str = "type.googleapis.com/tradews.v1.TerminalSessionEvent";
5485        }
5486        ::buffa::impl_default_view_instance!(TerminalSessionEventView);
5487        ::buffa::impl_view_reborrow!(TerminalSessionEventView);
5488        /** Self-contained, `'static` owned view of a `TerminalSessionEvent` message.
5489
5490 Wraps [`::buffa::OwnedView`]`<`[`TerminalSessionEventView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
5491
5492 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`TerminalSessionEventView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
5493        #[derive(Clone, Debug)]
5494        pub struct TerminalSessionEventOwnedView(
5495            ::buffa::OwnedView<TerminalSessionEventView<'static>>,
5496        );
5497        impl TerminalSessionEventOwnedView {
5498            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
5499            ///
5500            /// The view borrows directly from the buffer's data; the buffer is
5501            /// retained inside the returned handle.
5502            ///
5503            /// # Errors
5504            ///
5505            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
5506            /// protobuf data.
5507            pub fn decode(
5508                bytes: ::buffa::bytes::Bytes,
5509            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5510                ::core::result::Result::Ok(
5511                    TerminalSessionEventOwnedView(::buffa::OwnedView::decode(bytes)?),
5512                )
5513            }
5514            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
5515            /// max message size).
5516            ///
5517            /// # Errors
5518            ///
5519            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
5520            /// exceeds the configured limits.
5521            pub fn decode_with_options(
5522                bytes: ::buffa::bytes::Bytes,
5523                opts: &::buffa::DecodeOptions,
5524            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5525                ::core::result::Result::Ok(
5526                    TerminalSessionEventOwnedView(
5527                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5528                    ),
5529                )
5530            }
5531            /// Build from an owned message via an encode → decode round-trip.
5532            ///
5533            /// # Errors
5534            ///
5535            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
5536            /// somehow invalid (should not happen for well-formed messages).
5537            pub fn from_owned(
5538                msg: &super::super::TerminalSessionEvent,
5539            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5540                ::core::result::Result::Ok(
5541                    TerminalSessionEventOwnedView(::buffa::OwnedView::from_owned(msg)?),
5542                )
5543            }
5544            /// Borrow the full [`TerminalSessionEventView`] with its lifetime tied to `&self`.
5545            #[must_use]
5546            pub fn view(&self) -> &TerminalSessionEventView<'_> {
5547                self.0.reborrow()
5548            }
5549            /// Convert to the owned message type.
5550            ///
5551            /// # Errors
5552            ///
5553            /// Returns an error if re-materializing preserved unknown fields
5554            /// fails (e.g. the unknown-field limit is exceeded).
5555            pub fn to_owned_message(
5556                &self,
5557            ) -> ::core::result::Result<
5558                super::super::TerminalSessionEvent,
5559                ::buffa::DecodeError,
5560            > {
5561                self.0.to_owned_message()
5562            }
5563            /// The underlying bytes buffer.
5564            #[must_use]
5565            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5566                self.0.bytes()
5567            }
5568            /// Consume the handle, returning the underlying bytes buffer.
5569            #[must_use]
5570            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5571                self.0.into_bytes()
5572            }
5573            /// Stable machine-readable terminal code.
5574            ///
5575            /// Field 1: `code`
5576            #[must_use]
5577            pub fn code(&self) -> &'_ str {
5578                self.0.reborrow().code
5579            }
5580            /// Client-safe diagnostic detail.
5581            ///
5582            /// Field 2: `detail`
5583            #[must_use]
5584            pub fn detail(&self) -> &'_ str {
5585                self.0.reborrow().detail
5586            }
5587        }
5588        impl ::core::convert::From<::buffa::OwnedView<TerminalSessionEventView<'static>>>
5589        for TerminalSessionEventOwnedView {
5590            fn from(
5591                inner: ::buffa::OwnedView<TerminalSessionEventView<'static>>,
5592            ) -> Self {
5593                TerminalSessionEventOwnedView(inner)
5594            }
5595        }
5596        impl ::core::convert::From<TerminalSessionEventOwnedView>
5597        for ::buffa::OwnedView<TerminalSessionEventView<'static>> {
5598            fn from(wrapper: TerminalSessionEventOwnedView) -> Self {
5599                wrapper.0
5600            }
5601        }
5602        impl ::core::convert::AsRef<
5603            ::buffa::OwnedView<TerminalSessionEventView<'static>>,
5604        > for TerminalSessionEventOwnedView {
5605            fn as_ref(&self) -> &::buffa::OwnedView<TerminalSessionEventView<'static>> {
5606                &self.0
5607            }
5608        }
5609        impl ::buffa::HasMessageView for super::super::TerminalSessionEvent {
5610            type View<'a> = TerminalSessionEventView<'a>;
5611            type ViewHandle = TerminalSessionEventOwnedView;
5612        }
5613        impl ::serde::Serialize for TerminalSessionEventOwnedView {
5614            fn serialize<__S: ::serde::Serializer>(
5615                &self,
5616                __s: __S,
5617            ) -> ::core::result::Result<__S::Ok, __S::Error> {
5618                ::serde::Serialize::serialize(&self.0, __s)
5619            }
5620        }
5621        pub mod oneof {
5622            #[allow(unused_imports)]
5623            use super::*;
5624            pub mod client_frame {
5625                #[allow(unused_imports)]
5626                use super::*;
5627                #[derive(Clone, Debug)]
5628                pub enum Payload<'a> {
5629                    Ping(
5630                        ::buffa::alloc::boxed::Box<
5631                            super::super::super::super::__buffa::view::PingRequestView<
5632                                'a,
5633                            >,
5634                        >,
5635                    ),
5636                    CreateOrder(
5637                        ::buffa::alloc::boxed::Box<
5638                            super::super::super::super::super::super::orders::v1::__buffa::view::CreateOrderRequestView<
5639                                'a,
5640                            >,
5641                        >,
5642                    ),
5643                    CancelOrder(
5644                        ::buffa::alloc::boxed::Box<
5645                            super::super::super::super::super::super::orders::v1::__buffa::view::CancelOrderRequestView<
5646                                'a,
5647                            >,
5648                        >,
5649                    ),
5650                    ModifyOrder(
5651                        ::buffa::alloc::boxed::Box<
5652                            super::super::super::super::super::super::orders::v1::__buffa::view::ModifyOrderRequestView<
5653                                'a,
5654                            >,
5655                        >,
5656                    ),
5657                    CancelAllOrders(
5658                        ::buffa::alloc::boxed::Box<
5659                            super::super::super::super::super::super::orders::v1::__buffa::view::CancelAllOrdersRequestView<
5660                                'a,
5661                            >,
5662                        >,
5663                    ),
5664                }
5665            }
5666            pub mod server_frame {
5667                #[allow(unused_imports)]
5668                use super::*;
5669                #[derive(Clone, Debug)]
5670                pub enum Payload<'a> {
5671                    Pong(
5672                        ::buffa::alloc::boxed::Box<
5673                            super::super::super::super::__buffa::view::PongResponseView<
5674                                'a,
5675                            >,
5676                        >,
5677                    ),
5678                    Ack(
5679                        ::buffa::alloc::boxed::Box<
5680                            super::super::super::super::__buffa::view::AckResponseView<
5681                                'a,
5682                            >,
5683                        >,
5684                    ),
5685                    Reject(
5686                        ::buffa::alloc::boxed::Box<
5687                            super::super::super::super::__buffa::view::CommandRejectView<
5688                                'a,
5689                            >,
5690                        >,
5691                    ),
5692                    Overload(
5693                        ::buffa::alloc::boxed::Box<
5694                            super::super::super::super::__buffa::view::OverloadResponseView<
5695                                'a,
5696                            >,
5697                        >,
5698                    ),
5699                    Terminal(
5700                        ::buffa::alloc::boxed::Box<
5701                            super::super::super::super::__buffa::view::TerminalSessionEventView<
5702                                'a,
5703                            >,
5704                        >,
5705                    ),
5706                }
5707            }
5708            pub mod ack_response {
5709                #[allow(unused_imports)]
5710                use super::*;
5711                #[derive(Clone, Debug)]
5712                pub enum Result<'a> {
5713                    CreateOrder(
5714                        ::buffa::alloc::boxed::Box<
5715                            super::super::super::super::super::super::orders::v1::__buffa::view::CreateOrderResponseView<
5716                                'a,
5717                            >,
5718                        >,
5719                    ),
5720                    CancelOrder(
5721                        ::buffa::alloc::boxed::Box<
5722                            super::super::super::super::super::super::orders::v1::__buffa::view::CancelOrderResponseView<
5723                                'a,
5724                            >,
5725                        >,
5726                    ),
5727                    ModifyOrder(
5728                        ::buffa::alloc::boxed::Box<
5729                            super::super::super::super::super::super::orders::v1::__buffa::view::ModifyOrderResponseView<
5730                                'a,
5731                            >,
5732                        >,
5733                    ),
5734                    CancelAllOrders(
5735                        ::buffa::alloc::boxed::Box<
5736                            super::super::super::super::super::super::orders::v1::__buffa::view::CancelAllOrdersResponseView<
5737                                'a,
5738                            >,
5739                        >,
5740                    ),
5741                }
5742            }
5743        }
5744    }
5745    pub mod oneof {
5746        #[allow(unused_imports)]
5747        use super::*;
5748        pub mod client_frame {
5749            #[allow(unused_imports)]
5750            use super::*;
5751            #[derive(Clone, PartialEq, Debug)]
5752            pub enum Payload {
5753                Ping(::buffa::alloc::boxed::Box<super::super::super::PingRequest>),
5754                CreateOrder(
5755                    ::buffa::alloc::boxed::Box<
5756                        super::super::super::super::super::orders::v1::CreateOrderRequest,
5757                    >,
5758                ),
5759                CancelOrder(
5760                    ::buffa::alloc::boxed::Box<
5761                        super::super::super::super::super::orders::v1::CancelOrderRequest,
5762                    >,
5763                ),
5764                ModifyOrder(
5765                    ::buffa::alloc::boxed::Box<
5766                        super::super::super::super::super::orders::v1::ModifyOrderRequest,
5767                    >,
5768                ),
5769                CancelAllOrders(
5770                    ::buffa::alloc::boxed::Box<
5771                        super::super::super::super::super::orders::v1::CancelAllOrdersRequest,
5772                    >,
5773                ),
5774            }
5775            impl ::buffa::Oneof for Payload {}
5776            impl From<super::super::super::PingRequest> for Payload {
5777                fn from(v: super::super::super::PingRequest) -> Self {
5778                    Self::Ping(::buffa::alloc::boxed::Box::new(v))
5779                }
5780            }
5781            impl From<super::super::super::PingRequest>
5782            for ::core::option::Option<Payload> {
5783                fn from(v: super::super::super::PingRequest) -> Self {
5784                    Self::Some(Payload::from(v))
5785                }
5786            }
5787            impl From<super::super::super::super::super::orders::v1::CreateOrderRequest>
5788            for Payload {
5789                fn from(
5790                    v: super::super::super::super::super::orders::v1::CreateOrderRequest,
5791                ) -> Self {
5792                    Self::CreateOrder(::buffa::alloc::boxed::Box::new(v))
5793                }
5794            }
5795            impl From<super::super::super::super::super::orders::v1::CreateOrderRequest>
5796            for ::core::option::Option<Payload> {
5797                fn from(
5798                    v: super::super::super::super::super::orders::v1::CreateOrderRequest,
5799                ) -> Self {
5800                    Self::Some(Payload::from(v))
5801                }
5802            }
5803            impl From<super::super::super::super::super::orders::v1::CancelOrderRequest>
5804            for Payload {
5805                fn from(
5806                    v: super::super::super::super::super::orders::v1::CancelOrderRequest,
5807                ) -> Self {
5808                    Self::CancelOrder(::buffa::alloc::boxed::Box::new(v))
5809                }
5810            }
5811            impl From<super::super::super::super::super::orders::v1::CancelOrderRequest>
5812            for ::core::option::Option<Payload> {
5813                fn from(
5814                    v: super::super::super::super::super::orders::v1::CancelOrderRequest,
5815                ) -> Self {
5816                    Self::Some(Payload::from(v))
5817                }
5818            }
5819            impl From<super::super::super::super::super::orders::v1::ModifyOrderRequest>
5820            for Payload {
5821                fn from(
5822                    v: super::super::super::super::super::orders::v1::ModifyOrderRequest,
5823                ) -> Self {
5824                    Self::ModifyOrder(::buffa::alloc::boxed::Box::new(v))
5825                }
5826            }
5827            impl From<super::super::super::super::super::orders::v1::ModifyOrderRequest>
5828            for ::core::option::Option<Payload> {
5829                fn from(
5830                    v: super::super::super::super::super::orders::v1::ModifyOrderRequest,
5831                ) -> Self {
5832                    Self::Some(Payload::from(v))
5833                }
5834            }
5835            impl From<
5836                super::super::super::super::super::orders::v1::CancelAllOrdersRequest,
5837            > for Payload {
5838                fn from(
5839                    v: super::super::super::super::super::orders::v1::CancelAllOrdersRequest,
5840                ) -> Self {
5841                    Self::CancelAllOrders(::buffa::alloc::boxed::Box::new(v))
5842                }
5843            }
5844            impl From<
5845                super::super::super::super::super::orders::v1::CancelAllOrdersRequest,
5846            > for ::core::option::Option<Payload> {
5847                fn from(
5848                    v: super::super::super::super::super::orders::v1::CancelAllOrdersRequest,
5849                ) -> Self {
5850                    Self::Some(Payload::from(v))
5851                }
5852            }
5853            impl serde::Serialize for Payload {
5854                fn serialize<S: serde::Serializer>(
5855                    &self,
5856                    s: S,
5857                ) -> ::core::result::Result<S::Ok, S::Error> {
5858                    use serde::ser::SerializeMap;
5859                    let mut map = s.serialize_map(Some(1))?;
5860                    match self {
5861                        Self::Ping(v) => {
5862                            map.serialize_entry("ping", v)?;
5863                        }
5864                        Self::CreateOrder(v) => {
5865                            map.serialize_entry("createOrder", v)?;
5866                        }
5867                        Self::CancelOrder(v) => {
5868                            map.serialize_entry("cancelOrder", v)?;
5869                        }
5870                        Self::ModifyOrder(v) => {
5871                            map.serialize_entry("modifyOrder", v)?;
5872                        }
5873                        Self::CancelAllOrders(v) => {
5874                            map.serialize_entry("cancelAllOrders", v)?;
5875                        }
5876                    }
5877                    map.end()
5878                }
5879            }
5880        }
5881        pub mod server_frame {
5882            #[allow(unused_imports)]
5883            use super::*;
5884            #[derive(Clone, PartialEq, Debug)]
5885            pub enum Payload {
5886                Pong(::buffa::alloc::boxed::Box<super::super::super::PongResponse>),
5887                Ack(::buffa::alloc::boxed::Box<super::super::super::AckResponse>),
5888                Reject(::buffa::alloc::boxed::Box<super::super::super::CommandReject>),
5889                Overload(
5890                    ::buffa::alloc::boxed::Box<super::super::super::OverloadResponse>,
5891                ),
5892                Terminal(
5893                    ::buffa::alloc::boxed::Box<super::super::super::TerminalSessionEvent>,
5894                ),
5895            }
5896            impl ::buffa::Oneof for Payload {}
5897            impl From<super::super::super::PongResponse> for Payload {
5898                fn from(v: super::super::super::PongResponse) -> Self {
5899                    Self::Pong(::buffa::alloc::boxed::Box::new(v))
5900                }
5901            }
5902            impl From<super::super::super::PongResponse>
5903            for ::core::option::Option<Payload> {
5904                fn from(v: super::super::super::PongResponse) -> Self {
5905                    Self::Some(Payload::from(v))
5906                }
5907            }
5908            impl From<super::super::super::AckResponse> for Payload {
5909                fn from(v: super::super::super::AckResponse) -> Self {
5910                    Self::Ack(::buffa::alloc::boxed::Box::new(v))
5911                }
5912            }
5913            impl From<super::super::super::AckResponse>
5914            for ::core::option::Option<Payload> {
5915                fn from(v: super::super::super::AckResponse) -> Self {
5916                    Self::Some(Payload::from(v))
5917                }
5918            }
5919            impl From<super::super::super::CommandReject> for Payload {
5920                fn from(v: super::super::super::CommandReject) -> Self {
5921                    Self::Reject(::buffa::alloc::boxed::Box::new(v))
5922                }
5923            }
5924            impl From<super::super::super::CommandReject>
5925            for ::core::option::Option<Payload> {
5926                fn from(v: super::super::super::CommandReject) -> Self {
5927                    Self::Some(Payload::from(v))
5928                }
5929            }
5930            impl From<super::super::super::OverloadResponse> for Payload {
5931                fn from(v: super::super::super::OverloadResponse) -> Self {
5932                    Self::Overload(::buffa::alloc::boxed::Box::new(v))
5933                }
5934            }
5935            impl From<super::super::super::OverloadResponse>
5936            for ::core::option::Option<Payload> {
5937                fn from(v: super::super::super::OverloadResponse) -> Self {
5938                    Self::Some(Payload::from(v))
5939                }
5940            }
5941            impl From<super::super::super::TerminalSessionEvent> for Payload {
5942                fn from(v: super::super::super::TerminalSessionEvent) -> Self {
5943                    Self::Terminal(::buffa::alloc::boxed::Box::new(v))
5944                }
5945            }
5946            impl From<super::super::super::TerminalSessionEvent>
5947            for ::core::option::Option<Payload> {
5948                fn from(v: super::super::super::TerminalSessionEvent) -> Self {
5949                    Self::Some(Payload::from(v))
5950                }
5951            }
5952            impl serde::Serialize for Payload {
5953                fn serialize<S: serde::Serializer>(
5954                    &self,
5955                    s: S,
5956                ) -> ::core::result::Result<S::Ok, S::Error> {
5957                    use serde::ser::SerializeMap;
5958                    let mut map = s.serialize_map(Some(1))?;
5959                    match self {
5960                        Self::Pong(v) => {
5961                            map.serialize_entry("pong", v)?;
5962                        }
5963                        Self::Ack(v) => {
5964                            map.serialize_entry("ack", v)?;
5965                        }
5966                        Self::Reject(v) => {
5967                            map.serialize_entry("reject", v)?;
5968                        }
5969                        Self::Overload(v) => {
5970                            map.serialize_entry("overload", v)?;
5971                        }
5972                        Self::Terminal(v) => {
5973                            map.serialize_entry("terminal", v)?;
5974                        }
5975                    }
5976                    map.end()
5977                }
5978            }
5979        }
5980        pub mod ack_response {
5981            #[allow(unused_imports)]
5982            use super::*;
5983            #[derive(Clone, PartialEq, Debug)]
5984            pub enum Result {
5985                CreateOrder(
5986                    ::buffa::alloc::boxed::Box<
5987                        super::super::super::super::super::orders::v1::CreateOrderResponse,
5988                    >,
5989                ),
5990                CancelOrder(
5991                    ::buffa::alloc::boxed::Box<
5992                        super::super::super::super::super::orders::v1::CancelOrderResponse,
5993                    >,
5994                ),
5995                ModifyOrder(
5996                    ::buffa::alloc::boxed::Box<
5997                        super::super::super::super::super::orders::v1::ModifyOrderResponse,
5998                    >,
5999                ),
6000                CancelAllOrders(
6001                    ::buffa::alloc::boxed::Box<
6002                        super::super::super::super::super::orders::v1::CancelAllOrdersResponse,
6003                    >,
6004                ),
6005            }
6006            impl ::buffa::Oneof for Result {}
6007            impl From<super::super::super::super::super::orders::v1::CreateOrderResponse>
6008            for Result {
6009                fn from(
6010                    v: super::super::super::super::super::orders::v1::CreateOrderResponse,
6011                ) -> Self {
6012                    Self::CreateOrder(::buffa::alloc::boxed::Box::new(v))
6013                }
6014            }
6015            impl From<super::super::super::super::super::orders::v1::CreateOrderResponse>
6016            for ::core::option::Option<Result> {
6017                fn from(
6018                    v: super::super::super::super::super::orders::v1::CreateOrderResponse,
6019                ) -> Self {
6020                    Self::Some(Result::from(v))
6021                }
6022            }
6023            impl From<super::super::super::super::super::orders::v1::CancelOrderResponse>
6024            for Result {
6025                fn from(
6026                    v: super::super::super::super::super::orders::v1::CancelOrderResponse,
6027                ) -> Self {
6028                    Self::CancelOrder(::buffa::alloc::boxed::Box::new(v))
6029                }
6030            }
6031            impl From<super::super::super::super::super::orders::v1::CancelOrderResponse>
6032            for ::core::option::Option<Result> {
6033                fn from(
6034                    v: super::super::super::super::super::orders::v1::CancelOrderResponse,
6035                ) -> Self {
6036                    Self::Some(Result::from(v))
6037                }
6038            }
6039            impl From<super::super::super::super::super::orders::v1::ModifyOrderResponse>
6040            for Result {
6041                fn from(
6042                    v: super::super::super::super::super::orders::v1::ModifyOrderResponse,
6043                ) -> Self {
6044                    Self::ModifyOrder(::buffa::alloc::boxed::Box::new(v))
6045                }
6046            }
6047            impl From<super::super::super::super::super::orders::v1::ModifyOrderResponse>
6048            for ::core::option::Option<Result> {
6049                fn from(
6050                    v: super::super::super::super::super::orders::v1::ModifyOrderResponse,
6051                ) -> Self {
6052                    Self::Some(Result::from(v))
6053                }
6054            }
6055            impl From<
6056                super::super::super::super::super::orders::v1::CancelAllOrdersResponse,
6057            > for Result {
6058                fn from(
6059                    v: super::super::super::super::super::orders::v1::CancelAllOrdersResponse,
6060                ) -> Self {
6061                    Self::CancelAllOrders(::buffa::alloc::boxed::Box::new(v))
6062                }
6063            }
6064            impl From<
6065                super::super::super::super::super::orders::v1::CancelAllOrdersResponse,
6066            > for ::core::option::Option<Result> {
6067                fn from(
6068                    v: super::super::super::super::super::orders::v1::CancelAllOrdersResponse,
6069                ) -> Self {
6070                    Self::Some(Result::from(v))
6071                }
6072            }
6073            impl serde::Serialize for Result {
6074                fn serialize<S: serde::Serializer>(
6075                    &self,
6076                    s: S,
6077                ) -> ::core::result::Result<S::Ok, S::Error> {
6078                    use serde::ser::SerializeMap;
6079                    let mut map = s.serialize_map(Some(1))?;
6080                    match self {
6081                        Self::CreateOrder(v) => {
6082                            map.serialize_entry("createOrder", v)?;
6083                        }
6084                        Self::CancelOrder(v) => {
6085                            map.serialize_entry("cancelOrder", v)?;
6086                        }
6087                        Self::ModifyOrder(v) => {
6088                            map.serialize_entry("modifyOrder", v)?;
6089                        }
6090                        Self::CancelAllOrders(v) => {
6091                            map.serialize_entry("cancelAllOrders", v)?;
6092                        }
6093                    }
6094                    map.end()
6095                }
6096            }
6097        }
6098    }
6099    /// Register this package's `Any` type entries and extension entries.
6100    pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
6101        reg.register_json_any(super::__CLIENT_FRAME_JSON_ANY);
6102        reg.register_json_any(super::__PING_REQUEST_JSON_ANY);
6103        reg.register_json_any(super::__SERVER_FRAME_JSON_ANY);
6104        reg.register_json_any(super::__PONG_RESPONSE_JSON_ANY);
6105        reg.register_json_any(super::__ACK_RESPONSE_JSON_ANY);
6106        reg.register_json_any(super::__COMMAND_REJECT_JSON_ANY);
6107        reg.register_json_any(super::__OVERLOAD_RESPONSE_JSON_ANY);
6108        reg.register_json_any(super::__TERMINAL_SESSION_EVENT_JSON_ANY);
6109    }
6110}
6111#[doc(inline)]
6112pub use self::__buffa::view::ClientFrameView;
6113#[doc(inline)]
6114pub use self::__buffa::view::ClientFrameOwnedView;
6115#[doc(inline)]
6116pub use self::__buffa::view::PingRequestView;
6117#[doc(inline)]
6118pub use self::__buffa::view::PingRequestOwnedView;
6119#[doc(inline)]
6120pub use self::__buffa::view::ServerFrameView;
6121#[doc(inline)]
6122pub use self::__buffa::view::ServerFrameOwnedView;
6123#[doc(inline)]
6124pub use self::__buffa::view::PongResponseView;
6125#[doc(inline)]
6126pub use self::__buffa::view::PongResponseOwnedView;
6127#[doc(inline)]
6128pub use self::__buffa::view::AckResponseView;
6129#[doc(inline)]
6130pub use self::__buffa::view::AckResponseOwnedView;
6131#[doc(inline)]
6132pub use self::__buffa::view::CommandRejectView;
6133#[doc(inline)]
6134pub use self::__buffa::view::CommandRejectOwnedView;
6135#[doc(inline)]
6136pub use self::__buffa::view::OverloadResponseView;
6137#[doc(inline)]
6138pub use self::__buffa::view::OverloadResponseOwnedView;
6139#[doc(inline)]
6140pub use self::__buffa::view::TerminalSessionEventView;
6141#[doc(inline)]
6142pub use self::__buffa::view::TerminalSessionEventOwnedView;
6143#[doc(inline)]
6144pub use self::__buffa::register_types;