// @generated by buffa-codegen. DO NOT EDIT.
// source: google/protobuf/wrappers.proto

/// Wrapper message for `double`.
///
/// The JSON representation for `DoubleValue` is JSON number.
#[derive(Clone, Debug, Default)]
pub struct DoubleValueView<'a> {
    /// The double value.
    ///
    /// Field 1: `value`
    pub value: f64,
    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> DoubleValueView<'a> {
    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
    ///
    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
    /// and by generated sub-message decode arms with `depth - 1`.
    ///
    /// **Not part of the public API.** Named with a leading underscore to
    /// signal that it is for generated-code use only.
    #[doc(hidden)]
    pub fn _decode_depth(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        let mut view = Self::default();
        view._merge_into_view(buf, depth)?;
        ::core::result::Result::Ok(view)
    }
    /// Merge fields from `buf` into this view (proto merge semantics).
    ///
    /// Repeated fields append; singular fields last-wins; singular
    /// MESSAGE fields merge recursively. Used by sub-message decode
    /// arms when the same field appears multiple times on the wire.
    ///
    /// **Not part of the public API.**
    #[doc(hidden)]
    pub fn _merge_into_view(
        &mut self,
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
        let _ = depth;
        #[allow(unused_variables)]
        let view = self;
        let mut cur: &'a [u8] = buf;
        while !cur.is_empty() {
            let before_tag = cur;
            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
            match tag.field_number() {
                1u32 => {
                    if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
                            field_number: 1u32,
                            expected: 1u8,
                            actual: tag.wire_type() as u8,
                        });
                    }
                    view.value = ::buffa::types::decode_double(&mut cur)?;
                }
                _ => {
                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
                    let span_len = before_tag.len() - cur.len();
                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
                }
            }
        }
        ::core::result::Result::Ok(())
    }
}
impl<'a> ::buffa::MessageView<'a> for DoubleValueView<'a> {
    type Owned = super::super::DoubleValue;
    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
    }
    fn decode_view_with_limit(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, depth)
    }
    fn to_owned_message(&self) -> super::super::DoubleValue {
        self.to_owned_from_source(None)
    }
    #[allow(clippy::useless_conversion, clippy::needless_update)]
    fn to_owned_from_source(
        &self,
        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
    ) -> super::super::DoubleValue {
        #[allow(unused_imports)]
        use ::buffa::alloc::string::ToString as _;
        let _ = __buffa_src;
        super::super::DoubleValue {
            value: self.value,
            __buffa_unknown_fields: self
                .__buffa_unknown_fields
                .to_owned()
                .unwrap_or_default()
                .into(),
            ..::core::default::Default::default()
        }
    }
}
impl<'a> ::buffa::ViewEncode<'a> for DoubleValueView<'a> {
    #[allow(clippy::needless_borrow, clippy::let_and_return)]
    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        let mut size = 0u32;
        if self.value.to_bits() != 0u64 {
            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
        }
        size += self.__buffa_unknown_fields.encoded_len() as u32;
        size
    }
    #[allow(clippy::needless_borrow)]
    fn write_to(
        &self,
        _cache: &mut ::buffa::SizeCache,
        buf: &mut impl ::buffa::bytes::BufMut,
    ) {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        if self.value.to_bits() != 0u64 {
            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed64)
                .encode(buf);
            ::buffa::types::encode_double(self.value, buf);
        }
        self.__buffa_unknown_fields.write_to(buf);
    }
}
impl<'a> ::buffa::MessageName for DoubleValueView<'a> {
    const PACKAGE: &'static str = "google.protobuf";
    const NAME: &'static str = "DoubleValue";
    const FULL_NAME: &'static str = "google.protobuf.DoubleValue";
    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.DoubleValue";
}
impl<'v> ::buffa::DefaultViewInstance for DoubleValueView<'v> {
    fn default_view_instance<'a>() -> &'a Self
    where
        Self: 'a,
    {
        static VALUE: ::buffa::__private::OnceBox<DoubleValueView<'static>> = ::buffa::__private::OnceBox::new();
        VALUE
            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
                <DoubleValueView<'static>>::default(),
            ))
    }
}
impl ::buffa::ViewReborrow for DoubleValueView<'static> {
    type Reborrowed<'b> = DoubleValueView<'b>;
    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
        this
    }
}
/** Self-contained, `'static` owned view of a `DoubleValue` message.

 Wraps [`::buffa::OwnedView`]`<`[`DoubleValueView`]`<'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.

 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`DoubleValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
#[derive(Clone, Debug)]
pub struct DoubleValueOwnedView(::buffa::OwnedView<DoubleValueView<'static>>);
impl DoubleValueOwnedView {
    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
    ///
    /// The view borrows directly from the buffer's data; the buffer is
    /// retained inside the returned handle.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
    /// protobuf data.
    pub fn decode(
        bytes: ::buffa::bytes::Bytes,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            DoubleValueOwnedView(::buffa::OwnedView::decode(bytes)?),
        )
    }
    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
    /// max message size).
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
    /// exceeds the configured limits.
    pub fn decode_with_options(
        bytes: ::buffa::bytes::Bytes,
        opts: &::buffa::DecodeOptions,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            DoubleValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
        )
    }
    /// Build from an owned message via an encode → decode round-trip.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
    /// somehow invalid (should not happen for well-formed messages).
    pub fn from_owned(
        msg: &super::super::DoubleValue,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            DoubleValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
        )
    }
    /// Borrow the full [`DoubleValueView`] with its lifetime tied to `&self`.
    #[must_use]
    pub fn view(&self) -> &DoubleValueView<'_> {
        self.0.reborrow()
    }
    /// Convert to the owned message type.
    #[must_use]
    pub fn to_owned_message(&self) -> super::super::DoubleValue {
        self.0.to_owned_message()
    }
    /// The underlying bytes buffer.
    #[must_use]
    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
        self.0.bytes()
    }
    /// Consume the handle, returning the underlying bytes buffer.
    #[must_use]
    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
        self.0.into_bytes()
    }
    /// The double value.
    ///
    /// Field 1: `value`
    #[must_use]
    pub fn value(&self) -> f64 {
        self.0.reborrow().value
    }
}
impl ::core::convert::From<::buffa::OwnedView<DoubleValueView<'static>>>
for DoubleValueOwnedView {
    fn from(inner: ::buffa::OwnedView<DoubleValueView<'static>>) -> Self {
        DoubleValueOwnedView(inner)
    }
}
impl ::core::convert::From<DoubleValueOwnedView>
for ::buffa::OwnedView<DoubleValueView<'static>> {
    fn from(wrapper: DoubleValueOwnedView) -> Self {
        wrapper.0
    }
}
impl ::core::convert::AsRef<::buffa::OwnedView<DoubleValueView<'static>>>
for DoubleValueOwnedView {
    fn as_ref(&self) -> &::buffa::OwnedView<DoubleValueView<'static>> {
        &self.0
    }
}
impl ::buffa::HasMessageView for super::super::DoubleValue {
    type View<'a> = DoubleValueView<'a>;
    type ViewHandle = DoubleValueOwnedView;
}
#[cfg(feature = "reflect")]
const _: () = {
    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for DoubleValueView<'a> {
        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
            super::super::__buffa::reflect::descriptor_pool()
                .message(Self::__buffa_reflect_message_index())
        }
        fn pool(
            &self,
        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
            super::super::__buffa::reflect::descriptor_pool()
        }
        fn get(
            &self,
            field: &::buffa_descriptor::FieldDescriptor,
        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            #[allow(unused_imports)]
            use ::buffa::Enumeration as _;
            match field.number() {
                1u32 => ::buffa_descriptor::reflect::ValueRef::F64(self.value),
                _ => {
                    ::core::debug_assert!(
                        false,
                        "field number {} is not a member of this view's reflect get()",
                        field.number(),
                    );
                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
                }
            }
        }
        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
            match field.number() {
                1u32 => self.value != 0.0,
                _ => false,
            }
        }
        fn for_each_set(
            &self,
            f: &mut dyn ::core::ops::FnMut(
                &::buffa_descriptor::FieldDescriptor,
                ::buffa_descriptor::reflect::ValueRef<'_>,
            ),
        ) {
            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
                self,
            );
            for fd in md.fields() {
                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
                }
            }
        }
        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
            ::buffa_descriptor::reflect::DynamicMessage::decode(
                    ::buffa::alloc::sync::Arc::clone(
                        super::super::__buffa::reflect::descriptor_pool(),
                    ),
                    Self::__buffa_reflect_message_index(),
                    &bytes,
                )
                .expect("view re-encodes to bytes decodable against its own descriptor")
        }
    }
    impl<'a> ::buffa_descriptor::reflect::ReflectElement for DoubleValueView<'a> {
        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            ::buffa_descriptor::reflect::ValueRef::Message(
                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
            )
        }
    }
    impl<'a> DoubleValueView<'a> {
        /// Memoized `MessageIndex` for this view's message type, resolved
        /// once against the package's embedded descriptor pool. An inherent
        /// associated fn (not a free fn) so sibling views in the same module
        /// do not collide.
        #[doc(hidden)]
        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
            *IDX
                .get_or_init(|| {
                    super::super::__buffa::reflect::descriptor_pool()
                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
                        .expect(
                            "generated view type is registered in the embedded descriptor pool",
                        )
                })
        }
    }
};
/// Wrapper message for `float`.
///
/// The JSON representation for `FloatValue` is JSON number.
#[derive(Clone, Debug, Default)]
pub struct FloatValueView<'a> {
    /// The float value.
    ///
    /// Field 1: `value`
    pub value: f32,
    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> FloatValueView<'a> {
    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
    ///
    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
    /// and by generated sub-message decode arms with `depth - 1`.
    ///
    /// **Not part of the public API.** Named with a leading underscore to
    /// signal that it is for generated-code use only.
    #[doc(hidden)]
    pub fn _decode_depth(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        let mut view = Self::default();
        view._merge_into_view(buf, depth)?;
        ::core::result::Result::Ok(view)
    }
    /// Merge fields from `buf` into this view (proto merge semantics).
    ///
    /// Repeated fields append; singular fields last-wins; singular
    /// MESSAGE fields merge recursively. Used by sub-message decode
    /// arms when the same field appears multiple times on the wire.
    ///
    /// **Not part of the public API.**
    #[doc(hidden)]
    pub fn _merge_into_view(
        &mut self,
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
        let _ = depth;
        #[allow(unused_variables)]
        let view = self;
        let mut cur: &'a [u8] = buf;
        while !cur.is_empty() {
            let before_tag = cur;
            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
            match tag.field_number() {
                1u32 => {
                    if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
                            field_number: 1u32,
                            expected: 5u8,
                            actual: tag.wire_type() as u8,
                        });
                    }
                    view.value = ::buffa::types::decode_float(&mut cur)?;
                }
                _ => {
                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
                    let span_len = before_tag.len() - cur.len();
                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
                }
            }
        }
        ::core::result::Result::Ok(())
    }
}
impl<'a> ::buffa::MessageView<'a> for FloatValueView<'a> {
    type Owned = super::super::FloatValue;
    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
    }
    fn decode_view_with_limit(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, depth)
    }
    fn to_owned_message(&self) -> super::super::FloatValue {
        self.to_owned_from_source(None)
    }
    #[allow(clippy::useless_conversion, clippy::needless_update)]
    fn to_owned_from_source(
        &self,
        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
    ) -> super::super::FloatValue {
        #[allow(unused_imports)]
        use ::buffa::alloc::string::ToString as _;
        let _ = __buffa_src;
        super::super::FloatValue {
            value: self.value,
            __buffa_unknown_fields: self
                .__buffa_unknown_fields
                .to_owned()
                .unwrap_or_default()
                .into(),
            ..::core::default::Default::default()
        }
    }
}
impl<'a> ::buffa::ViewEncode<'a> for FloatValueView<'a> {
    #[allow(clippy::needless_borrow, clippy::let_and_return)]
    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        let mut size = 0u32;
        if self.value.to_bits() != 0u32 {
            size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
        }
        size += self.__buffa_unknown_fields.encoded_len() as u32;
        size
    }
    #[allow(clippy::needless_borrow)]
    fn write_to(
        &self,
        _cache: &mut ::buffa::SizeCache,
        buf: &mut impl ::buffa::bytes::BufMut,
    ) {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        if self.value.to_bits() != 0u32 {
            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed32)
                .encode(buf);
            ::buffa::types::encode_float(self.value, buf);
        }
        self.__buffa_unknown_fields.write_to(buf);
    }
}
impl<'a> ::buffa::MessageName for FloatValueView<'a> {
    const PACKAGE: &'static str = "google.protobuf";
    const NAME: &'static str = "FloatValue";
    const FULL_NAME: &'static str = "google.protobuf.FloatValue";
    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.FloatValue";
}
impl<'v> ::buffa::DefaultViewInstance for FloatValueView<'v> {
    fn default_view_instance<'a>() -> &'a Self
    where
        Self: 'a,
    {
        static VALUE: ::buffa::__private::OnceBox<FloatValueView<'static>> = ::buffa::__private::OnceBox::new();
        VALUE
            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
                <FloatValueView<'static>>::default(),
            ))
    }
}
impl ::buffa::ViewReborrow for FloatValueView<'static> {
    type Reborrowed<'b> = FloatValueView<'b>;
    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
        this
    }
}
/** Self-contained, `'static` owned view of a `FloatValue` message.

 Wraps [`::buffa::OwnedView`]`<`[`FloatValueView`]`<'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.

 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`FloatValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
#[derive(Clone, Debug)]
pub struct FloatValueOwnedView(::buffa::OwnedView<FloatValueView<'static>>);
impl FloatValueOwnedView {
    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
    ///
    /// The view borrows directly from the buffer's data; the buffer is
    /// retained inside the returned handle.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
    /// protobuf data.
    pub fn decode(
        bytes: ::buffa::bytes::Bytes,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            FloatValueOwnedView(::buffa::OwnedView::decode(bytes)?),
        )
    }
    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
    /// max message size).
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
    /// exceeds the configured limits.
    pub fn decode_with_options(
        bytes: ::buffa::bytes::Bytes,
        opts: &::buffa::DecodeOptions,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            FloatValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
        )
    }
    /// Build from an owned message via an encode → decode round-trip.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
    /// somehow invalid (should not happen for well-formed messages).
    pub fn from_owned(
        msg: &super::super::FloatValue,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            FloatValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
        )
    }
    /// Borrow the full [`FloatValueView`] with its lifetime tied to `&self`.
    #[must_use]
    pub fn view(&self) -> &FloatValueView<'_> {
        self.0.reborrow()
    }
    /// Convert to the owned message type.
    #[must_use]
    pub fn to_owned_message(&self) -> super::super::FloatValue {
        self.0.to_owned_message()
    }
    /// The underlying bytes buffer.
    #[must_use]
    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
        self.0.bytes()
    }
    /// Consume the handle, returning the underlying bytes buffer.
    #[must_use]
    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
        self.0.into_bytes()
    }
    /// The float value.
    ///
    /// Field 1: `value`
    #[must_use]
    pub fn value(&self) -> f32 {
        self.0.reborrow().value
    }
}
impl ::core::convert::From<::buffa::OwnedView<FloatValueView<'static>>>
for FloatValueOwnedView {
    fn from(inner: ::buffa::OwnedView<FloatValueView<'static>>) -> Self {
        FloatValueOwnedView(inner)
    }
}
impl ::core::convert::From<FloatValueOwnedView>
for ::buffa::OwnedView<FloatValueView<'static>> {
    fn from(wrapper: FloatValueOwnedView) -> Self {
        wrapper.0
    }
}
impl ::core::convert::AsRef<::buffa::OwnedView<FloatValueView<'static>>>
for FloatValueOwnedView {
    fn as_ref(&self) -> &::buffa::OwnedView<FloatValueView<'static>> {
        &self.0
    }
}
impl ::buffa::HasMessageView for super::super::FloatValue {
    type View<'a> = FloatValueView<'a>;
    type ViewHandle = FloatValueOwnedView;
}
#[cfg(feature = "reflect")]
const _: () = {
    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for FloatValueView<'a> {
        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
            super::super::__buffa::reflect::descriptor_pool()
                .message(Self::__buffa_reflect_message_index())
        }
        fn pool(
            &self,
        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
            super::super::__buffa::reflect::descriptor_pool()
        }
        fn get(
            &self,
            field: &::buffa_descriptor::FieldDescriptor,
        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            #[allow(unused_imports)]
            use ::buffa::Enumeration as _;
            match field.number() {
                1u32 => ::buffa_descriptor::reflect::ValueRef::F32(self.value),
                _ => {
                    ::core::debug_assert!(
                        false,
                        "field number {} is not a member of this view's reflect get()",
                        field.number(),
                    );
                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
                }
            }
        }
        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
            match field.number() {
                1u32 => self.value != 0.0,
                _ => false,
            }
        }
        fn for_each_set(
            &self,
            f: &mut dyn ::core::ops::FnMut(
                &::buffa_descriptor::FieldDescriptor,
                ::buffa_descriptor::reflect::ValueRef<'_>,
            ),
        ) {
            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
                self,
            );
            for fd in md.fields() {
                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
                }
            }
        }
        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
            ::buffa_descriptor::reflect::DynamicMessage::decode(
                    ::buffa::alloc::sync::Arc::clone(
                        super::super::__buffa::reflect::descriptor_pool(),
                    ),
                    Self::__buffa_reflect_message_index(),
                    &bytes,
                )
                .expect("view re-encodes to bytes decodable against its own descriptor")
        }
    }
    impl<'a> ::buffa_descriptor::reflect::ReflectElement for FloatValueView<'a> {
        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            ::buffa_descriptor::reflect::ValueRef::Message(
                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
            )
        }
    }
    impl<'a> FloatValueView<'a> {
        /// Memoized `MessageIndex` for this view's message type, resolved
        /// once against the package's embedded descriptor pool. An inherent
        /// associated fn (not a free fn) so sibling views in the same module
        /// do not collide.
        #[doc(hidden)]
        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
            *IDX
                .get_or_init(|| {
                    super::super::__buffa::reflect::descriptor_pool()
                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
                        .expect(
                            "generated view type is registered in the embedded descriptor pool",
                        )
                })
        }
    }
};
/// Wrapper message for `int64`.
///
/// The JSON representation for `Int64Value` is JSON string.
#[derive(Clone, Debug, Default)]
pub struct Int64ValueView<'a> {
    /// The int64 value.
    ///
    /// Field 1: `value`
    pub value: i64,
    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> Int64ValueView<'a> {
    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
    ///
    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
    /// and by generated sub-message decode arms with `depth - 1`.
    ///
    /// **Not part of the public API.** Named with a leading underscore to
    /// signal that it is for generated-code use only.
    #[doc(hidden)]
    pub fn _decode_depth(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        let mut view = Self::default();
        view._merge_into_view(buf, depth)?;
        ::core::result::Result::Ok(view)
    }
    /// Merge fields from `buf` into this view (proto merge semantics).
    ///
    /// Repeated fields append; singular fields last-wins; singular
    /// MESSAGE fields merge recursively. Used by sub-message decode
    /// arms when the same field appears multiple times on the wire.
    ///
    /// **Not part of the public API.**
    #[doc(hidden)]
    pub fn _merge_into_view(
        &mut self,
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
        let _ = depth;
        #[allow(unused_variables)]
        let view = self;
        let mut cur: &'a [u8] = buf;
        while !cur.is_empty() {
            let before_tag = cur;
            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
            match tag.field_number() {
                1u32 => {
                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
                            field_number: 1u32,
                            expected: 0u8,
                            actual: tag.wire_type() as u8,
                        });
                    }
                    view.value = ::buffa::types::decode_int64(&mut cur)?;
                }
                _ => {
                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
                    let span_len = before_tag.len() - cur.len();
                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
                }
            }
        }
        ::core::result::Result::Ok(())
    }
}
impl<'a> ::buffa::MessageView<'a> for Int64ValueView<'a> {
    type Owned = super::super::Int64Value;
    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
    }
    fn decode_view_with_limit(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, depth)
    }
    fn to_owned_message(&self) -> super::super::Int64Value {
        self.to_owned_from_source(None)
    }
    #[allow(clippy::useless_conversion, clippy::needless_update)]
    fn to_owned_from_source(
        &self,
        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
    ) -> super::super::Int64Value {
        #[allow(unused_imports)]
        use ::buffa::alloc::string::ToString as _;
        let _ = __buffa_src;
        super::super::Int64Value {
            value: self.value,
            __buffa_unknown_fields: self
                .__buffa_unknown_fields
                .to_owned()
                .unwrap_or_default()
                .into(),
            ..::core::default::Default::default()
        }
    }
}
impl<'a> ::buffa::ViewEncode<'a> for Int64ValueView<'a> {
    #[allow(clippy::needless_borrow, clippy::let_and_return)]
    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        let mut size = 0u32;
        if self.value != 0i64 {
            size += 1u32 + ::buffa::types::int64_encoded_len(self.value) as u32;
        }
        size += self.__buffa_unknown_fields.encoded_len() as u32;
        size
    }
    #[allow(clippy::needless_borrow)]
    fn write_to(
        &self,
        _cache: &mut ::buffa::SizeCache,
        buf: &mut impl ::buffa::bytes::BufMut,
    ) {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        if self.value != 0i64 {
            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
                .encode(buf);
            ::buffa::types::encode_int64(self.value, buf);
        }
        self.__buffa_unknown_fields.write_to(buf);
    }
}
impl<'a> ::buffa::MessageName for Int64ValueView<'a> {
    const PACKAGE: &'static str = "google.protobuf";
    const NAME: &'static str = "Int64Value";
    const FULL_NAME: &'static str = "google.protobuf.Int64Value";
    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.Int64Value";
}
impl<'v> ::buffa::DefaultViewInstance for Int64ValueView<'v> {
    fn default_view_instance<'a>() -> &'a Self
    where
        Self: 'a,
    {
        static VALUE: ::buffa::__private::OnceBox<Int64ValueView<'static>> = ::buffa::__private::OnceBox::new();
        VALUE
            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
                <Int64ValueView<'static>>::default(),
            ))
    }
}
impl ::buffa::ViewReborrow for Int64ValueView<'static> {
    type Reborrowed<'b> = Int64ValueView<'b>;
    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
        this
    }
}
/** Self-contained, `'static` owned view of a `Int64Value` message.

 Wraps [`::buffa::OwnedView`]`<`[`Int64ValueView`]`<'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.

 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`Int64ValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
#[derive(Clone, Debug)]
pub struct Int64ValueOwnedView(::buffa::OwnedView<Int64ValueView<'static>>);
impl Int64ValueOwnedView {
    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
    ///
    /// The view borrows directly from the buffer's data; the buffer is
    /// retained inside the returned handle.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
    /// protobuf data.
    pub fn decode(
        bytes: ::buffa::bytes::Bytes,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            Int64ValueOwnedView(::buffa::OwnedView::decode(bytes)?),
        )
    }
    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
    /// max message size).
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
    /// exceeds the configured limits.
    pub fn decode_with_options(
        bytes: ::buffa::bytes::Bytes,
        opts: &::buffa::DecodeOptions,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            Int64ValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
        )
    }
    /// Build from an owned message via an encode → decode round-trip.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
    /// somehow invalid (should not happen for well-formed messages).
    pub fn from_owned(
        msg: &super::super::Int64Value,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            Int64ValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
        )
    }
    /// Borrow the full [`Int64ValueView`] with its lifetime tied to `&self`.
    #[must_use]
    pub fn view(&self) -> &Int64ValueView<'_> {
        self.0.reborrow()
    }
    /// Convert to the owned message type.
    #[must_use]
    pub fn to_owned_message(&self) -> super::super::Int64Value {
        self.0.to_owned_message()
    }
    /// The underlying bytes buffer.
    #[must_use]
    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
        self.0.bytes()
    }
    /// Consume the handle, returning the underlying bytes buffer.
    #[must_use]
    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
        self.0.into_bytes()
    }
    /// The int64 value.
    ///
    /// Field 1: `value`
    #[must_use]
    pub fn value(&self) -> i64 {
        self.0.reborrow().value
    }
}
impl ::core::convert::From<::buffa::OwnedView<Int64ValueView<'static>>>
for Int64ValueOwnedView {
    fn from(inner: ::buffa::OwnedView<Int64ValueView<'static>>) -> Self {
        Int64ValueOwnedView(inner)
    }
}
impl ::core::convert::From<Int64ValueOwnedView>
for ::buffa::OwnedView<Int64ValueView<'static>> {
    fn from(wrapper: Int64ValueOwnedView) -> Self {
        wrapper.0
    }
}
impl ::core::convert::AsRef<::buffa::OwnedView<Int64ValueView<'static>>>
for Int64ValueOwnedView {
    fn as_ref(&self) -> &::buffa::OwnedView<Int64ValueView<'static>> {
        &self.0
    }
}
impl ::buffa::HasMessageView for super::super::Int64Value {
    type View<'a> = Int64ValueView<'a>;
    type ViewHandle = Int64ValueOwnedView;
}
#[cfg(feature = "reflect")]
const _: () = {
    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for Int64ValueView<'a> {
        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
            super::super::__buffa::reflect::descriptor_pool()
                .message(Self::__buffa_reflect_message_index())
        }
        fn pool(
            &self,
        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
            super::super::__buffa::reflect::descriptor_pool()
        }
        fn get(
            &self,
            field: &::buffa_descriptor::FieldDescriptor,
        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            #[allow(unused_imports)]
            use ::buffa::Enumeration as _;
            match field.number() {
                1u32 => ::buffa_descriptor::reflect::ValueRef::I64(self.value),
                _ => {
                    ::core::debug_assert!(
                        false,
                        "field number {} is not a member of this view's reflect get()",
                        field.number(),
                    );
                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
                }
            }
        }
        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
            match field.number() {
                1u32 => self.value != 0,
                _ => false,
            }
        }
        fn for_each_set(
            &self,
            f: &mut dyn ::core::ops::FnMut(
                &::buffa_descriptor::FieldDescriptor,
                ::buffa_descriptor::reflect::ValueRef<'_>,
            ),
        ) {
            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
                self,
            );
            for fd in md.fields() {
                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
                }
            }
        }
        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
            ::buffa_descriptor::reflect::DynamicMessage::decode(
                    ::buffa::alloc::sync::Arc::clone(
                        super::super::__buffa::reflect::descriptor_pool(),
                    ),
                    Self::__buffa_reflect_message_index(),
                    &bytes,
                )
                .expect("view re-encodes to bytes decodable against its own descriptor")
        }
    }
    impl<'a> ::buffa_descriptor::reflect::ReflectElement for Int64ValueView<'a> {
        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            ::buffa_descriptor::reflect::ValueRef::Message(
                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
            )
        }
    }
    impl<'a> Int64ValueView<'a> {
        /// Memoized `MessageIndex` for this view's message type, resolved
        /// once against the package's embedded descriptor pool. An inherent
        /// associated fn (not a free fn) so sibling views in the same module
        /// do not collide.
        #[doc(hidden)]
        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
            *IDX
                .get_or_init(|| {
                    super::super::__buffa::reflect::descriptor_pool()
                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
                        .expect(
                            "generated view type is registered in the embedded descriptor pool",
                        )
                })
        }
    }
};
/// Wrapper message for `uint64`.
///
/// The JSON representation for `UInt64Value` is JSON string.
#[derive(Clone, Debug, Default)]
pub struct UInt64ValueView<'a> {
    /// The uint64 value.
    ///
    /// Field 1: `value`
    pub value: u64,
    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> UInt64ValueView<'a> {
    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
    ///
    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
    /// and by generated sub-message decode arms with `depth - 1`.
    ///
    /// **Not part of the public API.** Named with a leading underscore to
    /// signal that it is for generated-code use only.
    #[doc(hidden)]
    pub fn _decode_depth(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        let mut view = Self::default();
        view._merge_into_view(buf, depth)?;
        ::core::result::Result::Ok(view)
    }
    /// Merge fields from `buf` into this view (proto merge semantics).
    ///
    /// Repeated fields append; singular fields last-wins; singular
    /// MESSAGE fields merge recursively. Used by sub-message decode
    /// arms when the same field appears multiple times on the wire.
    ///
    /// **Not part of the public API.**
    #[doc(hidden)]
    pub fn _merge_into_view(
        &mut self,
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
        let _ = depth;
        #[allow(unused_variables)]
        let view = self;
        let mut cur: &'a [u8] = buf;
        while !cur.is_empty() {
            let before_tag = cur;
            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
            match tag.field_number() {
                1u32 => {
                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
                            field_number: 1u32,
                            expected: 0u8,
                            actual: tag.wire_type() as u8,
                        });
                    }
                    view.value = ::buffa::types::decode_uint64(&mut cur)?;
                }
                _ => {
                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
                    let span_len = before_tag.len() - cur.len();
                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
                }
            }
        }
        ::core::result::Result::Ok(())
    }
}
impl<'a> ::buffa::MessageView<'a> for UInt64ValueView<'a> {
    type Owned = super::super::UInt64Value;
    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
    }
    fn decode_view_with_limit(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, depth)
    }
    fn to_owned_message(&self) -> super::super::UInt64Value {
        self.to_owned_from_source(None)
    }
    #[allow(clippy::useless_conversion, clippy::needless_update)]
    fn to_owned_from_source(
        &self,
        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
    ) -> super::super::UInt64Value {
        #[allow(unused_imports)]
        use ::buffa::alloc::string::ToString as _;
        let _ = __buffa_src;
        super::super::UInt64Value {
            value: self.value,
            __buffa_unknown_fields: self
                .__buffa_unknown_fields
                .to_owned()
                .unwrap_or_default()
                .into(),
            ..::core::default::Default::default()
        }
    }
}
impl<'a> ::buffa::ViewEncode<'a> for UInt64ValueView<'a> {
    #[allow(clippy::needless_borrow, clippy::let_and_return)]
    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        let mut size = 0u32;
        if self.value != 0u64 {
            size += 1u32 + ::buffa::types::uint64_encoded_len(self.value) as u32;
        }
        size += self.__buffa_unknown_fields.encoded_len() as u32;
        size
    }
    #[allow(clippy::needless_borrow)]
    fn write_to(
        &self,
        _cache: &mut ::buffa::SizeCache,
        buf: &mut impl ::buffa::bytes::BufMut,
    ) {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        if self.value != 0u64 {
            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
                .encode(buf);
            ::buffa::types::encode_uint64(self.value, buf);
        }
        self.__buffa_unknown_fields.write_to(buf);
    }
}
impl<'a> ::buffa::MessageName for UInt64ValueView<'a> {
    const PACKAGE: &'static str = "google.protobuf";
    const NAME: &'static str = "UInt64Value";
    const FULL_NAME: &'static str = "google.protobuf.UInt64Value";
    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UInt64Value";
}
impl<'v> ::buffa::DefaultViewInstance for UInt64ValueView<'v> {
    fn default_view_instance<'a>() -> &'a Self
    where
        Self: 'a,
    {
        static VALUE: ::buffa::__private::OnceBox<UInt64ValueView<'static>> = ::buffa::__private::OnceBox::new();
        VALUE
            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
                <UInt64ValueView<'static>>::default(),
            ))
    }
}
impl ::buffa::ViewReborrow for UInt64ValueView<'static> {
    type Reborrowed<'b> = UInt64ValueView<'b>;
    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
        this
    }
}
/** Self-contained, `'static` owned view of a `UInt64Value` message.

 Wraps [`::buffa::OwnedView`]`<`[`UInt64ValueView`]`<'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.

 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`UInt64ValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
#[derive(Clone, Debug)]
pub struct UInt64ValueOwnedView(::buffa::OwnedView<UInt64ValueView<'static>>);
impl UInt64ValueOwnedView {
    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
    ///
    /// The view borrows directly from the buffer's data; the buffer is
    /// retained inside the returned handle.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
    /// protobuf data.
    pub fn decode(
        bytes: ::buffa::bytes::Bytes,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            UInt64ValueOwnedView(::buffa::OwnedView::decode(bytes)?),
        )
    }
    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
    /// max message size).
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
    /// exceeds the configured limits.
    pub fn decode_with_options(
        bytes: ::buffa::bytes::Bytes,
        opts: &::buffa::DecodeOptions,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            UInt64ValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
        )
    }
    /// Build from an owned message via an encode → decode round-trip.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
    /// somehow invalid (should not happen for well-formed messages).
    pub fn from_owned(
        msg: &super::super::UInt64Value,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            UInt64ValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
        )
    }
    /// Borrow the full [`UInt64ValueView`] with its lifetime tied to `&self`.
    #[must_use]
    pub fn view(&self) -> &UInt64ValueView<'_> {
        self.0.reborrow()
    }
    /// Convert to the owned message type.
    #[must_use]
    pub fn to_owned_message(&self) -> super::super::UInt64Value {
        self.0.to_owned_message()
    }
    /// The underlying bytes buffer.
    #[must_use]
    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
        self.0.bytes()
    }
    /// Consume the handle, returning the underlying bytes buffer.
    #[must_use]
    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
        self.0.into_bytes()
    }
    /// The uint64 value.
    ///
    /// Field 1: `value`
    #[must_use]
    pub fn value(&self) -> u64 {
        self.0.reborrow().value
    }
}
impl ::core::convert::From<::buffa::OwnedView<UInt64ValueView<'static>>>
for UInt64ValueOwnedView {
    fn from(inner: ::buffa::OwnedView<UInt64ValueView<'static>>) -> Self {
        UInt64ValueOwnedView(inner)
    }
}
impl ::core::convert::From<UInt64ValueOwnedView>
for ::buffa::OwnedView<UInt64ValueView<'static>> {
    fn from(wrapper: UInt64ValueOwnedView) -> Self {
        wrapper.0
    }
}
impl ::core::convert::AsRef<::buffa::OwnedView<UInt64ValueView<'static>>>
for UInt64ValueOwnedView {
    fn as_ref(&self) -> &::buffa::OwnedView<UInt64ValueView<'static>> {
        &self.0
    }
}
impl ::buffa::HasMessageView for super::super::UInt64Value {
    type View<'a> = UInt64ValueView<'a>;
    type ViewHandle = UInt64ValueOwnedView;
}
#[cfg(feature = "reflect")]
const _: () = {
    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for UInt64ValueView<'a> {
        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
            super::super::__buffa::reflect::descriptor_pool()
                .message(Self::__buffa_reflect_message_index())
        }
        fn pool(
            &self,
        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
            super::super::__buffa::reflect::descriptor_pool()
        }
        fn get(
            &self,
            field: &::buffa_descriptor::FieldDescriptor,
        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            #[allow(unused_imports)]
            use ::buffa::Enumeration as _;
            match field.number() {
                1u32 => ::buffa_descriptor::reflect::ValueRef::U64(self.value),
                _ => {
                    ::core::debug_assert!(
                        false,
                        "field number {} is not a member of this view's reflect get()",
                        field.number(),
                    );
                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
                }
            }
        }
        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
            match field.number() {
                1u32 => self.value != 0,
                _ => false,
            }
        }
        fn for_each_set(
            &self,
            f: &mut dyn ::core::ops::FnMut(
                &::buffa_descriptor::FieldDescriptor,
                ::buffa_descriptor::reflect::ValueRef<'_>,
            ),
        ) {
            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
                self,
            );
            for fd in md.fields() {
                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
                }
            }
        }
        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
            ::buffa_descriptor::reflect::DynamicMessage::decode(
                    ::buffa::alloc::sync::Arc::clone(
                        super::super::__buffa::reflect::descriptor_pool(),
                    ),
                    Self::__buffa_reflect_message_index(),
                    &bytes,
                )
                .expect("view re-encodes to bytes decodable against its own descriptor")
        }
    }
    impl<'a> ::buffa_descriptor::reflect::ReflectElement for UInt64ValueView<'a> {
        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            ::buffa_descriptor::reflect::ValueRef::Message(
                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
            )
        }
    }
    impl<'a> UInt64ValueView<'a> {
        /// Memoized `MessageIndex` for this view's message type, resolved
        /// once against the package's embedded descriptor pool. An inherent
        /// associated fn (not a free fn) so sibling views in the same module
        /// do not collide.
        #[doc(hidden)]
        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
            *IDX
                .get_or_init(|| {
                    super::super::__buffa::reflect::descriptor_pool()
                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
                        .expect(
                            "generated view type is registered in the embedded descriptor pool",
                        )
                })
        }
    }
};
/// Wrapper message for `int32`.
///
/// The JSON representation for `Int32Value` is JSON number.
#[derive(Clone, Debug, Default)]
pub struct Int32ValueView<'a> {
    /// The int32 value.
    ///
    /// Field 1: `value`
    pub value: i32,
    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> Int32ValueView<'a> {
    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
    ///
    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
    /// and by generated sub-message decode arms with `depth - 1`.
    ///
    /// **Not part of the public API.** Named with a leading underscore to
    /// signal that it is for generated-code use only.
    #[doc(hidden)]
    pub fn _decode_depth(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        let mut view = Self::default();
        view._merge_into_view(buf, depth)?;
        ::core::result::Result::Ok(view)
    }
    /// Merge fields from `buf` into this view (proto merge semantics).
    ///
    /// Repeated fields append; singular fields last-wins; singular
    /// MESSAGE fields merge recursively. Used by sub-message decode
    /// arms when the same field appears multiple times on the wire.
    ///
    /// **Not part of the public API.**
    #[doc(hidden)]
    pub fn _merge_into_view(
        &mut self,
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
        let _ = depth;
        #[allow(unused_variables)]
        let view = self;
        let mut cur: &'a [u8] = buf;
        while !cur.is_empty() {
            let before_tag = cur;
            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
            match tag.field_number() {
                1u32 => {
                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
                            field_number: 1u32,
                            expected: 0u8,
                            actual: tag.wire_type() as u8,
                        });
                    }
                    view.value = ::buffa::types::decode_int32(&mut cur)?;
                }
                _ => {
                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
                    let span_len = before_tag.len() - cur.len();
                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
                }
            }
        }
        ::core::result::Result::Ok(())
    }
}
impl<'a> ::buffa::MessageView<'a> for Int32ValueView<'a> {
    type Owned = super::super::Int32Value;
    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
    }
    fn decode_view_with_limit(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, depth)
    }
    fn to_owned_message(&self) -> super::super::Int32Value {
        self.to_owned_from_source(None)
    }
    #[allow(clippy::useless_conversion, clippy::needless_update)]
    fn to_owned_from_source(
        &self,
        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
    ) -> super::super::Int32Value {
        #[allow(unused_imports)]
        use ::buffa::alloc::string::ToString as _;
        let _ = __buffa_src;
        super::super::Int32Value {
            value: self.value,
            __buffa_unknown_fields: self
                .__buffa_unknown_fields
                .to_owned()
                .unwrap_or_default()
                .into(),
            ..::core::default::Default::default()
        }
    }
}
impl<'a> ::buffa::ViewEncode<'a> for Int32ValueView<'a> {
    #[allow(clippy::needless_borrow, clippy::let_and_return)]
    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        let mut size = 0u32;
        if self.value != 0i32 {
            size += 1u32 + ::buffa::types::int32_encoded_len(self.value) as u32;
        }
        size += self.__buffa_unknown_fields.encoded_len() as u32;
        size
    }
    #[allow(clippy::needless_borrow)]
    fn write_to(
        &self,
        _cache: &mut ::buffa::SizeCache,
        buf: &mut impl ::buffa::bytes::BufMut,
    ) {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        if self.value != 0i32 {
            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
                .encode(buf);
            ::buffa::types::encode_int32(self.value, buf);
        }
        self.__buffa_unknown_fields.write_to(buf);
    }
}
impl<'a> ::buffa::MessageName for Int32ValueView<'a> {
    const PACKAGE: &'static str = "google.protobuf";
    const NAME: &'static str = "Int32Value";
    const FULL_NAME: &'static str = "google.protobuf.Int32Value";
    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.Int32Value";
}
impl<'v> ::buffa::DefaultViewInstance for Int32ValueView<'v> {
    fn default_view_instance<'a>() -> &'a Self
    where
        Self: 'a,
    {
        static VALUE: ::buffa::__private::OnceBox<Int32ValueView<'static>> = ::buffa::__private::OnceBox::new();
        VALUE
            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
                <Int32ValueView<'static>>::default(),
            ))
    }
}
impl ::buffa::ViewReborrow for Int32ValueView<'static> {
    type Reborrowed<'b> = Int32ValueView<'b>;
    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
        this
    }
}
/** Self-contained, `'static` owned view of a `Int32Value` message.

 Wraps [`::buffa::OwnedView`]`<`[`Int32ValueView`]`<'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.

 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`Int32ValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
#[derive(Clone, Debug)]
pub struct Int32ValueOwnedView(::buffa::OwnedView<Int32ValueView<'static>>);
impl Int32ValueOwnedView {
    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
    ///
    /// The view borrows directly from the buffer's data; the buffer is
    /// retained inside the returned handle.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
    /// protobuf data.
    pub fn decode(
        bytes: ::buffa::bytes::Bytes,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            Int32ValueOwnedView(::buffa::OwnedView::decode(bytes)?),
        )
    }
    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
    /// max message size).
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
    /// exceeds the configured limits.
    pub fn decode_with_options(
        bytes: ::buffa::bytes::Bytes,
        opts: &::buffa::DecodeOptions,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            Int32ValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
        )
    }
    /// Build from an owned message via an encode → decode round-trip.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
    /// somehow invalid (should not happen for well-formed messages).
    pub fn from_owned(
        msg: &super::super::Int32Value,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            Int32ValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
        )
    }
    /// Borrow the full [`Int32ValueView`] with its lifetime tied to `&self`.
    #[must_use]
    pub fn view(&self) -> &Int32ValueView<'_> {
        self.0.reborrow()
    }
    /// Convert to the owned message type.
    #[must_use]
    pub fn to_owned_message(&self) -> super::super::Int32Value {
        self.0.to_owned_message()
    }
    /// The underlying bytes buffer.
    #[must_use]
    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
        self.0.bytes()
    }
    /// Consume the handle, returning the underlying bytes buffer.
    #[must_use]
    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
        self.0.into_bytes()
    }
    /// The int32 value.
    ///
    /// Field 1: `value`
    #[must_use]
    pub fn value(&self) -> i32 {
        self.0.reborrow().value
    }
}
impl ::core::convert::From<::buffa::OwnedView<Int32ValueView<'static>>>
for Int32ValueOwnedView {
    fn from(inner: ::buffa::OwnedView<Int32ValueView<'static>>) -> Self {
        Int32ValueOwnedView(inner)
    }
}
impl ::core::convert::From<Int32ValueOwnedView>
for ::buffa::OwnedView<Int32ValueView<'static>> {
    fn from(wrapper: Int32ValueOwnedView) -> Self {
        wrapper.0
    }
}
impl ::core::convert::AsRef<::buffa::OwnedView<Int32ValueView<'static>>>
for Int32ValueOwnedView {
    fn as_ref(&self) -> &::buffa::OwnedView<Int32ValueView<'static>> {
        &self.0
    }
}
impl ::buffa::HasMessageView for super::super::Int32Value {
    type View<'a> = Int32ValueView<'a>;
    type ViewHandle = Int32ValueOwnedView;
}
#[cfg(feature = "reflect")]
const _: () = {
    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for Int32ValueView<'a> {
        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
            super::super::__buffa::reflect::descriptor_pool()
                .message(Self::__buffa_reflect_message_index())
        }
        fn pool(
            &self,
        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
            super::super::__buffa::reflect::descriptor_pool()
        }
        fn get(
            &self,
            field: &::buffa_descriptor::FieldDescriptor,
        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            #[allow(unused_imports)]
            use ::buffa::Enumeration as _;
            match field.number() {
                1u32 => ::buffa_descriptor::reflect::ValueRef::I32(self.value),
                _ => {
                    ::core::debug_assert!(
                        false,
                        "field number {} is not a member of this view's reflect get()",
                        field.number(),
                    );
                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
                }
            }
        }
        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
            match field.number() {
                1u32 => self.value != 0,
                _ => false,
            }
        }
        fn for_each_set(
            &self,
            f: &mut dyn ::core::ops::FnMut(
                &::buffa_descriptor::FieldDescriptor,
                ::buffa_descriptor::reflect::ValueRef<'_>,
            ),
        ) {
            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
                self,
            );
            for fd in md.fields() {
                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
                }
            }
        }
        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
            ::buffa_descriptor::reflect::DynamicMessage::decode(
                    ::buffa::alloc::sync::Arc::clone(
                        super::super::__buffa::reflect::descriptor_pool(),
                    ),
                    Self::__buffa_reflect_message_index(),
                    &bytes,
                )
                .expect("view re-encodes to bytes decodable against its own descriptor")
        }
    }
    impl<'a> ::buffa_descriptor::reflect::ReflectElement for Int32ValueView<'a> {
        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            ::buffa_descriptor::reflect::ValueRef::Message(
                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
            )
        }
    }
    impl<'a> Int32ValueView<'a> {
        /// Memoized `MessageIndex` for this view's message type, resolved
        /// once against the package's embedded descriptor pool. An inherent
        /// associated fn (not a free fn) so sibling views in the same module
        /// do not collide.
        #[doc(hidden)]
        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
            *IDX
                .get_or_init(|| {
                    super::super::__buffa::reflect::descriptor_pool()
                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
                        .expect(
                            "generated view type is registered in the embedded descriptor pool",
                        )
                })
        }
    }
};
/// Wrapper message for `uint32`.
///
/// The JSON representation for `UInt32Value` is JSON number.
#[derive(Clone, Debug, Default)]
pub struct UInt32ValueView<'a> {
    /// The uint32 value.
    ///
    /// Field 1: `value`
    pub value: u32,
    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> UInt32ValueView<'a> {
    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
    ///
    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
    /// and by generated sub-message decode arms with `depth - 1`.
    ///
    /// **Not part of the public API.** Named with a leading underscore to
    /// signal that it is for generated-code use only.
    #[doc(hidden)]
    pub fn _decode_depth(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        let mut view = Self::default();
        view._merge_into_view(buf, depth)?;
        ::core::result::Result::Ok(view)
    }
    /// Merge fields from `buf` into this view (proto merge semantics).
    ///
    /// Repeated fields append; singular fields last-wins; singular
    /// MESSAGE fields merge recursively. Used by sub-message decode
    /// arms when the same field appears multiple times on the wire.
    ///
    /// **Not part of the public API.**
    #[doc(hidden)]
    pub fn _merge_into_view(
        &mut self,
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
        let _ = depth;
        #[allow(unused_variables)]
        let view = self;
        let mut cur: &'a [u8] = buf;
        while !cur.is_empty() {
            let before_tag = cur;
            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
            match tag.field_number() {
                1u32 => {
                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
                            field_number: 1u32,
                            expected: 0u8,
                            actual: tag.wire_type() as u8,
                        });
                    }
                    view.value = ::buffa::types::decode_uint32(&mut cur)?;
                }
                _ => {
                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
                    let span_len = before_tag.len() - cur.len();
                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
                }
            }
        }
        ::core::result::Result::Ok(())
    }
}
impl<'a> ::buffa::MessageView<'a> for UInt32ValueView<'a> {
    type Owned = super::super::UInt32Value;
    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
    }
    fn decode_view_with_limit(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, depth)
    }
    fn to_owned_message(&self) -> super::super::UInt32Value {
        self.to_owned_from_source(None)
    }
    #[allow(clippy::useless_conversion, clippy::needless_update)]
    fn to_owned_from_source(
        &self,
        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
    ) -> super::super::UInt32Value {
        #[allow(unused_imports)]
        use ::buffa::alloc::string::ToString as _;
        let _ = __buffa_src;
        super::super::UInt32Value {
            value: self.value,
            __buffa_unknown_fields: self
                .__buffa_unknown_fields
                .to_owned()
                .unwrap_or_default()
                .into(),
            ..::core::default::Default::default()
        }
    }
}
impl<'a> ::buffa::ViewEncode<'a> for UInt32ValueView<'a> {
    #[allow(clippy::needless_borrow, clippy::let_and_return)]
    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        let mut size = 0u32;
        if self.value != 0u32 {
            size += 1u32 + ::buffa::types::uint32_encoded_len(self.value) as u32;
        }
        size += self.__buffa_unknown_fields.encoded_len() as u32;
        size
    }
    #[allow(clippy::needless_borrow)]
    fn write_to(
        &self,
        _cache: &mut ::buffa::SizeCache,
        buf: &mut impl ::buffa::bytes::BufMut,
    ) {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        if self.value != 0u32 {
            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
                .encode(buf);
            ::buffa::types::encode_uint32(self.value, buf);
        }
        self.__buffa_unknown_fields.write_to(buf);
    }
}
impl<'a> ::buffa::MessageName for UInt32ValueView<'a> {
    const PACKAGE: &'static str = "google.protobuf";
    const NAME: &'static str = "UInt32Value";
    const FULL_NAME: &'static str = "google.protobuf.UInt32Value";
    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.UInt32Value";
}
impl<'v> ::buffa::DefaultViewInstance for UInt32ValueView<'v> {
    fn default_view_instance<'a>() -> &'a Self
    where
        Self: 'a,
    {
        static VALUE: ::buffa::__private::OnceBox<UInt32ValueView<'static>> = ::buffa::__private::OnceBox::new();
        VALUE
            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
                <UInt32ValueView<'static>>::default(),
            ))
    }
}
impl ::buffa::ViewReborrow for UInt32ValueView<'static> {
    type Reborrowed<'b> = UInt32ValueView<'b>;
    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
        this
    }
}
/** Self-contained, `'static` owned view of a `UInt32Value` message.

 Wraps [`::buffa::OwnedView`]`<`[`UInt32ValueView`]`<'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.

 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`UInt32ValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
#[derive(Clone, Debug)]
pub struct UInt32ValueOwnedView(::buffa::OwnedView<UInt32ValueView<'static>>);
impl UInt32ValueOwnedView {
    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
    ///
    /// The view borrows directly from the buffer's data; the buffer is
    /// retained inside the returned handle.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
    /// protobuf data.
    pub fn decode(
        bytes: ::buffa::bytes::Bytes,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            UInt32ValueOwnedView(::buffa::OwnedView::decode(bytes)?),
        )
    }
    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
    /// max message size).
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
    /// exceeds the configured limits.
    pub fn decode_with_options(
        bytes: ::buffa::bytes::Bytes,
        opts: &::buffa::DecodeOptions,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            UInt32ValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
        )
    }
    /// Build from an owned message via an encode → decode round-trip.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
    /// somehow invalid (should not happen for well-formed messages).
    pub fn from_owned(
        msg: &super::super::UInt32Value,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            UInt32ValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
        )
    }
    /// Borrow the full [`UInt32ValueView`] with its lifetime tied to `&self`.
    #[must_use]
    pub fn view(&self) -> &UInt32ValueView<'_> {
        self.0.reborrow()
    }
    /// Convert to the owned message type.
    #[must_use]
    pub fn to_owned_message(&self) -> super::super::UInt32Value {
        self.0.to_owned_message()
    }
    /// The underlying bytes buffer.
    #[must_use]
    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
        self.0.bytes()
    }
    /// Consume the handle, returning the underlying bytes buffer.
    #[must_use]
    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
        self.0.into_bytes()
    }
    /// The uint32 value.
    ///
    /// Field 1: `value`
    #[must_use]
    pub fn value(&self) -> u32 {
        self.0.reborrow().value
    }
}
impl ::core::convert::From<::buffa::OwnedView<UInt32ValueView<'static>>>
for UInt32ValueOwnedView {
    fn from(inner: ::buffa::OwnedView<UInt32ValueView<'static>>) -> Self {
        UInt32ValueOwnedView(inner)
    }
}
impl ::core::convert::From<UInt32ValueOwnedView>
for ::buffa::OwnedView<UInt32ValueView<'static>> {
    fn from(wrapper: UInt32ValueOwnedView) -> Self {
        wrapper.0
    }
}
impl ::core::convert::AsRef<::buffa::OwnedView<UInt32ValueView<'static>>>
for UInt32ValueOwnedView {
    fn as_ref(&self) -> &::buffa::OwnedView<UInt32ValueView<'static>> {
        &self.0
    }
}
impl ::buffa::HasMessageView for super::super::UInt32Value {
    type View<'a> = UInt32ValueView<'a>;
    type ViewHandle = UInt32ValueOwnedView;
}
#[cfg(feature = "reflect")]
const _: () = {
    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for UInt32ValueView<'a> {
        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
            super::super::__buffa::reflect::descriptor_pool()
                .message(Self::__buffa_reflect_message_index())
        }
        fn pool(
            &self,
        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
            super::super::__buffa::reflect::descriptor_pool()
        }
        fn get(
            &self,
            field: &::buffa_descriptor::FieldDescriptor,
        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            #[allow(unused_imports)]
            use ::buffa::Enumeration as _;
            match field.number() {
                1u32 => ::buffa_descriptor::reflect::ValueRef::U32(self.value),
                _ => {
                    ::core::debug_assert!(
                        false,
                        "field number {} is not a member of this view's reflect get()",
                        field.number(),
                    );
                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
                }
            }
        }
        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
            match field.number() {
                1u32 => self.value != 0,
                _ => false,
            }
        }
        fn for_each_set(
            &self,
            f: &mut dyn ::core::ops::FnMut(
                &::buffa_descriptor::FieldDescriptor,
                ::buffa_descriptor::reflect::ValueRef<'_>,
            ),
        ) {
            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
                self,
            );
            for fd in md.fields() {
                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
                }
            }
        }
        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
            ::buffa_descriptor::reflect::DynamicMessage::decode(
                    ::buffa::alloc::sync::Arc::clone(
                        super::super::__buffa::reflect::descriptor_pool(),
                    ),
                    Self::__buffa_reflect_message_index(),
                    &bytes,
                )
                .expect("view re-encodes to bytes decodable against its own descriptor")
        }
    }
    impl<'a> ::buffa_descriptor::reflect::ReflectElement for UInt32ValueView<'a> {
        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            ::buffa_descriptor::reflect::ValueRef::Message(
                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
            )
        }
    }
    impl<'a> UInt32ValueView<'a> {
        /// Memoized `MessageIndex` for this view's message type, resolved
        /// once against the package's embedded descriptor pool. An inherent
        /// associated fn (not a free fn) so sibling views in the same module
        /// do not collide.
        #[doc(hidden)]
        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
            *IDX
                .get_or_init(|| {
                    super::super::__buffa::reflect::descriptor_pool()
                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
                        .expect(
                            "generated view type is registered in the embedded descriptor pool",
                        )
                })
        }
    }
};
/// Wrapper message for `bool`.
///
/// The JSON representation for `BoolValue` is JSON `true` and `false`.
#[derive(Clone, Debug, Default)]
pub struct BoolValueView<'a> {
    /// The bool value.
    ///
    /// Field 1: `value`
    pub value: bool,
    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> BoolValueView<'a> {
    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
    ///
    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
    /// and by generated sub-message decode arms with `depth - 1`.
    ///
    /// **Not part of the public API.** Named with a leading underscore to
    /// signal that it is for generated-code use only.
    #[doc(hidden)]
    pub fn _decode_depth(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        let mut view = Self::default();
        view._merge_into_view(buf, depth)?;
        ::core::result::Result::Ok(view)
    }
    /// Merge fields from `buf` into this view (proto merge semantics).
    ///
    /// Repeated fields append; singular fields last-wins; singular
    /// MESSAGE fields merge recursively. Used by sub-message decode
    /// arms when the same field appears multiple times on the wire.
    ///
    /// **Not part of the public API.**
    #[doc(hidden)]
    pub fn _merge_into_view(
        &mut self,
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
        let _ = depth;
        #[allow(unused_variables)]
        let view = self;
        let mut cur: &'a [u8] = buf;
        while !cur.is_empty() {
            let before_tag = cur;
            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
            match tag.field_number() {
                1u32 => {
                    if tag.wire_type() != ::buffa::encoding::WireType::Varint {
                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
                            field_number: 1u32,
                            expected: 0u8,
                            actual: tag.wire_type() as u8,
                        });
                    }
                    view.value = ::buffa::types::decode_bool(&mut cur)?;
                }
                _ => {
                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
                    let span_len = before_tag.len() - cur.len();
                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
                }
            }
        }
        ::core::result::Result::Ok(())
    }
}
impl<'a> ::buffa::MessageView<'a> for BoolValueView<'a> {
    type Owned = super::super::BoolValue;
    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
    }
    fn decode_view_with_limit(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, depth)
    }
    fn to_owned_message(&self) -> super::super::BoolValue {
        self.to_owned_from_source(None)
    }
    #[allow(clippy::useless_conversion, clippy::needless_update)]
    fn to_owned_from_source(
        &self,
        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
    ) -> super::super::BoolValue {
        #[allow(unused_imports)]
        use ::buffa::alloc::string::ToString as _;
        let _ = __buffa_src;
        super::super::BoolValue {
            value: self.value,
            __buffa_unknown_fields: self
                .__buffa_unknown_fields
                .to_owned()
                .unwrap_or_default()
                .into(),
            ..::core::default::Default::default()
        }
    }
}
impl<'a> ::buffa::ViewEncode<'a> for BoolValueView<'a> {
    #[allow(clippy::needless_borrow, clippy::let_and_return)]
    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        let mut size = 0u32;
        if self.value {
            size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
        }
        size += self.__buffa_unknown_fields.encoded_len() as u32;
        size
    }
    #[allow(clippy::needless_borrow)]
    fn write_to(
        &self,
        _cache: &mut ::buffa::SizeCache,
        buf: &mut impl ::buffa::bytes::BufMut,
    ) {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        if self.value {
            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
                .encode(buf);
            ::buffa::types::encode_bool(self.value, buf);
        }
        self.__buffa_unknown_fields.write_to(buf);
    }
}
impl<'a> ::buffa::MessageName for BoolValueView<'a> {
    const PACKAGE: &'static str = "google.protobuf";
    const NAME: &'static str = "BoolValue";
    const FULL_NAME: &'static str = "google.protobuf.BoolValue";
    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.BoolValue";
}
impl<'v> ::buffa::DefaultViewInstance for BoolValueView<'v> {
    fn default_view_instance<'a>() -> &'a Self
    where
        Self: 'a,
    {
        static VALUE: ::buffa::__private::OnceBox<BoolValueView<'static>> = ::buffa::__private::OnceBox::new();
        VALUE
            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
                <BoolValueView<'static>>::default(),
            ))
    }
}
impl ::buffa::ViewReborrow for BoolValueView<'static> {
    type Reborrowed<'b> = BoolValueView<'b>;
    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
        this
    }
}
/** Self-contained, `'static` owned view of a `BoolValue` message.

 Wraps [`::buffa::OwnedView`]`<`[`BoolValueView`]`<'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.

 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`BoolValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
#[derive(Clone, Debug)]
pub struct BoolValueOwnedView(::buffa::OwnedView<BoolValueView<'static>>);
impl BoolValueOwnedView {
    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
    ///
    /// The view borrows directly from the buffer's data; the buffer is
    /// retained inside the returned handle.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
    /// protobuf data.
    pub fn decode(
        bytes: ::buffa::bytes::Bytes,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            BoolValueOwnedView(::buffa::OwnedView::decode(bytes)?),
        )
    }
    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
    /// max message size).
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
    /// exceeds the configured limits.
    pub fn decode_with_options(
        bytes: ::buffa::bytes::Bytes,
        opts: &::buffa::DecodeOptions,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            BoolValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
        )
    }
    /// Build from an owned message via an encode → decode round-trip.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
    /// somehow invalid (should not happen for well-formed messages).
    pub fn from_owned(
        msg: &super::super::BoolValue,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            BoolValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
        )
    }
    /// Borrow the full [`BoolValueView`] with its lifetime tied to `&self`.
    #[must_use]
    pub fn view(&self) -> &BoolValueView<'_> {
        self.0.reborrow()
    }
    /// Convert to the owned message type.
    #[must_use]
    pub fn to_owned_message(&self) -> super::super::BoolValue {
        self.0.to_owned_message()
    }
    /// The underlying bytes buffer.
    #[must_use]
    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
        self.0.bytes()
    }
    /// Consume the handle, returning the underlying bytes buffer.
    #[must_use]
    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
        self.0.into_bytes()
    }
    /// The bool value.
    ///
    /// Field 1: `value`
    #[must_use]
    pub fn value(&self) -> bool {
        self.0.reborrow().value
    }
}
impl ::core::convert::From<::buffa::OwnedView<BoolValueView<'static>>>
for BoolValueOwnedView {
    fn from(inner: ::buffa::OwnedView<BoolValueView<'static>>) -> Self {
        BoolValueOwnedView(inner)
    }
}
impl ::core::convert::From<BoolValueOwnedView>
for ::buffa::OwnedView<BoolValueView<'static>> {
    fn from(wrapper: BoolValueOwnedView) -> Self {
        wrapper.0
    }
}
impl ::core::convert::AsRef<::buffa::OwnedView<BoolValueView<'static>>>
for BoolValueOwnedView {
    fn as_ref(&self) -> &::buffa::OwnedView<BoolValueView<'static>> {
        &self.0
    }
}
impl ::buffa::HasMessageView for super::super::BoolValue {
    type View<'a> = BoolValueView<'a>;
    type ViewHandle = BoolValueOwnedView;
}
#[cfg(feature = "reflect")]
const _: () = {
    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for BoolValueView<'a> {
        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
            super::super::__buffa::reflect::descriptor_pool()
                .message(Self::__buffa_reflect_message_index())
        }
        fn pool(
            &self,
        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
            super::super::__buffa::reflect::descriptor_pool()
        }
        fn get(
            &self,
            field: &::buffa_descriptor::FieldDescriptor,
        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            #[allow(unused_imports)]
            use ::buffa::Enumeration as _;
            match field.number() {
                1u32 => ::buffa_descriptor::reflect::ValueRef::Bool(self.value),
                _ => {
                    ::core::debug_assert!(
                        false,
                        "field number {} is not a member of this view's reflect get()",
                        field.number(),
                    );
                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
                }
            }
        }
        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
            match field.number() {
                1u32 => self.value,
                _ => false,
            }
        }
        fn for_each_set(
            &self,
            f: &mut dyn ::core::ops::FnMut(
                &::buffa_descriptor::FieldDescriptor,
                ::buffa_descriptor::reflect::ValueRef<'_>,
            ),
        ) {
            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
                self,
            );
            for fd in md.fields() {
                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
                }
            }
        }
        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
            ::buffa_descriptor::reflect::DynamicMessage::decode(
                    ::buffa::alloc::sync::Arc::clone(
                        super::super::__buffa::reflect::descriptor_pool(),
                    ),
                    Self::__buffa_reflect_message_index(),
                    &bytes,
                )
                .expect("view re-encodes to bytes decodable against its own descriptor")
        }
    }
    impl<'a> ::buffa_descriptor::reflect::ReflectElement for BoolValueView<'a> {
        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            ::buffa_descriptor::reflect::ValueRef::Message(
                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
            )
        }
    }
    impl<'a> BoolValueView<'a> {
        /// Memoized `MessageIndex` for this view's message type, resolved
        /// once against the package's embedded descriptor pool. An inherent
        /// associated fn (not a free fn) so sibling views in the same module
        /// do not collide.
        #[doc(hidden)]
        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
            *IDX
                .get_or_init(|| {
                    super::super::__buffa::reflect::descriptor_pool()
                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
                        .expect(
                            "generated view type is registered in the embedded descriptor pool",
                        )
                })
        }
    }
};
/// Wrapper message for `string`.
///
/// The JSON representation for `StringValue` is JSON string.
#[derive(Clone, Debug, Default)]
pub struct StringValueView<'a> {
    /// The string value.
    ///
    /// Field 1: `value`
    pub value: &'a str,
    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> StringValueView<'a> {
    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
    ///
    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
    /// and by generated sub-message decode arms with `depth - 1`.
    ///
    /// **Not part of the public API.** Named with a leading underscore to
    /// signal that it is for generated-code use only.
    #[doc(hidden)]
    pub fn _decode_depth(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        let mut view = Self::default();
        view._merge_into_view(buf, depth)?;
        ::core::result::Result::Ok(view)
    }
    /// Merge fields from `buf` into this view (proto merge semantics).
    ///
    /// Repeated fields append; singular fields last-wins; singular
    /// MESSAGE fields merge recursively. Used by sub-message decode
    /// arms when the same field appears multiple times on the wire.
    ///
    /// **Not part of the public API.**
    #[doc(hidden)]
    pub fn _merge_into_view(
        &mut self,
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
        let _ = depth;
        #[allow(unused_variables)]
        let view = self;
        let mut cur: &'a [u8] = buf;
        while !cur.is_empty() {
            let before_tag = cur;
            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
            match tag.field_number() {
                1u32 => {
                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
                            field_number: 1u32,
                            expected: 2u8,
                            actual: tag.wire_type() as u8,
                        });
                    }
                    view.value = ::buffa::types::borrow_str(&mut cur)?;
                }
                _ => {
                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
                    let span_len = before_tag.len() - cur.len();
                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
                }
            }
        }
        ::core::result::Result::Ok(())
    }
}
impl<'a> ::buffa::MessageView<'a> for StringValueView<'a> {
    type Owned = super::super::StringValue;
    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
    }
    fn decode_view_with_limit(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, depth)
    }
    fn to_owned_message(&self) -> super::super::StringValue {
        self.to_owned_from_source(None)
    }
    #[allow(clippy::useless_conversion, clippy::needless_update)]
    fn to_owned_from_source(
        &self,
        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
    ) -> super::super::StringValue {
        #[allow(unused_imports)]
        use ::buffa::alloc::string::ToString as _;
        let _ = __buffa_src;
        super::super::StringValue {
            value: self.value.to_string(),
            __buffa_unknown_fields: self
                .__buffa_unknown_fields
                .to_owned()
                .unwrap_or_default()
                .into(),
            ..::core::default::Default::default()
        }
    }
}
impl<'a> ::buffa::ViewEncode<'a> for StringValueView<'a> {
    #[allow(clippy::needless_borrow, clippy::let_and_return)]
    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        let mut size = 0u32;
        if !self.value.is_empty() {
            size += 1u32 + ::buffa::types::string_encoded_len(&self.value) as u32;
        }
        size += self.__buffa_unknown_fields.encoded_len() as u32;
        size
    }
    #[allow(clippy::needless_borrow)]
    fn write_to(
        &self,
        _cache: &mut ::buffa::SizeCache,
        buf: &mut impl ::buffa::bytes::BufMut,
    ) {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        if !self.value.is_empty() {
            ::buffa::encoding::Tag::new(
                    1u32,
                    ::buffa::encoding::WireType::LengthDelimited,
                )
                .encode(buf);
            ::buffa::types::encode_string(&self.value, buf);
        }
        self.__buffa_unknown_fields.write_to(buf);
    }
}
impl<'a> ::buffa::MessageName for StringValueView<'a> {
    const PACKAGE: &'static str = "google.protobuf";
    const NAME: &'static str = "StringValue";
    const FULL_NAME: &'static str = "google.protobuf.StringValue";
    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.StringValue";
}
impl<'v> ::buffa::DefaultViewInstance for StringValueView<'v> {
    fn default_view_instance<'a>() -> &'a Self
    where
        Self: 'a,
    {
        static VALUE: ::buffa::__private::OnceBox<StringValueView<'static>> = ::buffa::__private::OnceBox::new();
        VALUE
            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
                <StringValueView<'static>>::default(),
            ))
    }
}
impl ::buffa::ViewReborrow for StringValueView<'static> {
    type Reborrowed<'b> = StringValueView<'b>;
    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
        this
    }
}
/** Self-contained, `'static` owned view of a `StringValue` message.

 Wraps [`::buffa::OwnedView`]`<`[`StringValueView`]`<'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.

 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`StringValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
#[derive(Clone, Debug)]
pub struct StringValueOwnedView(::buffa::OwnedView<StringValueView<'static>>);
impl StringValueOwnedView {
    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
    ///
    /// The view borrows directly from the buffer's data; the buffer is
    /// retained inside the returned handle.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
    /// protobuf data.
    pub fn decode(
        bytes: ::buffa::bytes::Bytes,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            StringValueOwnedView(::buffa::OwnedView::decode(bytes)?),
        )
    }
    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
    /// max message size).
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
    /// exceeds the configured limits.
    pub fn decode_with_options(
        bytes: ::buffa::bytes::Bytes,
        opts: &::buffa::DecodeOptions,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            StringValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
        )
    }
    /// Build from an owned message via an encode → decode round-trip.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
    /// somehow invalid (should not happen for well-formed messages).
    pub fn from_owned(
        msg: &super::super::StringValue,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            StringValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
        )
    }
    /// Borrow the full [`StringValueView`] with its lifetime tied to `&self`.
    #[must_use]
    pub fn view(&self) -> &StringValueView<'_> {
        self.0.reborrow()
    }
    /// Convert to the owned message type.
    #[must_use]
    pub fn to_owned_message(&self) -> super::super::StringValue {
        self.0.to_owned_message()
    }
    /// The underlying bytes buffer.
    #[must_use]
    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
        self.0.bytes()
    }
    /// Consume the handle, returning the underlying bytes buffer.
    #[must_use]
    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
        self.0.into_bytes()
    }
    /// The string value.
    ///
    /// Field 1: `value`
    #[must_use]
    pub fn value(&self) -> &'_ str {
        self.0.reborrow().value
    }
}
impl ::core::convert::From<::buffa::OwnedView<StringValueView<'static>>>
for StringValueOwnedView {
    fn from(inner: ::buffa::OwnedView<StringValueView<'static>>) -> Self {
        StringValueOwnedView(inner)
    }
}
impl ::core::convert::From<StringValueOwnedView>
for ::buffa::OwnedView<StringValueView<'static>> {
    fn from(wrapper: StringValueOwnedView) -> Self {
        wrapper.0
    }
}
impl ::core::convert::AsRef<::buffa::OwnedView<StringValueView<'static>>>
for StringValueOwnedView {
    fn as_ref(&self) -> &::buffa::OwnedView<StringValueView<'static>> {
        &self.0
    }
}
impl ::buffa::HasMessageView for super::super::StringValue {
    type View<'a> = StringValueView<'a>;
    type ViewHandle = StringValueOwnedView;
}
#[cfg(feature = "reflect")]
const _: () = {
    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for StringValueView<'a> {
        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
            super::super::__buffa::reflect::descriptor_pool()
                .message(Self::__buffa_reflect_message_index())
        }
        fn pool(
            &self,
        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
            super::super::__buffa::reflect::descriptor_pool()
        }
        fn get(
            &self,
            field: &::buffa_descriptor::FieldDescriptor,
        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            #[allow(unused_imports)]
            use ::buffa::Enumeration as _;
            match field.number() {
                1u32 => ::buffa_descriptor::reflect::ValueRef::String(self.value),
                _ => {
                    ::core::debug_assert!(
                        false,
                        "field number {} is not a member of this view's reflect get()",
                        field.number(),
                    );
                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
                }
            }
        }
        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
            match field.number() {
                1u32 => !self.value.is_empty(),
                _ => false,
            }
        }
        fn for_each_set(
            &self,
            f: &mut dyn ::core::ops::FnMut(
                &::buffa_descriptor::FieldDescriptor,
                ::buffa_descriptor::reflect::ValueRef<'_>,
            ),
        ) {
            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
                self,
            );
            for fd in md.fields() {
                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
                }
            }
        }
        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
            ::buffa_descriptor::reflect::DynamicMessage::decode(
                    ::buffa::alloc::sync::Arc::clone(
                        super::super::__buffa::reflect::descriptor_pool(),
                    ),
                    Self::__buffa_reflect_message_index(),
                    &bytes,
                )
                .expect("view re-encodes to bytes decodable against its own descriptor")
        }
    }
    impl<'a> ::buffa_descriptor::reflect::ReflectElement for StringValueView<'a> {
        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            ::buffa_descriptor::reflect::ValueRef::Message(
                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
            )
        }
    }
    impl<'a> StringValueView<'a> {
        /// Memoized `MessageIndex` for this view's message type, resolved
        /// once against the package's embedded descriptor pool. An inherent
        /// associated fn (not a free fn) so sibling views in the same module
        /// do not collide.
        #[doc(hidden)]
        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
            *IDX
                .get_or_init(|| {
                    super::super::__buffa::reflect::descriptor_pool()
                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
                        .expect(
                            "generated view type is registered in the embedded descriptor pool",
                        )
                })
        }
    }
};
/// Wrapper message for `bytes`.
///
/// The JSON representation for `BytesValue` is JSON string.
#[derive(Clone, Debug, Default)]
pub struct BytesValueView<'a> {
    /// The bytes value.
    ///
    /// Field 1: `value`
    pub value: &'a [u8],
    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> BytesValueView<'a> {
    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
    ///
    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
    /// and by generated sub-message decode arms with `depth - 1`.
    ///
    /// **Not part of the public API.** Named with a leading underscore to
    /// signal that it is for generated-code use only.
    #[doc(hidden)]
    pub fn _decode_depth(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        let mut view = Self::default();
        view._merge_into_view(buf, depth)?;
        ::core::result::Result::Ok(view)
    }
    /// Merge fields from `buf` into this view (proto merge semantics).
    ///
    /// Repeated fields append; singular fields last-wins; singular
    /// MESSAGE fields merge recursively. Used by sub-message decode
    /// arms when the same field appears multiple times on the wire.
    ///
    /// **Not part of the public API.**
    #[doc(hidden)]
    pub fn _merge_into_view(
        &mut self,
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
        let _ = depth;
        #[allow(unused_variables)]
        let view = self;
        let mut cur: &'a [u8] = buf;
        while !cur.is_empty() {
            let before_tag = cur;
            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
            match tag.field_number() {
                1u32 => {
                    if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
                        return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
                            field_number: 1u32,
                            expected: 2u8,
                            actual: tag.wire_type() as u8,
                        });
                    }
                    view.value = ::buffa::types::borrow_bytes(&mut cur)?;
                }
                _ => {
                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
                    let span_len = before_tag.len() - cur.len();
                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
                }
            }
        }
        ::core::result::Result::Ok(())
    }
}
impl<'a> ::buffa::MessageView<'a> for BytesValueView<'a> {
    type Owned = super::super::BytesValue;
    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
    }
    fn decode_view_with_limit(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, depth)
    }
    fn to_owned_message(&self) -> super::super::BytesValue {
        self.to_owned_from_source(None)
    }
    #[allow(clippy::useless_conversion, clippy::needless_update)]
    fn to_owned_from_source(
        &self,
        __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
    ) -> super::super::BytesValue {
        #[allow(unused_imports)]
        use ::buffa::alloc::string::ToString as _;
        let _ = __buffa_src;
        super::super::BytesValue {
            value: (self.value).to_vec(),
            __buffa_unknown_fields: self
                .__buffa_unknown_fields
                .to_owned()
                .unwrap_or_default()
                .into(),
            ..::core::default::Default::default()
        }
    }
}
impl<'a> ::buffa::ViewEncode<'a> for BytesValueView<'a> {
    #[allow(clippy::needless_borrow, clippy::let_and_return)]
    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        let mut size = 0u32;
        if !self.value.is_empty() {
            size += 1u32 + ::buffa::types::bytes_encoded_len(&self.value) as u32;
        }
        size += self.__buffa_unknown_fields.encoded_len() as u32;
        size
    }
    #[allow(clippy::needless_borrow)]
    fn write_to(
        &self,
        _cache: &mut ::buffa::SizeCache,
        buf: &mut impl ::buffa::bytes::BufMut,
    ) {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        if !self.value.is_empty() {
            ::buffa::encoding::Tag::new(
                    1u32,
                    ::buffa::encoding::WireType::LengthDelimited,
                )
                .encode(buf);
            ::buffa::types::encode_bytes(&self.value, buf);
        }
        self.__buffa_unknown_fields.write_to(buf);
    }
}
impl<'a> ::buffa::MessageName for BytesValueView<'a> {
    const PACKAGE: &'static str = "google.protobuf";
    const NAME: &'static str = "BytesValue";
    const FULL_NAME: &'static str = "google.protobuf.BytesValue";
    const TYPE_URL: &'static str = "type.googleapis.com/google.protobuf.BytesValue";
}
impl<'v> ::buffa::DefaultViewInstance for BytesValueView<'v> {
    fn default_view_instance<'a>() -> &'a Self
    where
        Self: 'a,
    {
        static VALUE: ::buffa::__private::OnceBox<BytesValueView<'static>> = ::buffa::__private::OnceBox::new();
        VALUE
            .get_or_init(|| ::buffa::alloc::boxed::Box::new(
                <BytesValueView<'static>>::default(),
            ))
    }
}
impl ::buffa::ViewReborrow for BytesValueView<'static> {
    type Reborrowed<'b> = BytesValueView<'b>;
    fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
        this
    }
}
/** Self-contained, `'static` owned view of a `BytesValue` message.

 Wraps [`::buffa::OwnedView`]`<`[`BytesValueView`]`<'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.

 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`BytesValueView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
#[derive(Clone, Debug)]
pub struct BytesValueOwnedView(::buffa::OwnedView<BytesValueView<'static>>);
impl BytesValueOwnedView {
    /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
    ///
    /// The view borrows directly from the buffer's data; the buffer is
    /// retained inside the returned handle.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
    /// protobuf data.
    pub fn decode(
        bytes: ::buffa::bytes::Bytes,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            BytesValueOwnedView(::buffa::OwnedView::decode(bytes)?),
        )
    }
    /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
    /// max message size).
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
    /// exceeds the configured limits.
    pub fn decode_with_options(
        bytes: ::buffa::bytes::Bytes,
        opts: &::buffa::DecodeOptions,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            BytesValueOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
        )
    }
    /// Build from an owned message via an encode → decode round-trip.
    ///
    /// # Errors
    ///
    /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
    /// somehow invalid (should not happen for well-formed messages).
    pub fn from_owned(
        msg: &super::super::BytesValue,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        ::core::result::Result::Ok(
            BytesValueOwnedView(::buffa::OwnedView::from_owned(msg)?),
        )
    }
    /// Borrow the full [`BytesValueView`] with its lifetime tied to `&self`.
    #[must_use]
    pub fn view(&self) -> &BytesValueView<'_> {
        self.0.reborrow()
    }
    /// Convert to the owned message type.
    #[must_use]
    pub fn to_owned_message(&self) -> super::super::BytesValue {
        self.0.to_owned_message()
    }
    /// The underlying bytes buffer.
    #[must_use]
    pub fn bytes(&self) -> &::buffa::bytes::Bytes {
        self.0.bytes()
    }
    /// Consume the handle, returning the underlying bytes buffer.
    #[must_use]
    pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
        self.0.into_bytes()
    }
    /// The bytes value.
    ///
    /// Field 1: `value`
    #[must_use]
    pub fn value(&self) -> &'_ [u8] {
        self.0.reborrow().value
    }
}
impl ::core::convert::From<::buffa::OwnedView<BytesValueView<'static>>>
for BytesValueOwnedView {
    fn from(inner: ::buffa::OwnedView<BytesValueView<'static>>) -> Self {
        BytesValueOwnedView(inner)
    }
}
impl ::core::convert::From<BytesValueOwnedView>
for ::buffa::OwnedView<BytesValueView<'static>> {
    fn from(wrapper: BytesValueOwnedView) -> Self {
        wrapper.0
    }
}
impl ::core::convert::AsRef<::buffa::OwnedView<BytesValueView<'static>>>
for BytesValueOwnedView {
    fn as_ref(&self) -> &::buffa::OwnedView<BytesValueView<'static>> {
        &self.0
    }
}
impl ::buffa::HasMessageView for super::super::BytesValue {
    type View<'a> = BytesValueView<'a>;
    type ViewHandle = BytesValueOwnedView;
}
#[cfg(feature = "reflect")]
const _: () = {
    impl<'a> ::buffa_descriptor::reflect::ReflectMessage for BytesValueView<'a> {
        fn message_descriptor(&self) -> &::buffa_descriptor::MessageDescriptor {
            super::super::__buffa::reflect::descriptor_pool()
                .message(Self::__buffa_reflect_message_index())
        }
        fn pool(
            &self,
        ) -> &::buffa::alloc::sync::Arc<::buffa_descriptor::DescriptorPool> {
            super::super::__buffa::reflect::descriptor_pool()
        }
        fn get(
            &self,
            field: &::buffa_descriptor::FieldDescriptor,
        ) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            #[allow(unused_imports)]
            use ::buffa::Enumeration as _;
            match field.number() {
                1u32 => ::buffa_descriptor::reflect::ValueRef::Bytes(self.value),
                _ => {
                    ::core::debug_assert!(
                        false,
                        "field number {} is not a member of this view's reflect get()",
                        field.number(),
                    );
                    ::buffa_descriptor::reflect::ValueRef::Bool(false)
                }
            }
        }
        fn has(&self, field: &::buffa_descriptor::FieldDescriptor) -> bool {
            match field.number() {
                1u32 => !self.value.is_empty(),
                _ => false,
            }
        }
        fn for_each_set(
            &self,
            f: &mut dyn ::core::ops::FnMut(
                &::buffa_descriptor::FieldDescriptor,
                ::buffa_descriptor::reflect::ValueRef<'_>,
            ),
        ) {
            let md = ::buffa_descriptor::reflect::ReflectMessage::message_descriptor(
                self,
            );
            for fd in md.fields() {
                if ::buffa_descriptor::reflect::ReflectMessage::has(self, fd) {
                    f(fd, ::buffa_descriptor::reflect::ReflectMessage::get(self, fd));
                }
            }
        }
        fn to_dynamic(&self) -> ::buffa_descriptor::reflect::DynamicMessage {
            let bytes = ::buffa::ViewEncode::encode_to_vec(self);
            ::buffa_descriptor::reflect::DynamicMessage::decode(
                    ::buffa::alloc::sync::Arc::clone(
                        super::super::__buffa::reflect::descriptor_pool(),
                    ),
                    Self::__buffa_reflect_message_index(),
                    &bytes,
                )
                .expect("view re-encodes to bytes decodable against its own descriptor")
        }
    }
    impl<'a> ::buffa_descriptor::reflect::ReflectElement for BytesValueView<'a> {
        fn as_value_ref(&self) -> ::buffa_descriptor::reflect::ValueRef<'_> {
            ::buffa_descriptor::reflect::ValueRef::Message(
                ::buffa_descriptor::reflect::ReflectCow::Borrowed(self),
            )
        }
    }
    impl<'a> BytesValueView<'a> {
        /// Memoized `MessageIndex` for this view's message type, resolved
        /// once against the package's embedded descriptor pool. An inherent
        /// associated fn (not a free fn) so sibling views in the same module
        /// do not collide.
        #[doc(hidden)]
        fn __buffa_reflect_message_index() -> ::buffa_descriptor::MessageIndex {
            static IDX: ::std::sync::OnceLock<::buffa_descriptor::MessageIndex> = ::std::sync::OnceLock::new();
            *IDX
                .get_or_init(|| {
                    super::super::__buffa::reflect::descriptor_pool()
                        .message_index(<Self as ::buffa::MessageName>::FULL_NAME)
                        .expect(
                            "generated view type is registered in the embedded descriptor pool",
                        )
                })
        }
    }
};
