// This file is generated by rust-protobuf 3.7.2. Do not edit
// .proto file is parsed by protoc 3.19.6
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]

#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]

#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unused_results)]
#![allow(unused_mut)]

//! Generated file from `messages-ripple.proto`

/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2;

// @@protoc_insertion_point(message:hw.trezor.messages.ripple.RippleGetAddress)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct RippleGetAddress {
    // message fields
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleGetAddress.address_n)
    pub address_n: ::std::vec::Vec<u32>,
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleGetAddress.show_display)
    pub show_display: ::std::option::Option<bool>,
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleGetAddress.chunkify)
    pub chunkify: ::std::option::Option<bool>,
    // special fields
    // @@protoc_insertion_point(special_field:hw.trezor.messages.ripple.RippleGetAddress.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

impl<'a> ::std::default::Default for &'a RippleGetAddress {
    fn default() -> &'a RippleGetAddress {
        <RippleGetAddress as ::protobuf::Message>::default_instance()
    }
}

impl RippleGetAddress {
    pub fn new() -> RippleGetAddress {
        ::std::default::Default::default()
    }

    // optional bool show_display = 2;

    pub fn show_display(&self) -> bool {
        self.show_display.unwrap_or(false)
    }

    pub fn clear_show_display(&mut self) {
        self.show_display = ::std::option::Option::None;
    }

    pub fn has_show_display(&self) -> bool {
        self.show_display.is_some()
    }

    // Param is passed by value, moved
    pub fn set_show_display(&mut self, v: bool) {
        self.show_display = ::std::option::Option::Some(v);
    }

    // optional bool chunkify = 3;

    pub fn chunkify(&self) -> bool {
        self.chunkify.unwrap_or(false)
    }

    pub fn clear_chunkify(&mut self) {
        self.chunkify = ::std::option::Option::None;
    }

    pub fn has_chunkify(&self) -> bool {
        self.chunkify.is_some()
    }

    // Param is passed by value, moved
    pub fn set_chunkify(&mut self, v: bool) {
        self.chunkify = ::std::option::Option::Some(v);
    }

    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
        let mut fields = ::std::vec::Vec::with_capacity(3);
        let mut oneofs = ::std::vec::Vec::with_capacity(0);
        fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
            "address_n",
            |m: &RippleGetAddress| { &m.address_n },
            |m: &mut RippleGetAddress| { &mut m.address_n },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "show_display",
            |m: &RippleGetAddress| { &m.show_display },
            |m: &mut RippleGetAddress| { &mut m.show_display },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "chunkify",
            |m: &RippleGetAddress| { &m.chunkify },
            |m: &mut RippleGetAddress| { &mut m.chunkify },
        ));
        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<RippleGetAddress>(
            "RippleGetAddress",
            fields,
            oneofs,
        )
    }
}

impl ::protobuf::Message for RippleGetAddress {
    const NAME: &'static str = "RippleGetAddress";

