// 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-telemetry.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.telemetry.TelemetryGet)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct TelemetryGet {
    // special fields
    // @@protoc_insertion_point(special_field:hw.trezor.messages.telemetry.TelemetryGet.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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

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

    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
        let mut fields = ::std::vec::Vec::with_capacity(0);
        let mut oneofs = ::std::vec::Vec::with_capacity(0);
        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<TelemetryGet>(
            "TelemetryGet",
            fields,
            oneofs,
        )
    }
}

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

    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 {
                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;
        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<()> {
        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() -> TelemetryGet {
        TelemetryGet::new()
    }

    fn clear(&mut self) {
        self.special_fields.clear();
    }

    fn default_instance() -> &'static TelemetryGet {
        static instance: TelemetryGet = TelemetryGet {
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

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

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

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

// @@protoc_insertion_point(message:hw.trezor.messages.telemetry.Telemetry)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct Telemetry {
    // message fields
    // @@protoc_insertion_point(field:hw.trezor.messages.telemetry.Telemetry.min_temp_c)
    pub min_temp_c: ::std::option::Option<i32>,
    // @@protoc_insertion_point(field:hw.trezor.messages.telemetry.Telemetry.max_temp_c)
    pub max_temp_c: ::std::option::Option<i32>,
    // @@protoc_insertion_point(field:hw.trezor.messages.telemetry.Telemetry.battery_errors)
    pub battery_errors: ::std::option::Option<u32>,
    // @@protoc_insertion_point(field:hw.trezor.messages.telemetry.Telemetry.battery_cycles)
    pub battery_cycles: ::std::option::Option<u32>,
    // special fields
    // @@protoc_insertion_point(special_field:hw.trezor.messages.telemetry.Telemetry.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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

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

    // optional sint32 min_temp_c = 1;

    pub fn min_temp_c(&self) -> i32 {
        self.min_temp_c.unwrap_or(0)
    }

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

    pub fn has_min_temp_c(&self) -> bool {
        self.min_temp_c.is_some()
    }

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

    // optional sint32 max_temp_c = 2;

    pub fn max_temp_c(&self) -> i32 {
        self.max_temp_c.unwrap_or(0)
    }

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

    pub fn has_max_temp_c(&self) -> bool {
        self.max_temp_c.is_some()
    }

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

    // optional uint32 battery_errors = 3;

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

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

    pub fn has_battery_errors(&self) -> bool {
        self.battery_errors.is_some()
    }

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

    // optional uint32 battery_cycles = 4;

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

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

    pub fn has_battery_cycles(&self) -> bool {
        self.battery_cycles.is_some()
    }

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

    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
        let mut fields = ::std::vec::Vec::with_capacity(4);
        let mut oneofs = ::std::vec::Vec::with_capacity(0);
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "min_temp_c",
            |m: &Telemetry| { &m.min_temp_c },
            |m: &mut Telemetry| { &mut m.min_temp_c },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "max_temp_c",
            |m: &Telemetry| { &m.max_temp_c },
            |m: &mut Telemetry| { &mut m.max_temp_c },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "battery_errors",
            |m: &Telemetry| { &m.battery_errors },
            |m: &mut Telemetry| { &mut m.battery_errors },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "battery_cycles",
            |m: &Telemetry| { &m.battery_cycles },
            |m: &mut Telemetry| { &mut m.battery_cycles },
        ));
        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<Telemetry>(
            "Telemetry",
            fields,
            oneofs,
        )
    }
}

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

    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.min_temp_c = ::std::option::Option::Some(is.read_sint32()?);
                },
                16 => {
                    self.max_temp_c = ::std::option::Option::Some(is.read_sint32()?);
                },
                24 => {
                    self.battery_errors = ::std::option::Option::Some(is.read_uint32()?);
                },
                32 => {
                    self.battery_cycles = ::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.min_temp_c {
            my_size += ::protobuf::rt::sint32_size(1, v);
        }
        if let Some(v) = self.max_temp_c {
            my_size += ::protobuf::rt::sint32_size(2, v);
        }
        if let Some(v) = self.battery_errors {
            my_size += ::protobuf::rt::uint32_size(3, v);
        }
        if let Some(v) = self.battery_cycles {
            my_size += ::protobuf::rt::uint32_size(4, 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.min_temp_c {
            os.write_sint32(1, v)?;
        }
        if let Some(v) = self.max_temp_c {
            os.write_sint32(2, v)?;
        }
        if let Some(v) = self.battery_errors {
            os.write_uint32(3, v)?;
        }
        if let Some(v) = self.battery_cycles {
            os.write_uint32(4, 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() -> Telemetry {
        Telemetry::new()
    }

    fn clear(&mut self) {
        self.min_temp_c = ::std::option::Option::None;
        self.max_temp_c = ::std::option::Option::None;
        self.battery_errors = ::std::option::Option::None;
        self.battery_cycles = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static Telemetry {
        static instance: Telemetry = Telemetry {
            min_temp_c: ::std::option::Option::None,
            max_temp_c: ::std::option::Option::None,
            battery_errors: ::std::option::Option::None,
            battery_cycles: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

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

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

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

static file_descriptor_proto_data: &'static [u8] = b"\
    \n\x18messages-telemetry.proto\x12\x1chw.trezor.messages.telemetry\x1a\r\
    options.proto\"\x0e\n\x0cTelemetryGet\"\x95\x01\n\tTelemetry\x12\x1c\n\n\
    min_temp_c\x18\x01\x20\x01(\x11R\x08minTempC\x12\x1c\n\nmax_temp_c\x18\
    \x02\x20\x01(\x11R\x08maxTempC\x12%\n\x0ebattery_errors\x18\x03\x20\x01(\
    \rR\rbatteryErrors\x12%\n\x0ebattery_cycles\x18\x04\x20\x01(\rR\rbattery\
    CyclesBA\n#com.satoshilabs.trezor.lib.protobufB\x16TrezorMessageTelemetr\
    y\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(2);
            messages.push(TelemetryGet::generated_message_descriptor_data());
            messages.push(Telemetry::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)
    })
}
