#![allow(unused_imports)]
#![allow(unused_extern_crates)]
#![cfg_attr(feature = "cargo-clippy", allow(too_many_arguments, type_complexity))]
#![cfg_attr(rustfmt, rustfmt_skip)]
extern crate ordered_float;
extern crate thrift;
extern crate try_from;
use ordered_float::OrderedFloat;
use std::cell::RefCell;
use std::collections::{BTreeMap, BTreeSet};
use std::convert::From;
use std::default::Default;
use std::error::Error;
use std::fmt;
use std::fmt::{Display, Formatter};
use std::rc::Rc;
use try_from::TryFrom;
use thrift::{ApplicationError, ApplicationErrorKind, ProtocolError, ProtocolErrorKind, TThriftClient};
use thrift::protocol::{TFieldIdentifier, TListIdentifier, TMapIdentifier, TMessageIdentifier, TMessageType, TInputProtocol, TOutputProtocol, TSetIdentifier, TStructIdentifier, TType};
use thrift::protocol::field_id;
use thrift::protocol::verify_expected_message_type;
use thrift::protocol::verify_expected_sequence_number;
use thrift::protocol::verify_expected_service_call;
use thrift::protocol::verify_required_field_exists;
use thrift::server::TProcessor;
use common_type_s_d_k_data_types;
use setting_system_s_d_k_data_types;
pub trait TSettingSystemServiceSyncClient {
fn get_setting_item(&mut self, id: String) -> thrift::Result<common_type_s_d_k_data_types::SettingItem>;
fn get_setting_items(&mut self, category: String, include_children: bool) -> thrift::Result<Vec<common_type_s_d_k_data_types::SettingItem>>;
fn search_setting_items(&mut self, filter_json: String) -> thrift::Result<BTreeMap<String, setting_system_s_d_k_data_types::SettingSearchResult>>;
fn get_category_node(&mut self) -> thrift::Result<setting_system_s_d_k_data_types::SettingTree>;
fn get_child_node(&mut self, parent: String, node_type: setting_system_s_d_k_data_types::NodeType, param: String, tags: Vec<String>) -> thrift::Result<setting_system_s_d_k_data_types::NodeList>;
fn set_setting_item(&mut self, key: String, val: String) -> thrift::Result<bool>;
fn set_setting_items(&mut self, key_values: BTreeMap<String, String>) -> thrift::Result<i32>;
fn restore_default(&mut self, module_name: String, category: String) -> thrift::Result<bool>;
fn restore_user_default(&mut self, user_id: String, module_name: String, category: String) -> thrift::Result<bool>;
fn update_module_version(&mut self, module_name: String) -> thrift::Result<bool>;
fn set_user_app_data(&mut self, user_id: String, category: String, setting_items: BTreeMap<String, common_type_s_d_k_data_types::SettingValue>) -> thrift::Result<i32>;
fn get_user_app_data(&mut self, user_id: String, category: String, setting_keys: Vec<String>) -> thrift::Result<common_type_s_d_k_data_types::AppData>;
fn remove_user_app_data(&mut self, user_id: String, category: String, setting_keys: Vec<String>) -> thrift::Result<i32>;
fn setting_item_notify(&mut self, key: String, contents: setting_system_s_d_k_data_types::JSON) -> thrift::Result<bool>;
fn get_network_adapter_settings(&mut self) -> thrift::Result<setting_system_s_d_k_data_types::NetworkSettings>;
fn get_lan_network_name(&mut self) -> thrift::Result<String>;
fn set_network_settings(&mut self, is_w_lan: bool, enable_d_h_c_p: bool, ip_address: String, sub_mask: String, gateway: String, main_d_n_s: String, sub_d_n_s: String) -> thrift::Result<bool>;
fn set_network_proxy(&mut self, proxy_server: String, proxy_port: String) -> thrift::Result<bool>;
fn connect_to_wifi(&mut self, profile_name: String, key: String) -> thrift::Result<bool>;
fn connect_to_appointed_wifi(&mut self, profile_name: String, auth: String, ciper: String, key_type: String, key: String) -> thrift::Result<bool>;
fn get_network_settings(&mut self) -> thrift::Result<setting_system_s_d_k_data_types::RuyiNetworkSettings>;
fn get_network_status(&mut self) -> thrift::Result<setting_system_s_d_k_data_types::RuyiNetworkStatus>;
fn ruyi_test_network(&mut self) -> thrift::Result<setting_system_s_d_k_data_types::RuyiNetworkTestResult>;
fn ruyi_start_network_speed_test(&mut self, userindex: i32) -> thrift::Result<bool>;
fn ruyi_stop_network_speed_test(&mut self, userindex: i32) -> thrift::Result<bool>;
fn get_available_wifi(&mut self) -> thrift::Result<Vec<setting_system_s_d_k_data_types::WifiEntity>>;
fn disconnect_wifi(&mut self) -> thrift::Result<bool>;
fn discover_bluetooth_device(&mut self) -> thrift::Result<bool>;
fn connect_bluetooth_device(&mut self, device_name: String, device_address: String) -> thrift::Result<bool>;
fn disconnect_bluetooth_device(&mut self, device_name: String, device_address: String) -> thrift::Result<bool>;
fn remove_bluetooth_device(&mut self, device_name: String, device_address: String) -> thrift::Result<bool>;
}
pub trait TSettingSystemServiceSyncClientMarker {}
pub struct SettingSystemServiceSyncClient<IP, OP> where IP: TInputProtocol, OP: TOutputProtocol {
_i_prot: IP,
_o_prot: OP,
_sequence_number: i32,
}
impl <IP, OP> SettingSystemServiceSyncClient<IP, OP> where IP: TInputProtocol, OP: TOutputProtocol {
pub fn new(input_protocol: IP, output_protocol: OP) -> SettingSystemServiceSyncClient<IP, OP> {
SettingSystemServiceSyncClient { _i_prot: input_protocol, _o_prot: output_protocol, _sequence_number: 0 }
}
}
impl <IP, OP> TThriftClient for SettingSystemServiceSyncClient<IP, OP> where IP: TInputProtocol, OP: TOutputProtocol {
fn i_prot_mut(&mut self) -> &mut TInputProtocol { &mut self._i_prot }
fn o_prot_mut(&mut self) -> &mut TOutputProtocol { &mut self._o_prot }
fn sequence_number(&self) -> i32 { self._sequence_number }
fn increment_sequence_number(&mut self) -> i32 { self._sequence_number += 1; self._sequence_number }
}
impl <IP, OP> TSettingSystemServiceSyncClientMarker for SettingSystemServiceSyncClient<IP, OP> where IP: TInputProtocol, OP: TOutputProtocol {}
impl <C: TThriftClient + TSettingSystemServiceSyncClientMarker> TSettingSystemServiceSyncClient for C {
fn get_setting_item(&mut self, id: String) -> thrift::Result<common_type_s_d_k_data_types::SettingItem> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("GetSettingItem", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceGetSettingItemArgs { id: id };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("GetSettingItem", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceGetSettingItemResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn get_setting_items(&mut self, category: String, include_children: bool) -> thrift::Result<Vec<common_type_s_d_k_data_types::SettingItem>> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("GetSettingItems", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceGetSettingItemsArgs { category: category, include_children: include_children };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("GetSettingItems", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceGetSettingItemsResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn search_setting_items(&mut self, filter_json: String) -> thrift::Result<BTreeMap<String, setting_system_s_d_k_data_types::SettingSearchResult>> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("SearchSettingItems", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceSearchSettingItemsArgs { filter_json: filter_json };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("SearchSettingItems", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceSearchSettingItemsResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn get_category_node(&mut self) -> thrift::Result<setting_system_s_d_k_data_types::SettingTree> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("GetCategoryNode", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceGetCategoryNodeArgs { };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("GetCategoryNode", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceGetCategoryNodeResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn get_child_node(&mut self, parent: String, node_type: setting_system_s_d_k_data_types::NodeType, param: String, tags: Vec<String>) -> thrift::Result<setting_system_s_d_k_data_types::NodeList> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("GetChildNode", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceGetChildNodeArgs { parent: parent, node_type: node_type, param: param, tags: tags };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("GetChildNode", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceGetChildNodeResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn set_setting_item(&mut self, key: String, val: String) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("SetSettingItem", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceSetSettingItemArgs { key: key, val: val };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("SetSettingItem", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceSetSettingItemResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn set_setting_items(&mut self, key_values: BTreeMap<String, String>) -> thrift::Result<i32> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("SetSettingItems", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceSetSettingItemsArgs { key_values: key_values };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("SetSettingItems", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceSetSettingItemsResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn restore_default(&mut self, module_name: String, category: String) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("RestoreDefault", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceRestoreDefaultArgs { module_name: module_name, category: category };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("RestoreDefault", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceRestoreDefaultResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn restore_user_default(&mut self, user_id: String, module_name: String, category: String) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("RestoreUserDefault", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceRestoreUserDefaultArgs { user_id: user_id, module_name: module_name, category: category };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("RestoreUserDefault", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceRestoreUserDefaultResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn update_module_version(&mut self, module_name: String) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("UpdateModuleVersion", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceUpdateModuleVersionArgs { module_name: module_name };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("UpdateModuleVersion", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceUpdateModuleVersionResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn set_user_app_data(&mut self, user_id: String, category: String, setting_items: BTreeMap<String, common_type_s_d_k_data_types::SettingValue>) -> thrift::Result<i32> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("SetUserAppData", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceSetUserAppDataArgs { user_id: user_id, category: category, setting_items: setting_items };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("SetUserAppData", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceSetUserAppDataResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn get_user_app_data(&mut self, user_id: String, category: String, setting_keys: Vec<String>) -> thrift::Result<common_type_s_d_k_data_types::AppData> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("GetUserAppData", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceGetUserAppDataArgs { user_id: user_id, category: category, setting_keys: setting_keys };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("GetUserAppData", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceGetUserAppDataResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn remove_user_app_data(&mut self, user_id: String, category: String, setting_keys: Vec<String>) -> thrift::Result<i32> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("RemoveUserAppData", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceRemoveUserAppDataArgs { user_id: user_id, category: category, setting_keys: setting_keys };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("RemoveUserAppData", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceRemoveUserAppDataResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn setting_item_notify(&mut self, key: String, contents: setting_system_s_d_k_data_types::JSON) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("SettingItemNotify", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceSettingItemNotifyArgs { key: key, contents: contents };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("SettingItemNotify", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceSettingItemNotifyResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn get_network_adapter_settings(&mut self) -> thrift::Result<setting_system_s_d_k_data_types::NetworkSettings> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("GetNetworkAdapterSettings", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceGetNetworkAdapterSettingsArgs { };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("GetNetworkAdapterSettings", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceGetNetworkAdapterSettingsResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn get_lan_network_name(&mut self) -> thrift::Result<String> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("GetLanNetworkName", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceGetLanNetworkNameArgs { };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("GetLanNetworkName", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceGetLanNetworkNameResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn set_network_settings(&mut self, is_w_lan: bool, enable_d_h_c_p: bool, ip_address: String, sub_mask: String, gateway: String, main_d_n_s: String, sub_d_n_s: String) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("SetNetworkSettings", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceSetNetworkSettingsArgs { is_w_lan: is_w_lan, enable_d_h_c_p: enable_d_h_c_p, ip_address: ip_address, sub_mask: sub_mask, gateway: gateway, main_d_n_s: main_d_n_s, sub_d_n_s: sub_d_n_s };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("SetNetworkSettings", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceSetNetworkSettingsResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn set_network_proxy(&mut self, proxy_server: String, proxy_port: String) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("SetNetworkProxy", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceSetNetworkProxyArgs { proxy_server: proxy_server, proxy_port: proxy_port };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("SetNetworkProxy", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceSetNetworkProxyResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn connect_to_wifi(&mut self, profile_name: String, key: String) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("ConnectToWifi", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceConnectToWifiArgs { profile_name: profile_name, key: key };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("ConnectToWifi", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceConnectToWifiResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn connect_to_appointed_wifi(&mut self, profile_name: String, auth: String, ciper: String, key_type: String, key: String) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("ConnectToAppointedWifi", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceConnectToAppointedWifiArgs { profile_name: profile_name, auth: auth, ciper: ciper, key_type: key_type, key: key };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("ConnectToAppointedWifi", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceConnectToAppointedWifiResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn get_network_settings(&mut self) -> thrift::Result<setting_system_s_d_k_data_types::RuyiNetworkSettings> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("GetNetworkSettings", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceGetNetworkSettingsArgs { };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("GetNetworkSettings", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceGetNetworkSettingsResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn get_network_status(&mut self) -> thrift::Result<setting_system_s_d_k_data_types::RuyiNetworkStatus> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("GetNetworkStatus", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceGetNetworkStatusArgs { };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("GetNetworkStatus", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceGetNetworkStatusResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn ruyi_test_network(&mut self) -> thrift::Result<setting_system_s_d_k_data_types::RuyiNetworkTestResult> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("RuyiTestNetwork", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceRuyiTestNetworkArgs { };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("RuyiTestNetwork", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceRuyiTestNetworkResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn ruyi_start_network_speed_test(&mut self, userindex: i32) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("RuyiStartNetworkSpeedTest", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceRuyiStartNetworkSpeedTestArgs { userindex: userindex };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("RuyiStartNetworkSpeedTest", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceRuyiStartNetworkSpeedTestResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn ruyi_stop_network_speed_test(&mut self, userindex: i32) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("RuyiStopNetworkSpeedTest", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceRuyiStopNetworkSpeedTestArgs { userindex: userindex };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("RuyiStopNetworkSpeedTest", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceRuyiStopNetworkSpeedTestResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn get_available_wifi(&mut self) -> thrift::Result<Vec<setting_system_s_d_k_data_types::WifiEntity>> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("GetAvailableWifi", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceGetAvailableWifiArgs { };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("GetAvailableWifi", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceGetAvailableWifiResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn disconnect_wifi(&mut self) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("DisconnectWifi", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceDisconnectWifiArgs { };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("DisconnectWifi", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceDisconnectWifiResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn discover_bluetooth_device(&mut self) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("DiscoverBluetoothDevice", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceDiscoverBluetoothDeviceArgs { };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("DiscoverBluetoothDevice", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceDiscoverBluetoothDeviceResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn connect_bluetooth_device(&mut self, device_name: String, device_address: String) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("ConnectBluetoothDevice", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceConnectBluetoothDeviceArgs { device_name: device_name, device_address: device_address };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("ConnectBluetoothDevice", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceConnectBluetoothDeviceResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn disconnect_bluetooth_device(&mut self, device_name: String, device_address: String) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("DisconnectBluetoothDevice", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceDisconnectBluetoothDeviceArgs { device_name: device_name, device_address: device_address };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("DisconnectBluetoothDevice", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceDisconnectBluetoothDeviceResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
fn remove_bluetooth_device(&mut self, device_name: String, device_address: String) -> thrift::Result<bool> {
(
{
self.increment_sequence_number();
let message_ident = TMessageIdentifier::new("RemoveBluetoothDevice", TMessageType::Call, self.sequence_number());
let call_args = SettingSystemServiceRemoveBluetoothDeviceArgs { device_name: device_name, device_address: device_address };
self.o_prot_mut().write_message_begin(&message_ident)?;
call_args.write_to_out_protocol(self.o_prot_mut())?;
self.o_prot_mut().write_message_end()?;
self.o_prot_mut().flush()
}
)?;
{
let message_ident = self.i_prot_mut().read_message_begin()?;
verify_expected_sequence_number(self.sequence_number(), message_ident.sequence_number)?;
verify_expected_service_call("RemoveBluetoothDevice", &message_ident.name)?;
if message_ident.message_type == TMessageType::Exception {
let remote_error = thrift::Error::read_application_error_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
return Err(thrift::Error::Application(remote_error))
}
verify_expected_message_type(TMessageType::Reply, message_ident.message_type)?;
let result = SettingSystemServiceRemoveBluetoothDeviceResult::read_from_in_protocol(self.i_prot_mut())?;
self.i_prot_mut().read_message_end()?;
result.ok_or()
}
}
}
pub trait SettingSystemServiceSyncHandler {
fn handle_get_setting_item(&self, id: String) -> thrift::Result<common_type_s_d_k_data_types::SettingItem>;
fn handle_get_setting_items(&self, category: String, include_children: bool) -> thrift::Result<Vec<common_type_s_d_k_data_types::SettingItem>>;
fn handle_search_setting_items(&self, filter_json: String) -> thrift::Result<BTreeMap<String, setting_system_s_d_k_data_types::SettingSearchResult>>;
fn handle_get_category_node(&self) -> thrift::Result<setting_system_s_d_k_data_types::SettingTree>;
fn handle_get_child_node(&self, parent: String, node_type: setting_system_s_d_k_data_types::NodeType, param: String, tags: Vec<String>) -> thrift::Result<setting_system_s_d_k_data_types::NodeList>;
fn handle_set_setting_item(&self, key: String, val: String) -> thrift::Result<bool>;
fn handle_set_setting_items(&self, key_values: BTreeMap<String, String>) -> thrift::Result<i32>;
fn handle_restore_default(&self, module_name: String, category: String) -> thrift::Result<bool>;
fn handle_restore_user_default(&self, user_id: String, module_name: String, category: String) -> thrift::Result<bool>;
fn handle_update_module_version(&self, module_name: String) -> thrift::Result<bool>;
fn handle_set_user_app_data(&self, user_id: String, category: String, setting_items: BTreeMap<String, common_type_s_d_k_data_types::SettingValue>) -> thrift::Result<i32>;
fn handle_get_user_app_data(&self, user_id: String, category: String, setting_keys: Vec<String>) -> thrift::Result<common_type_s_d_k_data_types::AppData>;
fn handle_remove_user_app_data(&self, user_id: String, category: String, setting_keys: Vec<String>) -> thrift::Result<i32>;
fn handle_setting_item_notify(&self, key: String, contents: setting_system_s_d_k_data_types::JSON) -> thrift::Result<bool>;
fn handle_get_network_adapter_settings(&self) -> thrift::Result<setting_system_s_d_k_data_types::NetworkSettings>;
fn handle_get_lan_network_name(&self) -> thrift::Result<String>;
fn handle_set_network_settings(&self, is_w_lan: bool, enable_d_h_c_p: bool, ip_address: String, sub_mask: String, gateway: String, main_d_n_s: String, sub_d_n_s: String) -> thrift::Result<bool>;
fn handle_set_network_proxy(&self, proxy_server: String, proxy_port: String) -> thrift::Result<bool>;
fn handle_connect_to_wifi(&self, profile_name: String, key: String) -> thrift::Result<bool>;
fn handle_connect_to_appointed_wifi(&self, profile_name: String, auth: String, ciper: String, key_type: String, key: String) -> thrift::Result<bool>;
fn handle_get_network_settings(&self) -> thrift::Result<setting_system_s_d_k_data_types::RuyiNetworkSettings>;
fn handle_get_network_status(&self) -> thrift::Result<setting_system_s_d_k_data_types::RuyiNetworkStatus>;
fn handle_ruyi_test_network(&self) -> thrift::Result<setting_system_s_d_k_data_types::RuyiNetworkTestResult>;
fn handle_ruyi_start_network_speed_test(&self, userindex: i32) -> thrift::Result<bool>;
fn handle_ruyi_stop_network_speed_test(&self, userindex: i32) -> thrift::Result<bool>;
fn handle_get_available_wifi(&self) -> thrift::Result<Vec<setting_system_s_d_k_data_types::WifiEntity>>;
fn handle_disconnect_wifi(&self) -> thrift::Result<bool>;
fn handle_discover_bluetooth_device(&self) -> thrift::Result<bool>;
fn handle_connect_bluetooth_device(&self, device_name: String, device_address: String) -> thrift::Result<bool>;
fn handle_disconnect_bluetooth_device(&self, device_name: String, device_address: String) -> thrift::Result<bool>;
fn handle_remove_bluetooth_device(&self, device_name: String, device_address: String) -> thrift::Result<bool>;
}
pub struct SettingSystemServiceSyncProcessor<H: SettingSystemServiceSyncHandler> {
handler: H,
}
impl <H: SettingSystemServiceSyncHandler> SettingSystemServiceSyncProcessor<H> {
pub fn new(handler: H) -> SettingSystemServiceSyncProcessor<H> {
SettingSystemServiceSyncProcessor {
handler,
}
}
fn process_get_setting_item(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_get_setting_item(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_get_setting_items(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_get_setting_items(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_search_setting_items(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_search_setting_items(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_get_category_node(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_get_category_node(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_get_child_node(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_get_child_node(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_set_setting_item(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_set_setting_item(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_set_setting_items(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_set_setting_items(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_restore_default(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_restore_default(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_restore_user_default(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_restore_user_default(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_update_module_version(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_update_module_version(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_set_user_app_data(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_set_user_app_data(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_get_user_app_data(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_get_user_app_data(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_remove_user_app_data(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_remove_user_app_data(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_setting_item_notify(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_setting_item_notify(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_get_network_adapter_settings(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_get_network_adapter_settings(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_get_lan_network_name(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_get_lan_network_name(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_set_network_settings(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_set_network_settings(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_set_network_proxy(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_set_network_proxy(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_connect_to_wifi(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_connect_to_wifi(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_connect_to_appointed_wifi(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_connect_to_appointed_wifi(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_get_network_settings(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_get_network_settings(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_get_network_status(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_get_network_status(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_ruyi_test_network(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_ruyi_test_network(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_ruyi_start_network_speed_test(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_ruyi_start_network_speed_test(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_ruyi_stop_network_speed_test(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_ruyi_stop_network_speed_test(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_get_available_wifi(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_get_available_wifi(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_disconnect_wifi(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_disconnect_wifi(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_discover_bluetooth_device(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_discover_bluetooth_device(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_connect_bluetooth_device(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_connect_bluetooth_device(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_disconnect_bluetooth_device(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_disconnect_bluetooth_device(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
fn process_remove_bluetooth_device(&self, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
TSettingSystemServiceProcessFunctions::process_remove_bluetooth_device(&self.handler, incoming_sequence_number, i_prot, o_prot)
}
}
pub struct TSettingSystemServiceProcessFunctions;
impl TSettingSystemServiceProcessFunctions {
pub fn process_get_setting_item<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceGetSettingItemArgs::read_from_in_protocol(i_prot)?;
match handler.handle_get_setting_item(args.id) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("GetSettingItem", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceGetSettingItemResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceGetSettingItemResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("GetSettingItem", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("GetSettingItem", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("GetSettingItem", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("GetSettingItem", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_get_setting_items<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceGetSettingItemsArgs::read_from_in_protocol(i_prot)?;
match handler.handle_get_setting_items(args.category, args.include_children) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("GetSettingItems", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceGetSettingItemsResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceGetSettingItemsResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("GetSettingItems", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("GetSettingItems", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("GetSettingItems", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("GetSettingItems", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_search_setting_items<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceSearchSettingItemsArgs::read_from_in_protocol(i_prot)?;
match handler.handle_search_setting_items(args.filter_json) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("SearchSettingItems", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceSearchSettingItemsResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceSearchSettingItemsResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("SearchSettingItems", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("SearchSettingItems", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("SearchSettingItems", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("SearchSettingItems", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_get_category_node<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let _ = SettingSystemServiceGetCategoryNodeArgs::read_from_in_protocol(i_prot)?;
match handler.handle_get_category_node() {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("GetCategoryNode", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceGetCategoryNodeResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceGetCategoryNodeResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("GetCategoryNode", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("GetCategoryNode", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("GetCategoryNode", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("GetCategoryNode", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_get_child_node<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceGetChildNodeArgs::read_from_in_protocol(i_prot)?;
match handler.handle_get_child_node(args.parent, args.node_type, args.param, args.tags) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("GetChildNode", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceGetChildNodeResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceGetChildNodeResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("GetChildNode", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("GetChildNode", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("GetChildNode", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("GetChildNode", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_set_setting_item<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceSetSettingItemArgs::read_from_in_protocol(i_prot)?;
match handler.handle_set_setting_item(args.key, args.val) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("SetSettingItem", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceSetSettingItemResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceSetSettingItemResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("SetSettingItem", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("SetSettingItem", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("SetSettingItem", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("SetSettingItem", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_set_setting_items<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceSetSettingItemsArgs::read_from_in_protocol(i_prot)?;
match handler.handle_set_setting_items(args.key_values) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("SetSettingItems", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceSetSettingItemsResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceSetSettingItemsResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("SetSettingItems", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("SetSettingItems", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("SetSettingItems", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("SetSettingItems", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_restore_default<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceRestoreDefaultArgs::read_from_in_protocol(i_prot)?;
match handler.handle_restore_default(args.module_name, args.category) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("RestoreDefault", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceRestoreDefaultResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceRestoreDefaultResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("RestoreDefault", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("RestoreDefault", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("RestoreDefault", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("RestoreDefault", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_restore_user_default<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceRestoreUserDefaultArgs::read_from_in_protocol(i_prot)?;
match handler.handle_restore_user_default(args.user_id, args.module_name, args.category) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("RestoreUserDefault", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceRestoreUserDefaultResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceRestoreUserDefaultResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("RestoreUserDefault", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("RestoreUserDefault", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("RestoreUserDefault", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("RestoreUserDefault", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_update_module_version<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceUpdateModuleVersionArgs::read_from_in_protocol(i_prot)?;
match handler.handle_update_module_version(args.module_name) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("UpdateModuleVersion", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceUpdateModuleVersionResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceUpdateModuleVersionResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("UpdateModuleVersion", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("UpdateModuleVersion", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("UpdateModuleVersion", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("UpdateModuleVersion", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_set_user_app_data<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceSetUserAppDataArgs::read_from_in_protocol(i_prot)?;
match handler.handle_set_user_app_data(args.user_id, args.category, args.setting_items) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("SetUserAppData", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceSetUserAppDataResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceSetUserAppDataResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("SetUserAppData", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("SetUserAppData", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("SetUserAppData", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("SetUserAppData", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_get_user_app_data<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceGetUserAppDataArgs::read_from_in_protocol(i_prot)?;
match handler.handle_get_user_app_data(args.user_id, args.category, args.setting_keys) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("GetUserAppData", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceGetUserAppDataResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceGetUserAppDataResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("GetUserAppData", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("GetUserAppData", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("GetUserAppData", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("GetUserAppData", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_remove_user_app_data<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceRemoveUserAppDataArgs::read_from_in_protocol(i_prot)?;
match handler.handle_remove_user_app_data(args.user_id, args.category, args.setting_keys) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("RemoveUserAppData", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceRemoveUserAppDataResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceRemoveUserAppDataResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("RemoveUserAppData", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("RemoveUserAppData", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("RemoveUserAppData", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("RemoveUserAppData", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_setting_item_notify<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceSettingItemNotifyArgs::read_from_in_protocol(i_prot)?;
match handler.handle_setting_item_notify(args.key, args.contents) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("SettingItemNotify", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceSettingItemNotifyResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceSettingItemNotifyResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("SettingItemNotify", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("SettingItemNotify", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("SettingItemNotify", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("SettingItemNotify", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_get_network_adapter_settings<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let _ = SettingSystemServiceGetNetworkAdapterSettingsArgs::read_from_in_protocol(i_prot)?;
match handler.handle_get_network_adapter_settings() {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("GetNetworkAdapterSettings", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceGetNetworkAdapterSettingsResult { result_value: Some(handler_return) };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("GetNetworkAdapterSettings", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("GetNetworkAdapterSettings", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_get_lan_network_name<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let _ = SettingSystemServiceGetLanNetworkNameArgs::read_from_in_protocol(i_prot)?;
match handler.handle_get_lan_network_name() {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("GetLanNetworkName", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceGetLanNetworkNameResult { result_value: Some(handler_return) };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("GetLanNetworkName", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("GetLanNetworkName", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_set_network_settings<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceSetNetworkSettingsArgs::read_from_in_protocol(i_prot)?;
match handler.handle_set_network_settings(args.is_w_lan, args.enable_d_h_c_p, args.ip_address, args.sub_mask, args.gateway, args.main_d_n_s, args.sub_d_n_s) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("SetNetworkSettings", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceSetNetworkSettingsResult { result_value: Some(handler_return) };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("SetNetworkSettings", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("SetNetworkSettings", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_set_network_proxy<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceSetNetworkProxyArgs::read_from_in_protocol(i_prot)?;
match handler.handle_set_network_proxy(args.proxy_server, args.proxy_port) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("SetNetworkProxy", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceSetNetworkProxyResult { result_value: Some(handler_return) };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("SetNetworkProxy", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("SetNetworkProxy", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_connect_to_wifi<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceConnectToWifiArgs::read_from_in_protocol(i_prot)?;
match handler.handle_connect_to_wifi(args.profile_name, args.key) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("ConnectToWifi", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceConnectToWifiResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceConnectToWifiResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("ConnectToWifi", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("ConnectToWifi", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("ConnectToWifi", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("ConnectToWifi", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_connect_to_appointed_wifi<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceConnectToAppointedWifiArgs::read_from_in_protocol(i_prot)?;
match handler.handle_connect_to_appointed_wifi(args.profile_name, args.auth, args.ciper, args.key_type, args.key) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("ConnectToAppointedWifi", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceConnectToAppointedWifiResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceConnectToAppointedWifiResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("ConnectToAppointedWifi", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("ConnectToAppointedWifi", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("ConnectToAppointedWifi", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("ConnectToAppointedWifi", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_get_network_settings<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let _ = SettingSystemServiceGetNetworkSettingsArgs::read_from_in_protocol(i_prot)?;
match handler.handle_get_network_settings() {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("GetNetworkSettings", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceGetNetworkSettingsResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceGetNetworkSettingsResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("GetNetworkSettings", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("GetNetworkSettings", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("GetNetworkSettings", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("GetNetworkSettings", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_get_network_status<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let _ = SettingSystemServiceGetNetworkStatusArgs::read_from_in_protocol(i_prot)?;
match handler.handle_get_network_status() {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("GetNetworkStatus", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceGetNetworkStatusResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceGetNetworkStatusResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("GetNetworkStatus", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("GetNetworkStatus", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("GetNetworkStatus", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("GetNetworkStatus", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_ruyi_test_network<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let _ = SettingSystemServiceRuyiTestNetworkArgs::read_from_in_protocol(i_prot)?;
match handler.handle_ruyi_test_network() {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("RuyiTestNetwork", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceRuyiTestNetworkResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceRuyiTestNetworkResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("RuyiTestNetwork", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("RuyiTestNetwork", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("RuyiTestNetwork", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("RuyiTestNetwork", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_ruyi_start_network_speed_test<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceRuyiStartNetworkSpeedTestArgs::read_from_in_protocol(i_prot)?;
match handler.handle_ruyi_start_network_speed_test(args.userindex) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("RuyiStartNetworkSpeedTest", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceRuyiStartNetworkSpeedTestResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceRuyiStartNetworkSpeedTestResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("RuyiStartNetworkSpeedTest", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("RuyiStartNetworkSpeedTest", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("RuyiStartNetworkSpeedTest", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("RuyiStartNetworkSpeedTest", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_ruyi_stop_network_speed_test<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceRuyiStopNetworkSpeedTestArgs::read_from_in_protocol(i_prot)?;
match handler.handle_ruyi_stop_network_speed_test(args.userindex) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("RuyiStopNetworkSpeedTest", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceRuyiStopNetworkSpeedTestResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceRuyiStopNetworkSpeedTestResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("RuyiStopNetworkSpeedTest", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("RuyiStopNetworkSpeedTest", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("RuyiStopNetworkSpeedTest", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("RuyiStopNetworkSpeedTest", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_get_available_wifi<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let _ = SettingSystemServiceGetAvailableWifiArgs::read_from_in_protocol(i_prot)?;
match handler.handle_get_available_wifi() {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("GetAvailableWifi", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceGetAvailableWifiResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceGetAvailableWifiResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("GetAvailableWifi", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("GetAvailableWifi", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("GetAvailableWifi", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("GetAvailableWifi", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_disconnect_wifi<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let _ = SettingSystemServiceDisconnectWifiArgs::read_from_in_protocol(i_prot)?;
match handler.handle_disconnect_wifi() {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("DisconnectWifi", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceDisconnectWifiResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceDisconnectWifiResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("DisconnectWifi", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("DisconnectWifi", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("DisconnectWifi", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("DisconnectWifi", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_discover_bluetooth_device<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let _ = SettingSystemServiceDiscoverBluetoothDeviceArgs::read_from_in_protocol(i_prot)?;
match handler.handle_discover_bluetooth_device() {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("DiscoverBluetoothDevice", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceDiscoverBluetoothDeviceResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceDiscoverBluetoothDeviceResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("DiscoverBluetoothDevice", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("DiscoverBluetoothDevice", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("DiscoverBluetoothDevice", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("DiscoverBluetoothDevice", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_connect_bluetooth_device<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceConnectBluetoothDeviceArgs::read_from_in_protocol(i_prot)?;
match handler.handle_connect_bluetooth_device(args.device_name, args.device_address) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("ConnectBluetoothDevice", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceConnectBluetoothDeviceResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceConnectBluetoothDeviceResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("ConnectBluetoothDevice", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("ConnectBluetoothDevice", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("ConnectBluetoothDevice", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("ConnectBluetoothDevice", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_disconnect_bluetooth_device<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceDisconnectBluetoothDeviceArgs::read_from_in_protocol(i_prot)?;
match handler.handle_disconnect_bluetooth_device(args.device_name, args.device_address) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("DisconnectBluetoothDevice", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceDisconnectBluetoothDeviceResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceDisconnectBluetoothDeviceResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("DisconnectBluetoothDevice", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("DisconnectBluetoothDevice", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("DisconnectBluetoothDevice", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("DisconnectBluetoothDevice", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
pub fn process_remove_bluetooth_device<H: SettingSystemServiceSyncHandler>(handler: &H, incoming_sequence_number: i32, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let args = SettingSystemServiceRemoveBluetoothDeviceArgs::read_from_in_protocol(i_prot)?;
match handler.handle_remove_bluetooth_device(args.device_name, args.device_address) {
Ok(handler_return) => {
let message_ident = TMessageIdentifier::new("RemoveBluetoothDevice", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
let ret = SettingSystemServiceRemoveBluetoothDeviceResult { result_value: Some(handler_return), error1: None };
ret.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
Err(e) => {
match e {
thrift::Error::User(usr_err) => {
if usr_err.downcast_ref::<common_type_s_d_k_data_types::ErrorException>().is_some() {
let err = usr_err.downcast::<common_type_s_d_k_data_types::ErrorException>().expect("downcast already checked");
let ret_err = SettingSystemServiceRemoveBluetoothDeviceResult{ result_value: None, error1: Some(*err) };
let message_ident = TMessageIdentifier::new("RemoveBluetoothDevice", TMessageType::Reply, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
ret_err.write_to_out_protocol(o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
} else {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
usr_err.description()
)
};
let message_ident = TMessageIdentifier::new("RemoveBluetoothDevice", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
}
},
thrift::Error::Application(app_err) => {
let message_ident = TMessageIdentifier::new("RemoveBluetoothDevice", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
ApplicationErrorKind::Unknown,
e.description()
)
};
let message_ident = TMessageIdentifier::new("RemoveBluetoothDevice", TMessageType::Exception, incoming_sequence_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&ret_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
}
},
}
}
}
impl <H: SettingSystemServiceSyncHandler> TProcessor for SettingSystemServiceSyncProcessor<H> {
fn process(&self, i_prot: &mut TInputProtocol, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let message_ident = i_prot.read_message_begin()?;
let res = match &*message_ident.name {
"GetSettingItem" => {
self.process_get_setting_item(message_ident.sequence_number, i_prot, o_prot)
},
"GetSettingItems" => {
self.process_get_setting_items(message_ident.sequence_number, i_prot, o_prot)
},
"SearchSettingItems" => {
self.process_search_setting_items(message_ident.sequence_number, i_prot, o_prot)
},
"GetCategoryNode" => {
self.process_get_category_node(message_ident.sequence_number, i_prot, o_prot)
},
"GetChildNode" => {
self.process_get_child_node(message_ident.sequence_number, i_prot, o_prot)
},
"SetSettingItem" => {
self.process_set_setting_item(message_ident.sequence_number, i_prot, o_prot)
},
"SetSettingItems" => {
self.process_set_setting_items(message_ident.sequence_number, i_prot, o_prot)
},
"RestoreDefault" => {
self.process_restore_default(message_ident.sequence_number, i_prot, o_prot)
},
"RestoreUserDefault" => {
self.process_restore_user_default(message_ident.sequence_number, i_prot, o_prot)
},
"UpdateModuleVersion" => {
self.process_update_module_version(message_ident.sequence_number, i_prot, o_prot)
},
"SetUserAppData" => {
self.process_set_user_app_data(message_ident.sequence_number, i_prot, o_prot)
},
"GetUserAppData" => {
self.process_get_user_app_data(message_ident.sequence_number, i_prot, o_prot)
},
"RemoveUserAppData" => {
self.process_remove_user_app_data(message_ident.sequence_number, i_prot, o_prot)
},
"SettingItemNotify" => {
self.process_setting_item_notify(message_ident.sequence_number, i_prot, o_prot)
},
"GetNetworkAdapterSettings" => {
self.process_get_network_adapter_settings(message_ident.sequence_number, i_prot, o_prot)
},
"GetLanNetworkName" => {
self.process_get_lan_network_name(message_ident.sequence_number, i_prot, o_prot)
},
"SetNetworkSettings" => {
self.process_set_network_settings(message_ident.sequence_number, i_prot, o_prot)
},
"SetNetworkProxy" => {
self.process_set_network_proxy(message_ident.sequence_number, i_prot, o_prot)
},
"ConnectToWifi" => {
self.process_connect_to_wifi(message_ident.sequence_number, i_prot, o_prot)
},
"ConnectToAppointedWifi" => {
self.process_connect_to_appointed_wifi(message_ident.sequence_number, i_prot, o_prot)
},
"GetNetworkSettings" => {
self.process_get_network_settings(message_ident.sequence_number, i_prot, o_prot)
},
"GetNetworkStatus" => {
self.process_get_network_status(message_ident.sequence_number, i_prot, o_prot)
},
"RuyiTestNetwork" => {
self.process_ruyi_test_network(message_ident.sequence_number, i_prot, o_prot)
},
"RuyiStartNetworkSpeedTest" => {
self.process_ruyi_start_network_speed_test(message_ident.sequence_number, i_prot, o_prot)
},
"RuyiStopNetworkSpeedTest" => {
self.process_ruyi_stop_network_speed_test(message_ident.sequence_number, i_prot, o_prot)
},
"GetAvailableWifi" => {
self.process_get_available_wifi(message_ident.sequence_number, i_prot, o_prot)
},
"DisconnectWifi" => {
self.process_disconnect_wifi(message_ident.sequence_number, i_prot, o_prot)
},
"DiscoverBluetoothDevice" => {
self.process_discover_bluetooth_device(message_ident.sequence_number, i_prot, o_prot)
},
"ConnectBluetoothDevice" => {
self.process_connect_bluetooth_device(message_ident.sequence_number, i_prot, o_prot)
},
"DisconnectBluetoothDevice" => {
self.process_disconnect_bluetooth_device(message_ident.sequence_number, i_prot, o_prot)
},
"RemoveBluetoothDevice" => {
self.process_remove_bluetooth_device(message_ident.sequence_number, i_prot, o_prot)
},
method => {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::UnknownMethod,
format!("unknown method {}", method)
)
)
)
},
};
thrift::server::handle_process_result(&message_ident, res, o_prot)
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetSettingItemArgs {
id: String,
}
impl SettingSystemServiceGetSettingItemArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetSettingItemArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceGetSettingItemArgs.id", &f_1)?;
let ret = SettingSystemServiceGetSettingItemArgs {
id: f_1.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("GetSettingItem_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("id", TType::String, 1))?;
o_prot.write_string(&self.id)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetSettingItemResult {
result_value: Option<common_type_s_d_k_data_types::SettingItem>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceGetSettingItemResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetSettingItemResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<common_type_s_d_k_data_types::SettingItem> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = common_type_s_d_k_data_types::SettingItem::read_from_in_protocol(i_prot)?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetSettingItemResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceGetSettingItemResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Struct, 0))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<common_type_s_d_k_data_types::SettingItem> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceGetSettingItem"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetSettingItemsArgs {
category: String,
include_children: bool,
}
impl SettingSystemServiceGetSettingItemsArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetSettingItemsArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<bool> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_bool()?;
f_2 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceGetSettingItemsArgs.category", &f_1)?;
verify_required_field_exists("SettingSystemServiceGetSettingItemsArgs.include_children", &f_2)?;
let ret = SettingSystemServiceGetSettingItemsArgs {
category: f_1.expect("auto-generated code should have checked for presence of required fields"),
include_children: f_2.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("GetSettingItems_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("category", TType::String, 1))?;
o_prot.write_string(&self.category)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("includeChildren", TType::Bool, 2))?;
o_prot.write_bool(self.include_children)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetSettingItemsResult {
result_value: Option<Vec<common_type_s_d_k_data_types::SettingItem>>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceGetSettingItemsResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetSettingItemsResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<Vec<common_type_s_d_k_data_types::SettingItem>> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let list_ident = i_prot.read_list_begin()?;
let mut val: Vec<common_type_s_d_k_data_types::SettingItem> = Vec::with_capacity(list_ident.size as usize);
for _ in 0..list_ident.size {
let list_elem_0 = common_type_s_d_k_data_types::SettingItem::read_from_in_protocol(i_prot)?;
val.push(list_elem_0);
}
i_prot.read_list_end()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetSettingItemsResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceGetSettingItemsResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::List, 0))?;
o_prot.write_list_begin(&TListIdentifier::new(TType::Struct, fld_var.len() as i32))?;
for e in fld_var {
e.write_to_out_protocol(o_prot)?;
o_prot.write_list_end()?;
}
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<Vec<common_type_s_d_k_data_types::SettingItem>> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceGetSettingItems"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSearchSettingItemsArgs {
filter_json: String,
}
impl SettingSystemServiceSearchSettingItemsArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSearchSettingItemsArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceSearchSettingItemsArgs.filter_json", &f_1)?;
let ret = SettingSystemServiceSearchSettingItemsArgs {
filter_json: f_1.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SearchSettingItems_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("filterJson", TType::String, 1))?;
o_prot.write_string(&self.filter_json)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSearchSettingItemsResult {
result_value: Option<BTreeMap<String, setting_system_s_d_k_data_types::SettingSearchResult>>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceSearchSettingItemsResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSearchSettingItemsResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<BTreeMap<String, setting_system_s_d_k_data_types::SettingSearchResult>> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let map_ident = i_prot.read_map_begin()?;
let mut val: BTreeMap<String, setting_system_s_d_k_data_types::SettingSearchResult> = BTreeMap::new();
for _ in 0..map_ident.size {
let map_key_1 = i_prot.read_string()?;
let map_val_2 = setting_system_s_d_k_data_types::SettingSearchResult::read_from_in_protocol(i_prot)?;
val.insert(map_key_1, map_val_2);
}
i_prot.read_map_end()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceSearchSettingItemsResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceSearchSettingItemsResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Map, 0))?;
o_prot.write_map_begin(&TMapIdentifier::new(TType::String, TType::Struct, fld_var.len() as i32))?;
for (k, v) in fld_var {
o_prot.write_string(k)?;
v.write_to_out_protocol(o_prot)?;
o_prot.write_map_end()?;
}
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<BTreeMap<String, setting_system_s_d_k_data_types::SettingSearchResult>> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceSearchSettingItems"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetCategoryNodeArgs {
}
impl SettingSystemServiceGetCategoryNodeArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetCategoryNodeArgs> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetCategoryNodeArgs {};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("GetCategoryNode_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetCategoryNodeResult {
result_value: Option<setting_system_s_d_k_data_types::SettingTree>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceGetCategoryNodeResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetCategoryNodeResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<setting_system_s_d_k_data_types::SettingTree> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = setting_system_s_d_k_data_types::SettingTree::read_from_in_protocol(i_prot)?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetCategoryNodeResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceGetCategoryNodeResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Struct, 0))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<setting_system_s_d_k_data_types::SettingTree> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceGetCategoryNode"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetChildNodeArgs {
parent: String,
node_type: setting_system_s_d_k_data_types::NodeType,
param: String,
tags: Vec<String>,
}
impl SettingSystemServiceGetChildNodeArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetChildNodeArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<setting_system_s_d_k_data_types::NodeType> = None;
let mut f_3: Option<String> = None;
let mut f_4: Option<Vec<String>> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = setting_system_s_d_k_data_types::NodeType::read_from_in_protocol(i_prot)?;
f_2 = Some(val);
},
3 => {
let val = i_prot.read_string()?;
f_3 = Some(val);
},
4 => {
let list_ident = i_prot.read_list_begin()?;
let mut val: Vec<String> = Vec::with_capacity(list_ident.size as usize);
for _ in 0..list_ident.size {
let list_elem_3 = i_prot.read_string()?;
val.push(list_elem_3);
}
i_prot.read_list_end()?;
f_4 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceGetChildNodeArgs.parent", &f_1)?;
verify_required_field_exists("SettingSystemServiceGetChildNodeArgs.node_type", &f_2)?;
verify_required_field_exists("SettingSystemServiceGetChildNodeArgs.param", &f_3)?;
verify_required_field_exists("SettingSystemServiceGetChildNodeArgs.tags", &f_4)?;
let ret = SettingSystemServiceGetChildNodeArgs {
parent: f_1.expect("auto-generated code should have checked for presence of required fields"),
node_type: f_2.expect("auto-generated code should have checked for presence of required fields"),
param: f_3.expect("auto-generated code should have checked for presence of required fields"),
tags: f_4.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("GetChildNode_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("parent", TType::String, 1))?;
o_prot.write_string(&self.parent)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("nodeType", TType::I32, 2))?;
self.node_type.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("param", TType::String, 3))?;
o_prot.write_string(&self.param)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("tags", TType::List, 4))?;
o_prot.write_list_begin(&TListIdentifier::new(TType::String, self.tags.len() as i32))?;
for e in &self.tags {
o_prot.write_string(e)?;
o_prot.write_list_end()?;
}
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetChildNodeResult {
result_value: Option<setting_system_s_d_k_data_types::NodeList>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceGetChildNodeResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetChildNodeResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<setting_system_s_d_k_data_types::NodeList> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = setting_system_s_d_k_data_types::NodeList::read_from_in_protocol(i_prot)?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetChildNodeResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceGetChildNodeResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Struct, 0))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<setting_system_s_d_k_data_types::NodeList> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceGetChildNode"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSetSettingItemArgs {
key: String,
val: String,
}
impl SettingSystemServiceSetSettingItemArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSetSettingItemArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceSetSettingItemArgs.key", &f_1)?;
verify_required_field_exists("SettingSystemServiceSetSettingItemArgs.val", &f_2)?;
let ret = SettingSystemServiceSetSettingItemArgs {
key: f_1.expect("auto-generated code should have checked for presence of required fields"),
val: f_2.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SetSettingItem_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("key", TType::String, 1))?;
o_prot.write_string(&self.key)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("val", TType::String, 2))?;
o_prot.write_string(&self.val)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSetSettingItemResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceSetSettingItemResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSetSettingItemResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceSetSettingItemResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceSetSettingItemResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceSetSettingItem"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSetSettingItemsArgs {
key_values: BTreeMap<String, String>,
}
impl SettingSystemServiceSetSettingItemsArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSetSettingItemsArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<BTreeMap<String, String>> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let map_ident = i_prot.read_map_begin()?;
let mut val: BTreeMap<String, String> = BTreeMap::new();
for _ in 0..map_ident.size {
let map_key_4 = i_prot.read_string()?;
let map_val_5 = i_prot.read_string()?;
val.insert(map_key_4, map_val_5);
}
i_prot.read_map_end()?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceSetSettingItemsArgs.key_values", &f_1)?;
let ret = SettingSystemServiceSetSettingItemsArgs {
key_values: f_1.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SetSettingItems_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("keyValues", TType::Map, 1))?;
o_prot.write_map_begin(&TMapIdentifier::new(TType::String, TType::String, self.key_values.len() as i32))?;
for (k, v) in &self.key_values {
o_prot.write_string(k)?;
o_prot.write_string(v)?;
o_prot.write_map_end()?;
}
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSetSettingItemsResult {
result_value: Option<i32>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceSetSettingItemsResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSetSettingItemsResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<i32> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_i32()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceSetSettingItemsResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceSetSettingItemsResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::I32, 0))?;
o_prot.write_i32(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<i32> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceSetSettingItems"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRestoreDefaultArgs {
module_name: String,
category: String,
}
impl SettingSystemServiceRestoreDefaultArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRestoreDefaultArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceRestoreDefaultArgs.module_name", &f_1)?;
verify_required_field_exists("SettingSystemServiceRestoreDefaultArgs.category", &f_2)?;
let ret = SettingSystemServiceRestoreDefaultArgs {
module_name: f_1.expect("auto-generated code should have checked for presence of required fields"),
category: f_2.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("RestoreDefault_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("moduleName", TType::String, 1))?;
o_prot.write_string(&self.module_name)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("category", TType::String, 2))?;
o_prot.write_string(&self.category)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRestoreDefaultResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceRestoreDefaultResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRestoreDefaultResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceRestoreDefaultResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceRestoreDefaultResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceRestoreDefault"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRestoreUserDefaultArgs {
user_id: String,
module_name: String,
category: String,
}
impl SettingSystemServiceRestoreUserDefaultArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRestoreUserDefaultArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
let mut f_3: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
3 => {
let val = i_prot.read_string()?;
f_3 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceRestoreUserDefaultArgs.user_id", &f_1)?;
verify_required_field_exists("SettingSystemServiceRestoreUserDefaultArgs.module_name", &f_2)?;
verify_required_field_exists("SettingSystemServiceRestoreUserDefaultArgs.category", &f_3)?;
let ret = SettingSystemServiceRestoreUserDefaultArgs {
user_id: f_1.expect("auto-generated code should have checked for presence of required fields"),
module_name: f_2.expect("auto-generated code should have checked for presence of required fields"),
category: f_3.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("RestoreUserDefault_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("userId", TType::String, 1))?;
o_prot.write_string(&self.user_id)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("moduleName", TType::String, 2))?;
o_prot.write_string(&self.module_name)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("category", TType::String, 3))?;
o_prot.write_string(&self.category)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRestoreUserDefaultResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceRestoreUserDefaultResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRestoreUserDefaultResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceRestoreUserDefaultResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceRestoreUserDefaultResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceRestoreUserDefault"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceUpdateModuleVersionArgs {
module_name: String,
}
impl SettingSystemServiceUpdateModuleVersionArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceUpdateModuleVersionArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceUpdateModuleVersionArgs.module_name", &f_1)?;
let ret = SettingSystemServiceUpdateModuleVersionArgs {
module_name: f_1.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("UpdateModuleVersion_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("moduleName", TType::String, 1))?;
o_prot.write_string(&self.module_name)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceUpdateModuleVersionResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceUpdateModuleVersionResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceUpdateModuleVersionResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceUpdateModuleVersionResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceUpdateModuleVersionResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceUpdateModuleVersion"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSetUserAppDataArgs {
user_id: String,
category: String,
setting_items: BTreeMap<String, common_type_s_d_k_data_types::SettingValue>,
}
impl SettingSystemServiceSetUserAppDataArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSetUserAppDataArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
let mut f_3: Option<BTreeMap<String, common_type_s_d_k_data_types::SettingValue>> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
3 => {
let map_ident = i_prot.read_map_begin()?;
let mut val: BTreeMap<String, common_type_s_d_k_data_types::SettingValue> = BTreeMap::new();
for _ in 0..map_ident.size {
let map_key_6 = i_prot.read_string()?;
let map_val_7 = common_type_s_d_k_data_types::SettingValue::read_from_in_protocol(i_prot)?;
val.insert(map_key_6, map_val_7);
}
i_prot.read_map_end()?;
f_3 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceSetUserAppDataArgs.user_id", &f_1)?;
verify_required_field_exists("SettingSystemServiceSetUserAppDataArgs.category", &f_2)?;
verify_required_field_exists("SettingSystemServiceSetUserAppDataArgs.setting_items", &f_3)?;
let ret = SettingSystemServiceSetUserAppDataArgs {
user_id: f_1.expect("auto-generated code should have checked for presence of required fields"),
category: f_2.expect("auto-generated code should have checked for presence of required fields"),
setting_items: f_3.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SetUserAppData_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("userId", TType::String, 1))?;
o_prot.write_string(&self.user_id)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("category", TType::String, 2))?;
o_prot.write_string(&self.category)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("settingItems", TType::Map, 3))?;
o_prot.write_map_begin(&TMapIdentifier::new(TType::String, TType::Struct, self.setting_items.len() as i32))?;
for (k, v) in &self.setting_items {
o_prot.write_string(k)?;
v.write_to_out_protocol(o_prot)?;
o_prot.write_map_end()?;
}
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSetUserAppDataResult {
result_value: Option<i32>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceSetUserAppDataResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSetUserAppDataResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<i32> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_i32()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceSetUserAppDataResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceSetUserAppDataResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::I32, 0))?;
o_prot.write_i32(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<i32> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceSetUserAppData"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetUserAppDataArgs {
user_id: String,
category: String,
setting_keys: Vec<String>,
}
impl SettingSystemServiceGetUserAppDataArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetUserAppDataArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
let mut f_3: Option<Vec<String>> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
3 => {
let list_ident = i_prot.read_list_begin()?;
let mut val: Vec<String> = Vec::with_capacity(list_ident.size as usize);
for _ in 0..list_ident.size {
let list_elem_8 = i_prot.read_string()?;
val.push(list_elem_8);
}
i_prot.read_list_end()?;
f_3 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceGetUserAppDataArgs.user_id", &f_1)?;
verify_required_field_exists("SettingSystemServiceGetUserAppDataArgs.category", &f_2)?;
verify_required_field_exists("SettingSystemServiceGetUserAppDataArgs.setting_keys", &f_3)?;
let ret = SettingSystemServiceGetUserAppDataArgs {
user_id: f_1.expect("auto-generated code should have checked for presence of required fields"),
category: f_2.expect("auto-generated code should have checked for presence of required fields"),
setting_keys: f_3.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("GetUserAppData_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("userId", TType::String, 1))?;
o_prot.write_string(&self.user_id)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("category", TType::String, 2))?;
o_prot.write_string(&self.category)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("settingKeys", TType::List, 3))?;
o_prot.write_list_begin(&TListIdentifier::new(TType::String, self.setting_keys.len() as i32))?;
for e in &self.setting_keys {
o_prot.write_string(e)?;
o_prot.write_list_end()?;
}
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetUserAppDataResult {
result_value: Option<common_type_s_d_k_data_types::AppData>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceGetUserAppDataResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetUserAppDataResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<common_type_s_d_k_data_types::AppData> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = common_type_s_d_k_data_types::AppData::read_from_in_protocol(i_prot)?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetUserAppDataResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceGetUserAppDataResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Struct, 0))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<common_type_s_d_k_data_types::AppData> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceGetUserAppData"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRemoveUserAppDataArgs {
user_id: String,
category: String,
setting_keys: Vec<String>,
}
impl SettingSystemServiceRemoveUserAppDataArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRemoveUserAppDataArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
let mut f_3: Option<Vec<String>> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
3 => {
let list_ident = i_prot.read_list_begin()?;
let mut val: Vec<String> = Vec::with_capacity(list_ident.size as usize);
for _ in 0..list_ident.size {
let list_elem_9 = i_prot.read_string()?;
val.push(list_elem_9);
}
i_prot.read_list_end()?;
f_3 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceRemoveUserAppDataArgs.user_id", &f_1)?;
verify_required_field_exists("SettingSystemServiceRemoveUserAppDataArgs.category", &f_2)?;
verify_required_field_exists("SettingSystemServiceRemoveUserAppDataArgs.setting_keys", &f_3)?;
let ret = SettingSystemServiceRemoveUserAppDataArgs {
user_id: f_1.expect("auto-generated code should have checked for presence of required fields"),
category: f_2.expect("auto-generated code should have checked for presence of required fields"),
setting_keys: f_3.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("RemoveUserAppData_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("userId", TType::String, 1))?;
o_prot.write_string(&self.user_id)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("category", TType::String, 2))?;
o_prot.write_string(&self.category)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("settingKeys", TType::List, 3))?;
o_prot.write_list_begin(&TListIdentifier::new(TType::String, self.setting_keys.len() as i32))?;
for e in &self.setting_keys {
o_prot.write_string(e)?;
o_prot.write_list_end()?;
}
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRemoveUserAppDataResult {
result_value: Option<i32>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceRemoveUserAppDataResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRemoveUserAppDataResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<i32> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_i32()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceRemoveUserAppDataResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceRemoveUserAppDataResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::I32, 0))?;
o_prot.write_i32(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<i32> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceRemoveUserAppData"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSettingItemNotifyArgs {
key: String,
contents: setting_system_s_d_k_data_types::JSON,
}
impl SettingSystemServiceSettingItemNotifyArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSettingItemNotifyArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<setting_system_s_d_k_data_types::JSON> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceSettingItemNotifyArgs.key", &f_1)?;
verify_required_field_exists("SettingSystemServiceSettingItemNotifyArgs.contents", &f_2)?;
let ret = SettingSystemServiceSettingItemNotifyArgs {
key: f_1.expect("auto-generated code should have checked for presence of required fields"),
contents: f_2.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingItemNotify_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("key", TType::String, 1))?;
o_prot.write_string(&self.key)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("contents", TType::String, 2))?;
o_prot.write_string(&self.contents)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSettingItemNotifyResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceSettingItemNotifyResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSettingItemNotifyResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceSettingItemNotifyResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceSettingItemNotifyResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceSettingItemNotify"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetNetworkAdapterSettingsArgs {
}
impl SettingSystemServiceGetNetworkAdapterSettingsArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetNetworkAdapterSettingsArgs> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetNetworkAdapterSettingsArgs {};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("GetNetworkAdapterSettings_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetNetworkAdapterSettingsResult {
result_value: Option<setting_system_s_d_k_data_types::NetworkSettings>,
}
impl SettingSystemServiceGetNetworkAdapterSettingsResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetNetworkAdapterSettingsResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<setting_system_s_d_k_data_types::NetworkSettings> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = setting_system_s_d_k_data_types::NetworkSettings::read_from_in_protocol(i_prot)?;
f_0 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetNetworkAdapterSettingsResult {
result_value: f_0,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceGetNetworkAdapterSettingsResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Struct, 0))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<setting_system_s_d_k_data_types::NetworkSettings> {
if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceGetNetworkAdapterSettings"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetLanNetworkNameArgs {
}
impl SettingSystemServiceGetLanNetworkNameArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetLanNetworkNameArgs> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetLanNetworkNameArgs {};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("GetLanNetworkName_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetLanNetworkNameResult {
result_value: Option<String>,
}
impl SettingSystemServiceGetLanNetworkNameResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetLanNetworkNameResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_string()?;
f_0 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetLanNetworkNameResult {
result_value: f_0,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceGetLanNetworkNameResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::String, 0))?;
o_prot.write_string(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<String> {
if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceGetLanNetworkName"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSetNetworkSettingsArgs {
is_w_lan: bool,
enable_d_h_c_p: bool,
ip_address: String,
sub_mask: String,
gateway: String,
main_d_n_s: String,
sub_d_n_s: String,
}
impl SettingSystemServiceSetNetworkSettingsArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSetNetworkSettingsArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<bool> = None;
let mut f_2: Option<bool> = None;
let mut f_3: Option<String> = None;
let mut f_4: Option<String> = None;
let mut f_5: Option<String> = None;
let mut f_6: Option<String> = None;
let mut f_7: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_bool()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_bool()?;
f_2 = Some(val);
},
3 => {
let val = i_prot.read_string()?;
f_3 = Some(val);
},
4 => {
let val = i_prot.read_string()?;
f_4 = Some(val);
},
5 => {
let val = i_prot.read_string()?;
f_5 = Some(val);
},
6 => {
let val = i_prot.read_string()?;
f_6 = Some(val);
},
7 => {
let val = i_prot.read_string()?;
f_7 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceSetNetworkSettingsArgs.is_w_lan", &f_1)?;
verify_required_field_exists("SettingSystemServiceSetNetworkSettingsArgs.enable_d_h_c_p", &f_2)?;
verify_required_field_exists("SettingSystemServiceSetNetworkSettingsArgs.ip_address", &f_3)?;
verify_required_field_exists("SettingSystemServiceSetNetworkSettingsArgs.sub_mask", &f_4)?;
verify_required_field_exists("SettingSystemServiceSetNetworkSettingsArgs.gateway", &f_5)?;
verify_required_field_exists("SettingSystemServiceSetNetworkSettingsArgs.main_d_n_s", &f_6)?;
verify_required_field_exists("SettingSystemServiceSetNetworkSettingsArgs.sub_d_n_s", &f_7)?;
let ret = SettingSystemServiceSetNetworkSettingsArgs {
is_w_lan: f_1.expect("auto-generated code should have checked for presence of required fields"),
enable_d_h_c_p: f_2.expect("auto-generated code should have checked for presence of required fields"),
ip_address: f_3.expect("auto-generated code should have checked for presence of required fields"),
sub_mask: f_4.expect("auto-generated code should have checked for presence of required fields"),
gateway: f_5.expect("auto-generated code should have checked for presence of required fields"),
main_d_n_s: f_6.expect("auto-generated code should have checked for presence of required fields"),
sub_d_n_s: f_7.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SetNetworkSettings_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("isWLan", TType::Bool, 1))?;
o_prot.write_bool(self.is_w_lan)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("EnableDHCP", TType::Bool, 2))?;
o_prot.write_bool(self.enable_d_h_c_p)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("IpAddress", TType::String, 3))?;
o_prot.write_string(&self.ip_address)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("SubMask", TType::String, 4))?;
o_prot.write_string(&self.sub_mask)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("Gateway", TType::String, 5))?;
o_prot.write_string(&self.gateway)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("MainDNS", TType::String, 6))?;
o_prot.write_string(&self.main_d_n_s)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("SubDNS", TType::String, 7))?;
o_prot.write_string(&self.sub_d_n_s)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSetNetworkSettingsResult {
result_value: Option<bool>,
}
impl SettingSystemServiceSetNetworkSettingsResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSetNetworkSettingsResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceSetNetworkSettingsResult {
result_value: f_0,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceSetNetworkSettingsResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceSetNetworkSettings"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSetNetworkProxyArgs {
proxy_server: String,
proxy_port: String,
}
impl SettingSystemServiceSetNetworkProxyArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSetNetworkProxyArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceSetNetworkProxyArgs.proxy_server", &f_1)?;
verify_required_field_exists("SettingSystemServiceSetNetworkProxyArgs.proxy_port", &f_2)?;
let ret = SettingSystemServiceSetNetworkProxyArgs {
proxy_server: f_1.expect("auto-generated code should have checked for presence of required fields"),
proxy_port: f_2.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SetNetworkProxy_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("ProxyServer", TType::String, 1))?;
o_prot.write_string(&self.proxy_server)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("ProxyPort", TType::String, 2))?;
o_prot.write_string(&self.proxy_port)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceSetNetworkProxyResult {
result_value: Option<bool>,
}
impl SettingSystemServiceSetNetworkProxyResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceSetNetworkProxyResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceSetNetworkProxyResult {
result_value: f_0,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceSetNetworkProxyResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceSetNetworkProxy"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceConnectToWifiArgs {
profile_name: String,
key: String,
}
impl SettingSystemServiceConnectToWifiArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceConnectToWifiArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceConnectToWifiArgs.profile_name", &f_1)?;
verify_required_field_exists("SettingSystemServiceConnectToWifiArgs.key", &f_2)?;
let ret = SettingSystemServiceConnectToWifiArgs {
profile_name: f_1.expect("auto-generated code should have checked for presence of required fields"),
key: f_2.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("ConnectToWifi_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("profileName", TType::String, 1))?;
o_prot.write_string(&self.profile_name)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("key", TType::String, 2))?;
o_prot.write_string(&self.key)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceConnectToWifiResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceConnectToWifiResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceConnectToWifiResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceConnectToWifiResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceConnectToWifiResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceConnectToWifi"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceConnectToAppointedWifiArgs {
profile_name: String,
auth: String,
ciper: String,
key_type: String,
key: String,
}
impl SettingSystemServiceConnectToAppointedWifiArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceConnectToAppointedWifiArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
let mut f_3: Option<String> = None;
let mut f_4: Option<String> = None;
let mut f_5: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
3 => {
let val = i_prot.read_string()?;
f_3 = Some(val);
},
4 => {
let val = i_prot.read_string()?;
f_4 = Some(val);
},
5 => {
let val = i_prot.read_string()?;
f_5 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceConnectToAppointedWifiArgs.profile_name", &f_1)?;
verify_required_field_exists("SettingSystemServiceConnectToAppointedWifiArgs.auth", &f_2)?;
verify_required_field_exists("SettingSystemServiceConnectToAppointedWifiArgs.ciper", &f_3)?;
verify_required_field_exists("SettingSystemServiceConnectToAppointedWifiArgs.key_type", &f_4)?;
verify_required_field_exists("SettingSystemServiceConnectToAppointedWifiArgs.key", &f_5)?;
let ret = SettingSystemServiceConnectToAppointedWifiArgs {
profile_name: f_1.expect("auto-generated code should have checked for presence of required fields"),
auth: f_2.expect("auto-generated code should have checked for presence of required fields"),
ciper: f_3.expect("auto-generated code should have checked for presence of required fields"),
key_type: f_4.expect("auto-generated code should have checked for presence of required fields"),
key: f_5.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("ConnectToAppointedWifi_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("profileName", TType::String, 1))?;
o_prot.write_string(&self.profile_name)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("Auth", TType::String, 2))?;
o_prot.write_string(&self.auth)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("Ciper", TType::String, 3))?;
o_prot.write_string(&self.ciper)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("KeyType", TType::String, 4))?;
o_prot.write_string(&self.key_type)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("key", TType::String, 5))?;
o_prot.write_string(&self.key)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceConnectToAppointedWifiResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceConnectToAppointedWifiResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceConnectToAppointedWifiResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceConnectToAppointedWifiResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceConnectToAppointedWifiResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceConnectToAppointedWifi"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetNetworkSettingsArgs {
}
impl SettingSystemServiceGetNetworkSettingsArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetNetworkSettingsArgs> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetNetworkSettingsArgs {};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("GetNetworkSettings_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetNetworkSettingsResult {
result_value: Option<setting_system_s_d_k_data_types::RuyiNetworkSettings>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceGetNetworkSettingsResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetNetworkSettingsResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<setting_system_s_d_k_data_types::RuyiNetworkSettings> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = setting_system_s_d_k_data_types::RuyiNetworkSettings::read_from_in_protocol(i_prot)?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetNetworkSettingsResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceGetNetworkSettingsResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Struct, 0))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<setting_system_s_d_k_data_types::RuyiNetworkSettings> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceGetNetworkSettings"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetNetworkStatusArgs {
}
impl SettingSystemServiceGetNetworkStatusArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetNetworkStatusArgs> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetNetworkStatusArgs {};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("GetNetworkStatus_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetNetworkStatusResult {
result_value: Option<setting_system_s_d_k_data_types::RuyiNetworkStatus>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceGetNetworkStatusResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetNetworkStatusResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<setting_system_s_d_k_data_types::RuyiNetworkStatus> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = setting_system_s_d_k_data_types::RuyiNetworkStatus::read_from_in_protocol(i_prot)?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetNetworkStatusResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceGetNetworkStatusResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Struct, 0))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<setting_system_s_d_k_data_types::RuyiNetworkStatus> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceGetNetworkStatus"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRuyiTestNetworkArgs {
}
impl SettingSystemServiceRuyiTestNetworkArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRuyiTestNetworkArgs> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceRuyiTestNetworkArgs {};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("RuyiTestNetwork_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRuyiTestNetworkResult {
result_value: Option<setting_system_s_d_k_data_types::RuyiNetworkTestResult>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceRuyiTestNetworkResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRuyiTestNetworkResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<setting_system_s_d_k_data_types::RuyiNetworkTestResult> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = setting_system_s_d_k_data_types::RuyiNetworkTestResult::read_from_in_protocol(i_prot)?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceRuyiTestNetworkResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceRuyiTestNetworkResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Struct, 0))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<setting_system_s_d_k_data_types::RuyiNetworkTestResult> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceRuyiTestNetwork"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRuyiStartNetworkSpeedTestArgs {
userindex: i32,
}
impl SettingSystemServiceRuyiStartNetworkSpeedTestArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRuyiStartNetworkSpeedTestArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<i32> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_i32()?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceRuyiStartNetworkSpeedTestArgs.userindex", &f_1)?;
let ret = SettingSystemServiceRuyiStartNetworkSpeedTestArgs {
userindex: f_1.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("RuyiStartNetworkSpeedTest_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("userindex", TType::I32, 1))?;
o_prot.write_i32(self.userindex)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRuyiStartNetworkSpeedTestResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceRuyiStartNetworkSpeedTestResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRuyiStartNetworkSpeedTestResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceRuyiStartNetworkSpeedTestResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceRuyiStartNetworkSpeedTestResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceRuyiStartNetworkSpeedTest"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRuyiStopNetworkSpeedTestArgs {
userindex: i32,
}
impl SettingSystemServiceRuyiStopNetworkSpeedTestArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRuyiStopNetworkSpeedTestArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<i32> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_i32()?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceRuyiStopNetworkSpeedTestArgs.userindex", &f_1)?;
let ret = SettingSystemServiceRuyiStopNetworkSpeedTestArgs {
userindex: f_1.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("RuyiStopNetworkSpeedTest_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("userindex", TType::I32, 1))?;
o_prot.write_i32(self.userindex)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRuyiStopNetworkSpeedTestResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceRuyiStopNetworkSpeedTestResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRuyiStopNetworkSpeedTestResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceRuyiStopNetworkSpeedTestResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceRuyiStopNetworkSpeedTestResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceRuyiStopNetworkSpeedTest"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetAvailableWifiArgs {
}
impl SettingSystemServiceGetAvailableWifiArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetAvailableWifiArgs> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetAvailableWifiArgs {};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("GetAvailableWifi_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceGetAvailableWifiResult {
result_value: Option<Vec<setting_system_s_d_k_data_types::WifiEntity>>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceGetAvailableWifiResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceGetAvailableWifiResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<Vec<setting_system_s_d_k_data_types::WifiEntity>> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let list_ident = i_prot.read_list_begin()?;
let mut val: Vec<setting_system_s_d_k_data_types::WifiEntity> = Vec::with_capacity(list_ident.size as usize);
for _ in 0..list_ident.size {
let list_elem_10 = setting_system_s_d_k_data_types::WifiEntity::read_from_in_protocol(i_prot)?;
val.push(list_elem_10);
}
i_prot.read_list_end()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceGetAvailableWifiResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceGetAvailableWifiResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::List, 0))?;
o_prot.write_list_begin(&TListIdentifier::new(TType::Struct, fld_var.len() as i32))?;
for e in fld_var {
e.write_to_out_protocol(o_prot)?;
o_prot.write_list_end()?;
}
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<Vec<setting_system_s_d_k_data_types::WifiEntity>> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceGetAvailableWifi"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceDisconnectWifiArgs {
}
impl SettingSystemServiceDisconnectWifiArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceDisconnectWifiArgs> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceDisconnectWifiArgs {};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("DisconnectWifi_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceDisconnectWifiResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceDisconnectWifiResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceDisconnectWifiResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceDisconnectWifiResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceDisconnectWifiResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceDisconnectWifi"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceDiscoverBluetoothDeviceArgs {
}
impl SettingSystemServiceDiscoverBluetoothDeviceArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceDiscoverBluetoothDeviceArgs> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceDiscoverBluetoothDeviceArgs {};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("DiscoverBluetoothDevice_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceDiscoverBluetoothDeviceResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceDiscoverBluetoothDeviceResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceDiscoverBluetoothDeviceResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceDiscoverBluetoothDeviceResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceDiscoverBluetoothDeviceResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceDiscoverBluetoothDevice"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceConnectBluetoothDeviceArgs {
device_name: String,
device_address: String,
}
impl SettingSystemServiceConnectBluetoothDeviceArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceConnectBluetoothDeviceArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceConnectBluetoothDeviceArgs.device_name", &f_1)?;
verify_required_field_exists("SettingSystemServiceConnectBluetoothDeviceArgs.device_address", &f_2)?;
let ret = SettingSystemServiceConnectBluetoothDeviceArgs {
device_name: f_1.expect("auto-generated code should have checked for presence of required fields"),
device_address: f_2.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("ConnectBluetoothDevice_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("DeviceName", TType::String, 1))?;
o_prot.write_string(&self.device_name)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("DeviceAddress", TType::String, 2))?;
o_prot.write_string(&self.device_address)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceConnectBluetoothDeviceResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceConnectBluetoothDeviceResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceConnectBluetoothDeviceResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceConnectBluetoothDeviceResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceConnectBluetoothDeviceResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceConnectBluetoothDevice"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceDisconnectBluetoothDeviceArgs {
device_name: String,
device_address: String,
}
impl SettingSystemServiceDisconnectBluetoothDeviceArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceDisconnectBluetoothDeviceArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceDisconnectBluetoothDeviceArgs.device_name", &f_1)?;
verify_required_field_exists("SettingSystemServiceDisconnectBluetoothDeviceArgs.device_address", &f_2)?;
let ret = SettingSystemServiceDisconnectBluetoothDeviceArgs {
device_name: f_1.expect("auto-generated code should have checked for presence of required fields"),
device_address: f_2.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("DisconnectBluetoothDevice_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("DeviceName", TType::String, 1))?;
o_prot.write_string(&self.device_name)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("DeviceAddress", TType::String, 2))?;
o_prot.write_string(&self.device_address)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceDisconnectBluetoothDeviceResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceDisconnectBluetoothDeviceResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceDisconnectBluetoothDeviceResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceDisconnectBluetoothDeviceResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceDisconnectBluetoothDeviceResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceDisconnectBluetoothDevice"
)
)
)
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRemoveBluetoothDeviceArgs {
device_name: String,
device_address: String,
}
impl SettingSystemServiceRemoveBluetoothDeviceArgs {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRemoveBluetoothDeviceArgs> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_string()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
verify_required_field_exists("SettingSystemServiceRemoveBluetoothDeviceArgs.device_name", &f_1)?;
verify_required_field_exists("SettingSystemServiceRemoveBluetoothDeviceArgs.device_address", &f_2)?;
let ret = SettingSystemServiceRemoveBluetoothDeviceArgs {
device_name: f_1.expect("auto-generated code should have checked for presence of required fields"),
device_address: f_2.expect("auto-generated code should have checked for presence of required fields"),
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("RemoveBluetoothDevice_args");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("DeviceName", TType::String, 1))?;
o_prot.write_string(&self.device_name)?;
o_prot.write_field_end()?;
o_prot.write_field_begin(&TFieldIdentifier::new("DeviceAddress", TType::String, 2))?;
o_prot.write_string(&self.device_address)?;
o_prot.write_field_end()?;
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SettingSystemServiceRemoveBluetoothDeviceResult {
result_value: Option<bool>,
error1: Option<common_type_s_d_k_data_types::ErrorException>,
}
impl SettingSystemServiceRemoveBluetoothDeviceResult {
fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<SettingSystemServiceRemoveBluetoothDeviceResult> {
i_prot.read_struct_begin()?;
let mut f_0: Option<bool> = None;
let mut f_1: Option<common_type_s_d_k_data_types::ErrorException> = None;
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
0 => {
let val = i_prot.read_bool()?;
f_0 = Some(val);
},
1 => {
let val = common_type_s_d_k_data_types::ErrorException::read_from_in_protocol(i_prot)?;
f_1 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = SettingSystemServiceRemoveBluetoothDeviceResult {
result_value: f_0,
error1: f_1,
};
Ok(ret)
}
fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SettingSystemServiceRemoveBluetoothDeviceResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result_value {
o_prot.write_field_begin(&TFieldIdentifier::new("result_value", TType::Bool, 0))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.error1 {
o_prot.write_field_begin(&TFieldIdentifier::new("error1", TType::Struct, 1))?;
fld_var.write_to_out_protocol(o_prot)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
fn ok_or(self) -> thrift::Result<bool> {
if self.error1.is_some() {
Err(thrift::Error::User(Box::new(self.error1.unwrap())))
} else if self.result_value.is_some() {
Ok(self.result_value.unwrap())
} else {
Err(
thrift::Error::Application(
ApplicationError::new(
ApplicationErrorKind::MissingResult,
"no result received for SettingSystemServiceRemoveBluetoothDevice"
)
)
)
}
}
}