    fn is_initialized(&self) -> bool {
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    is.read_repeated_packed_uint32_into(&mut self.address_n)?;
                },
                8 => {
                    self.address_n.push(is.read_uint32()?);
                },
                16 => {
                    self.show_display = ::std::option::Option::Some(is.read_bool()?);
                },
                24 => {
                    self.chunkify = ::std::option::Option::Some(is.read_bool()?);
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        for value in &self.address_n {
            my_size += ::protobuf::rt::uint32_size(1, *value);
        };
        if let Some(v) = self.show_display {
            my_size += 1 + 1;
        }
        if let Some(v) = self.chunkify {
            my_size += 1 + 1;
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        for v in &self.address_n {
            os.write_uint32(1, *v)?;
        };
        if let Some(v) = self.show_display {
            os.write_bool(2, v)?;
        }
        if let Some(v) = self.chunkify {
            os.write_bool(3, v)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

    fn new() -> RippleGetAddress {
        RippleGetAddress::new()
    }

    fn clear(&mut self) {
        self.address_n.clear();
        self.show_display = ::std::option::Option::None;
        self.chunkify = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static RippleGetAddress {
        static instance: RippleGetAddress = RippleGetAddress {
            address_n: ::std::vec::Vec::new(),
            show_display: ::std::option::Option::None,
            chunkify: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

impl ::protobuf::MessageFull for RippleGetAddress {
    fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
        descriptor.get(|| file_descriptor().message_by_package_relative_name("RippleGetAddress").unwrap()).clone()
    }
}

impl ::std::fmt::Display for RippleGetAddress {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for RippleGetAddress {
    type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}

// @@protoc_insertion_point(message:hw.trezor.messages.ripple.RippleAddress)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct RippleAddress {
    // message fields
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleAddress.address)
    pub address: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleAddress.mac)
    pub mac: ::std::option::Option<::std::vec::Vec<u8>>,
    // special fields
    // @@protoc_insertion_point(special_field:hw.trezor.messages.ripple.RippleAddress.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

impl<'a> ::std::default::Default for &'a RippleAddress {
    fn default() -> &'a RippleAddress {
        <RippleAddress as ::protobuf::Message>::default_instance()
    }
}

impl RippleAddress {
    pub fn new() -> RippleAddress {
        ::std::default::Default::default()
    }

    // required string address = 1;

    pub fn address(&self) -> &str {
        match self.address.as_ref() {
            Some(v) => v,
            None => "",
        }
    }

    pub fn clear_address(&mut self) {
        self.address = ::std::option::Option::None;
    }

    pub fn has_address(&self) -> bool {
        self.address.is_some()
    }

    // Param is passed by value, moved
    pub fn set_address(&mut self, v: ::std::string::String) {
        self.address = ::std::option::Option::Some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_address(&mut self) -> &mut ::std::string::String {
        if self.address.is_none() {
            self.address = ::std::option::Option::Some(::std::string::String::new());
        }
        self.address.as_mut().unwrap()
    }

    // Take field
    pub fn take_address(&mut self) -> ::std::string::String {
        self.address.take().unwrap_or_else(|| ::std::string::String::new())
    }

    // optional bytes mac = 2;

    pub fn mac(&self) -> &[u8] {
        match self.mac.as_ref() {
            Some(v) => v,
            None => &[],
        }
    }

    pub fn clear_mac(&mut self) {
        self.mac = ::std::option::Option::None;
    }

    pub fn has_mac(&self) -> bool {
        self.mac.is_some()
    }

    // Param is passed by value, moved
    pub fn set_mac(&mut self, v: ::std::vec::Vec<u8>) {
        self.mac = ::std::option::Option::Some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_mac(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.mac.is_none() {
            self.mac = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        self.mac.as_mut().unwrap()
    }

    // Take field
    pub fn take_mac(&mut self) -> ::std::vec::Vec<u8> {
        self.mac.take().unwrap_or_else(|| ::std::vec::Vec::new())
    }

    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
        let mut fields = ::std::vec::Vec::with_capacity(2);
        let mut oneofs = ::std::vec::Vec::with_capacity(0);
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "address",
            |m: &RippleAddress| { &m.address },
            |m: &mut RippleAddress| { &mut m.address },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "mac",
            |m: &RippleAddress| { &m.mac },
            |m: &mut RippleAddress| { &mut m.mac },
        ));
        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<RippleAddress>(
            "RippleAddress",
            fields,
            oneofs,
        )
    }
}

impl ::protobuf::Message for RippleAddress {
    const NAME: &'static str = "RippleAddress";

    fn is_initialized(&self) -> bool {
        if self.address.is_none() {
            return false;
        }
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    self.address = ::std::option::Option::Some(is.read_string()?);
                },
                18 => {
                    self.mac = ::std::option::Option::Some(is.read_bytes()?);
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        if let Some(v) = self.address.as_ref() {
            my_size += ::protobuf::rt::string_size(1, &v);
        }
        if let Some(v) = self.mac.as_ref() {
            my_size += ::protobuf::rt::bytes_size(2, &v);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if let Some(v) = self.address.as_ref() {
            os.write_string(1, v)?;
        }
        if let Some(v) = self.mac.as_ref() {
            os.write_bytes(2, v)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

    fn new() -> RippleAddress {
        RippleAddress::new()
    }

    fn clear(&mut self) {
        self.address = ::std::option::Option::None;
        self.mac = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static RippleAddress {
        static instance: RippleAddress = RippleAddress {
            address: ::std::option::Option::None,
            mac: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

impl ::protobuf::MessageFull for RippleAddress {
    fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
        descriptor.get(|| file_descriptor().message_by_package_relative_name("RippleAddress").unwrap()).clone()
    }
}

impl ::std::fmt::Display for RippleAddress {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for RippleAddress {
    type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}

// @@protoc_insertion_point(message:hw.trezor.messages.ripple.RippleSignTx)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct RippleSignTx {
    // message fields
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.address_n)
    pub address_n: ::std::vec::Vec<u32>,
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.fee)
    pub fee: ::std::option::Option<u64>,
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.flags)
    pub flags: ::std::option::Option<u32>,
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.sequence)
    pub sequence: ::std::option::Option<u32>,
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.last_ledger_sequence)
    pub last_ledger_sequence: ::std::option::Option<u32>,
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.payment)
    pub payment: ::protobuf::MessageField<ripple_sign_tx::RipplePayment>,
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.chunkify)
    pub chunkify: ::std::option::Option<bool>,
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.payment_req)
    pub payment_req: ::protobuf::MessageField<super::messages_common::PaymentRequest>,
    // special fields
    // @@protoc_insertion_point(special_field:hw.trezor.messages.ripple.RippleSignTx.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

impl<'a> ::std::default::Default for &'a RippleSignTx {
    fn default() -> &'a RippleSignTx {
        <RippleSignTx as ::protobuf::Message>::default_instance()
    }
}

impl RippleSignTx {
    pub fn new() -> RippleSignTx {
        ::std::default::Default::default()
    }

    // required uint64 fee = 2;

    pub fn fee(&self) -> u64 {
        self.fee.unwrap_or(0)
    }

    pub fn clear_fee(&mut self) {
        self.fee = ::std::option::Option::None;
    }

    pub fn has_fee(&self) -> bool {
        self.fee.is_some()
    }

    // Param is passed by value, moved
    pub fn set_fee(&mut self, v: u64) {
        self.fee = ::std::option::Option::Some(v);
    }

    // optional uint32 flags = 3;

    pub fn flags(&self) -> u32 {
        self.flags.unwrap_or(0u32)
    }

    pub fn clear_flags(&mut self) {
        self.flags = ::std::option::Option::None;
    }

    pub fn has_flags(&self) -> bool {
        self.flags.is_some()
    }

    // Param is passed by value, moved
    pub fn set_flags(&mut self, v: u32) {
        self.flags = ::std::option::Option::Some(v);
    }

    // required uint32 sequence = 4;

    pub fn sequence(&self) -> u32 {
        self.sequence.unwrap_or(0)
    }

    pub fn clear_sequence(&mut self) {
        self.sequence = ::std::option::Option::None;
    }

    pub fn has_sequence(&self) -> bool {
        self.sequence.is_some()
    }

    // Param is passed by value, moved
    pub fn set_sequence(&mut self, v: u32) {
        self.sequence = ::std::option::Option::Some(v);
    }

    // optional uint32 last_ledger_sequence = 5;

    pub fn last_ledger_sequence(&self) -> u32 {
        self.last_ledger_sequence.unwrap_or(0)
    }

    pub fn clear_last_ledger_sequence(&mut self) {
        self.last_ledger_sequence = ::std::option::Option::None;
    }

    pub fn has_last_ledger_sequence(&self) -> bool {
        self.last_ledger_sequence.is_some()
    }

    // Param is passed by value, moved
    pub fn set_last_ledger_sequence(&mut self, v: u32) {
        self.last_ledger_sequence = ::std::option::Option::Some(v);
    }

    // optional bool chunkify = 7;

    pub fn chunkify(&self) -> bool {
        self.chunkify.unwrap_or(false)
    }

    pub fn clear_chunkify(&mut self) {
        self.chunkify = ::std::option::Option::None;
    }

    pub fn has_chunkify(&self) -> bool {
        self.chunkify.is_some()
    }

    // Param is passed by value, moved
    pub fn set_chunkify(&mut self, v: bool) {
        self.chunkify = ::std::option::Option::Some(v);
    }

    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
        let mut fields = ::std::vec::Vec::with_capacity(8);
        let mut oneofs = ::std::vec::Vec::with_capacity(0);
        fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
            "address_n",
            |m: &RippleSignTx| { &m.address_n },
            |m: &mut RippleSignTx| { &mut m.address_n },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "fee",
            |m: &RippleSignTx| { &m.fee },
            |m: &mut RippleSignTx| { &mut m.fee },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "flags",
            |m: &RippleSignTx| { &m.flags },
            |m: &mut RippleSignTx| { &mut m.flags },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "sequence",
            |m: &RippleSignTx| { &m.sequence },
            |m: &mut RippleSignTx| { &mut m.sequence },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "last_ledger_sequence",
            |m: &RippleSignTx| { &m.last_ledger_sequence },
            |m: &mut RippleSignTx| { &mut m.last_ledger_sequence },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, ripple_sign_tx::RipplePayment>(
            "payment",
            |m: &RippleSignTx| { &m.payment },
            |m: &mut RippleSignTx| { &mut m.payment },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "chunkify",
            |m: &RippleSignTx| { &m.chunkify },
            |m: &mut RippleSignTx| { &mut m.chunkify },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::messages_common::PaymentRequest>(
            "payment_req",
            |m: &RippleSignTx| { &m.payment_req },
            |m: &mut RippleSignTx| { &mut m.payment_req },
        ));
        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<RippleSignTx>(
            "RippleSignTx",
            fields,
            oneofs,
        )
    }
}

impl ::protobuf::Message for RippleSignTx {
    const NAME: &'static str = "RippleSignTx";

