// 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-ble.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.ble.BleUnpair)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct BleUnpair {
    // message fields
    // @@protoc_insertion_point(field:hw.trezor.messages.ble.BleUnpair.all)
    pub all: ::std::option::Option<bool>,
    // @@protoc_insertion_point(field:hw.trezor.messages.ble.BleUnpair.addr)
    pub addr: ::std::option::Option<::std::vec::Vec<u8>>,
    // special fields
    // @@protoc_insertion_point(special_field:hw.trezor.messages.ble.BleUnpair.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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

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

    // optional bool all = 1;

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

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

    pub fn has_all(&self) -> bool {
        self.all.is_some()
    }

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

    // optional bytes addr = 2;

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

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

    pub fn has_addr(&self) -> bool {
        self.addr.is_some()
    }

    // Param is passed by value, moved
    pub fn set_addr(&mut self, v: ::std::vec::Vec<u8>) {
        self.addr = ::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_addr(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.addr.is_none() {
            self.addr = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        self.addr.as_mut().unwrap()
    }

    // Take field
    pub fn take_addr(&mut self) -> ::std::vec::Vec<u8> {
        self.addr.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::<_, _>(
            "all",
            |m: &BleUnpair| { &m.all },
            |m: &mut BleUnpair| { &mut m.all },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "addr",
            |m: &BleUnpair| { &m.addr },
            |m: &mut BleUnpair| { &mut m.addr },
        ));
        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<BleUnpair>(
            "BleUnpair",
            fields,
            oneofs,
        )
    }
}

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

    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 {
                8 => {
                    self.all = ::std::option::Option::Some(is.read_bool()?);
                },
                18 => {
                    self.addr = ::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.all {
            my_size += 1 + 1;
        }
        if let Some(v) = self.addr.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.all {
            os.write_bool(1, v)?;
        }
        if let Some(v) = self.addr.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() -> BleUnpair {
        BleUnpair::new()
    }

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

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

impl ::protobuf::MessageFull for BleUnpair {
    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("BleUnpair").unwrap()).clone()
    }
}

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

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

static file_descriptor_proto_data: &'static [u8] = b"\
    \n\x12messages-ble.proto\x12\x16hw.trezor.messages.ble\x1a\roptions.prot\
    o\"1\n\tBleUnpair\x12\x10\n\x03all\x18\x01\x20\x01(\x08R\x03all\x12\x12\
    \n\x04addr\x18\x02\x20\x01(\x0cR\x04addrB;\n#com.satoshilabs.trezor.lib.\
    protobufB\x10TrezorMessageBle\x80\xa6\x1d\x01\
";

/// `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::options::file_descriptor().clone());
            let mut messages = ::std::vec::Vec::with_capacity(1);
            messages.push(BleUnpair::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)
    })
}
