Skip to main content

polyester/gen/buffa/
transfer.v1.rs

1// @generated by buffa-codegen. DO NOT EDIT.
2
3/// InternalTransferStatus is the public user-facing status for an internal
4/// transfer request.
5#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
6#[repr(i32)]
7pub enum InternalTransferStatus {
8    /// Status was not specified.
9    INTERNAL_TRANSFER_STATUS_UNSPECIFIED = 0i32,
10    /// The transfer request was accepted and has a durable transfer identifier.
11    INTERNAL_TRANSFER_STATUS_ACCEPTED = 1i32,
12    /// The transfer request was rejected before durable acceptance.
13    INTERNAL_TRANSFER_STATUS_REJECTED = 2i32,
14    /// The transfer request failed terminally before durable acceptance.
15    INTERNAL_TRANSFER_STATUS_FAILED = 3i32,
16}
17impl InternalTransferStatus {
18    ///Idiomatic alias for [`Self::INTERNAL_TRANSFER_STATUS_UNSPECIFIED`]; `Debug` prints the variant name.
19    #[allow(non_upper_case_globals)]
20    pub const Unspecified: Self = Self::INTERNAL_TRANSFER_STATUS_UNSPECIFIED;
21    ///Idiomatic alias for [`Self::INTERNAL_TRANSFER_STATUS_ACCEPTED`]; `Debug` prints the variant name.
22    #[allow(non_upper_case_globals)]
23    pub const Accepted: Self = Self::INTERNAL_TRANSFER_STATUS_ACCEPTED;
24    ///Idiomatic alias for [`Self::INTERNAL_TRANSFER_STATUS_REJECTED`]; `Debug` prints the variant name.
25    #[allow(non_upper_case_globals)]
26    pub const Rejected: Self = Self::INTERNAL_TRANSFER_STATUS_REJECTED;
27    ///Idiomatic alias for [`Self::INTERNAL_TRANSFER_STATUS_FAILED`]; `Debug` prints the variant name.
28    #[allow(non_upper_case_globals)]
29    pub const Failed: Self = Self::INTERNAL_TRANSFER_STATUS_FAILED;
30}
31impl ::core::default::Default for InternalTransferStatus {
32    fn default() -> Self {
33        Self::INTERNAL_TRANSFER_STATUS_UNSPECIFIED
34    }
35}
36impl ::serde::Serialize for InternalTransferStatus {
37    fn serialize<S: ::serde::Serializer>(
38        &self,
39        s: S,
40    ) -> ::core::result::Result<S::Ok, S::Error> {
41        s.serialize_str(::buffa::Enumeration::proto_name(self))
42    }
43}
44impl<'de> ::serde::Deserialize<'de> for InternalTransferStatus {
45    fn deserialize<D: ::serde::Deserializer<'de>>(
46        d: D,
47    ) -> ::core::result::Result<Self, D::Error> {
48        struct _V;
49        impl ::serde::de::Visitor<'_> for _V {
50            type Value = InternalTransferStatus;
51            fn expecting(
52                &self,
53                f: &mut ::core::fmt::Formatter<'_>,
54            ) -> ::core::fmt::Result {
55                f.write_str(
56                    concat!(
57                        "a string, integer, or null for ",
58                        stringify!(InternalTransferStatus)
59                    ),
60                )
61            }
62            fn visit_str<E: ::serde::de::Error>(
63                self,
64                v: &str,
65            ) -> ::core::result::Result<InternalTransferStatus, E> {
66                <InternalTransferStatus as ::buffa::Enumeration>::from_proto_name(v)
67                    .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
68            }
69            fn visit_i64<E: ::serde::de::Error>(
70                self,
71                v: i64,
72            ) -> ::core::result::Result<InternalTransferStatus, E> {
73                let v32 = i32::try_from(v)
74                    .map_err(|_| {
75                        ::serde::de::Error::custom(
76                            ::buffa::alloc::format!("enum value {v} out of i32 range"),
77                        )
78                    })?;
79                <InternalTransferStatus as ::buffa::Enumeration>::from_i32(v32)
80                    .ok_or_else(|| {
81                        ::serde::de::Error::custom(
82                            ::buffa::alloc::format!("unknown enum value {v32}"),
83                        )
84                    })
85            }
86            fn visit_u64<E: ::serde::de::Error>(
87                self,
88                v: u64,
89            ) -> ::core::result::Result<InternalTransferStatus, E> {
90                let v32 = i32::try_from(v)
91                    .map_err(|_| {
92                        ::serde::de::Error::custom(
93                            ::buffa::alloc::format!("enum value {v} out of i32 range"),
94                        )
95                    })?;
96                <InternalTransferStatus as ::buffa::Enumeration>::from_i32(v32)
97                    .ok_or_else(|| {
98                        ::serde::de::Error::custom(
99                            ::buffa::alloc::format!("unknown enum value {v32}"),
100                        )
101                    })
102            }
103            fn visit_unit<E: ::serde::de::Error>(
104                self,
105            ) -> ::core::result::Result<InternalTransferStatus, E> {
106                ::core::result::Result::Ok(::core::default::Default::default())
107            }
108        }
109        d.deserialize_any(_V)
110    }
111}
112impl ::buffa::json_helpers::ProtoElemJson for InternalTransferStatus {
113    fn serialize_proto_json<S: ::serde::Serializer>(
114        v: &Self,
115        s: S,
116    ) -> ::core::result::Result<S::Ok, S::Error> {
117        ::serde::Serialize::serialize(v, s)
118    }
119    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
120        d: D,
121    ) -> ::core::result::Result<Self, D::Error> {
122        <Self as ::serde::Deserialize>::deserialize(d)
123    }
124}
125impl ::buffa::Enumeration for InternalTransferStatus {
126    fn from_i32(value: i32) -> ::core::option::Option<Self> {
127        match value {
128            0i32 => {
129                ::core::option::Option::Some(Self::INTERNAL_TRANSFER_STATUS_UNSPECIFIED)
130            }
131            1i32 => ::core::option::Option::Some(Self::INTERNAL_TRANSFER_STATUS_ACCEPTED),
132            2i32 => ::core::option::Option::Some(Self::INTERNAL_TRANSFER_STATUS_REJECTED),
133            3i32 => ::core::option::Option::Some(Self::INTERNAL_TRANSFER_STATUS_FAILED),
134            _ => ::core::option::Option::None,
135        }
136    }
137    fn to_i32(&self) -> i32 {
138        *self as i32
139    }
140    fn proto_name(&self) -> &'static str {
141        match self {
142            Self::INTERNAL_TRANSFER_STATUS_UNSPECIFIED => {
143                "INTERNAL_TRANSFER_STATUS_UNSPECIFIED"
144            }
145            Self::INTERNAL_TRANSFER_STATUS_ACCEPTED => {
146                "INTERNAL_TRANSFER_STATUS_ACCEPTED"
147            }
148            Self::INTERNAL_TRANSFER_STATUS_REJECTED => {
149                "INTERNAL_TRANSFER_STATUS_REJECTED"
150            }
151            Self::INTERNAL_TRANSFER_STATUS_FAILED => "INTERNAL_TRANSFER_STATUS_FAILED",
152        }
153    }
154    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
155        match name {
156            "INTERNAL_TRANSFER_STATUS_UNSPECIFIED" => {
157                ::core::option::Option::Some(Self::INTERNAL_TRANSFER_STATUS_UNSPECIFIED)
158            }
159            "INTERNAL_TRANSFER_STATUS_ACCEPTED" => {
160                ::core::option::Option::Some(Self::INTERNAL_TRANSFER_STATUS_ACCEPTED)
161            }
162            "INTERNAL_TRANSFER_STATUS_REJECTED" => {
163                ::core::option::Option::Some(Self::INTERNAL_TRANSFER_STATUS_REJECTED)
164            }
165            "INTERNAL_TRANSFER_STATUS_FAILED" => {
166                ::core::option::Option::Some(Self::INTERNAL_TRANSFER_STATUS_FAILED)
167            }
168            _ => ::core::option::Option::None,
169        }
170    }
171    fn values() -> &'static [Self] {
172        &[
173            Self::INTERNAL_TRANSFER_STATUS_UNSPECIFIED,
174            Self::INTERNAL_TRANSFER_STATUS_ACCEPTED,
175            Self::INTERNAL_TRANSFER_STATUS_REJECTED,
176            Self::INTERNAL_TRANSFER_STATUS_FAILED,
177        ]
178    }
179}
180/// CreateInternalTransferRequest creates or returns one accepted Trading
181/// to Trading internal transfer for the authenticated source account.
182#[derive(Clone, PartialEq, Default)]
183#[derive(::serde::Serialize)]
184#[serde(default)]
185pub struct CreateInternalTransferRequest {
186    /// Optional source subaccount public id. When omitted, the authenticated
187    /// caller's root account is used as the source account.
188    ///
189    /// Field 1: `subaccount_id`
190    #[serde(
191        rename = "subaccountId",
192        alias = "subaccount_id",
193        with = "::buffa::json_helpers::uint64",
194        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
195    )]
196    pub subaccount_id: u64,
197    /// Canonical public unified asset id for the asset being transferred.
198    ///
199    /// Field 5: `asset_id`
200    #[serde(
201        rename = "assetId",
202        alias = "asset_id",
203        with = "::buffa::json_helpers::uint32",
204        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
205    )]
206    pub asset_id: u32,
207    /// Transfer amount in canonical 18-decimal unified asset units.
208    /// For example, 0.5 is encoded as 500000000000000000.
209    ///
210    /// Field 6: `amount_e18`
211    #[serde(
212        rename = "amountE18",
213        alias = "amount_e18",
214        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
215    )]
216    pub amount_e18: ::buffa::MessageField<super::super::polyester::r#type::v1::U128>,
217    /// Stable client-supplied idempotency key used to collapse safe retries.
218    ///
219    /// Field 7: `idempotency_key`
220    #[serde(
221        rename = "idempotencyKey",
222        alias = "idempotency_key",
223        with = "::buffa::json_helpers::proto_string",
224        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
225    )]
226    pub idempotency_key: ::buffa::alloc::string::String,
227    #[serde(flatten)]
228    pub destination: ::core::option::Option<
229        __buffa::oneof::create_internal_transfer_request::Destination,
230    >,
231    #[serde(skip)]
232    #[doc(hidden)]
233    pub __buffa_unknown_fields: ::buffa::UnknownFields,
234}
235impl ::core::fmt::Debug for CreateInternalTransferRequest {
236    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
237        f.debug_struct("CreateInternalTransferRequest")
238            .field("subaccount_id", &self.subaccount_id)
239            .field("asset_id", &self.asset_id)
240            .field("amount_e18", &self.amount_e18)
241            .field("idempotency_key", &self.idempotency_key)
242            .field("destination", &self.destination)
243            .finish()
244    }
245}
246impl CreateInternalTransferRequest {
247    /// Protobuf type URL for this message, for use with `Any::pack` and
248    /// `Any::unpack_if`.
249    ///
250    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
251    pub const TYPE_URL: &'static str = "type.googleapis.com/transfer.v1.CreateInternalTransferRequest";
252}
253::buffa::impl_default_instance!(CreateInternalTransferRequest);
254impl ::buffa::MessageName for CreateInternalTransferRequest {
255    const PACKAGE: &'static str = "transfer.v1";
256    const NAME: &'static str = "CreateInternalTransferRequest";
257    const FULL_NAME: &'static str = "transfer.v1.CreateInternalTransferRequest";
258    const TYPE_URL: &'static str = "type.googleapis.com/transfer.v1.CreateInternalTransferRequest";
259}
260impl ::buffa::Message for CreateInternalTransferRequest {
261    /// Returns the total encoded size in bytes.
262    ///
263    /// The result is a `u32`; the protobuf specification requires all
264    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
265    /// compliant message will never overflow this type.
266    #[allow(clippy::let_and_return)]
267    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
268        #[allow(unused_imports)]
269        use ::buffa::Enumeration as _;
270        let mut size = 0u32;
271        if self.subaccount_id != 0u64 {
272            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
273        }
274        if let ::core::option::Option::Some(ref v) = self.destination {
275            match v {
276                __buffa::oneof::create_internal_transfer_request::Destination::DestinationAccountId(
277                    _x,
278                ) => {
279                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
280                }
281                __buffa::oneof::create_internal_transfer_request::Destination::DestinationSubaccountId(
282                    _x,
283                ) => {
284                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
285                }
286                __buffa::oneof::create_internal_transfer_request::Destination::DestinationSmartAccountAddress(
287                    x,
288                ) => {
289                    size += 1u32 + ::buffa::types::string_encoded_len(x) as u32;
290                }
291            }
292        }
293        if self.asset_id != 0u32 {
294            size += 1u32 + ::buffa::types::uint32_encoded_len(self.asset_id) as u32;
295        }
296        if self.amount_e18.is_set() {
297            let __slot = __cache.reserve();
298            let inner_size = self.amount_e18.compute_size(__cache);
299            __cache.set(__slot, inner_size);
300            size
301                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
302                    + inner_size;
303        }
304        if !self.idempotency_key.is_empty() {
305            size
306                += 1u32
307                    + ::buffa::types::string_encoded_len(&self.idempotency_key) as u32;
308        }
309        size += self.__buffa_unknown_fields.encoded_len() as u32;
310        size
311    }
312    fn write_to(
313        &self,
314        __cache: &mut ::buffa::SizeCache,
315        buf: &mut impl ::buffa::bytes::BufMut,
316    ) {
317        #[allow(unused_imports)]
318        use ::buffa::Enumeration as _;
319        if self.subaccount_id != 0u64 {
320            ::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
321        }
322        if let ::core::option::Option::Some(ref v) = self.destination {
323            match v {
324                __buffa::oneof::create_internal_transfer_request::Destination::DestinationAccountId(
325                    x,
326                ) => {
327                    ::buffa::types::put_fixed64_field(2u32, *x, buf);
328                }
329                __buffa::oneof::create_internal_transfer_request::Destination::DestinationSubaccountId(
330                    x,
331                ) => {
332                    ::buffa::types::put_fixed64_field(3u32, *x, buf);
333                }
334                __buffa::oneof::create_internal_transfer_request::Destination::DestinationSmartAccountAddress(
335                    x,
336                ) => {
337                    ::buffa::types::put_string_field(4u32, x, buf);
338                }
339            }
340        }
341        if self.asset_id != 0u32 {
342            ::buffa::types::put_uint32_field(5u32, self.asset_id, buf);
343        }
344        if self.amount_e18.is_set() {
345            ::buffa::types::put_len_delimited_header(6u32, __cache.consume_next(), buf);
346            self.amount_e18.write_to(__cache, buf);
347        }
348        if !self.idempotency_key.is_empty() {
349            ::buffa::types::put_string_field(7u32, &self.idempotency_key, buf);
350        }
351        self.__buffa_unknown_fields.write_to(buf);
352    }
353    fn merge_field(
354        &mut self,
355        tag: ::buffa::encoding::Tag,
356        buf: &mut impl ::buffa::bytes::Buf,
357        ctx: ::buffa::DecodeContext<'_>,
358    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
359        #[allow(unused_imports)]
360        use ::buffa::bytes::Buf as _;
361        #[allow(unused_imports)]
362        use ::buffa::Enumeration as _;
363        match tag.field_number() {
364            1u32 => {
365                ::buffa::encoding::check_wire_type(
366                    tag,
367                    ::buffa::encoding::WireType::Fixed64,
368                )?;
369                self.subaccount_id = ::buffa::types::decode_fixed64(buf)?;
370            }
371            2u32 => {
372                ::buffa::encoding::check_wire_type(
373                    tag,
374                    ::buffa::encoding::WireType::Fixed64,
375                )?;
376                self.destination = ::core::option::Option::Some(
377                    __buffa::oneof::create_internal_transfer_request::Destination::DestinationAccountId(
378                        ::buffa::types::decode_fixed64(buf)?,
379                    ),
380                );
381            }
382            3u32 => {
383                ::buffa::encoding::check_wire_type(
384                    tag,
385                    ::buffa::encoding::WireType::Fixed64,
386                )?;
387                self.destination = ::core::option::Option::Some(
388                    __buffa::oneof::create_internal_transfer_request::Destination::DestinationSubaccountId(
389                        ::buffa::types::decode_fixed64(buf)?,
390                    ),
391                );
392            }
393            4u32 => {
394                ::buffa::encoding::check_wire_type(
395                    tag,
396                    ::buffa::encoding::WireType::LengthDelimited,
397                )?;
398                self.destination = ::core::option::Option::Some(
399                    __buffa::oneof::create_internal_transfer_request::Destination::DestinationSmartAccountAddress(
400                        ::buffa::types::decode_string(buf)?,
401                    ),
402                );
403            }
404            5u32 => {
405                ::buffa::encoding::check_wire_type(
406                    tag,
407                    ::buffa::encoding::WireType::Varint,
408                )?;
409                self.asset_id = ::buffa::types::decode_uint32(buf)?;
410            }
411            6u32 => {
412                ::buffa::encoding::check_wire_type(
413                    tag,
414                    ::buffa::encoding::WireType::LengthDelimited,
415                )?;
416                ::buffa::Message::merge_length_delimited(
417                    self.amount_e18.get_or_insert_default(),
418                    buf,
419                    ctx,
420                )?;
421            }
422            7u32 => {
423                ::buffa::encoding::check_wire_type(
424                    tag,
425                    ::buffa::encoding::WireType::LengthDelimited,
426                )?;
427                ::buffa::types::merge_string(&mut self.idempotency_key, buf)?;
428            }
429            _ => {
430                self.__buffa_unknown_fields
431                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
432            }
433        }
434        ::core::result::Result::Ok(())
435    }
436    fn clear(&mut self) {
437        self.subaccount_id = 0u64;
438        self.destination = ::core::option::Option::None;
439        self.asset_id = 0u32;
440        self.amount_e18 = ::buffa::MessageField::none();
441        self.idempotency_key.clear();
442        self.__buffa_unknown_fields.clear();
443    }
444}
445impl ::buffa::ExtensionSet for CreateInternalTransferRequest {
446    const PROTO_FQN: &'static str = "transfer.v1.CreateInternalTransferRequest";
447    fn unknown_fields(&self) -> &::buffa::UnknownFields {
448        &self.__buffa_unknown_fields
449    }
450    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
451        &mut self.__buffa_unknown_fields
452    }
453}
454impl<'de> serde::Deserialize<'de> for CreateInternalTransferRequest {
455    fn deserialize<D: serde::Deserializer<'de>>(
456        d: D,
457    ) -> ::core::result::Result<Self, D::Error> {
458        struct _V;
459        impl<'de> serde::de::Visitor<'de> for _V {
460            type Value = CreateInternalTransferRequest;
461            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
462                f.write_str("struct CreateInternalTransferRequest")
463            }
464            #[allow(clippy::field_reassign_with_default)]
465            fn visit_map<A: serde::de::MapAccess<'de>>(
466                self,
467                mut map: A,
468            ) -> ::core::result::Result<CreateInternalTransferRequest, A::Error> {
469                let mut __f_subaccount_id: ::core::option::Option<u64> = None;
470                let mut __f_asset_id: ::core::option::Option<u32> = None;
471                let mut __f_amount_e18: ::core::option::Option<
472                    ::buffa::MessageField<super::super::polyester::r#type::v1::U128>,
473                > = None;
474                let mut __f_idempotency_key: ::core::option::Option<
475                    ::buffa::alloc::string::String,
476                > = None;
477                let mut __oneof_destination: ::core::option::Option<
478                    __buffa::oneof::create_internal_transfer_request::Destination,
479                > = None;
480                while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
481                    match key.as_str() {
482                        "subaccountId" | "subaccount_id" => {
483                            __f_subaccount_id = Some({
484                                struct _S;
485                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
486                                    type Value = u64;
487                                    fn deserialize<D: serde::Deserializer<'de>>(
488                                        self,
489                                        d: D,
490                                    ) -> ::core::result::Result<u64, D::Error> {
491                                        ::buffa::json_helpers::uint64::deserialize(d)
492                                    }
493                                }
494                                map.next_value_seed(_S)?
495                            });
496                        }
497                        "assetId" | "asset_id" => {
498                            __f_asset_id = Some({
499                                struct _S;
500                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
501                                    type Value = u32;
502                                    fn deserialize<D: serde::Deserializer<'de>>(
503                                        self,
504                                        d: D,
505                                    ) -> ::core::result::Result<u32, D::Error> {
506                                        ::buffa::json_helpers::uint32::deserialize(d)
507                                    }
508                                }
509                                map.next_value_seed(_S)?
510                            });
511                        }
512                        "amountE18" | "amount_e18" => {
513                            __f_amount_e18 = Some(
514                                map
515                                    .next_value::<
516                                        ::buffa::MessageField<
517                                            super::super::polyester::r#type::v1::U128,
518                                        >,
519                                    >()?,
520                            );
521                        }
522                        "idempotencyKey" | "idempotency_key" => {
523                            __f_idempotency_key = Some({
524                                struct _S;
525                                impl<'de> serde::de::DeserializeSeed<'de> for _S {
526                                    type Value = ::buffa::alloc::string::String;
527                                    fn deserialize<D: serde::Deserializer<'de>>(
528                                        self,
529                                        d: D,
530                                    ) -> ::core::result::Result<
531                                        ::buffa::alloc::string::String,
532                                        D::Error,
533                                    > {
534                                        ::buffa::json_helpers::proto_string::deserialize(d)
535                                    }
536                                }
537                                map.next_value_seed(_S)?
538                            });
539                        }
540                        "destinationAccountId" | "destination_account_id" => {
541                            struct _DeserSeed;
542                            impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
543                                type Value = u64;
544                                fn deserialize<D: serde::Deserializer<'de>>(
545                                    self,
546                                    d: D,
547                                ) -> ::core::result::Result<u64, D::Error> {
548                                    ::buffa::json_helpers::uint64::deserialize(d)
549                                }
550                            }
551                            let v: ::core::option::Option<u64> = map
552                                .next_value_seed(
553                                    ::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
554                                )?;
555                            if let Some(v) = v {
556                                if __oneof_destination.is_some() {
557                                    return Err(
558                                        serde::de::Error::custom(
559                                            "multiple oneof fields set for 'destination'",
560                                        ),
561                                    );
562                                }
563                                __oneof_destination = Some(
564                                    __buffa::oneof::create_internal_transfer_request::Destination::DestinationAccountId(
565                                        v,
566                                    ),
567                                );
568                            }
569                        }
570                        "destinationSubaccountId" | "destination_subaccount_id" => {
571                            struct _DeserSeed;
572                            impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
573                                type Value = u64;
574                                fn deserialize<D: serde::Deserializer<'de>>(
575                                    self,
576                                    d: D,
577                                ) -> ::core::result::Result<u64, D::Error> {
578                                    ::buffa::json_helpers::uint64::deserialize(d)
579                                }
580                            }
581                            let v: ::core::option::Option<u64> = map
582                                .next_value_seed(
583                                    ::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
584                                )?;
585                            if let Some(v) = v {
586                                if __oneof_destination.is_some() {
587                                    return Err(
588                                        serde::de::Error::custom(
589                                            "multiple oneof fields set for 'destination'",
590                                        ),
591                                    );
592                                }
593                                __oneof_destination = Some(
594                                    __buffa::oneof::create_internal_transfer_request::Destination::DestinationSubaccountId(
595                                        v,
596                                    ),
597                                );
598                            }
599                        }
600                        "destinationSmartAccountAddress"
601                        | "destination_smart_account_address" => {
602                            let v: ::core::option::Option<
603                                ::buffa::alloc::string::String,
604                            > = map
605                                .next_value_seed(
606                                    ::buffa::json_helpers::NullableDeserializeSeed(
607                                        ::buffa::json_helpers::DefaultDeserializeSeed::<
608                                            ::buffa::alloc::string::String,
609                                        >::new(),
610                                    ),
611                                )?;
612                            if let Some(v) = v {
613                                if __oneof_destination.is_some() {
614                                    return Err(
615                                        serde::de::Error::custom(
616                                            "multiple oneof fields set for 'destination'",
617                                        ),
618                                    );
619                                }
620                                __oneof_destination = Some(
621                                    __buffa::oneof::create_internal_transfer_request::Destination::DestinationSmartAccountAddress(
622                                        v,
623                                    ),
624                                );
625                            }
626                        }
627                        _ => {
628                            map.next_value::<serde::de::IgnoredAny>()?;
629                        }
630                    }
631                }
632                let mut __r = <CreateInternalTransferRequest as ::core::default::Default>::default();
633                if let ::core::option::Option::Some(v) = __f_subaccount_id {
634                    __r.subaccount_id = v;
635                }
636                if let ::core::option::Option::Some(v) = __f_asset_id {
637                    __r.asset_id = v;
638                }
639                if let ::core::option::Option::Some(v) = __f_amount_e18 {
640                    __r.amount_e18 = v;
641                }
642                if let ::core::option::Option::Some(v) = __f_idempotency_key {
643                    __r.idempotency_key = v;
644                }
645                __r.destination = __oneof_destination;
646                Ok(__r)
647            }
648        }
649        d.deserialize_map(_V)
650    }
651}
652impl ::buffa::json_helpers::ProtoElemJson for CreateInternalTransferRequest {
653    fn serialize_proto_json<S: ::serde::Serializer>(
654        v: &Self,
655        s: S,
656    ) -> ::core::result::Result<S::Ok, S::Error> {
657        ::serde::Serialize::serialize(v, s)
658    }
659    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
660        d: D,
661    ) -> ::core::result::Result<Self, D::Error> {
662        <Self as ::serde::Deserialize>::deserialize(d)
663    }
664}
665#[doc(hidden)]
666pub const __CREATE_INTERNAL_TRANSFER_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
667    type_url: "type.googleapis.com/transfer.v1.CreateInternalTransferRequest",
668    to_json: ::buffa::type_registry::any_to_json::<CreateInternalTransferRequest>,
669    from_json: ::buffa::type_registry::any_from_json::<CreateInternalTransferRequest>,
670    is_wkt: false,
671};
672pub mod create_internal_transfer_request {
673    #[allow(unused_imports)]
674    use super::*;
675    #[doc(inline)]
676    pub use super::__buffa::oneof::create_internal_transfer_request::Destination;
677    #[doc(inline)]
678    pub use super::__buffa::view::oneof::create_internal_transfer_request::Destination as DestinationView;
679}
680/// ResolvedDestination describes the normalized transfer destination selected by
681/// the server after public-id / smart-account resolution.
682#[derive(Clone, PartialEq, Default)]
683#[derive(::serde::Serialize, ::serde::Deserialize)]
684#[serde(default)]
685pub struct ResolvedDestination {
686    /// Destination root account public id.
687    ///
688    /// Field 1: `root_account_public_id`
689    #[serde(
690        rename = "rootAccountPublicId",
691        alias = "root_account_public_id",
692        with = "::buffa::json_helpers::proto_string",
693        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
694    )]
695    pub root_account_public_id: ::buffa::alloc::string::String,
696    /// Destination subaccount public id when the destination targets a subaccount.
697    ///
698    /// Field 2: `subaccount_public_id`
699    #[serde(
700        rename = "subaccountPublicId",
701        alias = "subaccount_public_id",
702        with = "::buffa::json_helpers::proto_string",
703        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
704    )]
705    pub subaccount_public_id: ::buffa::alloc::string::String,
706    /// Destination smart-account address resolved by the server.
707    ///
708    /// Field 3: `smart_account_address`
709    #[serde(
710        rename = "smartAccountAddress",
711        alias = "smart_account_address",
712        with = "::buffa::json_helpers::proto_string",
713        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
714    )]
715    pub smart_account_address: ::buffa::alloc::string::String,
716    #[serde(skip)]
717    #[doc(hidden)]
718    pub __buffa_unknown_fields: ::buffa::UnknownFields,
719}
720impl ::core::fmt::Debug for ResolvedDestination {
721    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
722        f.debug_struct("ResolvedDestination")
723            .field("root_account_public_id", &self.root_account_public_id)
724            .field("subaccount_public_id", &self.subaccount_public_id)
725            .field("smart_account_address", &self.smart_account_address)
726            .finish()
727    }
728}
729impl ResolvedDestination {
730    /// Protobuf type URL for this message, for use with `Any::pack` and
731    /// `Any::unpack_if`.
732    ///
733    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
734    pub const TYPE_URL: &'static str = "type.googleapis.com/transfer.v1.ResolvedDestination";
735}
736::buffa::impl_default_instance!(ResolvedDestination);
737impl ::buffa::MessageName for ResolvedDestination {
738    const PACKAGE: &'static str = "transfer.v1";
739    const NAME: &'static str = "ResolvedDestination";
740    const FULL_NAME: &'static str = "transfer.v1.ResolvedDestination";
741    const TYPE_URL: &'static str = "type.googleapis.com/transfer.v1.ResolvedDestination";
742}
743impl ::buffa::Message for ResolvedDestination {
744    /// Returns the total encoded size in bytes.
745    ///
746    /// The result is a `u32`; the protobuf specification requires all
747    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
748    /// compliant message will never overflow this type.
749    #[allow(clippy::let_and_return)]
750    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
751        #[allow(unused_imports)]
752        use ::buffa::Enumeration as _;
753        let mut size = 0u32;
754        if !self.root_account_public_id.is_empty() {
755            size
756                += 1u32
757                    + ::buffa::types::string_encoded_len(&self.root_account_public_id)
758                        as u32;
759        }
760        if !self.subaccount_public_id.is_empty() {
761            size
762                += 1u32
763                    + ::buffa::types::string_encoded_len(&self.subaccount_public_id)
764                        as u32;
765        }
766        if !self.smart_account_address.is_empty() {
767            size
768                += 1u32
769                    + ::buffa::types::string_encoded_len(&self.smart_account_address)
770                        as u32;
771        }
772        size += self.__buffa_unknown_fields.encoded_len() as u32;
773        size
774    }
775    fn write_to(
776        &self,
777        _cache: &mut ::buffa::SizeCache,
778        buf: &mut impl ::buffa::bytes::BufMut,
779    ) {
780        #[allow(unused_imports)]
781        use ::buffa::Enumeration as _;
782        if !self.root_account_public_id.is_empty() {
783            ::buffa::types::put_string_field(1u32, &self.root_account_public_id, buf);
784        }
785        if !self.subaccount_public_id.is_empty() {
786            ::buffa::types::put_string_field(2u32, &self.subaccount_public_id, buf);
787        }
788        if !self.smart_account_address.is_empty() {
789            ::buffa::types::put_string_field(3u32, &self.smart_account_address, buf);
790        }
791        self.__buffa_unknown_fields.write_to(buf);
792    }
793    fn merge_field(
794        &mut self,
795        tag: ::buffa::encoding::Tag,
796        buf: &mut impl ::buffa::bytes::Buf,
797        ctx: ::buffa::DecodeContext<'_>,
798    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
799        #[allow(unused_imports)]
800        use ::buffa::bytes::Buf as _;
801        #[allow(unused_imports)]
802        use ::buffa::Enumeration as _;
803        match tag.field_number() {
804            1u32 => {
805                ::buffa::encoding::check_wire_type(
806                    tag,
807                    ::buffa::encoding::WireType::LengthDelimited,
808                )?;
809                ::buffa::types::merge_string(&mut self.root_account_public_id, buf)?;
810            }
811            2u32 => {
812                ::buffa::encoding::check_wire_type(
813                    tag,
814                    ::buffa::encoding::WireType::LengthDelimited,
815                )?;
816                ::buffa::types::merge_string(&mut self.subaccount_public_id, buf)?;
817            }
818            3u32 => {
819                ::buffa::encoding::check_wire_type(
820                    tag,
821                    ::buffa::encoding::WireType::LengthDelimited,
822                )?;
823                ::buffa::types::merge_string(&mut self.smart_account_address, buf)?;
824            }
825            _ => {
826                self.__buffa_unknown_fields
827                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
828            }
829        }
830        ::core::result::Result::Ok(())
831    }
832    fn clear(&mut self) {
833        self.root_account_public_id.clear();
834        self.subaccount_public_id.clear();
835        self.smart_account_address.clear();
836        self.__buffa_unknown_fields.clear();
837    }
838}
839impl ::buffa::ExtensionSet for ResolvedDestination {
840    const PROTO_FQN: &'static str = "transfer.v1.ResolvedDestination";
841    fn unknown_fields(&self) -> &::buffa::UnknownFields {
842        &self.__buffa_unknown_fields
843    }
844    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
845        &mut self.__buffa_unknown_fields
846    }
847}
848impl ::buffa::json_helpers::ProtoElemJson for ResolvedDestination {
849    fn serialize_proto_json<S: ::serde::Serializer>(
850        v: &Self,
851        s: S,
852    ) -> ::core::result::Result<S::Ok, S::Error> {
853        ::serde::Serialize::serialize(v, s)
854    }
855    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
856        d: D,
857    ) -> ::core::result::Result<Self, D::Error> {
858        <Self as ::serde::Deserialize>::deserialize(d)
859    }
860}
861#[doc(hidden)]
862pub const __RESOLVED_DESTINATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
863    type_url: "type.googleapis.com/transfer.v1.ResolvedDestination",
864    to_json: ::buffa::type_registry::any_to_json::<ResolvedDestination>,
865    from_json: ::buffa::type_registry::any_from_json::<ResolvedDestination>,
866    is_wkt: false,
867};
868/// CreateInternalTransferResponse returns the accepted request and transfer
869/// identifiers for later correlation.
870#[derive(Clone, PartialEq, Default)]
871#[derive(::serde::Serialize, ::serde::Deserialize)]
872#[serde(default)]
873pub struct CreateInternalTransferResponse {
874    /// Stable server-owned request identifier for this intake.
875    ///
876    /// Field 1: `request_id`
877    #[serde(
878        rename = "requestId",
879        alias = "request_id",
880        with = "::buffa::json_helpers::proto_string",
881        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
882    )]
883    pub request_id: ::buffa::alloc::string::String,
884    /// Stable transfer identifier for the settled internal transfer.
885    ///
886    /// Field 2: `transfer_id`
887    #[serde(
888        rename = "transferId",
889        alias = "transfer_id",
890        with = "::buffa::json_helpers::proto_string",
891        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
892    )]
893    pub transfer_id: ::buffa::alloc::string::String,
894    /// Acceptance timestamp in nanoseconds since epoch (server time).
895    ///
896    /// Field 3: `accepted_at_ts_ns`
897    #[serde(
898        rename = "acceptedAtTsNs",
899        alias = "accepted_at_ts_ns",
900        with = "::buffa::json_helpers::uint64",
901        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
902    )]
903    pub accepted_at_ts_ns: u64,
904    /// Echoed canonical public unified asset id.
905    ///
906    /// Field 4: `asset_id`
907    #[serde(
908        rename = "assetId",
909        alias = "asset_id",
910        with = "::buffa::json_helpers::uint32",
911        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
912    )]
913    pub asset_id: u32,
914    /// Resolved asset code for convenience.
915    ///
916    /// Field 5: `asset_code`
917    #[serde(
918        rename = "assetCode",
919        alias = "asset_code",
920        with = "::buffa::json_helpers::proto_string",
921        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
922    )]
923    pub asset_code: ::buffa::alloc::string::String,
924    /// Resolved unified asset id used by downstream settlement.
925    ///
926    /// Field 6: `u_asset_id`
927    #[serde(
928        rename = "uAssetId",
929        alias = "u_asset_id",
930        with = "::buffa::json_helpers::proto_string",
931        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
932    )]
933    pub u_asset_id: ::buffa::alloc::string::String,
934    /// Echoed transfer amount in canonical 18-decimal unified asset units.
935    ///
936    /// Field 7: `amount_e18`
937    #[serde(
938        rename = "amountE18",
939        alias = "amount_e18",
940        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
941    )]
942    pub amount_e18: ::buffa::MessageField<super::super::polyester::r#type::v1::U128>,
943    /// Server-resolved destination summary.
944    ///
945    /// Field 8: `destination`
946    #[serde(
947        rename = "destination",
948        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
949    )]
950    pub destination: ::buffa::MessageField<ResolvedDestination>,
951    /// Public status for the transfer request.
952    ///
953    /// Field 9: `status`
954    #[serde(
955        rename = "status",
956        with = "::buffa::json_helpers::proto_enum",
957        skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
958    )]
959    pub status: ::buffa::EnumValue<InternalTransferStatus>,
960    #[serde(skip)]
961    #[doc(hidden)]
962    pub __buffa_unknown_fields: ::buffa::UnknownFields,
963}
964impl ::core::fmt::Debug for CreateInternalTransferResponse {
965    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
966        f.debug_struct("CreateInternalTransferResponse")
967            .field("request_id", &self.request_id)
968            .field("transfer_id", &self.transfer_id)
969            .field("accepted_at_ts_ns", &self.accepted_at_ts_ns)
970            .field("asset_id", &self.asset_id)
971            .field("asset_code", &self.asset_code)
972            .field("u_asset_id", &self.u_asset_id)
973            .field("amount_e18", &self.amount_e18)
974            .field("destination", &self.destination)
975            .field("status", &self.status)
976            .finish()
977    }
978}
979impl CreateInternalTransferResponse {
980    /// Protobuf type URL for this message, for use with `Any::pack` and
981    /// `Any::unpack_if`.
982    ///
983    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
984    pub const TYPE_URL: &'static str = "type.googleapis.com/transfer.v1.CreateInternalTransferResponse";
985}
986::buffa::impl_default_instance!(CreateInternalTransferResponse);
987impl ::buffa::MessageName for CreateInternalTransferResponse {
988    const PACKAGE: &'static str = "transfer.v1";
989    const NAME: &'static str = "CreateInternalTransferResponse";
990    const FULL_NAME: &'static str = "transfer.v1.CreateInternalTransferResponse";
991    const TYPE_URL: &'static str = "type.googleapis.com/transfer.v1.CreateInternalTransferResponse";
992}
993impl ::buffa::Message for CreateInternalTransferResponse {
994    /// Returns the total encoded size in bytes.
995    ///
996    /// The result is a `u32`; the protobuf specification requires all
997    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
998    /// compliant message will never overflow this type.
999    #[allow(clippy::let_and_return)]
1000    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1001        #[allow(unused_imports)]
1002        use ::buffa::Enumeration as _;
1003        let mut size = 0u32;
1004        if !self.request_id.is_empty() {
1005            size += 1u32 + ::buffa::types::string_encoded_len(&self.request_id) as u32;
1006        }
1007        if !self.transfer_id.is_empty() {
1008            size += 1u32 + ::buffa::types::string_encoded_len(&self.transfer_id) as u32;
1009        }
1010        if self.accepted_at_ts_ns != 0u64 {
1011            size
1012                += 1u32
1013                    + ::buffa::types::uint64_encoded_len(self.accepted_at_ts_ns) as u32;
1014        }
1015        if self.asset_id != 0u32 {
1016            size += 1u32 + ::buffa::types::uint32_encoded_len(self.asset_id) as u32;
1017        }
1018        if !self.asset_code.is_empty() {
1019            size += 1u32 + ::buffa::types::string_encoded_len(&self.asset_code) as u32;
1020        }
1021        if !self.u_asset_id.is_empty() {
1022            size += 1u32 + ::buffa::types::string_encoded_len(&self.u_asset_id) as u32;
1023        }
1024        if self.amount_e18.is_set() {
1025            let __slot = __cache.reserve();
1026            let inner_size = self.amount_e18.compute_size(__cache);
1027            __cache.set(__slot, inner_size);
1028            size
1029                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1030                    + inner_size;
1031        }
1032        if self.destination.is_set() {
1033            let __slot = __cache.reserve();
1034            let inner_size = self.destination.compute_size(__cache);
1035            __cache.set(__slot, inner_size);
1036            size
1037                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1038                    + inner_size;
1039        }
1040        {
1041            let val = self.status.to_i32();
1042            if val != 0 {
1043                size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
1044            }
1045        }
1046        size += self.__buffa_unknown_fields.encoded_len() as u32;
1047        size
1048    }
1049    fn write_to(
1050        &self,
1051        __cache: &mut ::buffa::SizeCache,
1052        buf: &mut impl ::buffa::bytes::BufMut,
1053    ) {
1054        #[allow(unused_imports)]
1055        use ::buffa::Enumeration as _;
1056        if !self.request_id.is_empty() {
1057            ::buffa::types::put_string_field(1u32, &self.request_id, buf);
1058        }
1059        if !self.transfer_id.is_empty() {
1060            ::buffa::types::put_string_field(2u32, &self.transfer_id, buf);
1061        }
1062        if self.accepted_at_ts_ns != 0u64 {
1063            ::buffa::types::put_uint64_field(3u32, self.accepted_at_ts_ns, buf);
1064        }
1065        if self.asset_id != 0u32 {
1066            ::buffa::types::put_uint32_field(4u32, self.asset_id, buf);
1067        }
1068        if !self.asset_code.is_empty() {
1069            ::buffa::types::put_string_field(5u32, &self.asset_code, buf);
1070        }
1071        if !self.u_asset_id.is_empty() {
1072            ::buffa::types::put_string_field(6u32, &self.u_asset_id, buf);
1073        }
1074        if self.amount_e18.is_set() {
1075            ::buffa::types::put_len_delimited_header(7u32, __cache.consume_next(), buf);
1076            self.amount_e18.write_to(__cache, buf);
1077        }
1078        if self.destination.is_set() {
1079            ::buffa::types::put_len_delimited_header(8u32, __cache.consume_next(), buf);
1080            self.destination.write_to(__cache, buf);
1081        }
1082        {
1083            let val = self.status.to_i32();
1084            if val != 0 {
1085                ::buffa::types::put_int32_field(9u32, val, buf);
1086            }
1087        }
1088        self.__buffa_unknown_fields.write_to(buf);
1089    }
1090    fn merge_field(
1091        &mut self,
1092        tag: ::buffa::encoding::Tag,
1093        buf: &mut impl ::buffa::bytes::Buf,
1094        ctx: ::buffa::DecodeContext<'_>,
1095    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1096        #[allow(unused_imports)]
1097        use ::buffa::bytes::Buf as _;
1098        #[allow(unused_imports)]
1099        use ::buffa::Enumeration as _;
1100        match tag.field_number() {
1101            1u32 => {
1102                ::buffa::encoding::check_wire_type(
1103                    tag,
1104                    ::buffa::encoding::WireType::LengthDelimited,
1105                )?;
1106                ::buffa::types::merge_string(&mut self.request_id, buf)?;
1107            }
1108            2u32 => {
1109                ::buffa::encoding::check_wire_type(
1110                    tag,
1111                    ::buffa::encoding::WireType::LengthDelimited,
1112                )?;
1113                ::buffa::types::merge_string(&mut self.transfer_id, buf)?;
1114            }
1115            3u32 => {
1116                ::buffa::encoding::check_wire_type(
1117                    tag,
1118                    ::buffa::encoding::WireType::Varint,
1119                )?;
1120                self.accepted_at_ts_ns = ::buffa::types::decode_uint64(buf)?;
1121            }
1122            4u32 => {
1123                ::buffa::encoding::check_wire_type(
1124                    tag,
1125                    ::buffa::encoding::WireType::Varint,
1126                )?;
1127                self.asset_id = ::buffa::types::decode_uint32(buf)?;
1128            }
1129            5u32 => {
1130                ::buffa::encoding::check_wire_type(
1131                    tag,
1132                    ::buffa::encoding::WireType::LengthDelimited,
1133                )?;
1134                ::buffa::types::merge_string(&mut self.asset_code, buf)?;
1135            }
1136            6u32 => {
1137                ::buffa::encoding::check_wire_type(
1138                    tag,
1139                    ::buffa::encoding::WireType::LengthDelimited,
1140                )?;
1141                ::buffa::types::merge_string(&mut self.u_asset_id, buf)?;
1142            }
1143            7u32 => {
1144                ::buffa::encoding::check_wire_type(
1145                    tag,
1146                    ::buffa::encoding::WireType::LengthDelimited,
1147                )?;
1148                ::buffa::Message::merge_length_delimited(
1149                    self.amount_e18.get_or_insert_default(),
1150                    buf,
1151                    ctx,
1152                )?;
1153            }
1154            8u32 => {
1155                ::buffa::encoding::check_wire_type(
1156                    tag,
1157                    ::buffa::encoding::WireType::LengthDelimited,
1158                )?;
1159                ::buffa::Message::merge_length_delimited(
1160                    self.destination.get_or_insert_default(),
1161                    buf,
1162                    ctx,
1163                )?;
1164            }
1165            9u32 => {
1166                ::buffa::encoding::check_wire_type(
1167                    tag,
1168                    ::buffa::encoding::WireType::Varint,
1169                )?;
1170                self.status = ::buffa::EnumValue::from(
1171                    ::buffa::types::decode_int32(buf)?,
1172                );
1173            }
1174            _ => {
1175                self.__buffa_unknown_fields
1176                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1177            }
1178        }
1179        ::core::result::Result::Ok(())
1180    }
1181    fn clear(&mut self) {
1182        self.request_id.clear();
1183        self.transfer_id.clear();
1184        self.accepted_at_ts_ns = 0u64;
1185        self.asset_id = 0u32;
1186        self.asset_code.clear();
1187        self.u_asset_id.clear();
1188        self.amount_e18 = ::buffa::MessageField::none();
1189        self.destination = ::buffa::MessageField::none();
1190        self.status = ::buffa::EnumValue::from(0);
1191        self.__buffa_unknown_fields.clear();
1192    }
1193}
1194impl ::buffa::ExtensionSet for CreateInternalTransferResponse {
1195    const PROTO_FQN: &'static str = "transfer.v1.CreateInternalTransferResponse";
1196    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1197        &self.__buffa_unknown_fields
1198    }
1199    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1200        &mut self.__buffa_unknown_fields
1201    }
1202}
1203impl ::buffa::json_helpers::ProtoElemJson for CreateInternalTransferResponse {
1204    fn serialize_proto_json<S: ::serde::Serializer>(
1205        v: &Self,
1206        s: S,
1207    ) -> ::core::result::Result<S::Ok, S::Error> {
1208        ::serde::Serialize::serialize(v, s)
1209    }
1210    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1211        d: D,
1212    ) -> ::core::result::Result<Self, D::Error> {
1213        <Self as ::serde::Deserialize>::deserialize(d)
1214    }
1215}
1216#[doc(hidden)]
1217pub const __CREATE_INTERNAL_TRANSFER_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1218    type_url: "type.googleapis.com/transfer.v1.CreateInternalTransferResponse",
1219    to_json: ::buffa::type_registry::any_to_json::<CreateInternalTransferResponse>,
1220    from_json: ::buffa::type_registry::any_from_json::<CreateInternalTransferResponse>,
1221    is_wkt: false,
1222};
1223#[allow(
1224    non_camel_case_types,
1225    dead_code,
1226    unused_imports,
1227    unused_qualifications,
1228    clippy::derivable_impls,
1229    clippy::match_single_binding,
1230    clippy::uninlined_format_args,
1231    clippy::doc_lazy_continuation,
1232    clippy::module_inception
1233)]
1234pub mod __buffa {
1235    #[allow(unused_imports)]
1236    use super::*;
1237    pub mod view {
1238        #[allow(unused_imports)]
1239        use super::*;
1240        /// CreateInternalTransferRequest creates or returns one accepted Trading
1241        /// to Trading internal transfer for the authenticated source account.
1242        #[derive(Clone, Debug, Default)]
1243        pub struct CreateInternalTransferRequestView<'a> {
1244            /// Optional source subaccount public id. When omitted, the authenticated
1245            /// caller's root account is used as the source account.
1246            ///
1247            /// Field 1: `subaccount_id`
1248            pub subaccount_id: u64,
1249            /// Canonical public unified asset id for the asset being transferred.
1250            ///
1251            /// Field 5: `asset_id`
1252            pub asset_id: u32,
1253            /// Transfer amount in canonical 18-decimal unified asset units.
1254            /// For example, 0.5 is encoded as 500000000000000000.
1255            ///
1256            /// Field 6: `amount_e18`
1257            pub amount_e18: ::buffa::MessageFieldView<
1258                super::super::super::super::polyester::r#type::v1::__buffa::view::U128View<
1259                    'a,
1260                >,
1261            >,
1262            /// Stable client-supplied idempotency key used to collapse safe retries.
1263            ///
1264            /// Field 7: `idempotency_key`
1265            pub idempotency_key: &'a str,
1266            pub destination: ::core::option::Option<
1267                super::super::__buffa::view::oneof::create_internal_transfer_request::Destination<
1268                    'a,
1269                >,
1270            >,
1271            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1272        }
1273        impl<'a> ::buffa::MessageView<'a> for CreateInternalTransferRequestView<'a> {
1274            type Owned = super::super::CreateInternalTransferRequest;
1275            fn decode_view(
1276                buf: &'a [u8],
1277            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1278                let __limit = ::core::cell::Cell::new(
1279                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
1280                );
1281                <Self as ::buffa::MessageView>::decode_view_ctx(
1282                    buf,
1283                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
1284                )
1285            }
1286            fn decode_view_with_ctx(
1287                buf: &'a [u8],
1288                ctx: ::buffa::DecodeContext<'_>,
1289            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1290                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
1291            }
1292            fn merge_view_field(
1293                &mut self,
1294                tag: ::buffa::encoding::Tag,
1295                cur: &'a [u8],
1296                before_tag: &'a [u8],
1297                ctx: ::buffa::DecodeContext<'_>,
1298            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
1299                let _ = ctx;
1300                #[allow(unused_variables)]
1301                let view = self;
1302                let mut cur = cur;
1303                match tag.field_number() {
1304                    1u32 => {
1305                        ::buffa::encoding::check_wire_type(
1306                            tag,
1307                            ::buffa::encoding::WireType::Fixed64,
1308                        )?;
1309                        view.subaccount_id = ::buffa::types::decode_fixed64(&mut cur)?;
1310                    }
1311                    5u32 => {
1312                        ::buffa::encoding::check_wire_type(
1313                            tag,
1314                            ::buffa::encoding::WireType::Varint,
1315                        )?;
1316                        view.asset_id = ::buffa::types::decode_uint32(&mut cur)?;
1317                    }
1318                    6u32 => {
1319                        ::buffa::encoding::check_wire_type(
1320                            tag,
1321                            ::buffa::encoding::WireType::LengthDelimited,
1322                        )?;
1323                        let __sub_ctx = ctx.descend()?;
1324                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
1325                        match view.amount_e18.as_mut() {
1326                            Some(existing) => {
1327                                ::buffa::MessageView::merge_into_view(
1328                                    existing,
1329                                    sub,
1330                                    __sub_ctx,
1331                                )?
1332                            }
1333                            None => {
1334                                view.amount_e18 = ::buffa::MessageFieldView::set(
1335                                    <super::super::super::super::polyester::r#type::v1::__buffa::view::U128View as ::buffa::MessageView>::decode_view_ctx(
1336                                        sub,
1337                                        __sub_ctx,
1338                                    )?,
1339                                );
1340                            }
1341                        }
1342                    }
1343                    7u32 => {
1344                        ::buffa::encoding::check_wire_type(
1345                            tag,
1346                            ::buffa::encoding::WireType::LengthDelimited,
1347                        )?;
1348                        view.idempotency_key = ::buffa::types::borrow_str(&mut cur)?;
1349                    }
1350                    2u32 => {
1351                        ::buffa::encoding::check_wire_type(
1352                            tag,
1353                            ::buffa::encoding::WireType::Fixed64,
1354                        )?;
1355                        view.destination = Some(
1356                            super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationAccountId(
1357                                ::buffa::types::decode_fixed64(&mut cur)?,
1358                            ),
1359                        );
1360                    }
1361                    3u32 => {
1362                        ::buffa::encoding::check_wire_type(
1363                            tag,
1364                            ::buffa::encoding::WireType::Fixed64,
1365                        )?;
1366                        view.destination = Some(
1367                            super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationSubaccountId(
1368                                ::buffa::types::decode_fixed64(&mut cur)?,
1369                            ),
1370                        );
1371                    }
1372                    4u32 => {
1373                        ::buffa::encoding::check_wire_type(
1374                            tag,
1375                            ::buffa::encoding::WireType::LengthDelimited,
1376                        )?;
1377                        view.destination = Some(
1378                            super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationSmartAccountAddress(
1379                                ::buffa::types::borrow_str(&mut cur)?,
1380                            ),
1381                        );
1382                    }
1383                    _ => {
1384                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
1385                        let span_len = before_tag.len() - cur.len();
1386                        view.__buffa_unknown_fields
1387                            .push_record(before_tag, span_len, ctx)?;
1388                    }
1389                }
1390                ::core::result::Result::Ok(cur)
1391            }
1392            fn to_owned_message(
1393                &self,
1394            ) -> ::core::result::Result<
1395                super::super::CreateInternalTransferRequest,
1396                ::buffa::DecodeError,
1397            > {
1398                self.to_owned_from_source(None)
1399            }
1400            #[allow(clippy::useless_conversion, clippy::needless_update)]
1401            fn to_owned_from_source(
1402                &self,
1403                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
1404            ) -> ::core::result::Result<
1405                super::super::CreateInternalTransferRequest,
1406                ::buffa::DecodeError,
1407            > {
1408                #[allow(unused_imports)]
1409                use ::buffa::alloc::string::ToString as _;
1410                let _ = __buffa_src;
1411                ::core::result::Result::Ok(super::super::CreateInternalTransferRequest {
1412                    subaccount_id: self.subaccount_id,
1413                    asset_id: self.asset_id,
1414                    amount_e18: match self.amount_e18.as_option() {
1415                        Some(v) => {
1416                            ::buffa::MessageField::<
1417                                super::super::super::super::polyester::r#type::v1::U128,
1418                            >::some(v.to_owned_from_source(__buffa_src)?)
1419                        }
1420                        None => ::buffa::MessageField::none(),
1421                    },
1422                    idempotency_key: self.idempotency_key.to_string(),
1423                    destination: self
1424                        .destination
1425                        .as_ref()
1426                        .map(|v| match v {
1427                            super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationAccountId(
1428                                v,
1429                            ) => {
1430                                super::super::__buffa::oneof::create_internal_transfer_request::Destination::DestinationAccountId(
1431                                    *v,
1432                                )
1433                            }
1434                            super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationSubaccountId(
1435                                v,
1436                            ) => {
1437                                super::super::__buffa::oneof::create_internal_transfer_request::Destination::DestinationSubaccountId(
1438                                    *v,
1439                                )
1440                            }
1441                            super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationSmartAccountAddress(
1442                                v,
1443                            ) => {
1444                                super::super::__buffa::oneof::create_internal_transfer_request::Destination::DestinationSmartAccountAddress(
1445                                    v.to_string(),
1446                                )
1447                            }
1448                        }),
1449                    __buffa_unknown_fields: self
1450                        .__buffa_unknown_fields
1451                        .to_owned()?
1452                        .into(),
1453                    ..::core::default::Default::default()
1454                })
1455            }
1456        }
1457        impl<'a> ::buffa::ViewEncode<'a> for CreateInternalTransferRequestView<'a> {
1458            #[allow(clippy::needless_borrow, clippy::let_and_return)]
1459            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1460                #[allow(unused_imports)]
1461                use ::buffa::Enumeration as _;
1462                let mut size = 0u32;
1463                if self.subaccount_id != 0u64 {
1464                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
1465                }
1466                if let ::core::option::Option::Some(ref v) = self.destination {
1467                    match v {
1468                        super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationAccountId(
1469                            _x,
1470                        ) => {
1471                            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
1472                        }
1473                        super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationSubaccountId(
1474                            _x,
1475                        ) => {
1476                            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
1477                        }
1478                        super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationSmartAccountAddress(
1479                            x,
1480                        ) => {
1481                            size += 1u32 + ::buffa::types::string_encoded_len(x) as u32;
1482                        }
1483                    }
1484                }
1485                if self.asset_id != 0u32 {
1486                    size
1487                        += 1u32
1488                            + ::buffa::types::uint32_encoded_len(self.asset_id) as u32;
1489                }
1490                if self.amount_e18.is_set() {
1491                    let __slot = __cache.reserve();
1492                    let inner_size = self.amount_e18.compute_size(__cache);
1493                    __cache.set(__slot, inner_size);
1494                    size
1495                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1496                            + inner_size;
1497                }
1498                if !self.idempotency_key.is_empty() {
1499                    size
1500                        += 1u32
1501                            + ::buffa::types::string_encoded_len(&self.idempotency_key)
1502                                as u32;
1503                }
1504                size += self.__buffa_unknown_fields.encoded_len() as u32;
1505                size
1506            }
1507            #[allow(clippy::needless_borrow)]
1508            fn write_to(
1509                &self,
1510                __cache: &mut ::buffa::SizeCache,
1511                buf: &mut impl ::buffa::bytes::BufMut,
1512            ) {
1513                #[allow(unused_imports)]
1514                use ::buffa::Enumeration as _;
1515                if self.subaccount_id != 0u64 {
1516                    ::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
1517                }
1518                if let ::core::option::Option::Some(ref v) = self.destination {
1519                    match v {
1520                        super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationAccountId(
1521                            x,
1522                        ) => {
1523                            ::buffa::types::put_fixed64_field(2u32, *x, buf);
1524                        }
1525                        super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationSubaccountId(
1526                            x,
1527                        ) => {
1528                            ::buffa::types::put_fixed64_field(3u32, *x, buf);
1529                        }
1530                        super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationSmartAccountAddress(
1531                            x,
1532                        ) => {
1533                            ::buffa::types::put_string_field(4u32, x, buf);
1534                        }
1535                    }
1536                }
1537                if self.asset_id != 0u32 {
1538                    ::buffa::types::put_uint32_field(5u32, self.asset_id, buf);
1539                }
1540                if self.amount_e18.is_set() {
1541                    ::buffa::types::put_len_delimited_header(
1542                        6u32,
1543                        __cache.consume_next(),
1544                        buf,
1545                    );
1546                    self.amount_e18.write_to(__cache, buf);
1547                }
1548                if !self.idempotency_key.is_empty() {
1549                    ::buffa::types::put_string_field(7u32, &self.idempotency_key, buf);
1550                }
1551                self.__buffa_unknown_fields.write_to(buf);
1552            }
1553        }
1554        /// Serializes this view as protobuf JSON.
1555        ///
1556        /// Implicit-presence fields with default values are omitted, `required`
1557        /// fields are always emitted, explicit-presence (`optional`) fields are
1558        /// emitted only when set, bytes fields are base64-encoded, and enum
1559        /// values are their proto name strings.
1560        ///
1561        /// This impl uses `serialize_map(None)` because the number of emitted
1562        /// fields depends on default-omission rules; serializers that require
1563        /// known map lengths (e.g. `bincode`) will return a runtime error.
1564        /// Use the owned message type for those formats.
1565        impl<'__a> ::serde::Serialize for CreateInternalTransferRequestView<'__a> {
1566            fn serialize<__S: ::serde::Serializer>(
1567                &self,
1568                __s: __S,
1569            ) -> ::core::result::Result<__S::Ok, __S::Error> {
1570                use ::serde::ser::SerializeMap as _;
1571                let mut __map = __s.serialize_map(::core::option::Option::None)?;
1572                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.subaccount_id) {
1573                    __map
1574                        .serialize_entry(
1575                            "subaccountId",
1576                            &::buffa::json_helpers::ProtoJson(&self.subaccount_id),
1577                        )?;
1578                }
1579                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.asset_id) {
1580                    __map
1581                        .serialize_entry(
1582                            "assetId",
1583                            &::buffa::json_helpers::ProtoJson(&self.asset_id),
1584                        )?;
1585                }
1586                {
1587                    if let ::core::option::Option::Some(__v) = self
1588                        .amount_e18
1589                        .as_option()
1590                    {
1591                        __map.serialize_entry("amountE18", __v)?;
1592                    }
1593                }
1594                if !::buffa::json_helpers::skip_if::is_empty_str(self.idempotency_key) {
1595                    __map.serialize_entry("idempotencyKey", self.idempotency_key)?;
1596                }
1597                if let ::core::option::Option::Some(ref __ov) = self.destination {
1598                    match __ov {
1599                        super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationAccountId(
1600                            v,
1601                        ) => {
1602                            __map
1603                                .serialize_entry(
1604                                    "destinationAccountId",
1605                                    &::buffa::json_helpers::ProtoJson(v),
1606                                )?;
1607                        }
1608                        super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationSubaccountId(
1609                            v,
1610                        ) => {
1611                            __map
1612                                .serialize_entry(
1613                                    "destinationSubaccountId",
1614                                    &::buffa::json_helpers::ProtoJson(v),
1615                                )?;
1616                        }
1617                        super::super::__buffa::view::oneof::create_internal_transfer_request::Destination::DestinationSmartAccountAddress(
1618                            v,
1619                        ) => {
1620                            __map.serialize_entry("destinationSmartAccountAddress", v)?;
1621                        }
1622                    }
1623                }
1624                __map.end()
1625            }
1626        }
1627        impl<'a> ::buffa::MessageName for CreateInternalTransferRequestView<'a> {
1628            const PACKAGE: &'static str = "transfer.v1";
1629            const NAME: &'static str = "CreateInternalTransferRequest";
1630            const FULL_NAME: &'static str = "transfer.v1.CreateInternalTransferRequest";
1631            const TYPE_URL: &'static str = "type.googleapis.com/transfer.v1.CreateInternalTransferRequest";
1632        }
1633        ::buffa::impl_default_view_instance!(CreateInternalTransferRequestView);
1634        ::buffa::impl_view_reborrow!(CreateInternalTransferRequestView);
1635        /** Self-contained, `'static` owned view of a `CreateInternalTransferRequest` message.
1636
1637 Wraps [`::buffa::OwnedView`]`<`[`CreateInternalTransferRequestView`]`<'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.
1638
1639 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`CreateInternalTransferRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
1640        #[derive(Clone, Debug)]
1641        pub struct CreateInternalTransferRequestOwnedView(
1642            ::buffa::OwnedView<CreateInternalTransferRequestView<'static>>,
1643        );
1644        impl CreateInternalTransferRequestOwnedView {
1645            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
1646            ///
1647            /// The view borrows directly from the buffer's data; the buffer is
1648            /// retained inside the returned handle.
1649            ///
1650            /// # Errors
1651            ///
1652            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
1653            /// protobuf data.
1654            pub fn decode(
1655                bytes: ::buffa::bytes::Bytes,
1656            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1657                ::core::result::Result::Ok(
1658                    CreateInternalTransferRequestOwnedView(
1659                        ::buffa::OwnedView::decode(bytes)?,
1660                    ),
1661                )
1662            }
1663            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
1664            /// max message size).
1665            ///
1666            /// # Errors
1667            ///
1668            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
1669            /// exceeds the configured limits.
1670            pub fn decode_with_options(
1671                bytes: ::buffa::bytes::Bytes,
1672                opts: &::buffa::DecodeOptions,
1673            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1674                ::core::result::Result::Ok(
1675                    CreateInternalTransferRequestOwnedView(
1676                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
1677                    ),
1678                )
1679            }
1680            /// Build from an owned message via an encode → decode round-trip.
1681            ///
1682            /// # Errors
1683            ///
1684            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
1685            /// somehow invalid (should not happen for well-formed messages).
1686            pub fn from_owned(
1687                msg: &super::super::CreateInternalTransferRequest,
1688            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1689                ::core::result::Result::Ok(
1690                    CreateInternalTransferRequestOwnedView(
1691                        ::buffa::OwnedView::from_owned(msg)?,
1692                    ),
1693                )
1694            }
1695            /// Borrow the full [`CreateInternalTransferRequestView`] with its lifetime tied to `&self`.
1696            #[must_use]
1697            pub fn view(&self) -> &CreateInternalTransferRequestView<'_> {
1698                self.0.reborrow()
1699            }
1700            /// Convert to the owned message type.
1701            ///
1702            /// # Errors
1703            ///
1704            /// Returns an error if re-materializing preserved unknown fields
1705            /// fails (e.g. the unknown-field limit is exceeded).
1706            pub fn to_owned_message(
1707                &self,
1708            ) -> ::core::result::Result<
1709                super::super::CreateInternalTransferRequest,
1710                ::buffa::DecodeError,
1711            > {
1712                self.0.to_owned_message()
1713            }
1714            /// The underlying bytes buffer.
1715            #[must_use]
1716            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
1717                self.0.bytes()
1718            }
1719            /// Consume the handle, returning the underlying bytes buffer.
1720            #[must_use]
1721            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
1722                self.0.into_bytes()
1723            }
1724            /// Optional source subaccount public id. When omitted, the authenticated
1725            /// caller's root account is used as the source account.
1726            ///
1727            /// Field 1: `subaccount_id`
1728            #[must_use]
1729            pub fn subaccount_id(&self) -> u64 {
1730                self.0.reborrow().subaccount_id
1731            }
1732            /// Canonical public unified asset id for the asset being transferred.
1733            ///
1734            /// Field 5: `asset_id`
1735            #[must_use]
1736            pub fn asset_id(&self) -> u32 {
1737                self.0.reborrow().asset_id
1738            }
1739            /// Transfer amount in canonical 18-decimal unified asset units.
1740            /// For example, 0.5 is encoded as 500000000000000000.
1741            ///
1742            /// Field 6: `amount_e18`
1743            #[must_use]
1744            pub fn amount_e18(
1745                &self,
1746            ) -> &::buffa::MessageFieldView<
1747                super::super::super::super::polyester::r#type::v1::__buffa::view::U128View<
1748                    '_,
1749                >,
1750            > {
1751                &self.0.reborrow().amount_e18
1752            }
1753            /// Stable client-supplied idempotency key used to collapse safe retries.
1754            ///
1755            /// Field 7: `idempotency_key`
1756            #[must_use]
1757            pub fn idempotency_key(&self) -> &'_ str {
1758                self.0.reborrow().idempotency_key
1759            }
1760            /// Oneof `destination`.
1761            #[must_use]
1762            pub fn destination(
1763                &self,
1764            ) -> ::core::option::Option<
1765                &super::super::__buffa::view::oneof::create_internal_transfer_request::Destination<
1766                    '_,
1767                >,
1768            > {
1769                self.0.reborrow().destination.as_ref()
1770            }
1771        }
1772        impl ::core::convert::From<
1773            ::buffa::OwnedView<CreateInternalTransferRequestView<'static>>,
1774        > for CreateInternalTransferRequestOwnedView {
1775            fn from(
1776                inner: ::buffa::OwnedView<CreateInternalTransferRequestView<'static>>,
1777            ) -> Self {
1778                CreateInternalTransferRequestOwnedView(inner)
1779            }
1780        }
1781        impl ::core::convert::From<CreateInternalTransferRequestOwnedView>
1782        for ::buffa::OwnedView<CreateInternalTransferRequestView<'static>> {
1783            fn from(wrapper: CreateInternalTransferRequestOwnedView) -> Self {
1784                wrapper.0
1785            }
1786        }
1787        impl ::core::convert::AsRef<
1788            ::buffa::OwnedView<CreateInternalTransferRequestView<'static>>,
1789        > for CreateInternalTransferRequestOwnedView {
1790            fn as_ref(
1791                &self,
1792            ) -> &::buffa::OwnedView<CreateInternalTransferRequestView<'static>> {
1793                &self.0
1794            }
1795        }
1796        impl ::buffa::HasMessageView for super::super::CreateInternalTransferRequest {
1797            type View<'a> = CreateInternalTransferRequestView<'a>;
1798            type ViewHandle = CreateInternalTransferRequestOwnedView;
1799        }
1800        impl ::serde::Serialize for CreateInternalTransferRequestOwnedView {
1801            fn serialize<__S: ::serde::Serializer>(
1802                &self,
1803                __s: __S,
1804            ) -> ::core::result::Result<__S::Ok, __S::Error> {
1805                ::serde::Serialize::serialize(&self.0, __s)
1806            }
1807        }
1808        /// ResolvedDestination describes the normalized transfer destination selected by
1809        /// the server after public-id / smart-account resolution.
1810        #[derive(Clone, Debug, Default)]
1811        pub struct ResolvedDestinationView<'a> {
1812            /// Destination root account public id.
1813            ///
1814            /// Field 1: `root_account_public_id`
1815            pub root_account_public_id: &'a str,
1816            /// Destination subaccount public id when the destination targets a subaccount.
1817            ///
1818            /// Field 2: `subaccount_public_id`
1819            pub subaccount_public_id: &'a str,
1820            /// Destination smart-account address resolved by the server.
1821            ///
1822            /// Field 3: `smart_account_address`
1823            pub smart_account_address: &'a str,
1824            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1825        }
1826        impl<'a> ::buffa::MessageView<'a> for ResolvedDestinationView<'a> {
1827            type Owned = super::super::ResolvedDestination;
1828            fn decode_view(
1829                buf: &'a [u8],
1830            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1831                let __limit = ::core::cell::Cell::new(
1832                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
1833                );
1834                <Self as ::buffa::MessageView>::decode_view_ctx(
1835                    buf,
1836                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
1837                )
1838            }
1839            fn decode_view_with_ctx(
1840                buf: &'a [u8],
1841                ctx: ::buffa::DecodeContext<'_>,
1842            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1843                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
1844            }
1845            fn merge_view_field(
1846                &mut self,
1847                tag: ::buffa::encoding::Tag,
1848                cur: &'a [u8],
1849                before_tag: &'a [u8],
1850                ctx: ::buffa::DecodeContext<'_>,
1851            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
1852                let _ = ctx;
1853                #[allow(unused_variables)]
1854                let view = self;
1855                let mut cur = cur;
1856                match tag.field_number() {
1857                    1u32 => {
1858                        ::buffa::encoding::check_wire_type(
1859                            tag,
1860                            ::buffa::encoding::WireType::LengthDelimited,
1861                        )?;
1862                        view.root_account_public_id = ::buffa::types::borrow_str(
1863                            &mut cur,
1864                        )?;
1865                    }
1866                    2u32 => {
1867                        ::buffa::encoding::check_wire_type(
1868                            tag,
1869                            ::buffa::encoding::WireType::LengthDelimited,
1870                        )?;
1871                        view.subaccount_public_id = ::buffa::types::borrow_str(
1872                            &mut cur,
1873                        )?;
1874                    }
1875                    3u32 => {
1876                        ::buffa::encoding::check_wire_type(
1877                            tag,
1878                            ::buffa::encoding::WireType::LengthDelimited,
1879                        )?;
1880                        view.smart_account_address = ::buffa::types::borrow_str(
1881                            &mut cur,
1882                        )?;
1883                    }
1884                    _ => {
1885                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
1886                        let span_len = before_tag.len() - cur.len();
1887                        view.__buffa_unknown_fields
1888                            .push_record(before_tag, span_len, ctx)?;
1889                    }
1890                }
1891                ::core::result::Result::Ok(cur)
1892            }
1893            fn to_owned_message(
1894                &self,
1895            ) -> ::core::result::Result<
1896                super::super::ResolvedDestination,
1897                ::buffa::DecodeError,
1898            > {
1899                self.to_owned_from_source(None)
1900            }
1901            #[allow(clippy::useless_conversion, clippy::needless_update)]
1902            fn to_owned_from_source(
1903                &self,
1904                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
1905            ) -> ::core::result::Result<
1906                super::super::ResolvedDestination,
1907                ::buffa::DecodeError,
1908            > {
1909                #[allow(unused_imports)]
1910                use ::buffa::alloc::string::ToString as _;
1911                let _ = __buffa_src;
1912                ::core::result::Result::Ok(super::super::ResolvedDestination {
1913                    root_account_public_id: self.root_account_public_id.to_string(),
1914                    subaccount_public_id: self.subaccount_public_id.to_string(),
1915                    smart_account_address: self.smart_account_address.to_string(),
1916                    __buffa_unknown_fields: self
1917                        .__buffa_unknown_fields
1918                        .to_owned()?
1919                        .into(),
1920                    ..::core::default::Default::default()
1921                })
1922            }
1923        }
1924        impl<'a> ::buffa::ViewEncode<'a> for ResolvedDestinationView<'a> {
1925            #[allow(clippy::needless_borrow, clippy::let_and_return)]
1926            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1927                #[allow(unused_imports)]
1928                use ::buffa::Enumeration as _;
1929                let mut size = 0u32;
1930                if !self.root_account_public_id.is_empty() {
1931                    size
1932                        += 1u32
1933                            + ::buffa::types::string_encoded_len(
1934                                &self.root_account_public_id,
1935                            ) as u32;
1936                }
1937                if !self.subaccount_public_id.is_empty() {
1938                    size
1939                        += 1u32
1940                            + ::buffa::types::string_encoded_len(
1941                                &self.subaccount_public_id,
1942                            ) as u32;
1943                }
1944                if !self.smart_account_address.is_empty() {
1945                    size
1946                        += 1u32
1947                            + ::buffa::types::string_encoded_len(
1948                                &self.smart_account_address,
1949                            ) as u32;
1950                }
1951                size += self.__buffa_unknown_fields.encoded_len() as u32;
1952                size
1953            }
1954            #[allow(clippy::needless_borrow)]
1955            fn write_to(
1956                &self,
1957                _cache: &mut ::buffa::SizeCache,
1958                buf: &mut impl ::buffa::bytes::BufMut,
1959            ) {
1960                #[allow(unused_imports)]
1961                use ::buffa::Enumeration as _;
1962                if !self.root_account_public_id.is_empty() {
1963                    ::buffa::types::put_string_field(
1964                        1u32,
1965                        &self.root_account_public_id,
1966                        buf,
1967                    );
1968                }
1969                if !self.subaccount_public_id.is_empty() {
1970                    ::buffa::types::put_string_field(
1971                        2u32,
1972                        &self.subaccount_public_id,
1973                        buf,
1974                    );
1975                }
1976                if !self.smart_account_address.is_empty() {
1977                    ::buffa::types::put_string_field(
1978                        3u32,
1979                        &self.smart_account_address,
1980                        buf,
1981                    );
1982                }
1983                self.__buffa_unknown_fields.write_to(buf);
1984            }
1985        }
1986        /// Serializes this view as protobuf JSON.
1987        ///
1988        /// Implicit-presence fields with default values are omitted, `required`
1989        /// fields are always emitted, explicit-presence (`optional`) fields are
1990        /// emitted only when set, bytes fields are base64-encoded, and enum
1991        /// values are their proto name strings.
1992        ///
1993        /// This impl uses `serialize_map(None)` because the number of emitted
1994        /// fields depends on default-omission rules; serializers that require
1995        /// known map lengths (e.g. `bincode`) will return a runtime error.
1996        /// Use the owned message type for those formats.
1997        impl<'__a> ::serde::Serialize for ResolvedDestinationView<'__a> {
1998            fn serialize<__S: ::serde::Serializer>(
1999                &self,
2000                __s: __S,
2001            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2002                use ::serde::ser::SerializeMap as _;
2003                let mut __map = __s.serialize_map(::core::option::Option::None)?;
2004                if !::buffa::json_helpers::skip_if::is_empty_str(
2005                    self.root_account_public_id,
2006                ) {
2007                    __map
2008                        .serialize_entry(
2009                            "rootAccountPublicId",
2010                            self.root_account_public_id,
2011                        )?;
2012                }
2013                if !::buffa::json_helpers::skip_if::is_empty_str(
2014                    self.subaccount_public_id,
2015                ) {
2016                    __map
2017                        .serialize_entry(
2018                            "subaccountPublicId",
2019                            self.subaccount_public_id,
2020                        )?;
2021                }
2022                if !::buffa::json_helpers::skip_if::is_empty_str(
2023                    self.smart_account_address,
2024                ) {
2025                    __map
2026                        .serialize_entry(
2027                            "smartAccountAddress",
2028                            self.smart_account_address,
2029                        )?;
2030                }
2031                __map.end()
2032            }
2033        }
2034        impl<'a> ::buffa::MessageName for ResolvedDestinationView<'a> {
2035            const PACKAGE: &'static str = "transfer.v1";
2036            const NAME: &'static str = "ResolvedDestination";
2037            const FULL_NAME: &'static str = "transfer.v1.ResolvedDestination";
2038            const TYPE_URL: &'static str = "type.googleapis.com/transfer.v1.ResolvedDestination";
2039        }
2040        ::buffa::impl_default_view_instance!(ResolvedDestinationView);
2041        ::buffa::impl_view_reborrow!(ResolvedDestinationView);
2042        /** Self-contained, `'static` owned view of a `ResolvedDestination` message.
2043
2044 Wraps [`::buffa::OwnedView`]`<`[`ResolvedDestinationView`]`<'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.
2045
2046 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ResolvedDestinationView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
2047        #[derive(Clone, Debug)]
2048        pub struct ResolvedDestinationOwnedView(
2049            ::buffa::OwnedView<ResolvedDestinationView<'static>>,
2050        );
2051        impl ResolvedDestinationOwnedView {
2052            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
2053            ///
2054            /// The view borrows directly from the buffer's data; the buffer is
2055            /// retained inside the returned handle.
2056            ///
2057            /// # Errors
2058            ///
2059            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
2060            /// protobuf data.
2061            pub fn decode(
2062                bytes: ::buffa::bytes::Bytes,
2063            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2064                ::core::result::Result::Ok(
2065                    ResolvedDestinationOwnedView(::buffa::OwnedView::decode(bytes)?),
2066                )
2067            }
2068            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
2069            /// max message size).
2070            ///
2071            /// # Errors
2072            ///
2073            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
2074            /// exceeds the configured limits.
2075            pub fn decode_with_options(
2076                bytes: ::buffa::bytes::Bytes,
2077                opts: &::buffa::DecodeOptions,
2078            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2079                ::core::result::Result::Ok(
2080                    ResolvedDestinationOwnedView(
2081                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
2082                    ),
2083                )
2084            }
2085            /// Build from an owned message via an encode → decode round-trip.
2086            ///
2087            /// # Errors
2088            ///
2089            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
2090            /// somehow invalid (should not happen for well-formed messages).
2091            pub fn from_owned(
2092                msg: &super::super::ResolvedDestination,
2093            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2094                ::core::result::Result::Ok(
2095                    ResolvedDestinationOwnedView(::buffa::OwnedView::from_owned(msg)?),
2096                )
2097            }
2098            /// Borrow the full [`ResolvedDestinationView`] with its lifetime tied to `&self`.
2099            #[must_use]
2100            pub fn view(&self) -> &ResolvedDestinationView<'_> {
2101                self.0.reborrow()
2102            }
2103            /// Convert to the owned message type.
2104            ///
2105            /// # Errors
2106            ///
2107            /// Returns an error if re-materializing preserved unknown fields
2108            /// fails (e.g. the unknown-field limit is exceeded).
2109            pub fn to_owned_message(
2110                &self,
2111            ) -> ::core::result::Result<
2112                super::super::ResolvedDestination,
2113                ::buffa::DecodeError,
2114            > {
2115                self.0.to_owned_message()
2116            }
2117            /// The underlying bytes buffer.
2118            #[must_use]
2119            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
2120                self.0.bytes()
2121            }
2122            /// Consume the handle, returning the underlying bytes buffer.
2123            #[must_use]
2124            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
2125                self.0.into_bytes()
2126            }
2127            /// Destination root account public id.
2128            ///
2129            /// Field 1: `root_account_public_id`
2130            #[must_use]
2131            pub fn root_account_public_id(&self) -> &'_ str {
2132                self.0.reborrow().root_account_public_id
2133            }
2134            /// Destination subaccount public id when the destination targets a subaccount.
2135            ///
2136            /// Field 2: `subaccount_public_id`
2137            #[must_use]
2138            pub fn subaccount_public_id(&self) -> &'_ str {
2139                self.0.reborrow().subaccount_public_id
2140            }
2141            /// Destination smart-account address resolved by the server.
2142            ///
2143            /// Field 3: `smart_account_address`
2144            #[must_use]
2145            pub fn smart_account_address(&self) -> &'_ str {
2146                self.0.reborrow().smart_account_address
2147            }
2148        }
2149        impl ::core::convert::From<::buffa::OwnedView<ResolvedDestinationView<'static>>>
2150        for ResolvedDestinationOwnedView {
2151            fn from(
2152                inner: ::buffa::OwnedView<ResolvedDestinationView<'static>>,
2153            ) -> Self {
2154                ResolvedDestinationOwnedView(inner)
2155            }
2156        }
2157        impl ::core::convert::From<ResolvedDestinationOwnedView>
2158        for ::buffa::OwnedView<ResolvedDestinationView<'static>> {
2159            fn from(wrapper: ResolvedDestinationOwnedView) -> Self {
2160                wrapper.0
2161            }
2162        }
2163        impl ::core::convert::AsRef<::buffa::OwnedView<ResolvedDestinationView<'static>>>
2164        for ResolvedDestinationOwnedView {
2165            fn as_ref(&self) -> &::buffa::OwnedView<ResolvedDestinationView<'static>> {
2166                &self.0
2167            }
2168        }
2169        impl ::buffa::HasMessageView for super::super::ResolvedDestination {
2170            type View<'a> = ResolvedDestinationView<'a>;
2171            type ViewHandle = ResolvedDestinationOwnedView;
2172        }
2173        impl ::serde::Serialize for ResolvedDestinationOwnedView {
2174            fn serialize<__S: ::serde::Serializer>(
2175                &self,
2176                __s: __S,
2177            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2178                ::serde::Serialize::serialize(&self.0, __s)
2179            }
2180        }
2181        /// CreateInternalTransferResponse returns the accepted request and transfer
2182        /// identifiers for later correlation.
2183        #[derive(Clone, Debug, Default)]
2184        pub struct CreateInternalTransferResponseView<'a> {
2185            /// Stable server-owned request identifier for this intake.
2186            ///
2187            /// Field 1: `request_id`
2188            pub request_id: &'a str,
2189            /// Stable transfer identifier for the settled internal transfer.
2190            ///
2191            /// Field 2: `transfer_id`
2192            pub transfer_id: &'a str,
2193            /// Acceptance timestamp in nanoseconds since epoch (server time).
2194            ///
2195            /// Field 3: `accepted_at_ts_ns`
2196            pub accepted_at_ts_ns: u64,
2197            /// Echoed canonical public unified asset id.
2198            ///
2199            /// Field 4: `asset_id`
2200            pub asset_id: u32,
2201            /// Resolved asset code for convenience.
2202            ///
2203            /// Field 5: `asset_code`
2204            pub asset_code: &'a str,
2205            /// Resolved unified asset id used by downstream settlement.
2206            ///
2207            /// Field 6: `u_asset_id`
2208            pub u_asset_id: &'a str,
2209            /// Echoed transfer amount in canonical 18-decimal unified asset units.
2210            ///
2211            /// Field 7: `amount_e18`
2212            pub amount_e18: ::buffa::MessageFieldView<
2213                super::super::super::super::polyester::r#type::v1::__buffa::view::U128View<
2214                    'a,
2215                >,
2216            >,
2217            /// Server-resolved destination summary.
2218            ///
2219            /// Field 8: `destination`
2220            pub destination: ::buffa::MessageFieldView<
2221                super::super::__buffa::view::ResolvedDestinationView<'a>,
2222            >,
2223            /// Public status for the transfer request.
2224            ///
2225            /// Field 9: `status`
2226            pub status: ::buffa::EnumValue<super::super::InternalTransferStatus>,
2227            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2228        }
2229        impl<'a> ::buffa::MessageView<'a> for CreateInternalTransferResponseView<'a> {
2230            type Owned = super::super::CreateInternalTransferResponse;
2231            fn decode_view(
2232                buf: &'a [u8],
2233            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2234                let __limit = ::core::cell::Cell::new(
2235                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
2236                );
2237                <Self as ::buffa::MessageView>::decode_view_ctx(
2238                    buf,
2239                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
2240                )
2241            }
2242            fn decode_view_with_ctx(
2243                buf: &'a [u8],
2244                ctx: ::buffa::DecodeContext<'_>,
2245            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2246                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
2247            }
2248            fn merge_view_field(
2249                &mut self,
2250                tag: ::buffa::encoding::Tag,
2251                cur: &'a [u8],
2252                before_tag: &'a [u8],
2253                ctx: ::buffa::DecodeContext<'_>,
2254            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
2255                let _ = ctx;
2256                #[allow(unused_variables)]
2257                let view = self;
2258                let mut cur = cur;
2259                match tag.field_number() {
2260                    1u32 => {
2261                        ::buffa::encoding::check_wire_type(
2262                            tag,
2263                            ::buffa::encoding::WireType::LengthDelimited,
2264                        )?;
2265                        view.request_id = ::buffa::types::borrow_str(&mut cur)?;
2266                    }
2267                    2u32 => {
2268                        ::buffa::encoding::check_wire_type(
2269                            tag,
2270                            ::buffa::encoding::WireType::LengthDelimited,
2271                        )?;
2272                        view.transfer_id = ::buffa::types::borrow_str(&mut cur)?;
2273                    }
2274                    3u32 => {
2275                        ::buffa::encoding::check_wire_type(
2276                            tag,
2277                            ::buffa::encoding::WireType::Varint,
2278                        )?;
2279                        view.accepted_at_ts_ns = ::buffa::types::decode_uint64(
2280                            &mut cur,
2281                        )?;
2282                    }
2283                    4u32 => {
2284                        ::buffa::encoding::check_wire_type(
2285                            tag,
2286                            ::buffa::encoding::WireType::Varint,
2287                        )?;
2288                        view.asset_id = ::buffa::types::decode_uint32(&mut cur)?;
2289                    }
2290                    5u32 => {
2291                        ::buffa::encoding::check_wire_type(
2292                            tag,
2293                            ::buffa::encoding::WireType::LengthDelimited,
2294                        )?;
2295                        view.asset_code = ::buffa::types::borrow_str(&mut cur)?;
2296                    }
2297                    6u32 => {
2298                        ::buffa::encoding::check_wire_type(
2299                            tag,
2300                            ::buffa::encoding::WireType::LengthDelimited,
2301                        )?;
2302                        view.u_asset_id = ::buffa::types::borrow_str(&mut cur)?;
2303                    }
2304                    7u32 => {
2305                        ::buffa::encoding::check_wire_type(
2306                            tag,
2307                            ::buffa::encoding::WireType::LengthDelimited,
2308                        )?;
2309                        let __sub_ctx = ctx.descend()?;
2310                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
2311                        match view.amount_e18.as_mut() {
2312                            Some(existing) => {
2313                                ::buffa::MessageView::merge_into_view(
2314                                    existing,
2315                                    sub,
2316                                    __sub_ctx,
2317                                )?
2318                            }
2319                            None => {
2320                                view.amount_e18 = ::buffa::MessageFieldView::set(
2321                                    <super::super::super::super::polyester::r#type::v1::__buffa::view::U128View as ::buffa::MessageView>::decode_view_ctx(
2322                                        sub,
2323                                        __sub_ctx,
2324                                    )?,
2325                                );
2326                            }
2327                        }
2328                    }
2329                    8u32 => {
2330                        ::buffa::encoding::check_wire_type(
2331                            tag,
2332                            ::buffa::encoding::WireType::LengthDelimited,
2333                        )?;
2334                        let __sub_ctx = ctx.descend()?;
2335                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
2336                        match view.destination.as_mut() {
2337                            Some(existing) => {
2338                                ::buffa::MessageView::merge_into_view(
2339                                    existing,
2340                                    sub,
2341                                    __sub_ctx,
2342                                )?
2343                            }
2344                            None => {
2345                                view.destination = ::buffa::MessageFieldView::set(
2346                                    <super::super::__buffa::view::ResolvedDestinationView as ::buffa::MessageView>::decode_view_ctx(
2347                                        sub,
2348                                        __sub_ctx,
2349                                    )?,
2350                                );
2351                            }
2352                        }
2353                    }
2354                    9u32 => {
2355                        ::buffa::encoding::check_wire_type(
2356                            tag,
2357                            ::buffa::encoding::WireType::Varint,
2358                        )?;
2359                        view.status = ::buffa::EnumValue::from(
2360                            ::buffa::types::decode_int32(&mut cur)?,
2361                        );
2362                    }
2363                    _ => {
2364                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
2365                        let span_len = before_tag.len() - cur.len();
2366                        view.__buffa_unknown_fields
2367                            .push_record(before_tag, span_len, ctx)?;
2368                    }
2369                }
2370                ::core::result::Result::Ok(cur)
2371            }
2372            fn to_owned_message(
2373                &self,
2374            ) -> ::core::result::Result<
2375                super::super::CreateInternalTransferResponse,
2376                ::buffa::DecodeError,
2377            > {
2378                self.to_owned_from_source(None)
2379            }
2380            #[allow(clippy::useless_conversion, clippy::needless_update)]
2381            fn to_owned_from_source(
2382                &self,
2383                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
2384            ) -> ::core::result::Result<
2385                super::super::CreateInternalTransferResponse,
2386                ::buffa::DecodeError,
2387            > {
2388                #[allow(unused_imports)]
2389                use ::buffa::alloc::string::ToString as _;
2390                let _ = __buffa_src;
2391                ::core::result::Result::Ok(super::super::CreateInternalTransferResponse {
2392                    request_id: self.request_id.to_string(),
2393                    transfer_id: self.transfer_id.to_string(),
2394                    accepted_at_ts_ns: self.accepted_at_ts_ns,
2395                    asset_id: self.asset_id,
2396                    asset_code: self.asset_code.to_string(),
2397                    u_asset_id: self.u_asset_id.to_string(),
2398                    amount_e18: match self.amount_e18.as_option() {
2399                        Some(v) => {
2400                            ::buffa::MessageField::<
2401                                super::super::super::super::polyester::r#type::v1::U128,
2402                            >::some(v.to_owned_from_source(__buffa_src)?)
2403                        }
2404                        None => ::buffa::MessageField::none(),
2405                    },
2406                    destination: match self.destination.as_option() {
2407                        Some(v) => {
2408                            ::buffa::MessageField::<
2409                                super::super::ResolvedDestination,
2410                            >::some(v.to_owned_from_source(__buffa_src)?)
2411                        }
2412                        None => ::buffa::MessageField::none(),
2413                    },
2414                    status: self.status,
2415                    __buffa_unknown_fields: self
2416                        .__buffa_unknown_fields
2417                        .to_owned()?
2418                        .into(),
2419                    ..::core::default::Default::default()
2420                })
2421            }
2422        }
2423        impl<'a> ::buffa::ViewEncode<'a> for CreateInternalTransferResponseView<'a> {
2424            #[allow(clippy::needless_borrow, clippy::let_and_return)]
2425            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2426                #[allow(unused_imports)]
2427                use ::buffa::Enumeration as _;
2428                let mut size = 0u32;
2429                if !self.request_id.is_empty() {
2430                    size
2431                        += 1u32
2432                            + ::buffa::types::string_encoded_len(&self.request_id)
2433                                as u32;
2434                }
2435                if !self.transfer_id.is_empty() {
2436                    size
2437                        += 1u32
2438                            + ::buffa::types::string_encoded_len(&self.transfer_id)
2439                                as u32;
2440                }
2441                if self.accepted_at_ts_ns != 0u64 {
2442                    size
2443                        += 1u32
2444                            + ::buffa::types::uint64_encoded_len(self.accepted_at_ts_ns)
2445                                as u32;
2446                }
2447                if self.asset_id != 0u32 {
2448                    size
2449                        += 1u32
2450                            + ::buffa::types::uint32_encoded_len(self.asset_id) as u32;
2451                }
2452                if !self.asset_code.is_empty() {
2453                    size
2454                        += 1u32
2455                            + ::buffa::types::string_encoded_len(&self.asset_code)
2456                                as u32;
2457                }
2458                if !self.u_asset_id.is_empty() {
2459                    size
2460                        += 1u32
2461                            + ::buffa::types::string_encoded_len(&self.u_asset_id)
2462                                as u32;
2463                }
2464                if self.amount_e18.is_set() {
2465                    let __slot = __cache.reserve();
2466                    let inner_size = self.amount_e18.compute_size(__cache);
2467                    __cache.set(__slot, inner_size);
2468                    size
2469                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2470                            + inner_size;
2471                }
2472                if self.destination.is_set() {
2473                    let __slot = __cache.reserve();
2474                    let inner_size = self.destination.compute_size(__cache);
2475                    __cache.set(__slot, inner_size);
2476                    size
2477                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2478                            + inner_size;
2479                }
2480                {
2481                    let val = self.status.to_i32();
2482                    if val != 0 {
2483                        size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
2484                    }
2485                }
2486                size += self.__buffa_unknown_fields.encoded_len() as u32;
2487                size
2488            }
2489            #[allow(clippy::needless_borrow)]
2490            fn write_to(
2491                &self,
2492                __cache: &mut ::buffa::SizeCache,
2493                buf: &mut impl ::buffa::bytes::BufMut,
2494            ) {
2495                #[allow(unused_imports)]
2496                use ::buffa::Enumeration as _;
2497                if !self.request_id.is_empty() {
2498                    ::buffa::types::put_string_field(1u32, &self.request_id, buf);
2499                }
2500                if !self.transfer_id.is_empty() {
2501                    ::buffa::types::put_string_field(2u32, &self.transfer_id, buf);
2502                }
2503                if self.accepted_at_ts_ns != 0u64 {
2504                    ::buffa::types::put_uint64_field(3u32, self.accepted_at_ts_ns, buf);
2505                }
2506                if self.asset_id != 0u32 {
2507                    ::buffa::types::put_uint32_field(4u32, self.asset_id, buf);
2508                }
2509                if !self.asset_code.is_empty() {
2510                    ::buffa::types::put_string_field(5u32, &self.asset_code, buf);
2511                }
2512                if !self.u_asset_id.is_empty() {
2513                    ::buffa::types::put_string_field(6u32, &self.u_asset_id, buf);
2514                }
2515                if self.amount_e18.is_set() {
2516                    ::buffa::types::put_len_delimited_header(
2517                        7u32,
2518                        __cache.consume_next(),
2519                        buf,
2520                    );
2521                    self.amount_e18.write_to(__cache, buf);
2522                }
2523                if self.destination.is_set() {
2524                    ::buffa::types::put_len_delimited_header(
2525                        8u32,
2526                        __cache.consume_next(),
2527                        buf,
2528                    );
2529                    self.destination.write_to(__cache, buf);
2530                }
2531                {
2532                    let val = self.status.to_i32();
2533                    if val != 0 {
2534                        ::buffa::types::put_int32_field(9u32, val, buf);
2535                    }
2536                }
2537                self.__buffa_unknown_fields.write_to(buf);
2538            }
2539        }
2540        /// Serializes this view as protobuf JSON.
2541        ///
2542        /// Implicit-presence fields with default values are omitted, `required`
2543        /// fields are always emitted, explicit-presence (`optional`) fields are
2544        /// emitted only when set, bytes fields are base64-encoded, and enum
2545        /// values are their proto name strings.
2546        ///
2547        /// This impl uses `serialize_map(None)` because the number of emitted
2548        /// fields depends on default-omission rules; serializers that require
2549        /// known map lengths (e.g. `bincode`) will return a runtime error.
2550        /// Use the owned message type for those formats.
2551        impl<'__a> ::serde::Serialize for CreateInternalTransferResponseView<'__a> {
2552            fn serialize<__S: ::serde::Serializer>(
2553                &self,
2554                __s: __S,
2555            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2556                use ::serde::ser::SerializeMap as _;
2557                let mut __map = __s.serialize_map(::core::option::Option::None)?;
2558                if !::buffa::json_helpers::skip_if::is_empty_str(self.request_id) {
2559                    __map.serialize_entry("requestId", self.request_id)?;
2560                }
2561                if !::buffa::json_helpers::skip_if::is_empty_str(self.transfer_id) {
2562                    __map.serialize_entry("transferId", self.transfer_id)?;
2563                }
2564                if !::buffa::json_helpers::skip_if::is_zero_u64(
2565                    &self.accepted_at_ts_ns,
2566                ) {
2567                    __map
2568                        .serialize_entry(
2569                            "acceptedAtTsNs",
2570                            &::buffa::json_helpers::ProtoJson(&self.accepted_at_ts_ns),
2571                        )?;
2572                }
2573                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.asset_id) {
2574                    __map
2575                        .serialize_entry(
2576                            "assetId",
2577                            &::buffa::json_helpers::ProtoJson(&self.asset_id),
2578                        )?;
2579                }
2580                if !::buffa::json_helpers::skip_if::is_empty_str(self.asset_code) {
2581                    __map.serialize_entry("assetCode", self.asset_code)?;
2582                }
2583                if !::buffa::json_helpers::skip_if::is_empty_str(self.u_asset_id) {
2584                    __map.serialize_entry("uAssetId", self.u_asset_id)?;
2585                }
2586                {
2587                    if let ::core::option::Option::Some(__v) = self
2588                        .amount_e18
2589                        .as_option()
2590                    {
2591                        __map.serialize_entry("amountE18", __v)?;
2592                    }
2593                }
2594                {
2595                    if let ::core::option::Option::Some(__v) = self
2596                        .destination
2597                        .as_option()
2598                    {
2599                        __map.serialize_entry("destination", __v)?;
2600                    }
2601                }
2602                if !::buffa::json_helpers::skip_if::is_default_enum_value(&self.status) {
2603                    __map.serialize_entry("status", &self.status)?;
2604                }
2605                __map.end()
2606            }
2607        }
2608        impl<'a> ::buffa::MessageName for CreateInternalTransferResponseView<'a> {
2609            const PACKAGE: &'static str = "transfer.v1";
2610            const NAME: &'static str = "CreateInternalTransferResponse";
2611            const FULL_NAME: &'static str = "transfer.v1.CreateInternalTransferResponse";
2612            const TYPE_URL: &'static str = "type.googleapis.com/transfer.v1.CreateInternalTransferResponse";
2613        }
2614        ::buffa::impl_default_view_instance!(CreateInternalTransferResponseView);
2615        ::buffa::impl_view_reborrow!(CreateInternalTransferResponseView);
2616        /** Self-contained, `'static` owned view of a `CreateInternalTransferResponse` message.
2617
2618 Wraps [`::buffa::OwnedView`]`<`[`CreateInternalTransferResponseView`]`<'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.
2619
2620 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`CreateInternalTransferResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
2621        #[derive(Clone, Debug)]
2622        pub struct CreateInternalTransferResponseOwnedView(
2623            ::buffa::OwnedView<CreateInternalTransferResponseView<'static>>,
2624        );
2625        impl CreateInternalTransferResponseOwnedView {
2626            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
2627            ///
2628            /// The view borrows directly from the buffer's data; the buffer is
2629            /// retained inside the returned handle.
2630            ///
2631            /// # Errors
2632            ///
2633            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
2634            /// protobuf data.
2635            pub fn decode(
2636                bytes: ::buffa::bytes::Bytes,
2637            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2638                ::core::result::Result::Ok(
2639                    CreateInternalTransferResponseOwnedView(
2640                        ::buffa::OwnedView::decode(bytes)?,
2641                    ),
2642                )
2643            }
2644            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
2645            /// max message size).
2646            ///
2647            /// # Errors
2648            ///
2649            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
2650            /// exceeds the configured limits.
2651            pub fn decode_with_options(
2652                bytes: ::buffa::bytes::Bytes,
2653                opts: &::buffa::DecodeOptions,
2654            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2655                ::core::result::Result::Ok(
2656                    CreateInternalTransferResponseOwnedView(
2657                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
2658                    ),
2659                )
2660            }
2661            /// Build from an owned message via an encode → decode round-trip.
2662            ///
2663            /// # Errors
2664            ///
2665            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
2666            /// somehow invalid (should not happen for well-formed messages).
2667            pub fn from_owned(
2668                msg: &super::super::CreateInternalTransferResponse,
2669            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2670                ::core::result::Result::Ok(
2671                    CreateInternalTransferResponseOwnedView(
2672                        ::buffa::OwnedView::from_owned(msg)?,
2673                    ),
2674                )
2675            }
2676            /// Borrow the full [`CreateInternalTransferResponseView`] with its lifetime tied to `&self`.
2677            #[must_use]
2678            pub fn view(&self) -> &CreateInternalTransferResponseView<'_> {
2679                self.0.reborrow()
2680            }
2681            /// Convert to the owned message type.
2682            ///
2683            /// # Errors
2684            ///
2685            /// Returns an error if re-materializing preserved unknown fields
2686            /// fails (e.g. the unknown-field limit is exceeded).
2687            pub fn to_owned_message(
2688                &self,
2689            ) -> ::core::result::Result<
2690                super::super::CreateInternalTransferResponse,
2691                ::buffa::DecodeError,
2692            > {
2693                self.0.to_owned_message()
2694            }
2695            /// The underlying bytes buffer.
2696            #[must_use]
2697            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
2698                self.0.bytes()
2699            }
2700            /// Consume the handle, returning the underlying bytes buffer.
2701            #[must_use]
2702            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
2703                self.0.into_bytes()
2704            }
2705            /// Stable server-owned request identifier for this intake.
2706            ///
2707            /// Field 1: `request_id`
2708            #[must_use]
2709            pub fn request_id(&self) -> &'_ str {
2710                self.0.reborrow().request_id
2711            }
2712            /// Stable transfer identifier for the settled internal transfer.
2713            ///
2714            /// Field 2: `transfer_id`
2715            #[must_use]
2716            pub fn transfer_id(&self) -> &'_ str {
2717                self.0.reborrow().transfer_id
2718            }
2719            /// Acceptance timestamp in nanoseconds since epoch (server time).
2720            ///
2721            /// Field 3: `accepted_at_ts_ns`
2722            #[must_use]
2723            pub fn accepted_at_ts_ns(&self) -> u64 {
2724                self.0.reborrow().accepted_at_ts_ns
2725            }
2726            /// Echoed canonical public unified asset id.
2727            ///
2728            /// Field 4: `asset_id`
2729            #[must_use]
2730            pub fn asset_id(&self) -> u32 {
2731                self.0.reborrow().asset_id
2732            }
2733            /// Resolved asset code for convenience.
2734            ///
2735            /// Field 5: `asset_code`
2736            #[must_use]
2737            pub fn asset_code(&self) -> &'_ str {
2738                self.0.reborrow().asset_code
2739            }
2740            /// Resolved unified asset id used by downstream settlement.
2741            ///
2742            /// Field 6: `u_asset_id`
2743            #[must_use]
2744            pub fn u_asset_id(&self) -> &'_ str {
2745                self.0.reborrow().u_asset_id
2746            }
2747            /// Echoed transfer amount in canonical 18-decimal unified asset units.
2748            ///
2749            /// Field 7: `amount_e18`
2750            #[must_use]
2751            pub fn amount_e18(
2752                &self,
2753            ) -> &::buffa::MessageFieldView<
2754                super::super::super::super::polyester::r#type::v1::__buffa::view::U128View<
2755                    '_,
2756                >,
2757            > {
2758                &self.0.reborrow().amount_e18
2759            }
2760            /// Server-resolved destination summary.
2761            ///
2762            /// Field 8: `destination`
2763            #[must_use]
2764            pub fn destination(
2765                &self,
2766            ) -> &::buffa::MessageFieldView<
2767                super::super::__buffa::view::ResolvedDestinationView<'_>,
2768            > {
2769                &self.0.reborrow().destination
2770            }
2771            /// Public status for the transfer request.
2772            ///
2773            /// Field 9: `status`
2774            #[must_use]
2775            pub fn status(
2776                &self,
2777            ) -> ::buffa::EnumValue<super::super::InternalTransferStatus> {
2778                self.0.reborrow().status
2779            }
2780        }
2781        impl ::core::convert::From<
2782            ::buffa::OwnedView<CreateInternalTransferResponseView<'static>>,
2783        > for CreateInternalTransferResponseOwnedView {
2784            fn from(
2785                inner: ::buffa::OwnedView<CreateInternalTransferResponseView<'static>>,
2786            ) -> Self {
2787                CreateInternalTransferResponseOwnedView(inner)
2788            }
2789        }
2790        impl ::core::convert::From<CreateInternalTransferResponseOwnedView>
2791        for ::buffa::OwnedView<CreateInternalTransferResponseView<'static>> {
2792            fn from(wrapper: CreateInternalTransferResponseOwnedView) -> Self {
2793                wrapper.0
2794            }
2795        }
2796        impl ::core::convert::AsRef<
2797            ::buffa::OwnedView<CreateInternalTransferResponseView<'static>>,
2798        > for CreateInternalTransferResponseOwnedView {
2799            fn as_ref(
2800                &self,
2801            ) -> &::buffa::OwnedView<CreateInternalTransferResponseView<'static>> {
2802                &self.0
2803            }
2804        }
2805        impl ::buffa::HasMessageView for super::super::CreateInternalTransferResponse {
2806            type View<'a> = CreateInternalTransferResponseView<'a>;
2807            type ViewHandle = CreateInternalTransferResponseOwnedView;
2808        }
2809        impl ::serde::Serialize for CreateInternalTransferResponseOwnedView {
2810            fn serialize<__S: ::serde::Serializer>(
2811                &self,
2812                __s: __S,
2813            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2814                ::serde::Serialize::serialize(&self.0, __s)
2815            }
2816        }
2817        pub mod oneof {
2818            #[allow(unused_imports)]
2819            use super::*;
2820            pub mod create_internal_transfer_request {
2821                #[allow(unused_imports)]
2822                use super::*;
2823                #[derive(Clone, Debug)]
2824                pub enum Destination<'a> {
2825                    DestinationAccountId(u64),
2826                    DestinationSubaccountId(u64),
2827                    DestinationSmartAccountAddress(&'a str),
2828                }
2829            }
2830        }
2831    }
2832    pub mod oneof {
2833        #[allow(unused_imports)]
2834        use super::*;
2835        pub mod create_internal_transfer_request {
2836            #[allow(unused_imports)]
2837            use super::*;
2838            #[derive(Clone, PartialEq, Debug)]
2839            pub enum Destination {
2840                DestinationAccountId(u64),
2841                DestinationSubaccountId(u64),
2842                DestinationSmartAccountAddress(::buffa::alloc::string::String),
2843            }
2844            impl ::buffa::Oneof for Destination {}
2845            impl serde::Serialize for Destination {
2846                fn serialize<S: serde::Serializer>(
2847                    &self,
2848                    s: S,
2849                ) -> ::core::result::Result<S::Ok, S::Error> {
2850                    use serde::ser::SerializeMap;
2851                    let mut map = s.serialize_map(Some(1))?;
2852                    match self {
2853                        Self::DestinationAccountId(v) => {
2854                            map.serialize_entry(
2855                                "destinationAccountId",
2856                                &::buffa::json_helpers::ProtoJson(v),
2857                            )?;
2858                        }
2859                        Self::DestinationSubaccountId(v) => {
2860                            map.serialize_entry(
2861                                "destinationSubaccountId",
2862                                &::buffa::json_helpers::ProtoJson(v),
2863                            )?;
2864                        }
2865                        Self::DestinationSmartAccountAddress(v) => {
2866                            map.serialize_entry("destinationSmartAccountAddress", v)?;
2867                        }
2868                    }
2869                    map.end()
2870                }
2871            }
2872        }
2873    }
2874    /// Register this package's `Any` type entries and extension entries.
2875    pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
2876        reg.register_json_any(super::__CREATE_INTERNAL_TRANSFER_REQUEST_JSON_ANY);
2877        reg.register_json_any(super::__RESOLVED_DESTINATION_JSON_ANY);
2878        reg.register_json_any(super::__CREATE_INTERNAL_TRANSFER_RESPONSE_JSON_ANY);
2879    }
2880}
2881#[doc(inline)]
2882pub use self::__buffa::view::CreateInternalTransferRequestView;
2883#[doc(inline)]
2884pub use self::__buffa::view::CreateInternalTransferRequestOwnedView;
2885#[doc(inline)]
2886pub use self::__buffa::view::ResolvedDestinationView;
2887#[doc(inline)]
2888pub use self::__buffa::view::ResolvedDestinationOwnedView;
2889#[doc(inline)]
2890pub use self::__buffa::view::CreateInternalTransferResponseView;
2891#[doc(inline)]
2892pub use self::__buffa::view::CreateInternalTransferResponseOwnedView;
2893#[doc(inline)]
2894pub use self::__buffa::register_types;