    fn is_initialized(&self) -> bool {
        if self.fee.is_none() {
            return false;
        }
        if self.sequence.is_none() {
            return false;
        }
        if self.payment.is_none() {
            return false;
        }
        for v in &self.payment {
            if !v.is_initialized() {
                return false;
            }
        };
        for v in &self.payment_req {
            if !v.is_initialized() {
                return false;
            }
        };
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    is.read_repeated_packed_uint32_into(&mut self.address_n)?;
                },
                8 => {
                    self.address_n.push(is.read_uint32()?);
                },
                16 => {
                    self.fee = ::std::option::Option::Some(is.read_uint64()?);
                },
                24 => {
                    self.flags = ::std::option::Option::Some(is.read_uint32()?);
                },
                32 => {
                    self.sequence = ::std::option::Option::Some(is.read_uint32()?);
                },
                40 => {
                    self.last_ledger_sequence = ::std::option::Option::Some(is.read_uint32()?);
                },
                50 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.payment)?;
                },
                56 => {
                    self.chunkify = ::std::option::Option::Some(is.read_bool()?);
                },
                66 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.payment_req)?;
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        for value in &self.address_n {
            my_size += ::protobuf::rt::uint32_size(1, *value);
        };
        if let Some(v) = self.fee {
            my_size += ::protobuf::rt::uint64_size(2, v);
        }
        if let Some(v) = self.flags {
            my_size += ::protobuf::rt::uint32_size(3, v);
        }
        if let Some(v) = self.sequence {
            my_size += ::protobuf::rt::uint32_size(4, v);
        }
        if let Some(v) = self.last_ledger_sequence {
            my_size += ::protobuf::rt::uint32_size(5, v);
        }
        if let Some(v) = self.payment.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.chunkify {
            my_size += 1 + 1;
        }
        if let Some(v) = self.payment_req.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        for v in &self.address_n {
            os.write_uint32(1, *v)?;
        };
        if let Some(v) = self.fee {
            os.write_uint64(2, v)?;
        }
        if let Some(v) = self.flags {
            os.write_uint32(3, v)?;
        }
        if let Some(v) = self.sequence {
            os.write_uint32(4, v)?;
        }
        if let Some(v) = self.last_ledger_sequence {
            os.write_uint32(5, v)?;
        }
        if let Some(v) = self.payment.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?;
        }
        if let Some(v) = self.chunkify {
            os.write_bool(7, v)?;
        }
        if let Some(v) = self.payment_req.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(8, v, os)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

    fn new() -> RippleSignTx {
        RippleSignTx::new()
    }

    fn clear(&mut self) {
        self.address_n.clear();
        self.fee = ::std::option::Option::None;
        self.flags = ::std::option::Option::None;
        self.sequence = ::std::option::Option::None;
        self.last_ledger_sequence = ::std::option::Option::None;
        self.payment.clear();
        self.chunkify = ::std::option::Option::None;
        self.payment_req.clear();
        self.special_fields.clear();
    }

    fn default_instance() -> &'static RippleSignTx {
        static instance: RippleSignTx = RippleSignTx {
            address_n: ::std::vec::Vec::new(),
            fee: ::std::option::Option::None,
            flags: ::std::option::Option::None,
            sequence: ::std::option::Option::None,
            last_ledger_sequence: ::std::option::Option::None,
            payment: ::protobuf::MessageField::none(),
            chunkify: ::std::option::Option::None,
            payment_req: ::protobuf::MessageField::none(),
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

impl ::protobuf::MessageFull for RippleSignTx {
    fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
        descriptor.get(|| file_descriptor().message_by_package_relative_name("RippleSignTx").unwrap()).clone()
    }
}

