From 20987a66b460580857bc2fb37a73630796269137 Mon Sep 17 00:00:00 2001 From: KubaWis Date: Sun, 23 Feb 2025 18:21:10 +0100 Subject: [PATCH] remove unneded file --- src/xiaomi.rs | 29681 ------------------------------------------------ 1 file changed, 29681 deletions(-) delete mode 100644 src/xiaomi.rs diff --git a/src/xiaomi.rs b/src/xiaomi.rs deleted file mode 100644 index 39f697a..0000000 --- a/src/xiaomi.rs +++ /dev/null @@ -1,29681 +0,0 @@ -// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit -// .proto file is parsed by protoc --rs_out=... -// @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 `xiaomi.proto` - -// @@protoc_insertion_point(message:xiaomi.Command) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct Command { - // message fields - // @@protoc_insertion_point(field:xiaomi.Command.type) - pub type_: ::std::option::Option, - // @@protoc_insertion_point(field:xiaomi.Command.subtype) - pub subtype: ::std::option::Option, - // @@protoc_insertion_point(field:xiaomi.Command.auth) - pub auth: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.Command.system) - pub system: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.Command.watchface) - pub watchface: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.Command.health) - pub health: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.Command.calendar) - pub calendar: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.Command.music) - pub music: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.Command.notification) - pub notification: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.Command.weather) - pub weather: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.Command.schedule) - pub schedule: ::protobuf::MessageField, - /// command type 21 - // @@protoc_insertion_point(field:xiaomi.Command.phonebook) - pub phonebook: ::protobuf::MessageField, - /// type 22 - // @@protoc_insertion_point(field:xiaomi.Command.dataUpload) - pub dataUpload: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.Command.status) - pub status: ::std::option::Option, - // special fields - // @@protoc_insertion_point(special_field:xiaomi.Command.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a Command { - fn default() -> &'a Command { - ::default_instance() - } -} - -impl Command { - pub fn new() -> Command { - ::std::default::Default::default() - } - - // required uint32 type = 1; - - pub fn type_(&self) -> u32 { - self.type_.unwrap_or(0) - } - - pub fn clear_type_(&mut self) { - self.type_ = ::std::option::Option::None; - } - - pub fn has_type(&self) -> bool { - self.type_.is_some() - } - - // Param is passed by value, moved - pub fn set_type(&mut self, v: u32) { - self.type_ = ::std::option::Option::Some(v); - } - - // optional uint32 subtype = 2; - - pub fn subtype(&self) -> u32 { - self.subtype.unwrap_or(0) - } - - pub fn clear_subtype(&mut self) { - self.subtype = ::std::option::Option::None; - } - - pub fn has_subtype(&self) -> bool { - self.subtype.is_some() - } - - // Param is passed by value, moved - pub fn set_subtype(&mut self, v: u32) { - self.subtype = ::std::option::Option::Some(v); - } - - // optional uint32 status = 100; - - pub fn status(&self) -> u32 { - self.status.unwrap_or(0) - } - - pub fn clear_status(&mut self) { - self.status = ::std::option::Option::None; - } - - pub fn has_status(&self) -> bool { - self.status.is_some() - } - - // Param is passed by value, moved - pub fn set_status(&mut self, v: u32) { - self.status = ::std::option::Option::Some(v); - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(14); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "type", - |m: &Command| { &m.type_ }, - |m: &mut Command| { &mut m.type_ }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "subtype", - |m: &Command| { &m.subtype }, - |m: &mut Command| { &mut m.subtype }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Auth>( - "auth", - |m: &Command| { &m.auth }, - |m: &mut Command| { &mut m.auth }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, System>( - "system", - |m: &Command| { &m.system }, - |m: &mut Command| { &mut m.system }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Watchface>( - "watchface", - |m: &Command| { &m.watchface }, - |m: &mut Command| { &mut m.watchface }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Health>( - "health", - |m: &Command| { &m.health }, - |m: &mut Command| { &mut m.health }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Calendar>( - "calendar", - |m: &Command| { &m.calendar }, - |m: &mut Command| { &mut m.calendar }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Music>( - "music", - |m: &Command| { &m.music }, - |m: &mut Command| { &mut m.music }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Notification>( - "notification", - |m: &Command| { &m.notification }, - |m: &mut Command| { &mut m.notification }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Weather>( - "weather", - |m: &Command| { &m.weather }, - |m: &mut Command| { &mut m.weather }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Schedule>( - "schedule", - |m: &Command| { &m.schedule }, - |m: &mut Command| { &mut m.schedule }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Phonebook>( - "phonebook", - |m: &Command| { &m.phonebook }, - |m: &mut Command| { &mut m.phonebook }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, DataUpload>( - "dataUpload", - |m: &Command| { &m.dataUpload }, - |m: &mut Command| { &mut m.dataUpload }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "status", - |m: &Command| { &m.status }, - |m: &mut Command| { &mut m.status }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "Command", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for Command { - const NAME: &'static str = "Command"; - - fn is_initialized(&self) -> bool { - if self.type_.is_none() { - return false; - } - for v in &self.auth { - if !v.is_initialized() { - return false; - } - }; - for v in &self.system { - if !v.is_initialized() { - return false; - } - }; - for v in &self.watchface { - if !v.is_initialized() { - return false; - } - }; - for v in &self.health { - if !v.is_initialized() { - return false; - } - }; - for v in &self.calendar { - if !v.is_initialized() { - return false; - } - }; - for v in &self.music { - if !v.is_initialized() { - return false; - } - }; - for v in &self.notification { - if !v.is_initialized() { - return false; - } - }; - for v in &self.weather { - if !v.is_initialized() { - return false; - } - }; - for v in &self.schedule { - if !v.is_initialized() { - return false; - } - }; - for v in &self.phonebook { - if !v.is_initialized() { - return false; - } - }; - for v in &self.dataUpload { - 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 { - 8 => { - self.type_ = ::std::option::Option::Some(is.read_uint32()?); - }, - 16 => { - self.subtype = ::std::option::Option::Some(is.read_uint32()?); - }, - 26 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.auth)?; - }, - 34 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.system)?; - }, - 50 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.watchface)?; - }, - 82 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.health)?; - }, - 114 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.calendar)?; - }, - 162 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.music)?; - }, - 74 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.notification)?; - }, - 98 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.weather)?; - }, - 154 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.schedule)?; - }, - 186 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.phonebook)?; - }, - 194 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.dataUpload)?; - }, - 800 => { - self.status = ::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.type_ { - my_size += ::protobuf::rt::uint32_size(1, v); - } - if let Some(v) = self.subtype { - my_size += ::protobuf::rt::uint32_size(2, v); - } - if let Some(v) = self.auth.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.system.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.watchface.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.health.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.calendar.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.music.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.notification.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.weather.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.schedule.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.phonebook.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.dataUpload.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.status { - my_size += ::protobuf::rt::uint32_size(100, 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.type_ { - os.write_uint32(1, v)?; - } - if let Some(v) = self.subtype { - os.write_uint32(2, v)?; - } - if let Some(v) = self.auth.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; - } - if let Some(v) = self.system.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; - } - if let Some(v) = self.watchface.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?; - } - if let Some(v) = self.health.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(10, v, os)?; - } - if let Some(v) = self.calendar.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(14, v, os)?; - } - if let Some(v) = self.music.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(20, v, os)?; - } - if let Some(v) = self.notification.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(9, v, os)?; - } - if let Some(v) = self.weather.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(12, v, os)?; - } - if let Some(v) = self.schedule.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(19, v, os)?; - } - if let Some(v) = self.phonebook.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(23, v, os)?; - } - if let Some(v) = self.dataUpload.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(24, v, os)?; - } - if let Some(v) = self.status { - os.write_uint32(100, 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() -> Command { - Command::new() - } - - fn clear(&mut self) { - self.type_ = ::std::option::Option::None; - self.subtype = ::std::option::Option::None; - self.auth.clear(); - self.system.clear(); - self.watchface.clear(); - self.health.clear(); - self.calendar.clear(); - self.music.clear(); - self.notification.clear(); - self.weather.clear(); - self.schedule.clear(); - self.phonebook.clear(); - self.dataUpload.clear(); - self.status = ::std::option::Option::None; - self.special_fields.clear(); - } - - fn default_instance() -> &'static Command { - static instance: Command = Command { - type_: ::std::option::Option::None, - subtype: ::std::option::Option::None, - auth: ::protobuf::MessageField::none(), - system: ::protobuf::MessageField::none(), - watchface: ::protobuf::MessageField::none(), - health: ::protobuf::MessageField::none(), - calendar: ::protobuf::MessageField::none(), - music: ::protobuf::MessageField::none(), - notification: ::protobuf::MessageField::none(), - weather: ::protobuf::MessageField::none(), - schedule: ::protobuf::MessageField::none(), - phonebook: ::protobuf::MessageField::none(), - dataUpload: ::protobuf::MessageField::none(), - status: ::std::option::Option::None, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for Command { - 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("Command").unwrap()).clone() - } -} - -impl ::std::fmt::Display for Command { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Command { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -// @@protoc_insertion_point(message:xiaomi.Auth) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct Auth { - // message fields - // @@protoc_insertion_point(field:xiaomi.Auth.userId) - pub userId: ::std::option::Option<::std::string::String>, - // @@protoc_insertion_point(field:xiaomi.Auth.status) - pub status: ::std::option::Option, - /// 1, 26 - // @@protoc_insertion_point(field:xiaomi.Auth.phoneNonce) - pub phoneNonce: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.Auth.watchNonce) - pub watchNonce: ::protobuf::MessageField, - /// 1, 27 - // @@protoc_insertion_point(field:xiaomi.Auth.authStep3) - pub authStep3: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.Auth.authStep4) - pub authStep4: ::protobuf::MessageField, - // special fields - // @@protoc_insertion_point(special_field:xiaomi.Auth.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a Auth { - fn default() -> &'a Auth { - ::default_instance() - } -} - -impl Auth { - pub fn new() -> Auth { - ::std::default::Default::default() - } - - // optional string userId = 7; - - pub fn userId(&self) -> &str { - match self.userId.as_ref() { - Some(v) => v, - None => "", - } - } - - pub fn clear_userId(&mut self) { - self.userId = ::std::option::Option::None; - } - - pub fn has_userId(&self) -> bool { - self.userId.is_some() - } - - // Param is passed by value, moved - pub fn set_userId(&mut self, v: ::std::string::String) { - self.userId = ::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_userId(&mut self) -> &mut ::std::string::String { - if self.userId.is_none() { - self.userId = ::std::option::Option::Some(::std::string::String::new()); - } - self.userId.as_mut().unwrap() - } - - // Take field - pub fn take_userId(&mut self) -> ::std::string::String { - self.userId.take().unwrap_or_else(|| ::std::string::String::new()) - } - - // optional uint32 status = 8; - - pub fn status(&self) -> u32 { - self.status.unwrap_or(0) - } - - pub fn clear_status(&mut self) { - self.status = ::std::option::Option::None; - } - - pub fn has_status(&self) -> bool { - self.status.is_some() - } - - // Param is passed by value, moved - pub fn set_status(&mut self, v: u32) { - self.status = ::std::option::Option::Some(v); - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(6); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "userId", - |m: &Auth| { &m.userId }, - |m: &mut Auth| { &mut m.userId }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "status", - |m: &Auth| { &m.status }, - |m: &mut Auth| { &mut m.status }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, PhoneNonce>( - "phoneNonce", - |m: &Auth| { &m.phoneNonce }, - |m: &mut Auth| { &mut m.phoneNonce }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, WatchNonce>( - "watchNonce", - |m: &Auth| { &m.watchNonce }, - |m: &mut Auth| { &mut m.watchNonce }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, AuthStep3>( - "authStep3", - |m: &Auth| { &m.authStep3 }, - |m: &mut Auth| { &mut m.authStep3 }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, AuthStep4>( - "authStep4", - |m: &Auth| { &m.authStep4 }, - |m: &mut Auth| { &mut m.authStep4 }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "Auth", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for Auth { - const NAME: &'static str = "Auth"; - - fn is_initialized(&self) -> bool { - for v in &self.phoneNonce { - if !v.is_initialized() { - return false; - } - }; - for v in &self.watchNonce { - if !v.is_initialized() { - return false; - } - }; - for v in &self.authStep3 { - if !v.is_initialized() { - return false; - } - }; - for v in &self.authStep4 { - 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 { - 58 => { - self.userId = ::std::option::Option::Some(is.read_string()?); - }, - 64 => { - self.status = ::std::option::Option::Some(is.read_uint32()?); - }, - 242 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.phoneNonce)?; - }, - 250 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.watchNonce)?; - }, - 258 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.authStep3)?; - }, - 266 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.authStep4)?; - }, - 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.userId.as_ref() { - my_size += ::protobuf::rt::string_size(7, &v); - } - if let Some(v) = self.status { - my_size += ::protobuf::rt::uint32_size(8, v); - } - if let Some(v) = self.phoneNonce.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.watchNonce.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.authStep3.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.authStep4.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::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<()> { - if let Some(v) = self.userId.as_ref() { - os.write_string(7, v)?; - } - if let Some(v) = self.status { - os.write_uint32(8, v)?; - } - if let Some(v) = self.phoneNonce.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(30, v, os)?; - } - if let Some(v) = self.watchNonce.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(31, v, os)?; - } - if let Some(v) = self.authStep3.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(32, v, os)?; - } - if let Some(v) = self.authStep4.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(33, 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() -> Auth { - Auth::new() - } - - fn clear(&mut self) { - self.userId = ::std::option::Option::None; - self.status = ::std::option::Option::None; - self.phoneNonce.clear(); - self.watchNonce.clear(); - self.authStep3.clear(); - self.authStep4.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static Auth { - static instance: Auth = Auth { - userId: ::std::option::Option::None, - status: ::std::option::Option::None, - phoneNonce: ::protobuf::MessageField::none(), - watchNonce: ::protobuf::MessageField::none(), - authStep3: ::protobuf::MessageField::none(), - authStep4: ::protobuf::MessageField::none(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for Auth { - 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("Auth").unwrap()).clone() - } -} - -impl ::std::fmt::Display for Auth { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Auth { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -// @@protoc_insertion_point(message:xiaomi.PhoneNonce) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct PhoneNonce { - // message fields - // @@protoc_insertion_point(field:xiaomi.PhoneNonce.nonce) - pub nonce: ::std::option::Option<::std::vec::Vec>, - // special fields - // @@protoc_insertion_point(special_field:xiaomi.PhoneNonce.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a PhoneNonce { - fn default() -> &'a PhoneNonce { - ::default_instance() - } -} - -impl PhoneNonce { - pub fn new() -> PhoneNonce { - ::std::default::Default::default() - } - - // required bytes nonce = 1; - - pub fn nonce(&self) -> &[u8] { - match self.nonce.as_ref() { - Some(v) => v, - None => &[], - } - } - - pub fn clear_nonce(&mut self) { - self.nonce = ::std::option::Option::None; - } - - pub fn has_nonce(&self) -> bool { - self.nonce.is_some() - } - - // Param is passed by value, moved - pub fn set_nonce(&mut self, v: ::std::vec::Vec) { - self.nonce = ::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_nonce(&mut self) -> &mut ::std::vec::Vec { - if self.nonce.is_none() { - self.nonce = ::std::option::Option::Some(::std::vec::Vec::new()); - } - self.nonce.as_mut().unwrap() - } - - // Take field - pub fn take_nonce(&mut self) -> ::std::vec::Vec { - self.nonce.take().unwrap_or_else(|| ::std::vec::Vec::new()) - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(1); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "nonce", - |m: &PhoneNonce| { &m.nonce }, - |m: &mut PhoneNonce| { &mut m.nonce }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "PhoneNonce", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for PhoneNonce { - const NAME: &'static str = "PhoneNonce"; - - fn is_initialized(&self) -> bool { - if self.nonce.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.nonce = ::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.nonce.as_ref() { - my_size += ::protobuf::rt::bytes_size(1, &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.nonce.as_ref() { - os.write_bytes(1, 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() -> PhoneNonce { - PhoneNonce::new() - } - - fn clear(&mut self) { - self.nonce = ::std::option::Option::None; - self.special_fields.clear(); - } - - fn default_instance() -> &'static PhoneNonce { - static instance: PhoneNonce = PhoneNonce { - nonce: ::std::option::Option::None, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for PhoneNonce { - 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("PhoneNonce").unwrap()).clone() - } -} - -impl ::std::fmt::Display for PhoneNonce { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PhoneNonce { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -// @@protoc_insertion_point(message:xiaomi.WatchNonce) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct WatchNonce { - // message fields - // @@protoc_insertion_point(field:xiaomi.WatchNonce.nonce) - pub nonce: ::std::option::Option<::std::vec::Vec>, - // @@protoc_insertion_point(field:xiaomi.WatchNonce.hmac) - pub hmac: ::std::option::Option<::std::vec::Vec>, - // special fields - // @@protoc_insertion_point(special_field:xiaomi.WatchNonce.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a WatchNonce { - fn default() -> &'a WatchNonce { - ::default_instance() - } -} - -impl WatchNonce { - pub fn new() -> WatchNonce { - ::std::default::Default::default() - } - - // required bytes nonce = 1; - - pub fn nonce(&self) -> &[u8] { - match self.nonce.as_ref() { - Some(v) => v, - None => &[], - } - } - - pub fn clear_nonce(&mut self) { - self.nonce = ::std::option::Option::None; - } - - pub fn has_nonce(&self) -> bool { - self.nonce.is_some() - } - - // Param is passed by value, moved - pub fn set_nonce(&mut self, v: ::std::vec::Vec) { - self.nonce = ::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_nonce(&mut self) -> &mut ::std::vec::Vec { - if self.nonce.is_none() { - self.nonce = ::std::option::Option::Some(::std::vec::Vec::new()); - } - self.nonce.as_mut().unwrap() - } - - // Take field - pub fn take_nonce(&mut self) -> ::std::vec::Vec { - self.nonce.take().unwrap_or_else(|| ::std::vec::Vec::new()) - } - - // required bytes hmac = 2; - - pub fn hmac(&self) -> &[u8] { - match self.hmac.as_ref() { - Some(v) => v, - None => &[], - } - } - - pub fn clear_hmac(&mut self) { - self.hmac = ::std::option::Option::None; - } - - pub fn has_hmac(&self) -> bool { - self.hmac.is_some() - } - - // Param is passed by value, moved - pub fn set_hmac(&mut self, v: ::std::vec::Vec) { - self.hmac = ::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_hmac(&mut self) -> &mut ::std::vec::Vec { - if self.hmac.is_none() { - self.hmac = ::std::option::Option::Some(::std::vec::Vec::new()); - } - self.hmac.as_mut().unwrap() - } - - // Take field - pub fn take_hmac(&mut self) -> ::std::vec::Vec { - self.hmac.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::<_, _>( - "nonce", - |m: &WatchNonce| { &m.nonce }, - |m: &mut WatchNonce| { &mut m.nonce }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "hmac", - |m: &WatchNonce| { &m.hmac }, - |m: &mut WatchNonce| { &mut m.hmac }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "WatchNonce", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for WatchNonce { - const NAME: &'static str = "WatchNonce"; - - fn is_initialized(&self) -> bool { - if self.nonce.is_none() { - return false; - } - if self.hmac.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.nonce = ::std::option::Option::Some(is.read_bytes()?); - }, - 18 => { - self.hmac = ::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.nonce.as_ref() { - my_size += ::protobuf::rt::bytes_size(1, &v); - } - if let Some(v) = self.hmac.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.nonce.as_ref() { - os.write_bytes(1, v)?; - } - if let Some(v) = self.hmac.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() -> WatchNonce { - WatchNonce::new() - } - - fn clear(&mut self) { - self.nonce = ::std::option::Option::None; - self.hmac = ::std::option::Option::None; - self.special_fields.clear(); - } - - fn default_instance() -> &'static WatchNonce { - static instance: WatchNonce = WatchNonce { - nonce: ::std::option::Option::None, - hmac: ::std::option::Option::None, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for WatchNonce { - 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("WatchNonce").unwrap()).clone() - } -} - -impl ::std::fmt::Display for WatchNonce { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for WatchNonce { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -// @@protoc_insertion_point(message:xiaomi.AuthStep3) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct AuthStep3 { - // message fields - // @@protoc_insertion_point(field:xiaomi.AuthStep3.encryptedNonces) - pub encryptedNonces: ::std::option::Option<::std::vec::Vec>, - // @@protoc_insertion_point(field:xiaomi.AuthStep3.encryptedDeviceInfo) - pub encryptedDeviceInfo: ::std::option::Option<::std::vec::Vec>, - // special fields - // @@protoc_insertion_point(special_field:xiaomi.AuthStep3.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a AuthStep3 { - fn default() -> &'a AuthStep3 { - ::default_instance() - } -} - -impl AuthStep3 { - pub fn new() -> AuthStep3 { - ::std::default::Default::default() - } - - // required bytes encryptedNonces = 1; - - pub fn encryptedNonces(&self) -> &[u8] { - match self.encryptedNonces.as_ref() { - Some(v) => v, - None => &[], - } - } - - pub fn clear_encryptedNonces(&mut self) { - self.encryptedNonces = ::std::option::Option::None; - } - - pub fn has_encryptedNonces(&self) -> bool { - self.encryptedNonces.is_some() - } - - // Param is passed by value, moved - pub fn set_encryptedNonces(&mut self, v: ::std::vec::Vec) { - self.encryptedNonces = ::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_encryptedNonces(&mut self) -> &mut ::std::vec::Vec { - if self.encryptedNonces.is_none() { - self.encryptedNonces = ::std::option::Option::Some(::std::vec::Vec::new()); - } - self.encryptedNonces.as_mut().unwrap() - } - - // Take field - pub fn take_encryptedNonces(&mut self) -> ::std::vec::Vec { - self.encryptedNonces.take().unwrap_or_else(|| ::std::vec::Vec::new()) - } - - // required bytes encryptedDeviceInfo = 2; - - pub fn encryptedDeviceInfo(&self) -> &[u8] { - match self.encryptedDeviceInfo.as_ref() { - Some(v) => v, - None => &[], - } - } - - pub fn clear_encryptedDeviceInfo(&mut self) { - self.encryptedDeviceInfo = ::std::option::Option::None; - } - - pub fn has_encryptedDeviceInfo(&self) -> bool { - self.encryptedDeviceInfo.is_some() - } - - // Param is passed by value, moved - pub fn set_encryptedDeviceInfo(&mut self, v: ::std::vec::Vec) { - self.encryptedDeviceInfo = ::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_encryptedDeviceInfo(&mut self) -> &mut ::std::vec::Vec { - if self.encryptedDeviceInfo.is_none() { - self.encryptedDeviceInfo = ::std::option::Option::Some(::std::vec::Vec::new()); - } - self.encryptedDeviceInfo.as_mut().unwrap() - } - - // Take field - pub fn take_encryptedDeviceInfo(&mut self) -> ::std::vec::Vec { - self.encryptedDeviceInfo.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::<_, _>( - "encryptedNonces", - |m: &AuthStep3| { &m.encryptedNonces }, - |m: &mut AuthStep3| { &mut m.encryptedNonces }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "encryptedDeviceInfo", - |m: &AuthStep3| { &m.encryptedDeviceInfo }, - |m: &mut AuthStep3| { &mut m.encryptedDeviceInfo }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "AuthStep3", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for AuthStep3 { - const NAME: &'static str = "AuthStep3"; - - fn is_initialized(&self) -> bool { - if self.encryptedNonces.is_none() { - return false; - } - if self.encryptedDeviceInfo.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.encryptedNonces = ::std::option::Option::Some(is.read_bytes()?); - }, - 18 => { - self.encryptedDeviceInfo = ::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.encryptedNonces.as_ref() { - my_size += ::protobuf::rt::bytes_size(1, &v); - } - if let Some(v) = self.encryptedDeviceInfo.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.encryptedNonces.as_ref() { - os.write_bytes(1, v)?; - } - if let Some(v) = self.encryptedDeviceInfo.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() -> AuthStep3 { - AuthStep3::new() - } - - fn clear(&mut self) { - self.encryptedNonces = ::std::option::Option::None; - self.encryptedDeviceInfo = ::std::option::Option::None; - self.special_fields.clear(); - } - - fn default_instance() -> &'static AuthStep3 { - static instance: AuthStep3 = AuthStep3 { - encryptedNonces: ::std::option::Option::None, - encryptedDeviceInfo: ::std::option::Option::None, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for AuthStep3 { - 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("AuthStep3").unwrap()).clone() - } -} - -impl ::std::fmt::Display for AuthStep3 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for AuthStep3 { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -// @@protoc_insertion_point(message:xiaomi.AuthStep4) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct AuthStep4 { - // message fields - // @@protoc_insertion_point(field:xiaomi.AuthStep4.unknown1) - pub unknown1: ::std::option::Option, - // @@protoc_insertion_point(field:xiaomi.AuthStep4.unknown2) - pub unknown2: ::std::option::Option, - // special fields - // @@protoc_insertion_point(special_field:xiaomi.AuthStep4.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a AuthStep4 { - fn default() -> &'a AuthStep4 { - ::default_instance() - } -} - -impl AuthStep4 { - pub fn new() -> AuthStep4 { - ::std::default::Default::default() - } - - // required uint32 unknown1 = 1; - - pub fn unknown1(&self) -> u32 { - self.unknown1.unwrap_or(0) - } - - pub fn clear_unknown1(&mut self) { - self.unknown1 = ::std::option::Option::None; - } - - pub fn has_unknown1(&self) -> bool { - self.unknown1.is_some() - } - - // Param is passed by value, moved - pub fn set_unknown1(&mut self, v: u32) { - self.unknown1 = ::std::option::Option::Some(v); - } - - // optional uint32 unknown2 = 2; - - pub fn unknown2(&self) -> u32 { - self.unknown2.unwrap_or(0) - } - - pub fn clear_unknown2(&mut self) { - self.unknown2 = ::std::option::Option::None; - } - - pub fn has_unknown2(&self) -> bool { - self.unknown2.is_some() - } - - // Param is passed by value, moved - pub fn set_unknown2(&mut self, v: u32) { - self.unknown2 = ::std::option::Option::Some(v); - } - - 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::<_, _>( - "unknown1", - |m: &AuthStep4| { &m.unknown1 }, - |m: &mut AuthStep4| { &mut m.unknown1 }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "unknown2", - |m: &AuthStep4| { &m.unknown2 }, - |m: &mut AuthStep4| { &mut m.unknown2 }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "AuthStep4", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for AuthStep4 { - const NAME: &'static str = "AuthStep4"; - - fn is_initialized(&self) -> bool { - if self.unknown1.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.unknown1 = ::std::option::Option::Some(is.read_uint32()?); - }, - 16 => { - self.unknown2 = ::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.unknown1 { - my_size += ::protobuf::rt::uint32_size(1, v); - } - if let Some(v) = self.unknown2 { - my_size += ::protobuf::rt::uint32_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.unknown1 { - os.write_uint32(1, v)?; - } - if let Some(v) = self.unknown2 { - os.write_uint32(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() -> AuthStep4 { - AuthStep4::new() - } - - fn clear(&mut self) { - self.unknown1 = ::std::option::Option::None; - self.unknown2 = ::std::option::Option::None; - self.special_fields.clear(); - } - - fn default_instance() -> &'static AuthStep4 { - static instance: AuthStep4 = AuthStep4 { - unknown1: ::std::option::Option::None, - unknown2: ::std::option::Option::None, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for AuthStep4 { - 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("AuthStep4").unwrap()).clone() - } -} - -impl ::std::fmt::Display for AuthStep4 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for AuthStep4 { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -// @@protoc_insertion_point(message:xiaomi.AuthDeviceInfo) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct AuthDeviceInfo { - // message fields - // @@protoc_insertion_point(field:xiaomi.AuthDeviceInfo.unknown1) - pub unknown1: ::std::option::Option, - // @@protoc_insertion_point(field:xiaomi.AuthDeviceInfo.phoneApiLevel) - pub phoneApiLevel: ::std::option::Option, - // @@protoc_insertion_point(field:xiaomi.AuthDeviceInfo.phoneName) - pub phoneName: ::std::option::Option<::std::string::String>, - // @@protoc_insertion_point(field:xiaomi.AuthDeviceInfo.unknown3) - pub unknown3: ::std::option::Option, - // @@protoc_insertion_point(field:xiaomi.AuthDeviceInfo.region) - pub region: ::std::option::Option<::std::string::String>, - // special fields - // @@protoc_insertion_point(special_field:xiaomi.AuthDeviceInfo.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a AuthDeviceInfo { - fn default() -> &'a AuthDeviceInfo { - ::default_instance() - } -} - -impl AuthDeviceInfo { - pub fn new() -> AuthDeviceInfo { - ::std::default::Default::default() - } - - // required uint32 unknown1 = 1; - - pub fn unknown1(&self) -> u32 { - self.unknown1.unwrap_or(0) - } - - pub fn clear_unknown1(&mut self) { - self.unknown1 = ::std::option::Option::None; - } - - pub fn has_unknown1(&self) -> bool { - self.unknown1.is_some() - } - - // Param is passed by value, moved - pub fn set_unknown1(&mut self, v: u32) { - self.unknown1 = ::std::option::Option::Some(v); - } - - // required float phoneApiLevel = 2; - - pub fn phoneApiLevel(&self) -> f32 { - self.phoneApiLevel.unwrap_or(0.) - } - - pub fn clear_phoneApiLevel(&mut self) { - self.phoneApiLevel = ::std::option::Option::None; - } - - pub fn has_phoneApiLevel(&self) -> bool { - self.phoneApiLevel.is_some() - } - - // Param is passed by value, moved - pub fn set_phoneApiLevel(&mut self, v: f32) { - self.phoneApiLevel = ::std::option::Option::Some(v); - } - - // required string phoneName = 3; - - pub fn phoneName(&self) -> &str { - match self.phoneName.as_ref() { - Some(v) => v, - None => "", - } - } - - pub fn clear_phoneName(&mut self) { - self.phoneName = ::std::option::Option::None; - } - - pub fn has_phoneName(&self) -> bool { - self.phoneName.is_some() - } - - // Param is passed by value, moved - pub fn set_phoneName(&mut self, v: ::std::string::String) { - self.phoneName = ::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_phoneName(&mut self) -> &mut ::std::string::String { - if self.phoneName.is_none() { - self.phoneName = ::std::option::Option::Some(::std::string::String::new()); - } - self.phoneName.as_mut().unwrap() - } - - // Take field - pub fn take_phoneName(&mut self) -> ::std::string::String { - self.phoneName.take().unwrap_or_else(|| ::std::string::String::new()) - } - - // required uint32 unknown3 = 4; - - pub fn unknown3(&self) -> u32 { - self.unknown3.unwrap_or(0) - } - - pub fn clear_unknown3(&mut self) { - self.unknown3 = ::std::option::Option::None; - } - - pub fn has_unknown3(&self) -> bool { - self.unknown3.is_some() - } - - // Param is passed by value, moved - pub fn set_unknown3(&mut self, v: u32) { - self.unknown3 = ::std::option::Option::Some(v); - } - - // required string region = 5; - - pub fn region(&self) -> &str { - match self.region.as_ref() { - Some(v) => v, - None => "", - } - } - - pub fn clear_region(&mut self) { - self.region = ::std::option::Option::None; - } - - pub fn has_region(&self) -> bool { - self.region.is_some() - } - - // Param is passed by value, moved - pub fn set_region(&mut self, v: ::std::string::String) { - self.region = ::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_region(&mut self) -> &mut ::std::string::String { - if self.region.is_none() { - self.region = ::std::option::Option::Some(::std::string::String::new()); - } - self.region.as_mut().unwrap() - } - - // Take field - pub fn take_region(&mut self) -> ::std::string::String { - self.region.take().unwrap_or_else(|| ::std::string::String::new()) - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(5); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "unknown1", - |m: &AuthDeviceInfo| { &m.unknown1 }, - |m: &mut AuthDeviceInfo| { &mut m.unknown1 }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "phoneApiLevel", - |m: &AuthDeviceInfo| { &m.phoneApiLevel }, - |m: &mut AuthDeviceInfo| { &mut m.phoneApiLevel }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "phoneName", - |m: &AuthDeviceInfo| { &m.phoneName }, - |m: &mut AuthDeviceInfo| { &mut m.phoneName }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "unknown3", - |m: &AuthDeviceInfo| { &m.unknown3 }, - |m: &mut AuthDeviceInfo| { &mut m.unknown3 }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "region", - |m: &AuthDeviceInfo| { &m.region }, - |m: &mut AuthDeviceInfo| { &mut m.region }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "AuthDeviceInfo", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for AuthDeviceInfo { - const NAME: &'static str = "AuthDeviceInfo"; - - fn is_initialized(&self) -> bool { - if self.unknown1.is_none() { - return false; - } - if self.phoneApiLevel.is_none() { - return false; - } - if self.phoneName.is_none() { - return false; - } - if self.unknown3.is_none() { - return false; - } - if self.region.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.unknown1 = ::std::option::Option::Some(is.read_uint32()?); - }, - 21 => { - self.phoneApiLevel = ::std::option::Option::Some(is.read_float()?); - }, - 26 => { - self.phoneName = ::std::option::Option::Some(is.read_string()?); - }, - 32 => { - self.unknown3 = ::std::option::Option::Some(is.read_uint32()?); - }, - 42 => { - self.region = ::std::option::Option::Some(is.read_string()?); - }, - 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.unknown1 { - my_size += ::protobuf::rt::uint32_size(1, v); - } - if let Some(v) = self.phoneApiLevel { - my_size += 1 + 4; - } - if let Some(v) = self.phoneName.as_ref() { - my_size += ::protobuf::rt::string_size(3, &v); - } - if let Some(v) = self.unknown3 { - my_size += ::protobuf::rt::uint32_size(4, v); - } - if let Some(v) = self.region.as_ref() { - my_size += ::protobuf::rt::string_size(5, &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.unknown1 { - os.write_uint32(1, v)?; - } - if let Some(v) = self.phoneApiLevel { - os.write_float(2, v)?; - } - if let Some(v) = self.phoneName.as_ref() { - os.write_string(3, v)?; - } - if let Some(v) = self.unknown3 { - os.write_uint32(4, v)?; - } - if let Some(v) = self.region.as_ref() { - os.write_string(5, 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() -> AuthDeviceInfo { - AuthDeviceInfo::new() - } - - fn clear(&mut self) { - self.unknown1 = ::std::option::Option::None; - self.phoneApiLevel = ::std::option::Option::None; - self.phoneName = ::std::option::Option::None; - self.unknown3 = ::std::option::Option::None; - self.region = ::std::option::Option::None; - self.special_fields.clear(); - } - - fn default_instance() -> &'static AuthDeviceInfo { - static instance: AuthDeviceInfo = AuthDeviceInfo { - unknown1: ::std::option::Option::None, - phoneApiLevel: ::std::option::Option::None, - phoneName: ::std::option::Option::None, - unknown3: ::std::option::Option::None, - region: ::std::option::Option::None, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for AuthDeviceInfo { - 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("AuthDeviceInfo").unwrap()).clone() - } -} - -impl ::std::fmt::Display for AuthDeviceInfo { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for AuthDeviceInfo { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -// @@protoc_insertion_point(message:xiaomi.System) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct System { - // message fields - /// 2, 1 - // @@protoc_insertion_point(field:xiaomi.System.power) - pub power: ::protobuf::MessageField, - /// 2, 2 - // @@protoc_insertion_point(field:xiaomi.System.deviceInfo) - pub deviceInfo: ::protobuf::MessageField, - /// 2, 3 - // @@protoc_insertion_point(field:xiaomi.System.clock) - pub clock: ::protobuf::MessageField, - /// 2, 18 - // @@protoc_insertion_point(field:xiaomi.System.findDevice) - pub findDevice: ::std::option::Option, - /// 2, 29 get | 2, 39 set - // @@protoc_insertion_point(field:xiaomi.System.displayItems) - pub displayItems: ::protobuf::MessageField, - /// 2, 34 - // @@protoc_insertion_point(field:xiaomi.System.dndStatus) - pub dndStatus: ::protobuf::MessageField, - /// 2, 39 - // @@protoc_insertion_point(field:xiaomi.System.workoutTypes) - pub workoutTypes: ::protobuf::MessageField, - /// 2, 5 - // @@protoc_insertion_point(field:xiaomi.System.firmwareInstallRequest) - pub firmwareInstallRequest: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.System.firmwareInstallResponse) - pub firmwareInstallResponse: ::protobuf::MessageField, - /// 2, 9 get | 2, 21 set - // @@protoc_insertion_point(field:xiaomi.System.password) - pub password: ::protobuf::MessageField, - /// 2, 7 get | 2, 8 set - // @@protoc_insertion_point(field:xiaomi.System.camera) - pub camera: ::protobuf::MessageField, - /// 2, 6 - // @@protoc_insertion_point(field:xiaomi.System.language) - pub language: ::protobuf::MessageField, - /// 2, 51 get | 2, 52 create - // @@protoc_insertion_point(field:xiaomi.System.widgetScreens) - pub widgetScreens: ::protobuf::MessageField, - /// 2, 53 - // @@protoc_insertion_point(field:xiaomi.System.widgetParts) - pub widgetParts: ::protobuf::MessageField, - /// 2, 14 - // @@protoc_insertion_point(field:xiaomi.System.miscSettingGet) - pub miscSettingGet: ::protobuf::MessageField, - /// 2, 15 - // @@protoc_insertion_point(field:xiaomi.System.miscSettingSet) - pub miscSettingSet: ::protobuf::MessageField, - /// 2, 43 - // @@protoc_insertion_point(field:xiaomi.System.phoneSilentModeGet) - pub phoneSilentModeGet: ::protobuf::MessageField, - /// 2, 44 returning to watch, 2, 45 setting from watch - // @@protoc_insertion_point(field:xiaomi.System.phoneSilentModeSet) - pub phoneSilentModeSet: ::protobuf::MessageField, - /// 2, 46 - // @@protoc_insertion_point(field:xiaomi.System.vibrationPatterns) - pub vibrationPatterns: ::protobuf::MessageField, - /// 2, 47 - // @@protoc_insertion_point(field:xiaomi.System.vibrationSetPreset) - pub vibrationSetPreset: ::protobuf::MessageField, - /// 2, 58 - // @@protoc_insertion_point(field:xiaomi.System.vibrationPatternCreate) - pub vibrationPatternCreate: ::protobuf::MessageField, - /// 2, 59 - // @@protoc_insertion_point(field:xiaomi.System.vibrationTestCustom) - pub vibrationTestCustom: ::protobuf::MessageField, - /// 2, 47 - // @@protoc_insertion_point(field:xiaomi.System.vibrationPatternAck) - pub vibrationPatternAck: ::protobuf::MessageField, - /// 2, 78 - // @@protoc_insertion_point(field:xiaomi.System.basicDeviceState) - pub basicDeviceState: ::protobuf::MessageField, - /// 2, 79 - // @@protoc_insertion_point(field:xiaomi.System.deviceState) - pub deviceState: ::protobuf::MessageField, - // special fields - // @@protoc_insertion_point(special_field:xiaomi.System.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a System { - fn default() -> &'a System { - ::default_instance() - } -} - -impl System { - pub fn new() -> System { - ::std::default::Default::default() - } - - // optional uint32 findDevice = 5; - - pub fn findDevice(&self) -> u32 { - self.findDevice.unwrap_or(0) - } - - pub fn clear_findDevice(&mut self) { - self.findDevice = ::std::option::Option::None; - } - - pub fn has_findDevice(&self) -> bool { - self.findDevice.is_some() - } - - // Param is passed by value, moved - pub fn set_findDevice(&mut self, v: u32) { - self.findDevice = ::std::option::Option::Some(v); - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(25); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Power>( - "power", - |m: &System| { &m.power }, - |m: &mut System| { &mut m.power }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, DeviceInfo>( - "deviceInfo", - |m: &System| { &m.deviceInfo }, - |m: &mut System| { &mut m.deviceInfo }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Clock>( - "clock", - |m: &System| { &m.clock }, - |m: &mut System| { &mut m.clock }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "findDevice", - |m: &System| { &m.findDevice }, - |m: &mut System| { &mut m.findDevice }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, DisplayItems>( - "displayItems", - |m: &System| { &m.displayItems }, - |m: &mut System| { &mut m.displayItems }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, DoNotDisturb>( - "dndStatus", - |m: &System| { &m.dndStatus }, - |m: &mut System| { &mut m.dndStatus }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, WorkoutTypes>( - "workoutTypes", - |m: &System| { &m.workoutTypes }, - |m: &mut System| { &mut m.workoutTypes }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, FirmwareInstallRequest>( - "firmwareInstallRequest", - |m: &System| { &m.firmwareInstallRequest }, - |m: &mut System| { &mut m.firmwareInstallRequest }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, FirmwareInstallResponse>( - "firmwareInstallResponse", - |m: &System| { &m.firmwareInstallResponse }, - |m: &mut System| { &mut m.firmwareInstallResponse }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Password>( - "password", - |m: &System| { &m.password }, - |m: &mut System| { &mut m.password }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Camera>( - "camera", - |m: &System| { &m.camera }, - |m: &mut System| { &mut m.camera }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Language>( - "language", - |m: &System| { &m.language }, - |m: &mut System| { &mut m.language }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, WidgetScreens>( - "widgetScreens", - |m: &System| { &m.widgetScreens }, - |m: &mut System| { &mut m.widgetScreens }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, WidgetParts>( - "widgetParts", - |m: &System| { &m.widgetParts }, - |m: &mut System| { &mut m.widgetParts }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MiscSettingGet>( - "miscSettingGet", - |m: &System| { &m.miscSettingGet }, - |m: &mut System| { &mut m.miscSettingGet }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, MiscSettingSet>( - "miscSettingSet", - |m: &System| { &m.miscSettingSet }, - |m: &mut System| { &mut m.miscSettingSet }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, PhoneSilentModeGet>( - "phoneSilentModeGet", - |m: &System| { &m.phoneSilentModeGet }, - |m: &mut System| { &mut m.phoneSilentModeGet }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, PhoneSilentModeSet>( - "phoneSilentModeSet", - |m: &System| { &m.phoneSilentModeSet }, - |m: &mut System| { &mut m.phoneSilentModeSet }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, VibrationPatterns>( - "vibrationPatterns", - |m: &System| { &m.vibrationPatterns }, - |m: &mut System| { &mut m.vibrationPatterns }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, VibrationNotificationType>( - "vibrationSetPreset", - |m: &System| { &m.vibrationSetPreset }, - |m: &mut System| { &mut m.vibrationSetPreset }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, CustomVibrationPattern>( - "vibrationPatternCreate", - |m: &System| { &m.vibrationPatternCreate }, - |m: &mut System| { &mut m.vibrationPatternCreate }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, VibrationTest>( - "vibrationTestCustom", - |m: &System| { &m.vibrationTestCustom }, - |m: &mut System| { &mut m.vibrationTestCustom }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, VibrationPatternAck>( - "vibrationPatternAck", - |m: &System| { &m.vibrationPatternAck }, - |m: &mut System| { &mut m.vibrationPatternAck }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, BasicDeviceState>( - "basicDeviceState", - |m: &System| { &m.basicDeviceState }, - |m: &mut System| { &mut m.basicDeviceState }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, DeviceState>( - "deviceState", - |m: &System| { &m.deviceState }, - |m: &mut System| { &mut m.deviceState }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "System", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for System { - const NAME: &'static str = "System"; - - fn is_initialized(&self) -> bool { - for v in &self.power { - if !v.is_initialized() { - return false; - } - }; - for v in &self.deviceInfo { - if !v.is_initialized() { - return false; - } - }; - for v in &self.clock { - if !v.is_initialized() { - return false; - } - }; - for v in &self.displayItems { - if !v.is_initialized() { - return false; - } - }; - for v in &self.dndStatus { - if !v.is_initialized() { - return false; - } - }; - for v in &self.workoutTypes { - if !v.is_initialized() { - return false; - } - }; - for v in &self.firmwareInstallRequest { - if !v.is_initialized() { - return false; - } - }; - for v in &self.firmwareInstallResponse { - if !v.is_initialized() { - return false; - } - }; - for v in &self.password { - if !v.is_initialized() { - return false; - } - }; - for v in &self.camera { - if !v.is_initialized() { - return false; - } - }; - for v in &self.language { - if !v.is_initialized() { - return false; - } - }; - for v in &self.widgetScreens { - if !v.is_initialized() { - return false; - } - }; - for v in &self.widgetParts { - if !v.is_initialized() { - return false; - } - }; - for v in &self.miscSettingGet { - if !v.is_initialized() { - return false; - } - }; - for v in &self.miscSettingSet { - if !v.is_initialized() { - return false; - } - }; - for v in &self.phoneSilentModeGet { - if !v.is_initialized() { - return false; - } - }; - for v in &self.phoneSilentModeSet { - if !v.is_initialized() { - return false; - } - }; - for v in &self.vibrationPatterns { - if !v.is_initialized() { - return false; - } - }; - for v in &self.vibrationSetPreset { - if !v.is_initialized() { - return false; - } - }; - for v in &self.vibrationPatternCreate { - if !v.is_initialized() { - return false; - } - }; - for v in &self.vibrationTestCustom { - if !v.is_initialized() { - return false; - } - }; - for v in &self.vibrationPatternAck { - if !v.is_initialized() { - return false; - } - }; - for v in &self.basicDeviceState { - if !v.is_initialized() { - return false; - } - }; - for v in &self.deviceState { - 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 { - 18 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.power)?; - }, - 26 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.deviceInfo)?; - }, - 34 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.clock)?; - }, - 40 => { - self.findDevice = ::std::option::Option::Some(is.read_uint32()?); - }, - 82 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.displayItems)?; - }, - 90 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.dndStatus)?; - }, - 114 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.workoutTypes)?; - }, - 130 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.firmwareInstallRequest)?; - }, - 138 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.firmwareInstallResponse)?; - }, - 154 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.password)?; - }, - 122 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.camera)?; - }, - 162 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.language)?; - }, - 226 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.widgetScreens)?; - }, - 234 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.widgetParts)?; - }, - 274 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.miscSettingGet)?; - }, - 282 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.miscSettingSet)?; - }, - 290 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.phoneSilentModeGet)?; - }, - 298 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.phoneSilentModeSet)?; - }, - 306 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.vibrationPatterns)?; - }, - 314 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.vibrationSetPreset)?; - }, - 322 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.vibrationPatternCreate)?; - }, - 330 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.vibrationTestCustom)?; - }, - 346 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.vibrationPatternAck)?; - }, - 386 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.basicDeviceState)?; - }, - 394 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.deviceState)?; - }, - 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.power.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.deviceInfo.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.clock.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.findDevice { - my_size += ::protobuf::rt::uint32_size(5, v); - } - if let Some(v) = self.displayItems.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.dndStatus.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.workoutTypes.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.firmwareInstallRequest.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.firmwareInstallResponse.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.password.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.camera.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.language.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.widgetScreens.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.widgetParts.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.miscSettingGet.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.miscSettingSet.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.phoneSilentModeGet.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.phoneSilentModeSet.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.vibrationPatterns.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.vibrationSetPreset.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.vibrationPatternCreate.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.vibrationTestCustom.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.vibrationPatternAck.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.basicDeviceState.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.deviceState.as_ref() { - let len = v.compute_size(); - my_size += 2 + ::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<()> { - if let Some(v) = self.power.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; - } - if let Some(v) = self.deviceInfo.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; - } - if let Some(v) = self.clock.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; - } - if let Some(v) = self.findDevice { - os.write_uint32(5, v)?; - } - if let Some(v) = self.displayItems.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(10, v, os)?; - } - if let Some(v) = self.dndStatus.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(11, v, os)?; - } - if let Some(v) = self.workoutTypes.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(14, v, os)?; - } - if let Some(v) = self.firmwareInstallRequest.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(16, v, os)?; - } - if let Some(v) = self.firmwareInstallResponse.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(17, v, os)?; - } - if let Some(v) = self.password.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(19, v, os)?; - } - if let Some(v) = self.camera.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(15, v, os)?; - } - if let Some(v) = self.language.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(20, v, os)?; - } - if let Some(v) = self.widgetScreens.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(28, v, os)?; - } - if let Some(v) = self.widgetParts.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(29, v, os)?; - } - if let Some(v) = self.miscSettingGet.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(34, v, os)?; - } - if let Some(v) = self.miscSettingSet.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(35, v, os)?; - } - if let Some(v) = self.phoneSilentModeGet.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(36, v, os)?; - } - if let Some(v) = self.phoneSilentModeSet.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(37, v, os)?; - } - if let Some(v) = self.vibrationPatterns.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(38, v, os)?; - } - if let Some(v) = self.vibrationSetPreset.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(39, v, os)?; - } - if let Some(v) = self.vibrationPatternCreate.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(40, v, os)?; - } - if let Some(v) = self.vibrationTestCustom.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(41, v, os)?; - } - if let Some(v) = self.vibrationPatternAck.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(43, v, os)?; - } - if let Some(v) = self.basicDeviceState.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(48, v, os)?; - } - if let Some(v) = self.deviceState.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(49, 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() -> System { - System::new() - } - - fn clear(&mut self) { - self.power.clear(); - self.deviceInfo.clear(); - self.clock.clear(); - self.findDevice = ::std::option::Option::None; - self.displayItems.clear(); - self.dndStatus.clear(); - self.workoutTypes.clear(); - self.firmwareInstallRequest.clear(); - self.firmwareInstallResponse.clear(); - self.password.clear(); - self.camera.clear(); - self.language.clear(); - self.widgetScreens.clear(); - self.widgetParts.clear(); - self.miscSettingGet.clear(); - self.miscSettingSet.clear(); - self.phoneSilentModeGet.clear(); - self.phoneSilentModeSet.clear(); - self.vibrationPatterns.clear(); - self.vibrationSetPreset.clear(); - self.vibrationPatternCreate.clear(); - self.vibrationTestCustom.clear(); - self.vibrationPatternAck.clear(); - self.basicDeviceState.clear(); - self.deviceState.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static System { - static instance: System = System { - power: ::protobuf::MessageField::none(), - deviceInfo: ::protobuf::MessageField::none(), - clock: ::protobuf::MessageField::none(), - findDevice: ::std::option::Option::None, - displayItems: ::protobuf::MessageField::none(), - dndStatus: ::protobuf::MessageField::none(), - workoutTypes: ::protobuf::MessageField::none(), - firmwareInstallRequest: ::protobuf::MessageField::none(), - firmwareInstallResponse: ::protobuf::MessageField::none(), - password: ::protobuf::MessageField::none(), - camera: ::protobuf::MessageField::none(), - language: ::protobuf::MessageField::none(), - widgetScreens: ::protobuf::MessageField::none(), - widgetParts: ::protobuf::MessageField::none(), - miscSettingGet: ::protobuf::MessageField::none(), - miscSettingSet: ::protobuf::MessageField::none(), - phoneSilentModeGet: ::protobuf::MessageField::none(), - phoneSilentModeSet: ::protobuf::MessageField::none(), - vibrationPatterns: ::protobuf::MessageField::none(), - vibrationSetPreset: ::protobuf::MessageField::none(), - vibrationPatternCreate: ::protobuf::MessageField::none(), - vibrationTestCustom: ::protobuf::MessageField::none(), - vibrationPatternAck: ::protobuf::MessageField::none(), - basicDeviceState: ::protobuf::MessageField::none(), - deviceState: ::protobuf::MessageField::none(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for System { - 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("System").unwrap()).clone() - } -} - -impl ::std::fmt::Display for System { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for System { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -// @@protoc_insertion_point(message:xiaomi.Power) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct Power { - // message fields - // @@protoc_insertion_point(field:xiaomi.Power.battery) - pub battery: ::protobuf::MessageField, - // special fields - // @@protoc_insertion_point(special_field:xiaomi.Power.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a Power { - fn default() -> &'a Power { - ::default_instance() - } -} - -impl Power { - pub fn new() -> Power { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(1); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Battery>( - "battery", - |m: &Power| { &m.battery }, - |m: &mut Power| { &mut m.battery }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "Power", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for Power { - const NAME: &'static str = "Power"; - - 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 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.battery)?; - }, - 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.battery.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<()> { - if let Some(v) = self.battery.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(1, 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() -> Power { - Power::new() - } - - fn clear(&mut self) { - self.battery.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static Power { - static instance: Power = Power { - battery: ::protobuf::MessageField::none(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for Power { - 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("Power").unwrap()).clone() - } -} - -impl ::std::fmt::Display for Power { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Power { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -// @@protoc_insertion_point(message:xiaomi.Battery) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct Battery { - // message fields - // @@protoc_insertion_point(field:xiaomi.Battery.level) - pub level: ::std::option::Option, - // @@protoc_insertion_point(field:xiaomi.Battery.state) - pub state: ::std::option::Option, - // @@protoc_insertion_point(field:xiaomi.Battery.lastCharge) - pub lastCharge: ::protobuf::MessageField, - // special fields - // @@protoc_insertion_point(special_field:xiaomi.Battery.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a Battery { - fn default() -> &'a Battery { - ::default_instance() - } -} - -impl Battery { - pub fn new() -> Battery { - ::std::default::Default::default() - } - - // optional uint32 level = 1; - - pub fn level(&self) -> u32 { - self.level.unwrap_or(0) - } - - pub fn clear_level(&mut self) { - self.level = ::std::option::Option::None; - } - - pub fn has_level(&self) -> bool { - self.level.is_some() - } - - // Param is passed by value, moved - pub fn set_level(&mut self, v: u32) { - self.level = ::std::option::Option::Some(v); - } - - // optional uint32 state = 2; - - pub fn state(&self) -> u32 { - self.state.unwrap_or(0) - } - - pub fn clear_state(&mut self) { - self.state = ::std::option::Option::None; - } - - pub fn has_state(&self) -> bool { - self.state.is_some() - } - - // Param is passed by value, moved - pub fn set_state(&mut self, v: u32) { - self.state = ::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_option_accessor::<_, _>( - "level", - |m: &Battery| { &m.level }, - |m: &mut Battery| { &mut m.level }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "state", - |m: &Battery| { &m.state }, - |m: &mut Battery| { &mut m.state }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, LastCharge>( - "lastCharge", - |m: &Battery| { &m.lastCharge }, - |m: &mut Battery| { &mut m.lastCharge }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "Battery", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for Battery { - const NAME: &'static str = "Battery"; - - 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.level = ::std::option::Option::Some(is.read_uint32()?); - }, - 16 => { - self.state = ::std::option::Option::Some(is.read_uint32()?); - }, - 26 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.lastCharge)?; - }, - 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.level { - my_size += ::protobuf::rt::uint32_size(1, v); - } - if let Some(v) = self.state { - my_size += ::protobuf::rt::uint32_size(2, v); - } - if let Some(v) = self.lastCharge.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<()> { - if let Some(v) = self.level { - os.write_uint32(1, v)?; - } - if let Some(v) = self.state { - os.write_uint32(2, v)?; - } - if let Some(v) = self.lastCharge.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(3, 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() -> Battery { - Battery::new() - } - - fn clear(&mut self) { - self.level = ::std::option::Option::None; - self.state = ::std::option::Option::None; - self.lastCharge.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static Battery { - static instance: Battery = Battery { - level: ::std::option::Option::None, - state: ::std::option::Option::None, - lastCharge: ::protobuf::MessageField::none(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for Battery { - 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("Battery").unwrap()).clone() - } -} - -impl ::std::fmt::Display for Battery { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Battery { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -// @@protoc_insertion_point(message:xiaomi.LastCharge) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct LastCharge { - // message fields - // @@protoc_insertion_point(field:xiaomi.LastCharge.state) - pub state: ::std::option::Option, - // @@protoc_insertion_point(field:xiaomi.LastCharge.timestampSeconds) - pub timestampSeconds: ::std::option::Option, - // special fields - // @@protoc_insertion_point(special_field:xiaomi.LastCharge.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a LastCharge { - fn default() -> &'a LastCharge { - ::default_instance() - } -} - -impl LastCharge { - pub fn new() -> LastCharge { - ::std::default::Default::default() - } - - // optional uint32 state = 1; - - pub fn state(&self) -> u32 { - self.state.unwrap_or(0) - } - - pub fn clear_state(&mut self) { - self.state = ::std::option::Option::None; - } - - pub fn has_state(&self) -> bool { - self.state.is_some() - } - - // Param is passed by value, moved - pub fn set_state(&mut self, v: u32) { - self.state = ::std::option::Option::Some(v); - } - - // optional uint32 timestampSeconds = 2; - - pub fn timestampSeconds(&self) -> u32 { - self.timestampSeconds.unwrap_or(0) - } - - pub fn clear_timestampSeconds(&mut self) { - self.timestampSeconds = ::std::option::Option::None; - } - - pub fn has_timestampSeconds(&self) -> bool { - self.timestampSeconds.is_some() - } - - // Param is passed by value, moved - pub fn set_timestampSeconds(&mut self, v: u32) { - self.timestampSeconds = ::std::option::Option::Some(v); - } - - 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::<_, _>( - "state", - |m: &LastCharge| { &m.state }, - |m: &mut LastCharge| { &mut m.state }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "timestampSeconds", - |m: &LastCharge| { &m.timestampSeconds }, - |m: &mut LastCharge| { &mut m.timestampSeconds }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "LastCharge", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for LastCharge { - const NAME: &'static str = "LastCharge"; - - 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.state = ::std::option::Option::Some(is.read_uint32()?); - }, - 16 => { - self.timestampSeconds = ::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.state { - my_size += ::protobuf::rt::uint32_size(1, v); - } - if let Some(v) = self.timestampSeconds { - my_size += ::protobuf::rt::uint32_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.state { - os.write_uint32(1, v)?; - } - if let Some(v) = self.timestampSeconds { - os.write_uint32(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() -> LastCharge { - LastCharge::new() - } - - fn clear(&mut self) { - self.state = ::std::option::Option::None; - self.timestampSeconds = ::std::option::Option::None; - self.special_fields.clear(); - } - - fn default_instance() -> &'static LastCharge { - static instance: LastCharge = LastCharge { - state: ::std::option::Option::None, - timestampSeconds: ::std::option::Option::None, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for LastCharge { - 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("LastCharge").unwrap()).clone() - } -} - -impl ::std::fmt::Display for LastCharge { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for LastCharge { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -// @@protoc_insertion_point(message:xiaomi.DeviceInfo) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct DeviceInfo { - // message fields - // @@protoc_insertion_point(field:xiaomi.DeviceInfo.serialNumber) - pub serialNumber: ::std::option::Option<::std::string::String>, - // @@protoc_insertion_point(field:xiaomi.DeviceInfo.firmware) - pub firmware: ::std::option::Option<::std::string::String>, - // @@protoc_insertion_point(field:xiaomi.DeviceInfo.unknown3) - pub unknown3: ::std::option::Option<::std::string::String>, - // @@protoc_insertion_point(field:xiaomi.DeviceInfo.model) - pub model: ::std::option::Option<::std::string::String>, - // special fields - // @@protoc_insertion_point(special_field:xiaomi.DeviceInfo.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a DeviceInfo { - fn default() -> &'a DeviceInfo { - ::default_instance() - } -} - -impl DeviceInfo { - pub fn new() -> DeviceInfo { - ::std::default::Default::default() - } - - // required string serialNumber = 1; - - pub fn serialNumber(&self) -> &str { - match self.serialNumber.as_ref() { - Some(v) => v, - None => "", - } - } - - pub fn clear_serialNumber(&mut self) { - self.serialNumber = ::std::option::Option::None; - } - - pub fn has_serialNumber(&self) -> bool { - self.serialNumber.is_some() - } - - // Param is passed by value, moved - pub fn set_serialNumber(&mut self, v: ::std::string::String) { - self.serialNumber = ::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_serialNumber(&mut self) -> &mut ::std::string::String { - if self.serialNumber.is_none() { - self.serialNumber = ::std::option::Option::Some(::std::string::String::new()); - } - self.serialNumber.as_mut().unwrap() - } - - // Take field - pub fn take_serialNumber(&mut self) -> ::std::string::String { - self.serialNumber.take().unwrap_or_else(|| ::std::string::String::new()) - } - - // required string firmware = 2; - - pub fn firmware(&self) -> &str { - match self.firmware.as_ref() { - Some(v) => v, - None => "", - } - } - - pub fn clear_firmware(&mut self) { - self.firmware = ::std::option::Option::None; - } - - pub fn has_firmware(&self) -> bool { - self.firmware.is_some() - } - - // Param is passed by value, moved - pub fn set_firmware(&mut self, v: ::std::string::String) { - self.firmware = ::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_firmware(&mut self) -> &mut ::std::string::String { - if self.firmware.is_none() { - self.firmware = ::std::option::Option::Some(::std::string::String::new()); - } - self.firmware.as_mut().unwrap() - } - - // Take field - pub fn take_firmware(&mut self) -> ::std::string::String { - self.firmware.take().unwrap_or_else(|| ::std::string::String::new()) - } - - // optional string unknown3 = 3; - - pub fn unknown3(&self) -> &str { - match self.unknown3.as_ref() { - Some(v) => v, - None => "", - } - } - - pub fn clear_unknown3(&mut self) { - self.unknown3 = ::std::option::Option::None; - } - - pub fn has_unknown3(&self) -> bool { - self.unknown3.is_some() - } - - // Param is passed by value, moved - pub fn set_unknown3(&mut self, v: ::std::string::String) { - self.unknown3 = ::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_unknown3(&mut self) -> &mut ::std::string::String { - if self.unknown3.is_none() { - self.unknown3 = ::std::option::Option::Some(::std::string::String::new()); - } - self.unknown3.as_mut().unwrap() - } - - // Take field - pub fn take_unknown3(&mut self) -> ::std::string::String { - self.unknown3.take().unwrap_or_else(|| ::std::string::String::new()) - } - - // required string model = 4; - - pub fn model(&self) -> &str { - match self.model.as_ref() { - Some(v) => v, - None => "", - } - } - - pub fn clear_model(&mut self) { - self.model = ::std::option::Option::None; - } - - pub fn has_model(&self) -> bool { - self.model.is_some() - } - - // Param is passed by value, moved - pub fn set_model(&mut self, v: ::std::string::String) { - self.model = ::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_model(&mut self) -> &mut ::std::string::String { - if self.model.is_none() { - self.model = ::std::option::Option::Some(::std::string::String::new()); - } - self.model.as_mut().unwrap() - } - - // Take field - pub fn take_model(&mut self) -> ::std::string::String { - self.model.take().unwrap_or_else(|| ::std::string::String::new()) - } - - 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::<_, _>( - "serialNumber", - |m: &DeviceInfo| { &m.serialNumber }, - |m: &mut DeviceInfo| { &mut m.serialNumber }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "firmware", - |m: &DeviceInfo| { &m.firmware }, - |m: &mut DeviceInfo| { &mut m.firmware }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "unknown3", - |m: &DeviceInfo| { &m.unknown3 }, - |m: &mut DeviceInfo| { &mut m.unknown3 }, - )); - fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>( - "model", - |m: &DeviceInfo| { &m.model }, - |m: &mut DeviceInfo| { &mut m.model }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "DeviceInfo", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for DeviceInfo { - const NAME: &'static str = "DeviceInfo"; - - fn is_initialized(&self) -> bool { - if self.serialNumber.is_none() { - return false; - } - if self.firmware.is_none() { - return false; - } - if self.model.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.serialNumber = ::std::option::Option::Some(is.read_string()?); - }, - 18 => { - self.firmware = ::std::option::Option::Some(is.read_string()?); - }, - 26 => { - self.unknown3 = ::std::option::Option::Some(is.read_string()?); - }, - 34 => { - self.model = ::std::option::Option::Some(is.read_string()?); - }, - 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.serialNumber.as_ref() { - my_size += ::protobuf::rt::string_size(1, &v); - } - if let Some(v) = self.firmware.as_ref() { - my_size += ::protobuf::rt::string_size(2, &v); - } - if let Some(v) = self.unknown3.as_ref() { - my_size += ::protobuf::rt::string_size(3, &v); - } - if let Some(v) = self.model.as_ref() { - my_size += ::protobuf::rt::string_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.serialNumber.as_ref() { - os.write_string(1, v)?; - } - if let Some(v) = self.firmware.as_ref() { - os.write_string(2, v)?; - } - if let Some(v) = self.unknown3.as_ref() { - os.write_string(3, v)?; - } - if let Some(v) = self.model.as_ref() { - os.write_string(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() -> DeviceInfo { - DeviceInfo::new() - } - - fn clear(&mut self) { - self.serialNumber = ::std::option::Option::None; - self.firmware = ::std::option::Option::None; - self.unknown3 = ::std::option::Option::None; - self.model = ::std::option::Option::None; - self.special_fields.clear(); - } - - fn default_instance() -> &'static DeviceInfo { - static instance: DeviceInfo = DeviceInfo { - serialNumber: ::std::option::Option::None, - firmware: ::std::option::Option::None, - unknown3: ::std::option::Option::None, - model: ::std::option::Option::None, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for DeviceInfo { - 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("DeviceInfo").unwrap()).clone() - } -} - -impl ::std::fmt::Display for DeviceInfo { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for DeviceInfo { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -// @@protoc_insertion_point(message:xiaomi.Clock) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct Clock { - // message fields - // @@protoc_insertion_point(field:xiaomi.Clock.date) - pub date: ::protobuf::MessageField, - // @@protoc_insertion_point(field:xiaomi.Clock.time) - pub time: ::protobuf::MessageField