impl ::std::fmt::Display for RippleSignTx {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for RippleSignTx {
    type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}

/// Nested message and enums of message `RippleSignTx`
pub mod ripple_sign_tx {
    // @@protoc_insertion_point(message:hw.trezor.messages.ripple.RippleSignTx.RipplePayment)
    #[derive(PartialEq,Clone,Default,Debug)]
    pub struct RipplePayment {
        // message fields
        // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.RipplePayment.amount)
        pub amount: ::std::option::Option<u64>,
        // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.RipplePayment.destination)
        pub destination: ::std::option::Option<::std::string::String>,
        // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignTx.RipplePayment.destination_tag)
        pub destination_tag: ::std::option::Option<u32>,
        // special fields
        // @@protoc_insertion_point(special_field:hw.trezor.messages.ripple.RippleSignTx.RipplePayment.special_fields)
        pub special_fields: ::protobuf::SpecialFields,
    }

    impl<'a> ::std::default::Default for &'a RipplePayment {
        fn default() -> &'a RipplePayment {
            <RipplePayment as ::protobuf::Message>::default_instance()
        }
    }

    impl RipplePayment {
        pub fn new() -> RipplePayment {
            ::std::default::Default::default()
        }

        // required uint64 amount = 1;

        pub fn amount(&self) -> u64 {
            self.amount.unwrap_or(0)
        }

        pub fn clear_amount(&mut self) {
            self.amount = ::std::option::Option::None;
        }

        pub fn has_amount(&self) -> bool {
            self.amount.is_some()
        }

        // Param is passed by value, moved
        pub fn set_amount(&mut self, v: u64) {
            self.amount = ::std::option::Option::Some(v);
        }

        // required string destination = 2;

        pub fn destination(&self) -> &str {
            match self.destination.as_ref() {
                Some(v) => v,
                None => "",
            }
        }

        pub fn clear_destination(&mut self) {
            self.destination = ::std::option::Option::None;
        }

        pub fn has_destination(&self) -> bool {
            self.destination.is_some()
        }

        // Param is passed by value, moved
        pub fn set_destination(&mut self, v: ::std::string::String) {
            self.destination = ::std::option::Option::Some(v);
        }

        // Mutable pointer to the field.
        // If field is not initialized, it is initialized with default value first.
        pub fn mut_destination(&mut self) -> &mut ::std::string::String {
            if self.destination.is_none() {
                self.destination = ::std::option::Option::Some(::std::string::String::new());
            }
            self.destination.as_mut().unwrap()
        }

        // Take field
        pub fn take_destination(&mut self) -> ::std::string::String {
            self.destination.take().unwrap_or_else(|| ::std::string::String::new())
        }

        // optional uint32 destination_tag = 3;

        pub fn destination_tag(&self) -> u32 {
            self.destination_tag.unwrap_or(0)
        }

        pub fn clear_destination_tag(&mut self) {
            self.destination_tag = ::std::option::Option::None;
        }

        pub fn has_destination_tag(&self) -> bool {
            self.destination_tag.is_some()
        }

        // Param is passed by value, moved
        pub fn set_destination_tag(&mut self, v: u32) {
            self.destination_tag = ::std::option::Option::Some(v);
        }

        pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
            let mut fields = ::std::vec::Vec::with_capacity(3);
            let mut oneofs = ::std::vec::Vec::with_capacity(0);
            fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
                "amount",
                |m: &RipplePayment| { &m.amount },
                |m: &mut RipplePayment| { &mut m.amount },
            ));
            fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
                "destination",
                |m: &RipplePayment| { &m.destination },
                |m: &mut RipplePayment| { &mut m.destination },
            ));
            fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
                "destination_tag",
                |m: &RipplePayment| { &m.destination_tag },
                |m: &mut RipplePayment| { &mut m.destination_tag },
            ));
            ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<RipplePayment>(
                "RippleSignTx.RipplePayment",
                fields,
                oneofs,
            )
        }
    }

    impl ::protobuf::Message for RipplePayment {
        const NAME: &'static str = "RipplePayment";

        fn is_initialized(&self) -> bool {
            if self.amount.is_none() {
                return false;
            }
            if self.destination.is_none() {
                return false;
            }
            true
        }

        fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
            while let Some(tag) = is.read_raw_tag_or_eof()? {
                match tag {
                    8 => {
                        self.amount = ::std::option::Option::Some(is.read_uint64()?);
                    },
                    18 => {
                        self.destination = ::std::option::Option::Some(is.read_string()?);
                    },
                    24 => {
                        self.destination_tag = ::std::option::Option::Some(is.read_uint32()?);
                    },
                    tag => {
                        ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                    },
                };
            }
            ::std::result::Result::Ok(())
        }

        // Compute sizes of nested messages
        #[allow(unused_variables)]
        fn compute_size(&self) -> u64 {
            let mut my_size = 0;
            if let Some(v) = self.amount {
                my_size += ::protobuf::rt::uint64_size(1, v);
            }
            if let Some(v) = self.destination.as_ref() {
                my_size += ::protobuf::rt::string_size(2, &v);
            }
            if let Some(v) = self.destination_tag {
                my_size += ::protobuf::rt::uint32_size(3, v);
            }
            my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
            self.special_fields.cached_size().set(my_size as u32);
            my_size
        }

        fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
            if let Some(v) = self.amount {
                os.write_uint64(1, v)?;
            }
            if let Some(v) = self.destination.as_ref() {
                os.write_string(2, v)?;
            }
            if let Some(v) = self.destination_tag {
                os.write_uint32(3, v)?;
            }
            os.write_unknown_fields(self.special_fields.unknown_fields())?;
            ::std::result::Result::Ok(())
        }

        fn special_fields(&self) -> &::protobuf::SpecialFields {
            &self.special_fields
        }

        fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
            &mut self.special_fields
        }

        fn new() -> RipplePayment {
            RipplePayment::new()
        }

        fn clear(&mut self) {
            self.amount = ::std::option::Option::None;
            self.destination = ::std::option::Option::None;
            self.destination_tag = ::std::option::Option::None;
            self.special_fields.clear();
        }

        fn default_instance() -> &'static RipplePayment {
            static instance: RipplePayment = RipplePayment {
                amount: ::std::option::Option::None,
                destination: ::std::option::Option::None,
                destination_tag: ::std::option::Option::None,
                special_fields: ::protobuf::SpecialFields::new(),
            };
            &instance
        }
    }

    impl ::protobuf::MessageFull for RipplePayment {
        fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
            static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
            descriptor.get(|| super::file_descriptor().message_by_package_relative_name("RippleSignTx.RipplePayment").unwrap()).clone()
        }
    }

    impl ::std::fmt::Display for RipplePayment {
        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            ::protobuf::text_format::fmt(self, f)
        }
    }

    impl ::protobuf::reflect::ProtobufValue for RipplePayment {
        type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
    }
}

// @@protoc_insertion_point(message:hw.trezor.messages.ripple.RippleSignedTx)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct RippleSignedTx {
    // message fields
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignedTx.signature)
    pub signature: ::std::option::Option<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:hw.trezor.messages.ripple.RippleSignedTx.serialized_tx)
    pub serialized_tx: ::std::option::Option<::std::vec::Vec<u8>>,
    // special fields
    // @@protoc_insertion_point(special_field:hw.trezor.messages.ripple.RippleSignedTx.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

impl<'a> ::std::default::Default for &'a RippleSignedTx {
    fn default() -> &'a RippleSignedTx {
        <RippleSignedTx as ::protobuf::Message>::default_instance()
    }
}

impl RippleSignedTx {
    pub fn new() -> RippleSignedTx {
        ::std::default::Default::default()
    }

    // required bytes signature = 1;

    pub fn signature(&self) -> &[u8] {
        match self.signature.as_ref() {
            Some(v) => v,
            None => &[],
        }
    }

    pub fn clear_signature(&mut self) {
        self.signature = ::std::option::Option::None;
    }

    pub fn has_signature(&self) -> bool {
        self.signature.is_some()
    }

    // Param is passed by value, moved
    pub fn set_signature(&mut self, v: ::std::vec::Vec<u8>) {
        self.signature = ::std::option::Option::Some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.signature.is_none() {
            self.signature = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        self.signature.as_mut().unwrap()
    }

    // Take field
    pub fn take_signature(&mut self) -> ::std::vec::Vec<u8> {
        self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new())
    }

    // required bytes serialized_tx = 2;

    pub fn serialized_tx(&self) -> &[u8] {
        match self.serialized_tx.as_ref() {
            Some(v) => v,
            None => &[],
        }
    }

    pub fn clear_serialized_tx(&mut self) {
        self.serialized_tx = ::std::option::Option::None;
    }

    pub fn has_serialized_tx(&self) -> bool {
        self.serialized_tx.is_some()
    }

    // Param is passed by value, moved
    pub fn set_serialized_tx(&mut self, v: ::std::vec::Vec<u8>) {
        self.serialized_tx = ::std::option::Option::Some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_serialized_tx(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.serialized_tx.is_none() {
            self.serialized_tx = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        self.serialized_tx.as_mut().unwrap()
    }

    // Take field
    pub fn take_serialized_tx(&mut self) -> ::std::vec::Vec<u8> {
        self.serialized_tx.take().unwrap_or_else(|| ::std::vec::Vec::new())
    }

    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
        let mut fields = ::std::vec::Vec::with_capacity(2);
        let mut oneofs = ::std::vec::Vec::with_capacity(0);
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "signature",
            |m: &RippleSignedTx| { &m.signature },
            |m: &mut RippleSignedTx| { &mut m.signature },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "serialized_tx",
            |m: &RippleSignedTx| { &m.serialized_tx },
            |m: &mut RippleSignedTx| { &mut m.serialized_tx },
        ));
        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<RippleSignedTx>(
            "RippleSignedTx",
            fields,
            oneofs,
        )
    }
}

impl ::protobuf::Message for RippleSignedTx {
    const NAME: &'static str = "RippleSignedTx";

    fn is_initialized(&self) -> bool {
        if self.signature.is_none() {
            return false;
        }
        if self.serialized_tx.is_none() {
            return false;
        }
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    self.signature = ::std::option::Option::Some(is.read_bytes()?);
                },
                18 => {
                    self.serialized_tx = ::std::option::Option::Some(is.read_bytes()?);
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        if let Some(v) = self.signature.as_ref() {
            my_size += ::protobuf::rt::bytes_size(1, &v);
        }
        if let Some(v) = self.serialized_tx.as_ref() {
            my_size += ::protobuf::rt::bytes_size(2, &v);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if let Some(v) = self.signature.as_ref() {
            os.write_bytes(1, v)?;
        }
        if let Some(v) = self.serialized_tx.as_ref() {
            os.write_bytes(2, v)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

    fn new() -> RippleSignedTx {
        RippleSignedTx::new()
    }

    fn clear(&mut self) {
        self.signature = ::std::option::Option::None;
        self.serialized_tx = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static RippleSignedTx {
        static instance: RippleSignedTx = RippleSignedTx {
            signature: ::std::option::Option::None,
            serialized_tx: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

impl ::protobuf::MessageFull for RippleSignedTx {
    fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
        descriptor.get(|| file_descriptor().message_by_package_relative_name("RippleSignedTx").unwrap()).clone()
    }
}

impl ::std::fmt::Display for RippleSignedTx {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for RippleSignedTx {
    type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}

static file_descriptor_proto_data: &'static [u8] = b"\
    \n\x15messages-ripple.proto\x12\x19hw.trezor.messages.ripple\x1a\x15mess\
    ages-common.proto\"n\n\x10RippleGetAddress\x12\x1b\n\taddress_n\x18\x01\
    \x20\x03(\rR\x08addressN\x12!\n\x0cshow_display\x18\x02\x20\x01(\x08R\
    \x0bshowDisplay\x12\x1a\n\x08chunkify\x18\x03\x20\x01(\x08R\x08chunkify\
    \";\n\rRippleAddress\x12\x18\n\x07address\x18\x01\x20\x02(\tR\x07address\
    \x12\x10\n\x03mac\x18\x02\x20\x01(\x0cR\x03mac\"\xd1\x03\n\x0cRippleSign\
    Tx\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12\x10\n\x03fee\
    \x18\x02\x20\x02(\x04R\x03fee\x12\x17\n\x05flags\x18\x03\x20\x01(\r:\x01\
    0R\x05flags\x12\x1a\n\x08sequence\x18\x04\x20\x02(\rR\x08sequence\x120\n\
    \x14last_ledger_sequence\x18\x05\x20\x01(\rR\x12lastLedgerSequence\x12O\
    \n\x07payment\x18\x06\x20\x02(\x0b25.hw.trezor.messages.ripple.RippleSig\
    nTx.RipplePaymentR\x07payment\x12\x1a\n\x08chunkify\x18\x07\x20\x01(\x08\
    R\x08chunkify\x12J\n\x0bpayment_req\x18\x08\x20\x01(\x0b2).hw.trezor.mes\
    sages.common.PaymentRequestR\npaymentReq\x1ar\n\rRipplePayment\x12\x16\n\
    \x06amount\x18\x01\x20\x02(\x04R\x06amount\x12\x20\n\x0bdestination\x18\
    \x02\x20\x02(\tR\x0bdestination\x12'\n\x0fdestination_tag\x18\x03\x20\
    \x01(\rR\x0edestinationTag\"S\n\x0eRippleSignedTx\x12\x1c\n\tsignature\
    \x18\x01\x20\x02(\x0cR\tsignature\x12#\n\rserialized_tx\x18\x02\x20\x02(\
    \x0cR\x0cserializedTxB:\n#com.satoshilabs.trezor.lib.protobufB\x13Trezor\
    MessageRipple\
";

/// `FileDescriptorProto` object which was a source for this generated file
fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
    static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
    file_descriptor_proto_lazy.get(|| {
        ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
    })
}

/// `FileDescriptor` object which allows dynamic access to files
pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
    static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
    static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
    file_descriptor.get(|| {
        let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
            let mut deps = ::std::vec::Vec::with_capacity(1);
            deps.push(super::messages_common::file_descriptor().clone());
            let mut messages = ::std::vec::Vec::with_capacity(5);
            messages.push(RippleGetAddress::generated_message_descriptor_data());
            messages.push(RippleAddress::generated_message_descriptor_data());
            messages.push(RippleSignTx::generated_message_descriptor_data());
            messages.push(RippleSignedTx::generated_message_descriptor_data());
            messages.push(ripple_sign_tx::RipplePayment::generated_message_descriptor_data());
            let mut enums = ::std::vec::Vec::with_capacity(0);
            ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
                file_descriptor_proto(),
                deps,
                messages,
                enums,
            )
        });
        ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
    })
}
