view.rs 106 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193
  1. // This file is generated by rust-protobuf 2.25.2. Do not edit
  2. // @generated
  3. // https://github.com/rust-lang/rust-clippy/issues/702
  4. #![allow(unknown_lints)]
  5. #![allow(clippy::all)]
  6. #![allow(unused_attributes)]
  7. #![cfg_attr(rustfmt, rustfmt::skip)]
  8. #![allow(box_pointers)]
  9. #![allow(dead_code)]
  10. #![allow(missing_docs)]
  11. #![allow(non_camel_case_types)]
  12. #![allow(non_snake_case)]
  13. #![allow(non_upper_case_globals)]
  14. #![allow(trivial_casts)]
  15. #![allow(unused_imports)]
  16. #![allow(unused_results)]
  17. //! Generated file from `view.proto`
  18. /// Generated files are compatible only with the same version
  19. /// of protobuf runtime.
  20. // const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
  21. #[derive(PartialEq,Clone,Default)]
  22. pub struct View {
  23. // message fields
  24. pub id: ::std::string::String,
  25. pub belong_to_id: ::std::string::String,
  26. pub name: ::std::string::String,
  27. pub desc: ::std::string::String,
  28. pub data_type: ViewDataType,
  29. pub version: i64,
  30. pub belongings: ::protobuf::SingularPtrField<RepeatedView>,
  31. pub modified_time: i64,
  32. pub create_time: i64,
  33. pub ext_data: ::std::string::String,
  34. pub thumbnail: ::std::string::String,
  35. pub plugin_type: i32,
  36. // special fields
  37. pub unknown_fields: ::protobuf::UnknownFields,
  38. pub cached_size: ::protobuf::CachedSize,
  39. }
  40. impl<'a> ::std::default::Default for &'a View {
  41. fn default() -> &'a View {
  42. <View as ::protobuf::Message>::default_instance()
  43. }
  44. }
  45. impl View {
  46. pub fn new() -> View {
  47. ::std::default::Default::default()
  48. }
  49. // string id = 1;
  50. pub fn get_id(&self) -> &str {
  51. &self.id
  52. }
  53. pub fn clear_id(&mut self) {
  54. self.id.clear();
  55. }
  56. // Param is passed by value, moved
  57. pub fn set_id(&mut self, v: ::std::string::String) {
  58. self.id = v;
  59. }
  60. // Mutable pointer to the field.
  61. // If field is not initialized, it is initialized with default value first.
  62. pub fn mut_id(&mut self) -> &mut ::std::string::String {
  63. &mut self.id
  64. }
  65. // Take field
  66. pub fn take_id(&mut self) -> ::std::string::String {
  67. ::std::mem::replace(&mut self.id, ::std::string::String::new())
  68. }
  69. // string belong_to_id = 2;
  70. pub fn get_belong_to_id(&self) -> &str {
  71. &self.belong_to_id
  72. }
  73. pub fn clear_belong_to_id(&mut self) {
  74. self.belong_to_id.clear();
  75. }
  76. // Param is passed by value, moved
  77. pub fn set_belong_to_id(&mut self, v: ::std::string::String) {
  78. self.belong_to_id = v;
  79. }
  80. // Mutable pointer to the field.
  81. // If field is not initialized, it is initialized with default value first.
  82. pub fn mut_belong_to_id(&mut self) -> &mut ::std::string::String {
  83. &mut self.belong_to_id
  84. }
  85. // Take field
  86. pub fn take_belong_to_id(&mut self) -> ::std::string::String {
  87. ::std::mem::replace(&mut self.belong_to_id, ::std::string::String::new())
  88. }
  89. // string name = 3;
  90. pub fn get_name(&self) -> &str {
  91. &self.name
  92. }
  93. pub fn clear_name(&mut self) {
  94. self.name.clear();
  95. }
  96. // Param is passed by value, moved
  97. pub fn set_name(&mut self, v: ::std::string::String) {
  98. self.name = v;
  99. }
  100. // Mutable pointer to the field.
  101. // If field is not initialized, it is initialized with default value first.
  102. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  103. &mut self.name
  104. }
  105. // Take field
  106. pub fn take_name(&mut self) -> ::std::string::String {
  107. ::std::mem::replace(&mut self.name, ::std::string::String::new())
  108. }
  109. // string desc = 4;
  110. pub fn get_desc(&self) -> &str {
  111. &self.desc
  112. }
  113. pub fn clear_desc(&mut self) {
  114. self.desc.clear();
  115. }
  116. // Param is passed by value, moved
  117. pub fn set_desc(&mut self, v: ::std::string::String) {
  118. self.desc = v;
  119. }
  120. // Mutable pointer to the field.
  121. // If field is not initialized, it is initialized with default value first.
  122. pub fn mut_desc(&mut self) -> &mut ::std::string::String {
  123. &mut self.desc
  124. }
  125. // Take field
  126. pub fn take_desc(&mut self) -> ::std::string::String {
  127. ::std::mem::replace(&mut self.desc, ::std::string::String::new())
  128. }
  129. // .ViewDataType data_type = 5;
  130. pub fn get_data_type(&self) -> ViewDataType {
  131. self.data_type
  132. }
  133. pub fn clear_data_type(&mut self) {
  134. self.data_type = ViewDataType::TextBlock;
  135. }
  136. // Param is passed by value, moved
  137. pub fn set_data_type(&mut self, v: ViewDataType) {
  138. self.data_type = v;
  139. }
  140. // int64 version = 6;
  141. pub fn get_version(&self) -> i64 {
  142. self.version
  143. }
  144. pub fn clear_version(&mut self) {
  145. self.version = 0;
  146. }
  147. // Param is passed by value, moved
  148. pub fn set_version(&mut self, v: i64) {
  149. self.version = v;
  150. }
  151. // .RepeatedView belongings = 7;
  152. pub fn get_belongings(&self) -> &RepeatedView {
  153. self.belongings.as_ref().unwrap_or_else(|| <RepeatedView as ::protobuf::Message>::default_instance())
  154. }
  155. pub fn clear_belongings(&mut self) {
  156. self.belongings.clear();
  157. }
  158. pub fn has_belongings(&self) -> bool {
  159. self.belongings.is_some()
  160. }
  161. // Param is passed by value, moved
  162. pub fn set_belongings(&mut self, v: RepeatedView) {
  163. self.belongings = ::protobuf::SingularPtrField::some(v);
  164. }
  165. // Mutable pointer to the field.
  166. // If field is not initialized, it is initialized with default value first.
  167. pub fn mut_belongings(&mut self) -> &mut RepeatedView {
  168. if self.belongings.is_none() {
  169. self.belongings.set_default();
  170. }
  171. self.belongings.as_mut().unwrap()
  172. }
  173. // Take field
  174. pub fn take_belongings(&mut self) -> RepeatedView {
  175. self.belongings.take().unwrap_or_else(|| RepeatedView::new())
  176. }
  177. // int64 modified_time = 8;
  178. pub fn get_modified_time(&self) -> i64 {
  179. self.modified_time
  180. }
  181. pub fn clear_modified_time(&mut self) {
  182. self.modified_time = 0;
  183. }
  184. // Param is passed by value, moved
  185. pub fn set_modified_time(&mut self, v: i64) {
  186. self.modified_time = v;
  187. }
  188. // int64 create_time = 9;
  189. pub fn get_create_time(&self) -> i64 {
  190. self.create_time
  191. }
  192. pub fn clear_create_time(&mut self) {
  193. self.create_time = 0;
  194. }
  195. // Param is passed by value, moved
  196. pub fn set_create_time(&mut self, v: i64) {
  197. self.create_time = v;
  198. }
  199. // string ext_data = 10;
  200. pub fn get_ext_data(&self) -> &str {
  201. &self.ext_data
  202. }
  203. pub fn clear_ext_data(&mut self) {
  204. self.ext_data.clear();
  205. }
  206. // Param is passed by value, moved
  207. pub fn set_ext_data(&mut self, v: ::std::string::String) {
  208. self.ext_data = v;
  209. }
  210. // Mutable pointer to the field.
  211. // If field is not initialized, it is initialized with default value first.
  212. pub fn mut_ext_data(&mut self) -> &mut ::std::string::String {
  213. &mut self.ext_data
  214. }
  215. // Take field
  216. pub fn take_ext_data(&mut self) -> ::std::string::String {
  217. ::std::mem::replace(&mut self.ext_data, ::std::string::String::new())
  218. }
  219. // string thumbnail = 11;
  220. pub fn get_thumbnail(&self) -> &str {
  221. &self.thumbnail
  222. }
  223. pub fn clear_thumbnail(&mut self) {
  224. self.thumbnail.clear();
  225. }
  226. // Param is passed by value, moved
  227. pub fn set_thumbnail(&mut self, v: ::std::string::String) {
  228. self.thumbnail = v;
  229. }
  230. // Mutable pointer to the field.
  231. // If field is not initialized, it is initialized with default value first.
  232. pub fn mut_thumbnail(&mut self) -> &mut ::std::string::String {
  233. &mut self.thumbnail
  234. }
  235. // Take field
  236. pub fn take_thumbnail(&mut self) -> ::std::string::String {
  237. ::std::mem::replace(&mut self.thumbnail, ::std::string::String::new())
  238. }
  239. // int32 plugin_type = 12;
  240. pub fn get_plugin_type(&self) -> i32 {
  241. self.plugin_type
  242. }
  243. pub fn clear_plugin_type(&mut self) {
  244. self.plugin_type = 0;
  245. }
  246. // Param is passed by value, moved
  247. pub fn set_plugin_type(&mut self, v: i32) {
  248. self.plugin_type = v;
  249. }
  250. }
  251. impl ::protobuf::Message for View {
  252. fn is_initialized(&self) -> bool {
  253. for v in &self.belongings {
  254. if !v.is_initialized() {
  255. return false;
  256. }
  257. };
  258. true
  259. }
  260. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  261. while !is.eof()? {
  262. let (field_number, wire_type) = is.read_tag_unpack()?;
  263. match field_number {
  264. 1 => {
  265. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?;
  266. },
  267. 2 => {
  268. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.belong_to_id)?;
  269. },
  270. 3 => {
  271. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
  272. },
  273. 4 => {
  274. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.desc)?;
  275. },
  276. 5 => {
  277. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.data_type, 5, &mut self.unknown_fields)?
  278. },
  279. 6 => {
  280. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  281. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  282. }
  283. let tmp = is.read_int64()?;
  284. self.version = tmp;
  285. },
  286. 7 => {
  287. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.belongings)?;
  288. },
  289. 8 => {
  290. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  291. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  292. }
  293. let tmp = is.read_int64()?;
  294. self.modified_time = tmp;
  295. },
  296. 9 => {
  297. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  298. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  299. }
  300. let tmp = is.read_int64()?;
  301. self.create_time = tmp;
  302. },
  303. 10 => {
  304. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.ext_data)?;
  305. },
  306. 11 => {
  307. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.thumbnail)?;
  308. },
  309. 12 => {
  310. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  311. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  312. }
  313. let tmp = is.read_int32()?;
  314. self.plugin_type = tmp;
  315. },
  316. _ => {
  317. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  318. },
  319. };
  320. }
  321. ::std::result::Result::Ok(())
  322. }
  323. // Compute sizes of nested messages
  324. #[allow(unused_variables)]
  325. fn compute_size(&self) -> u32 {
  326. let mut my_size = 0;
  327. if !self.id.is_empty() {
  328. my_size += ::protobuf::rt::string_size(1, &self.id);
  329. }
  330. if !self.belong_to_id.is_empty() {
  331. my_size += ::protobuf::rt::string_size(2, &self.belong_to_id);
  332. }
  333. if !self.name.is_empty() {
  334. my_size += ::protobuf::rt::string_size(3, &self.name);
  335. }
  336. if !self.desc.is_empty() {
  337. my_size += ::protobuf::rt::string_size(4, &self.desc);
  338. }
  339. if self.data_type != ViewDataType::TextBlock {
  340. my_size += ::protobuf::rt::enum_size(5, self.data_type);
  341. }
  342. if self.version != 0 {
  343. my_size += ::protobuf::rt::value_size(6, self.version, ::protobuf::wire_format::WireTypeVarint);
  344. }
  345. if let Some(ref v) = self.belongings.as_ref() {
  346. let len = v.compute_size();
  347. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  348. }
  349. if self.modified_time != 0 {
  350. my_size += ::protobuf::rt::value_size(8, self.modified_time, ::protobuf::wire_format::WireTypeVarint);
  351. }
  352. if self.create_time != 0 {
  353. my_size += ::protobuf::rt::value_size(9, self.create_time, ::protobuf::wire_format::WireTypeVarint);
  354. }
  355. if !self.ext_data.is_empty() {
  356. my_size += ::protobuf::rt::string_size(10, &self.ext_data);
  357. }
  358. if !self.thumbnail.is_empty() {
  359. my_size += ::protobuf::rt::string_size(11, &self.thumbnail);
  360. }
  361. if self.plugin_type != 0 {
  362. my_size += ::protobuf::rt::value_size(12, self.plugin_type, ::protobuf::wire_format::WireTypeVarint);
  363. }
  364. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  365. self.cached_size.set(my_size);
  366. my_size
  367. }
  368. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  369. if !self.id.is_empty() {
  370. os.write_string(1, &self.id)?;
  371. }
  372. if !self.belong_to_id.is_empty() {
  373. os.write_string(2, &self.belong_to_id)?;
  374. }
  375. if !self.name.is_empty() {
  376. os.write_string(3, &self.name)?;
  377. }
  378. if !self.desc.is_empty() {
  379. os.write_string(4, &self.desc)?;
  380. }
  381. if self.data_type != ViewDataType::TextBlock {
  382. os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.data_type))?;
  383. }
  384. if self.version != 0 {
  385. os.write_int64(6, self.version)?;
  386. }
  387. if let Some(ref v) = self.belongings.as_ref() {
  388. os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  389. os.write_raw_varint32(v.get_cached_size())?;
  390. v.write_to_with_cached_sizes(os)?;
  391. }
  392. if self.modified_time != 0 {
  393. os.write_int64(8, self.modified_time)?;
  394. }
  395. if self.create_time != 0 {
  396. os.write_int64(9, self.create_time)?;
  397. }
  398. if !self.ext_data.is_empty() {
  399. os.write_string(10, &self.ext_data)?;
  400. }
  401. if !self.thumbnail.is_empty() {
  402. os.write_string(11, &self.thumbnail)?;
  403. }
  404. if self.plugin_type != 0 {
  405. os.write_int32(12, self.plugin_type)?;
  406. }
  407. os.write_unknown_fields(self.get_unknown_fields())?;
  408. ::std::result::Result::Ok(())
  409. }
  410. fn get_cached_size(&self) -> u32 {
  411. self.cached_size.get()
  412. }
  413. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  414. &self.unknown_fields
  415. }
  416. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  417. &mut self.unknown_fields
  418. }
  419. fn as_any(&self) -> &dyn (::std::any::Any) {
  420. self as &dyn (::std::any::Any)
  421. }
  422. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  423. self as &mut dyn (::std::any::Any)
  424. }
  425. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  426. self
  427. }
  428. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  429. Self::descriptor_static()
  430. }
  431. fn new() -> View {
  432. View::new()
  433. }
  434. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  435. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  436. descriptor.get(|| {
  437. let mut fields = ::std::vec::Vec::new();
  438. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  439. "id",
  440. |m: &View| { &m.id },
  441. |m: &mut View| { &mut m.id },
  442. ));
  443. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  444. "belong_to_id",
  445. |m: &View| { &m.belong_to_id },
  446. |m: &mut View| { &mut m.belong_to_id },
  447. ));
  448. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  449. "name",
  450. |m: &View| { &m.name },
  451. |m: &mut View| { &mut m.name },
  452. ));
  453. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  454. "desc",
  455. |m: &View| { &m.desc },
  456. |m: &mut View| { &mut m.desc },
  457. ));
  458. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ViewDataType>>(
  459. "data_type",
  460. |m: &View| { &m.data_type },
  461. |m: &mut View| { &mut m.data_type },
  462. ));
  463. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
  464. "version",
  465. |m: &View| { &m.version },
  466. |m: &mut View| { &mut m.version },
  467. ));
  468. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<RepeatedView>>(
  469. "belongings",
  470. |m: &View| { &m.belongings },
  471. |m: &mut View| { &mut m.belongings },
  472. ));
  473. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
  474. "modified_time",
  475. |m: &View| { &m.modified_time },
  476. |m: &mut View| { &mut m.modified_time },
  477. ));
  478. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
  479. "create_time",
  480. |m: &View| { &m.create_time },
  481. |m: &mut View| { &mut m.create_time },
  482. ));
  483. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  484. "ext_data",
  485. |m: &View| { &m.ext_data },
  486. |m: &mut View| { &mut m.ext_data },
  487. ));
  488. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  489. "thumbnail",
  490. |m: &View| { &m.thumbnail },
  491. |m: &mut View| { &mut m.thumbnail },
  492. ));
  493. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  494. "plugin_type",
  495. |m: &View| { &m.plugin_type },
  496. |m: &mut View| { &mut m.plugin_type },
  497. ));
  498. ::protobuf::reflect::MessageDescriptor::new_pb_name::<View>(
  499. "View",
  500. fields,
  501. file_descriptor_proto()
  502. )
  503. })
  504. }
  505. fn default_instance() -> &'static View {
  506. static instance: ::protobuf::rt::LazyV2<View> = ::protobuf::rt::LazyV2::INIT;
  507. instance.get(View::new)
  508. }
  509. }
  510. impl ::protobuf::Clear for View {
  511. fn clear(&mut self) {
  512. self.id.clear();
  513. self.belong_to_id.clear();
  514. self.name.clear();
  515. self.desc.clear();
  516. self.data_type = ViewDataType::TextBlock;
  517. self.version = 0;
  518. self.belongings.clear();
  519. self.modified_time = 0;
  520. self.create_time = 0;
  521. self.ext_data.clear();
  522. self.thumbnail.clear();
  523. self.plugin_type = 0;
  524. self.unknown_fields.clear();
  525. }
  526. }
  527. impl ::std::fmt::Debug for View {
  528. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  529. ::protobuf::text_format::fmt(self, f)
  530. }
  531. }
  532. impl ::protobuf::reflect::ProtobufValue for View {
  533. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  534. ::protobuf::reflect::ReflectValueRef::Message(self)
  535. }
  536. }
  537. #[derive(PartialEq,Clone,Default)]
  538. pub struct RepeatedView {
  539. // message fields
  540. pub items: ::protobuf::RepeatedField<View>,
  541. // special fields
  542. pub unknown_fields: ::protobuf::UnknownFields,
  543. pub cached_size: ::protobuf::CachedSize,
  544. }
  545. impl<'a> ::std::default::Default for &'a RepeatedView {
  546. fn default() -> &'a RepeatedView {
  547. <RepeatedView as ::protobuf::Message>::default_instance()
  548. }
  549. }
  550. impl RepeatedView {
  551. pub fn new() -> RepeatedView {
  552. ::std::default::Default::default()
  553. }
  554. // repeated .View items = 1;
  555. pub fn get_items(&self) -> &[View] {
  556. &self.items
  557. }
  558. pub fn clear_items(&mut self) {
  559. self.items.clear();
  560. }
  561. // Param is passed by value, moved
  562. pub fn set_items(&mut self, v: ::protobuf::RepeatedField<View>) {
  563. self.items = v;
  564. }
  565. // Mutable pointer to the field.
  566. pub fn mut_items(&mut self) -> &mut ::protobuf::RepeatedField<View> {
  567. &mut self.items
  568. }
  569. // Take field
  570. pub fn take_items(&mut self) -> ::protobuf::RepeatedField<View> {
  571. ::std::mem::replace(&mut self.items, ::protobuf::RepeatedField::new())
  572. }
  573. }
  574. impl ::protobuf::Message for RepeatedView {
  575. fn is_initialized(&self) -> bool {
  576. for v in &self.items {
  577. if !v.is_initialized() {
  578. return false;
  579. }
  580. };
  581. true
  582. }
  583. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  584. while !is.eof()? {
  585. let (field_number, wire_type) = is.read_tag_unpack()?;
  586. match field_number {
  587. 1 => {
  588. ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.items)?;
  589. },
  590. _ => {
  591. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  592. },
  593. };
  594. }
  595. ::std::result::Result::Ok(())
  596. }
  597. // Compute sizes of nested messages
  598. #[allow(unused_variables)]
  599. fn compute_size(&self) -> u32 {
  600. let mut my_size = 0;
  601. for value in &self.items {
  602. let len = value.compute_size();
  603. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  604. };
  605. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  606. self.cached_size.set(my_size);
  607. my_size
  608. }
  609. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  610. for v in &self.items {
  611. os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  612. os.write_raw_varint32(v.get_cached_size())?;
  613. v.write_to_with_cached_sizes(os)?;
  614. };
  615. os.write_unknown_fields(self.get_unknown_fields())?;
  616. ::std::result::Result::Ok(())
  617. }
  618. fn get_cached_size(&self) -> u32 {
  619. self.cached_size.get()
  620. }
  621. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  622. &self.unknown_fields
  623. }
  624. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  625. &mut self.unknown_fields
  626. }
  627. fn as_any(&self) -> &dyn (::std::any::Any) {
  628. self as &dyn (::std::any::Any)
  629. }
  630. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  631. self as &mut dyn (::std::any::Any)
  632. }
  633. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  634. self
  635. }
  636. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  637. Self::descriptor_static()
  638. }
  639. fn new() -> RepeatedView {
  640. RepeatedView::new()
  641. }
  642. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  643. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  644. descriptor.get(|| {
  645. let mut fields = ::std::vec::Vec::new();
  646. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<View>>(
  647. "items",
  648. |m: &RepeatedView| { &m.items },
  649. |m: &mut RepeatedView| { &mut m.items },
  650. ));
  651. ::protobuf::reflect::MessageDescriptor::new_pb_name::<RepeatedView>(
  652. "RepeatedView",
  653. fields,
  654. file_descriptor_proto()
  655. )
  656. })
  657. }
  658. fn default_instance() -> &'static RepeatedView {
  659. static instance: ::protobuf::rt::LazyV2<RepeatedView> = ::protobuf::rt::LazyV2::INIT;
  660. instance.get(RepeatedView::new)
  661. }
  662. }
  663. impl ::protobuf::Clear for RepeatedView {
  664. fn clear(&mut self) {
  665. self.items.clear();
  666. self.unknown_fields.clear();
  667. }
  668. }
  669. impl ::std::fmt::Debug for RepeatedView {
  670. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  671. ::protobuf::text_format::fmt(self, f)
  672. }
  673. }
  674. impl ::protobuf::reflect::ProtobufValue for RepeatedView {
  675. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  676. ::protobuf::reflect::ReflectValueRef::Message(self)
  677. }
  678. }
  679. #[derive(PartialEq,Clone,Default)]
  680. pub struct CreateViewPayload {
  681. // message fields
  682. pub belong_to_id: ::std::string::String,
  683. pub name: ::std::string::String,
  684. pub desc: ::std::string::String,
  685. pub data_type: ViewDataType,
  686. pub plugin_type: i32,
  687. pub data: ::std::vec::Vec<u8>,
  688. // message oneof groups
  689. pub one_of_thumbnail: ::std::option::Option<CreateViewPayload_oneof_one_of_thumbnail>,
  690. // special fields
  691. pub unknown_fields: ::protobuf::UnknownFields,
  692. pub cached_size: ::protobuf::CachedSize,
  693. }
  694. impl<'a> ::std::default::Default for &'a CreateViewPayload {
  695. fn default() -> &'a CreateViewPayload {
  696. <CreateViewPayload as ::protobuf::Message>::default_instance()
  697. }
  698. }
  699. #[derive(Clone,PartialEq,Debug)]
  700. pub enum CreateViewPayload_oneof_one_of_thumbnail {
  701. thumbnail(::std::string::String),
  702. }
  703. impl CreateViewPayload {
  704. pub fn new() -> CreateViewPayload {
  705. ::std::default::Default::default()
  706. }
  707. // string belong_to_id = 1;
  708. pub fn get_belong_to_id(&self) -> &str {
  709. &self.belong_to_id
  710. }
  711. pub fn clear_belong_to_id(&mut self) {
  712. self.belong_to_id.clear();
  713. }
  714. // Param is passed by value, moved
  715. pub fn set_belong_to_id(&mut self, v: ::std::string::String) {
  716. self.belong_to_id = v;
  717. }
  718. // Mutable pointer to the field.
  719. // If field is not initialized, it is initialized with default value first.
  720. pub fn mut_belong_to_id(&mut self) -> &mut ::std::string::String {
  721. &mut self.belong_to_id
  722. }
  723. // Take field
  724. pub fn take_belong_to_id(&mut self) -> ::std::string::String {
  725. ::std::mem::replace(&mut self.belong_to_id, ::std::string::String::new())
  726. }
  727. // string name = 2;
  728. pub fn get_name(&self) -> &str {
  729. &self.name
  730. }
  731. pub fn clear_name(&mut self) {
  732. self.name.clear();
  733. }
  734. // Param is passed by value, moved
  735. pub fn set_name(&mut self, v: ::std::string::String) {
  736. self.name = v;
  737. }
  738. // Mutable pointer to the field.
  739. // If field is not initialized, it is initialized with default value first.
  740. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  741. &mut self.name
  742. }
  743. // Take field
  744. pub fn take_name(&mut self) -> ::std::string::String {
  745. ::std::mem::replace(&mut self.name, ::std::string::String::new())
  746. }
  747. // string desc = 3;
  748. pub fn get_desc(&self) -> &str {
  749. &self.desc
  750. }
  751. pub fn clear_desc(&mut self) {
  752. self.desc.clear();
  753. }
  754. // Param is passed by value, moved
  755. pub fn set_desc(&mut self, v: ::std::string::String) {
  756. self.desc = v;
  757. }
  758. // Mutable pointer to the field.
  759. // If field is not initialized, it is initialized with default value first.
  760. pub fn mut_desc(&mut self) -> &mut ::std::string::String {
  761. &mut self.desc
  762. }
  763. // Take field
  764. pub fn take_desc(&mut self) -> ::std::string::String {
  765. ::std::mem::replace(&mut self.desc, ::std::string::String::new())
  766. }
  767. // string thumbnail = 4;
  768. pub fn get_thumbnail(&self) -> &str {
  769. match self.one_of_thumbnail {
  770. ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v)) => v,
  771. _ => "",
  772. }
  773. }
  774. pub fn clear_thumbnail(&mut self) {
  775. self.one_of_thumbnail = ::std::option::Option::None;
  776. }
  777. pub fn has_thumbnail(&self) -> bool {
  778. match self.one_of_thumbnail {
  779. ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(..)) => true,
  780. _ => false,
  781. }
  782. }
  783. // Param is passed by value, moved
  784. pub fn set_thumbnail(&mut self, v: ::std::string::String) {
  785. self.one_of_thumbnail = ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(v))
  786. }
  787. // Mutable pointer to the field.
  788. pub fn mut_thumbnail(&mut self) -> &mut ::std::string::String {
  789. if let ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(_)) = self.one_of_thumbnail {
  790. } else {
  791. self.one_of_thumbnail = ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(::std::string::String::new()));
  792. }
  793. match self.one_of_thumbnail {
  794. ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref mut v)) => v,
  795. _ => panic!(),
  796. }
  797. }
  798. // Take field
  799. pub fn take_thumbnail(&mut self) -> ::std::string::String {
  800. if self.has_thumbnail() {
  801. match self.one_of_thumbnail.take() {
  802. ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(v)) => v,
  803. _ => panic!(),
  804. }
  805. } else {
  806. ::std::string::String::new()
  807. }
  808. }
  809. // .ViewDataType data_type = 5;
  810. pub fn get_data_type(&self) -> ViewDataType {
  811. self.data_type
  812. }
  813. pub fn clear_data_type(&mut self) {
  814. self.data_type = ViewDataType::TextBlock;
  815. }
  816. // Param is passed by value, moved
  817. pub fn set_data_type(&mut self, v: ViewDataType) {
  818. self.data_type = v;
  819. }
  820. // int32 plugin_type = 6;
  821. pub fn get_plugin_type(&self) -> i32 {
  822. self.plugin_type
  823. }
  824. pub fn clear_plugin_type(&mut self) {
  825. self.plugin_type = 0;
  826. }
  827. // Param is passed by value, moved
  828. pub fn set_plugin_type(&mut self, v: i32) {
  829. self.plugin_type = v;
  830. }
  831. // bytes data = 7;
  832. pub fn get_data(&self) -> &[u8] {
  833. &self.data
  834. }
  835. pub fn clear_data(&mut self) {
  836. self.data.clear();
  837. }
  838. // Param is passed by value, moved
  839. pub fn set_data(&mut self, v: ::std::vec::Vec<u8>) {
  840. self.data = v;
  841. }
  842. // Mutable pointer to the field.
  843. // If field is not initialized, it is initialized with default value first.
  844. pub fn mut_data(&mut self) -> &mut ::std::vec::Vec<u8> {
  845. &mut self.data
  846. }
  847. // Take field
  848. pub fn take_data(&mut self) -> ::std::vec::Vec<u8> {
  849. ::std::mem::replace(&mut self.data, ::std::vec::Vec::new())
  850. }
  851. }
  852. impl ::protobuf::Message for CreateViewPayload {
  853. fn is_initialized(&self) -> bool {
  854. true
  855. }
  856. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  857. while !is.eof()? {
  858. let (field_number, wire_type) = is.read_tag_unpack()?;
  859. match field_number {
  860. 1 => {
  861. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.belong_to_id)?;
  862. },
  863. 2 => {
  864. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
  865. },
  866. 3 => {
  867. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.desc)?;
  868. },
  869. 4 => {
  870. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  871. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  872. }
  873. self.one_of_thumbnail = ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(is.read_string()?));
  874. },
  875. 5 => {
  876. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.data_type, 5, &mut self.unknown_fields)?
  877. },
  878. 6 => {
  879. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  880. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  881. }
  882. let tmp = is.read_int32()?;
  883. self.plugin_type = tmp;
  884. },
  885. 7 => {
  886. ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.data)?;
  887. },
  888. _ => {
  889. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  890. },
  891. };
  892. }
  893. ::std::result::Result::Ok(())
  894. }
  895. // Compute sizes of nested messages
  896. #[allow(unused_variables)]
  897. fn compute_size(&self) -> u32 {
  898. let mut my_size = 0;
  899. if !self.belong_to_id.is_empty() {
  900. my_size += ::protobuf::rt::string_size(1, &self.belong_to_id);
  901. }
  902. if !self.name.is_empty() {
  903. my_size += ::protobuf::rt::string_size(2, &self.name);
  904. }
  905. if !self.desc.is_empty() {
  906. my_size += ::protobuf::rt::string_size(3, &self.desc);
  907. }
  908. if self.data_type != ViewDataType::TextBlock {
  909. my_size += ::protobuf::rt::enum_size(5, self.data_type);
  910. }
  911. if self.plugin_type != 0 {
  912. my_size += ::protobuf::rt::value_size(6, self.plugin_type, ::protobuf::wire_format::WireTypeVarint);
  913. }
  914. if !self.data.is_empty() {
  915. my_size += ::protobuf::rt::bytes_size(7, &self.data);
  916. }
  917. if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
  918. match v {
  919. &CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
  920. my_size += ::protobuf::rt::string_size(4, &v);
  921. },
  922. };
  923. }
  924. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  925. self.cached_size.set(my_size);
  926. my_size
  927. }
  928. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  929. if !self.belong_to_id.is_empty() {
  930. os.write_string(1, &self.belong_to_id)?;
  931. }
  932. if !self.name.is_empty() {
  933. os.write_string(2, &self.name)?;
  934. }
  935. if !self.desc.is_empty() {
  936. os.write_string(3, &self.desc)?;
  937. }
  938. if self.data_type != ViewDataType::TextBlock {
  939. os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.data_type))?;
  940. }
  941. if self.plugin_type != 0 {
  942. os.write_int32(6, self.plugin_type)?;
  943. }
  944. if !self.data.is_empty() {
  945. os.write_bytes(7, &self.data)?;
  946. }
  947. if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
  948. match v {
  949. &CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
  950. os.write_string(4, v)?;
  951. },
  952. };
  953. }
  954. os.write_unknown_fields(self.get_unknown_fields())?;
  955. ::std::result::Result::Ok(())
  956. }
  957. fn get_cached_size(&self) -> u32 {
  958. self.cached_size.get()
  959. }
  960. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  961. &self.unknown_fields
  962. }
  963. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  964. &mut self.unknown_fields
  965. }
  966. fn as_any(&self) -> &dyn (::std::any::Any) {
  967. self as &dyn (::std::any::Any)
  968. }
  969. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  970. self as &mut dyn (::std::any::Any)
  971. }
  972. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  973. self
  974. }
  975. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  976. Self::descriptor_static()
  977. }
  978. fn new() -> CreateViewPayload {
  979. CreateViewPayload::new()
  980. }
  981. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  982. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  983. descriptor.get(|| {
  984. let mut fields = ::std::vec::Vec::new();
  985. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  986. "belong_to_id",
  987. |m: &CreateViewPayload| { &m.belong_to_id },
  988. |m: &mut CreateViewPayload| { &mut m.belong_to_id },
  989. ));
  990. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  991. "name",
  992. |m: &CreateViewPayload| { &m.name },
  993. |m: &mut CreateViewPayload| { &mut m.name },
  994. ));
  995. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  996. "desc",
  997. |m: &CreateViewPayload| { &m.desc },
  998. |m: &mut CreateViewPayload| { &mut m.desc },
  999. ));
  1000. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  1001. "thumbnail",
  1002. CreateViewPayload::has_thumbnail,
  1003. CreateViewPayload::get_thumbnail,
  1004. ));
  1005. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ViewDataType>>(
  1006. "data_type",
  1007. |m: &CreateViewPayload| { &m.data_type },
  1008. |m: &mut CreateViewPayload| { &mut m.data_type },
  1009. ));
  1010. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  1011. "plugin_type",
  1012. |m: &CreateViewPayload| { &m.plugin_type },
  1013. |m: &mut CreateViewPayload| { &mut m.plugin_type },
  1014. ));
  1015. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  1016. "data",
  1017. |m: &CreateViewPayload| { &m.data },
  1018. |m: &mut CreateViewPayload| { &mut m.data },
  1019. ));
  1020. ::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewPayload>(
  1021. "CreateViewPayload",
  1022. fields,
  1023. file_descriptor_proto()
  1024. )
  1025. })
  1026. }
  1027. fn default_instance() -> &'static CreateViewPayload {
  1028. static instance: ::protobuf::rt::LazyV2<CreateViewPayload> = ::protobuf::rt::LazyV2::INIT;
  1029. instance.get(CreateViewPayload::new)
  1030. }
  1031. }
  1032. impl ::protobuf::Clear for CreateViewPayload {
  1033. fn clear(&mut self) {
  1034. self.belong_to_id.clear();
  1035. self.name.clear();
  1036. self.desc.clear();
  1037. self.one_of_thumbnail = ::std::option::Option::None;
  1038. self.data_type = ViewDataType::TextBlock;
  1039. self.plugin_type = 0;
  1040. self.data.clear();
  1041. self.unknown_fields.clear();
  1042. }
  1043. }
  1044. impl ::std::fmt::Debug for CreateViewPayload {
  1045. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1046. ::protobuf::text_format::fmt(self, f)
  1047. }
  1048. }
  1049. impl ::protobuf::reflect::ProtobufValue for CreateViewPayload {
  1050. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  1051. ::protobuf::reflect::ReflectValueRef::Message(self)
  1052. }
  1053. }
  1054. #[derive(PartialEq,Clone,Default)]
  1055. pub struct CreateViewParams {
  1056. // message fields
  1057. pub belong_to_id: ::std::string::String,
  1058. pub name: ::std::string::String,
  1059. pub desc: ::std::string::String,
  1060. pub thumbnail: ::std::string::String,
  1061. pub data_type: ViewDataType,
  1062. pub view_id: ::std::string::String,
  1063. pub data: ::std::vec::Vec<u8>,
  1064. pub plugin_type: i32,
  1065. // special fields
  1066. pub unknown_fields: ::protobuf::UnknownFields,
  1067. pub cached_size: ::protobuf::CachedSize,
  1068. }
  1069. impl<'a> ::std::default::Default for &'a CreateViewParams {
  1070. fn default() -> &'a CreateViewParams {
  1071. <CreateViewParams as ::protobuf::Message>::default_instance()
  1072. }
  1073. }
  1074. impl CreateViewParams {
  1075. pub fn new() -> CreateViewParams {
  1076. ::std::default::Default::default()
  1077. }
  1078. // string belong_to_id = 1;
  1079. pub fn get_belong_to_id(&self) -> &str {
  1080. &self.belong_to_id
  1081. }
  1082. pub fn clear_belong_to_id(&mut self) {
  1083. self.belong_to_id.clear();
  1084. }
  1085. // Param is passed by value, moved
  1086. pub fn set_belong_to_id(&mut self, v: ::std::string::String) {
  1087. self.belong_to_id = v;
  1088. }
  1089. // Mutable pointer to the field.
  1090. // If field is not initialized, it is initialized with default value first.
  1091. pub fn mut_belong_to_id(&mut self) -> &mut ::std::string::String {
  1092. &mut self.belong_to_id
  1093. }
  1094. // Take field
  1095. pub fn take_belong_to_id(&mut self) -> ::std::string::String {
  1096. ::std::mem::replace(&mut self.belong_to_id, ::std::string::String::new())
  1097. }
  1098. // string name = 2;
  1099. pub fn get_name(&self) -> &str {
  1100. &self.name
  1101. }
  1102. pub fn clear_name(&mut self) {
  1103. self.name.clear();
  1104. }
  1105. // Param is passed by value, moved
  1106. pub fn set_name(&mut self, v: ::std::string::String) {
  1107. self.name = v;
  1108. }
  1109. // Mutable pointer to the field.
  1110. // If field is not initialized, it is initialized with default value first.
  1111. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  1112. &mut self.name
  1113. }
  1114. // Take field
  1115. pub fn take_name(&mut self) -> ::std::string::String {
  1116. ::std::mem::replace(&mut self.name, ::std::string::String::new())
  1117. }
  1118. // string desc = 3;
  1119. pub fn get_desc(&self) -> &str {
  1120. &self.desc
  1121. }
  1122. pub fn clear_desc(&mut self) {
  1123. self.desc.clear();
  1124. }
  1125. // Param is passed by value, moved
  1126. pub fn set_desc(&mut self, v: ::std::string::String) {
  1127. self.desc = v;
  1128. }
  1129. // Mutable pointer to the field.
  1130. // If field is not initialized, it is initialized with default value first.
  1131. pub fn mut_desc(&mut self) -> &mut ::std::string::String {
  1132. &mut self.desc
  1133. }
  1134. // Take field
  1135. pub fn take_desc(&mut self) -> ::std::string::String {
  1136. ::std::mem::replace(&mut self.desc, ::std::string::String::new())
  1137. }
  1138. // string thumbnail = 4;
  1139. pub fn get_thumbnail(&self) -> &str {
  1140. &self.thumbnail
  1141. }
  1142. pub fn clear_thumbnail(&mut self) {
  1143. self.thumbnail.clear();
  1144. }
  1145. // Param is passed by value, moved
  1146. pub fn set_thumbnail(&mut self, v: ::std::string::String) {
  1147. self.thumbnail = v;
  1148. }
  1149. // Mutable pointer to the field.
  1150. // If field is not initialized, it is initialized with default value first.
  1151. pub fn mut_thumbnail(&mut self) -> &mut ::std::string::String {
  1152. &mut self.thumbnail
  1153. }
  1154. // Take field
  1155. pub fn take_thumbnail(&mut self) -> ::std::string::String {
  1156. ::std::mem::replace(&mut self.thumbnail, ::std::string::String::new())
  1157. }
  1158. // .ViewDataType data_type = 5;
  1159. pub fn get_data_type(&self) -> ViewDataType {
  1160. self.data_type
  1161. }
  1162. pub fn clear_data_type(&mut self) {
  1163. self.data_type = ViewDataType::TextBlock;
  1164. }
  1165. // Param is passed by value, moved
  1166. pub fn set_data_type(&mut self, v: ViewDataType) {
  1167. self.data_type = v;
  1168. }
  1169. // string view_id = 6;
  1170. pub fn get_view_id(&self) -> &str {
  1171. &self.view_id
  1172. }
  1173. pub fn clear_view_id(&mut self) {
  1174. self.view_id.clear();
  1175. }
  1176. // Param is passed by value, moved
  1177. pub fn set_view_id(&mut self, v: ::std::string::String) {
  1178. self.view_id = v;
  1179. }
  1180. // Mutable pointer to the field.
  1181. // If field is not initialized, it is initialized with default value first.
  1182. pub fn mut_view_id(&mut self) -> &mut ::std::string::String {
  1183. &mut self.view_id
  1184. }
  1185. // Take field
  1186. pub fn take_view_id(&mut self) -> ::std::string::String {
  1187. ::std::mem::replace(&mut self.view_id, ::std::string::String::new())
  1188. }
  1189. // bytes data = 7;
  1190. pub fn get_data(&self) -> &[u8] {
  1191. &self.data
  1192. }
  1193. pub fn clear_data(&mut self) {
  1194. self.data.clear();
  1195. }
  1196. // Param is passed by value, moved
  1197. pub fn set_data(&mut self, v: ::std::vec::Vec<u8>) {
  1198. self.data = v;
  1199. }
  1200. // Mutable pointer to the field.
  1201. // If field is not initialized, it is initialized with default value first.
  1202. pub fn mut_data(&mut self) -> &mut ::std::vec::Vec<u8> {
  1203. &mut self.data
  1204. }
  1205. // Take field
  1206. pub fn take_data(&mut self) -> ::std::vec::Vec<u8> {
  1207. ::std::mem::replace(&mut self.data, ::std::vec::Vec::new())
  1208. }
  1209. // int32 plugin_type = 8;
  1210. pub fn get_plugin_type(&self) -> i32 {
  1211. self.plugin_type
  1212. }
  1213. pub fn clear_plugin_type(&mut self) {
  1214. self.plugin_type = 0;
  1215. }
  1216. // Param is passed by value, moved
  1217. pub fn set_plugin_type(&mut self, v: i32) {
  1218. self.plugin_type = v;
  1219. }
  1220. }
  1221. impl ::protobuf::Message for CreateViewParams {
  1222. fn is_initialized(&self) -> bool {
  1223. true
  1224. }
  1225. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1226. while !is.eof()? {
  1227. let (field_number, wire_type) = is.read_tag_unpack()?;
  1228. match field_number {
  1229. 1 => {
  1230. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.belong_to_id)?;
  1231. },
  1232. 2 => {
  1233. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
  1234. },
  1235. 3 => {
  1236. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.desc)?;
  1237. },
  1238. 4 => {
  1239. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.thumbnail)?;
  1240. },
  1241. 5 => {
  1242. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.data_type, 5, &mut self.unknown_fields)?
  1243. },
  1244. 6 => {
  1245. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_id)?;
  1246. },
  1247. 7 => {
  1248. ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.data)?;
  1249. },
  1250. 8 => {
  1251. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1252. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1253. }
  1254. let tmp = is.read_int32()?;
  1255. self.plugin_type = tmp;
  1256. },
  1257. _ => {
  1258. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1259. },
  1260. };
  1261. }
  1262. ::std::result::Result::Ok(())
  1263. }
  1264. // Compute sizes of nested messages
  1265. #[allow(unused_variables)]
  1266. fn compute_size(&self) -> u32 {
  1267. let mut my_size = 0;
  1268. if !self.belong_to_id.is_empty() {
  1269. my_size += ::protobuf::rt::string_size(1, &self.belong_to_id);
  1270. }
  1271. if !self.name.is_empty() {
  1272. my_size += ::protobuf::rt::string_size(2, &self.name);
  1273. }
  1274. if !self.desc.is_empty() {
  1275. my_size += ::protobuf::rt::string_size(3, &self.desc);
  1276. }
  1277. if !self.thumbnail.is_empty() {
  1278. my_size += ::protobuf::rt::string_size(4, &self.thumbnail);
  1279. }
  1280. if self.data_type != ViewDataType::TextBlock {
  1281. my_size += ::protobuf::rt::enum_size(5, self.data_type);
  1282. }
  1283. if !self.view_id.is_empty() {
  1284. my_size += ::protobuf::rt::string_size(6, &self.view_id);
  1285. }
  1286. if !self.data.is_empty() {
  1287. my_size += ::protobuf::rt::bytes_size(7, &self.data);
  1288. }
  1289. if self.plugin_type != 0 {
  1290. my_size += ::protobuf::rt::value_size(8, self.plugin_type, ::protobuf::wire_format::WireTypeVarint);
  1291. }
  1292. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1293. self.cached_size.set(my_size);
  1294. my_size
  1295. }
  1296. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1297. if !self.belong_to_id.is_empty() {
  1298. os.write_string(1, &self.belong_to_id)?;
  1299. }
  1300. if !self.name.is_empty() {
  1301. os.write_string(2, &self.name)?;
  1302. }
  1303. if !self.desc.is_empty() {
  1304. os.write_string(3, &self.desc)?;
  1305. }
  1306. if !self.thumbnail.is_empty() {
  1307. os.write_string(4, &self.thumbnail)?;
  1308. }
  1309. if self.data_type != ViewDataType::TextBlock {
  1310. os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.data_type))?;
  1311. }
  1312. if !self.view_id.is_empty() {
  1313. os.write_string(6, &self.view_id)?;
  1314. }
  1315. if !self.data.is_empty() {
  1316. os.write_bytes(7, &self.data)?;
  1317. }
  1318. if self.plugin_type != 0 {
  1319. os.write_int32(8, self.plugin_type)?;
  1320. }
  1321. os.write_unknown_fields(self.get_unknown_fields())?;
  1322. ::std::result::Result::Ok(())
  1323. }
  1324. fn get_cached_size(&self) -> u32 {
  1325. self.cached_size.get()
  1326. }
  1327. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1328. &self.unknown_fields
  1329. }
  1330. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1331. &mut self.unknown_fields
  1332. }
  1333. fn as_any(&self) -> &dyn (::std::any::Any) {
  1334. self as &dyn (::std::any::Any)
  1335. }
  1336. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1337. self as &mut dyn (::std::any::Any)
  1338. }
  1339. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1340. self
  1341. }
  1342. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1343. Self::descriptor_static()
  1344. }
  1345. fn new() -> CreateViewParams {
  1346. CreateViewParams::new()
  1347. }
  1348. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1349. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  1350. descriptor.get(|| {
  1351. let mut fields = ::std::vec::Vec::new();
  1352. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1353. "belong_to_id",
  1354. |m: &CreateViewParams| { &m.belong_to_id },
  1355. |m: &mut CreateViewParams| { &mut m.belong_to_id },
  1356. ));
  1357. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1358. "name",
  1359. |m: &CreateViewParams| { &m.name },
  1360. |m: &mut CreateViewParams| { &mut m.name },
  1361. ));
  1362. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1363. "desc",
  1364. |m: &CreateViewParams| { &m.desc },
  1365. |m: &mut CreateViewParams| { &mut m.desc },
  1366. ));
  1367. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1368. "thumbnail",
  1369. |m: &CreateViewParams| { &m.thumbnail },
  1370. |m: &mut CreateViewParams| { &mut m.thumbnail },
  1371. ));
  1372. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ViewDataType>>(
  1373. "data_type",
  1374. |m: &CreateViewParams| { &m.data_type },
  1375. |m: &mut CreateViewParams| { &mut m.data_type },
  1376. ));
  1377. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1378. "view_id",
  1379. |m: &CreateViewParams| { &m.view_id },
  1380. |m: &mut CreateViewParams| { &mut m.view_id },
  1381. ));
  1382. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  1383. "data",
  1384. |m: &CreateViewParams| { &m.data },
  1385. |m: &mut CreateViewParams| { &mut m.data },
  1386. ));
  1387. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  1388. "plugin_type",
  1389. |m: &CreateViewParams| { &m.plugin_type },
  1390. |m: &mut CreateViewParams| { &mut m.plugin_type },
  1391. ));
  1392. ::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewParams>(
  1393. "CreateViewParams",
  1394. fields,
  1395. file_descriptor_proto()
  1396. )
  1397. })
  1398. }
  1399. fn default_instance() -> &'static CreateViewParams {
  1400. static instance: ::protobuf::rt::LazyV2<CreateViewParams> = ::protobuf::rt::LazyV2::INIT;
  1401. instance.get(CreateViewParams::new)
  1402. }
  1403. }
  1404. impl ::protobuf::Clear for CreateViewParams {
  1405. fn clear(&mut self) {
  1406. self.belong_to_id.clear();
  1407. self.name.clear();
  1408. self.desc.clear();
  1409. self.thumbnail.clear();
  1410. self.data_type = ViewDataType::TextBlock;
  1411. self.view_id.clear();
  1412. self.data.clear();
  1413. self.plugin_type = 0;
  1414. self.unknown_fields.clear();
  1415. }
  1416. }
  1417. impl ::std::fmt::Debug for CreateViewParams {
  1418. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1419. ::protobuf::text_format::fmt(self, f)
  1420. }
  1421. }
  1422. impl ::protobuf::reflect::ProtobufValue for CreateViewParams {
  1423. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  1424. ::protobuf::reflect::ReflectValueRef::Message(self)
  1425. }
  1426. }
  1427. #[derive(PartialEq,Clone,Default)]
  1428. pub struct ViewId {
  1429. // message fields
  1430. pub value: ::std::string::String,
  1431. // special fields
  1432. pub unknown_fields: ::protobuf::UnknownFields,
  1433. pub cached_size: ::protobuf::CachedSize,
  1434. }
  1435. impl<'a> ::std::default::Default for &'a ViewId {
  1436. fn default() -> &'a ViewId {
  1437. <ViewId as ::protobuf::Message>::default_instance()
  1438. }
  1439. }
  1440. impl ViewId {
  1441. pub fn new() -> ViewId {
  1442. ::std::default::Default::default()
  1443. }
  1444. // string value = 1;
  1445. pub fn get_value(&self) -> &str {
  1446. &self.value
  1447. }
  1448. pub fn clear_value(&mut self) {
  1449. self.value.clear();
  1450. }
  1451. // Param is passed by value, moved
  1452. pub fn set_value(&mut self, v: ::std::string::String) {
  1453. self.value = v;
  1454. }
  1455. // Mutable pointer to the field.
  1456. // If field is not initialized, it is initialized with default value first.
  1457. pub fn mut_value(&mut self) -> &mut ::std::string::String {
  1458. &mut self.value
  1459. }
  1460. // Take field
  1461. pub fn take_value(&mut self) -> ::std::string::String {
  1462. ::std::mem::replace(&mut self.value, ::std::string::String::new())
  1463. }
  1464. }
  1465. impl ::protobuf::Message for ViewId {
  1466. fn is_initialized(&self) -> bool {
  1467. true
  1468. }
  1469. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1470. while !is.eof()? {
  1471. let (field_number, wire_type) = is.read_tag_unpack()?;
  1472. match field_number {
  1473. 1 => {
  1474. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.value)?;
  1475. },
  1476. _ => {
  1477. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1478. },
  1479. };
  1480. }
  1481. ::std::result::Result::Ok(())
  1482. }
  1483. // Compute sizes of nested messages
  1484. #[allow(unused_variables)]
  1485. fn compute_size(&self) -> u32 {
  1486. let mut my_size = 0;
  1487. if !self.value.is_empty() {
  1488. my_size += ::protobuf::rt::string_size(1, &self.value);
  1489. }
  1490. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1491. self.cached_size.set(my_size);
  1492. my_size
  1493. }
  1494. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1495. if !self.value.is_empty() {
  1496. os.write_string(1, &self.value)?;
  1497. }
  1498. os.write_unknown_fields(self.get_unknown_fields())?;
  1499. ::std::result::Result::Ok(())
  1500. }
  1501. fn get_cached_size(&self) -> u32 {
  1502. self.cached_size.get()
  1503. }
  1504. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1505. &self.unknown_fields
  1506. }
  1507. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1508. &mut self.unknown_fields
  1509. }
  1510. fn as_any(&self) -> &dyn (::std::any::Any) {
  1511. self as &dyn (::std::any::Any)
  1512. }
  1513. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1514. self as &mut dyn (::std::any::Any)
  1515. }
  1516. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1517. self
  1518. }
  1519. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1520. Self::descriptor_static()
  1521. }
  1522. fn new() -> ViewId {
  1523. ViewId::new()
  1524. }
  1525. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1526. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  1527. descriptor.get(|| {
  1528. let mut fields = ::std::vec::Vec::new();
  1529. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1530. "value",
  1531. |m: &ViewId| { &m.value },
  1532. |m: &mut ViewId| { &mut m.value },
  1533. ));
  1534. ::protobuf::reflect::MessageDescriptor::new_pb_name::<ViewId>(
  1535. "ViewId",
  1536. fields,
  1537. file_descriptor_proto()
  1538. )
  1539. })
  1540. }
  1541. fn default_instance() -> &'static ViewId {
  1542. static instance: ::protobuf::rt::LazyV2<ViewId> = ::protobuf::rt::LazyV2::INIT;
  1543. instance.get(ViewId::new)
  1544. }
  1545. }
  1546. impl ::protobuf::Clear for ViewId {
  1547. fn clear(&mut self) {
  1548. self.value.clear();
  1549. self.unknown_fields.clear();
  1550. }
  1551. }
  1552. impl ::std::fmt::Debug for ViewId {
  1553. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1554. ::protobuf::text_format::fmt(self, f)
  1555. }
  1556. }
  1557. impl ::protobuf::reflect::ProtobufValue for ViewId {
  1558. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  1559. ::protobuf::reflect::ReflectValueRef::Message(self)
  1560. }
  1561. }
  1562. #[derive(PartialEq,Clone,Default)]
  1563. pub struct RepeatedViewId {
  1564. // message fields
  1565. pub items: ::protobuf::RepeatedField<::std::string::String>,
  1566. // special fields
  1567. pub unknown_fields: ::protobuf::UnknownFields,
  1568. pub cached_size: ::protobuf::CachedSize,
  1569. }
  1570. impl<'a> ::std::default::Default for &'a RepeatedViewId {
  1571. fn default() -> &'a RepeatedViewId {
  1572. <RepeatedViewId as ::protobuf::Message>::default_instance()
  1573. }
  1574. }
  1575. impl RepeatedViewId {
  1576. pub fn new() -> RepeatedViewId {
  1577. ::std::default::Default::default()
  1578. }
  1579. // repeated string items = 1;
  1580. pub fn get_items(&self) -> &[::std::string::String] {
  1581. &self.items
  1582. }
  1583. pub fn clear_items(&mut self) {
  1584. self.items.clear();
  1585. }
  1586. // Param is passed by value, moved
  1587. pub fn set_items(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
  1588. self.items = v;
  1589. }
  1590. // Mutable pointer to the field.
  1591. pub fn mut_items(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
  1592. &mut self.items
  1593. }
  1594. // Take field
  1595. pub fn take_items(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
  1596. ::std::mem::replace(&mut self.items, ::protobuf::RepeatedField::new())
  1597. }
  1598. }
  1599. impl ::protobuf::Message for RepeatedViewId {
  1600. fn is_initialized(&self) -> bool {
  1601. true
  1602. }
  1603. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1604. while !is.eof()? {
  1605. let (field_number, wire_type) = is.read_tag_unpack()?;
  1606. match field_number {
  1607. 1 => {
  1608. ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.items)?;
  1609. },
  1610. _ => {
  1611. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1612. },
  1613. };
  1614. }
  1615. ::std::result::Result::Ok(())
  1616. }
  1617. // Compute sizes of nested messages
  1618. #[allow(unused_variables)]
  1619. fn compute_size(&self) -> u32 {
  1620. let mut my_size = 0;
  1621. for value in &self.items {
  1622. my_size += ::protobuf::rt::string_size(1, &value);
  1623. };
  1624. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1625. self.cached_size.set(my_size);
  1626. my_size
  1627. }
  1628. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1629. for v in &self.items {
  1630. os.write_string(1, &v)?;
  1631. };
  1632. os.write_unknown_fields(self.get_unknown_fields())?;
  1633. ::std::result::Result::Ok(())
  1634. }
  1635. fn get_cached_size(&self) -> u32 {
  1636. self.cached_size.get()
  1637. }
  1638. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1639. &self.unknown_fields
  1640. }
  1641. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1642. &mut self.unknown_fields
  1643. }
  1644. fn as_any(&self) -> &dyn (::std::any::Any) {
  1645. self as &dyn (::std::any::Any)
  1646. }
  1647. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1648. self as &mut dyn (::std::any::Any)
  1649. }
  1650. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1651. self
  1652. }
  1653. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1654. Self::descriptor_static()
  1655. }
  1656. fn new() -> RepeatedViewId {
  1657. RepeatedViewId::new()
  1658. }
  1659. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1660. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  1661. descriptor.get(|| {
  1662. let mut fields = ::std::vec::Vec::new();
  1663. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1664. "items",
  1665. |m: &RepeatedViewId| { &m.items },
  1666. |m: &mut RepeatedViewId| { &mut m.items },
  1667. ));
  1668. ::protobuf::reflect::MessageDescriptor::new_pb_name::<RepeatedViewId>(
  1669. "RepeatedViewId",
  1670. fields,
  1671. file_descriptor_proto()
  1672. )
  1673. })
  1674. }
  1675. fn default_instance() -> &'static RepeatedViewId {
  1676. static instance: ::protobuf::rt::LazyV2<RepeatedViewId> = ::protobuf::rt::LazyV2::INIT;
  1677. instance.get(RepeatedViewId::new)
  1678. }
  1679. }
  1680. impl ::protobuf::Clear for RepeatedViewId {
  1681. fn clear(&mut self) {
  1682. self.items.clear();
  1683. self.unknown_fields.clear();
  1684. }
  1685. }
  1686. impl ::std::fmt::Debug for RepeatedViewId {
  1687. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1688. ::protobuf::text_format::fmt(self, f)
  1689. }
  1690. }
  1691. impl ::protobuf::reflect::ProtobufValue for RepeatedViewId {
  1692. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  1693. ::protobuf::reflect::ReflectValueRef::Message(self)
  1694. }
  1695. }
  1696. #[derive(PartialEq,Clone,Default)]
  1697. pub struct UpdateViewPayload {
  1698. // message fields
  1699. pub view_id: ::std::string::String,
  1700. // message oneof groups
  1701. pub one_of_name: ::std::option::Option<UpdateViewPayload_oneof_one_of_name>,
  1702. pub one_of_desc: ::std::option::Option<UpdateViewPayload_oneof_one_of_desc>,
  1703. pub one_of_thumbnail: ::std::option::Option<UpdateViewPayload_oneof_one_of_thumbnail>,
  1704. // special fields
  1705. pub unknown_fields: ::protobuf::UnknownFields,
  1706. pub cached_size: ::protobuf::CachedSize,
  1707. }
  1708. impl<'a> ::std::default::Default for &'a UpdateViewPayload {
  1709. fn default() -> &'a UpdateViewPayload {
  1710. <UpdateViewPayload as ::protobuf::Message>::default_instance()
  1711. }
  1712. }
  1713. #[derive(Clone,PartialEq,Debug)]
  1714. pub enum UpdateViewPayload_oneof_one_of_name {
  1715. name(::std::string::String),
  1716. }
  1717. #[derive(Clone,PartialEq,Debug)]
  1718. pub enum UpdateViewPayload_oneof_one_of_desc {
  1719. desc(::std::string::String),
  1720. }
  1721. #[derive(Clone,PartialEq,Debug)]
  1722. pub enum UpdateViewPayload_oneof_one_of_thumbnail {
  1723. thumbnail(::std::string::String),
  1724. }
  1725. impl UpdateViewPayload {
  1726. pub fn new() -> UpdateViewPayload {
  1727. ::std::default::Default::default()
  1728. }
  1729. // string view_id = 1;
  1730. pub fn get_view_id(&self) -> &str {
  1731. &self.view_id
  1732. }
  1733. pub fn clear_view_id(&mut self) {
  1734. self.view_id.clear();
  1735. }
  1736. // Param is passed by value, moved
  1737. pub fn set_view_id(&mut self, v: ::std::string::String) {
  1738. self.view_id = v;
  1739. }
  1740. // Mutable pointer to the field.
  1741. // If field is not initialized, it is initialized with default value first.
  1742. pub fn mut_view_id(&mut self) -> &mut ::std::string::String {
  1743. &mut self.view_id
  1744. }
  1745. // Take field
  1746. pub fn take_view_id(&mut self) -> ::std::string::String {
  1747. ::std::mem::replace(&mut self.view_id, ::std::string::String::new())
  1748. }
  1749. // string name = 2;
  1750. pub fn get_name(&self) -> &str {
  1751. match self.one_of_name {
  1752. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(ref v)) => v,
  1753. _ => "",
  1754. }
  1755. }
  1756. pub fn clear_name(&mut self) {
  1757. self.one_of_name = ::std::option::Option::None;
  1758. }
  1759. pub fn has_name(&self) -> bool {
  1760. match self.one_of_name {
  1761. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(..)) => true,
  1762. _ => false,
  1763. }
  1764. }
  1765. // Param is passed by value, moved
  1766. pub fn set_name(&mut self, v: ::std::string::String) {
  1767. self.one_of_name = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(v))
  1768. }
  1769. // Mutable pointer to the field.
  1770. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  1771. if let ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(_)) = self.one_of_name {
  1772. } else {
  1773. self.one_of_name = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(::std::string::String::new()));
  1774. }
  1775. match self.one_of_name {
  1776. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(ref mut v)) => v,
  1777. _ => panic!(),
  1778. }
  1779. }
  1780. // Take field
  1781. pub fn take_name(&mut self) -> ::std::string::String {
  1782. if self.has_name() {
  1783. match self.one_of_name.take() {
  1784. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(v)) => v,
  1785. _ => panic!(),
  1786. }
  1787. } else {
  1788. ::std::string::String::new()
  1789. }
  1790. }
  1791. // string desc = 3;
  1792. pub fn get_desc(&self) -> &str {
  1793. match self.one_of_desc {
  1794. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(ref v)) => v,
  1795. _ => "",
  1796. }
  1797. }
  1798. pub fn clear_desc(&mut self) {
  1799. self.one_of_desc = ::std::option::Option::None;
  1800. }
  1801. pub fn has_desc(&self) -> bool {
  1802. match self.one_of_desc {
  1803. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(..)) => true,
  1804. _ => false,
  1805. }
  1806. }
  1807. // Param is passed by value, moved
  1808. pub fn set_desc(&mut self, v: ::std::string::String) {
  1809. self.one_of_desc = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(v))
  1810. }
  1811. // Mutable pointer to the field.
  1812. pub fn mut_desc(&mut self) -> &mut ::std::string::String {
  1813. if let ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(_)) = self.one_of_desc {
  1814. } else {
  1815. self.one_of_desc = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(::std::string::String::new()));
  1816. }
  1817. match self.one_of_desc {
  1818. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(ref mut v)) => v,
  1819. _ => panic!(),
  1820. }
  1821. }
  1822. // Take field
  1823. pub fn take_desc(&mut self) -> ::std::string::String {
  1824. if self.has_desc() {
  1825. match self.one_of_desc.take() {
  1826. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(v)) => v,
  1827. _ => panic!(),
  1828. }
  1829. } else {
  1830. ::std::string::String::new()
  1831. }
  1832. }
  1833. // string thumbnail = 4;
  1834. pub fn get_thumbnail(&self) -> &str {
  1835. match self.one_of_thumbnail {
  1836. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v)) => v,
  1837. _ => "",
  1838. }
  1839. }
  1840. pub fn clear_thumbnail(&mut self) {
  1841. self.one_of_thumbnail = ::std::option::Option::None;
  1842. }
  1843. pub fn has_thumbnail(&self) -> bool {
  1844. match self.one_of_thumbnail {
  1845. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(..)) => true,
  1846. _ => false,
  1847. }
  1848. }
  1849. // Param is passed by value, moved
  1850. pub fn set_thumbnail(&mut self, v: ::std::string::String) {
  1851. self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(v))
  1852. }
  1853. // Mutable pointer to the field.
  1854. pub fn mut_thumbnail(&mut self) -> &mut ::std::string::String {
  1855. if let ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(_)) = self.one_of_thumbnail {
  1856. } else {
  1857. self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(::std::string::String::new()));
  1858. }
  1859. match self.one_of_thumbnail {
  1860. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(ref mut v)) => v,
  1861. _ => panic!(),
  1862. }
  1863. }
  1864. // Take field
  1865. pub fn take_thumbnail(&mut self) -> ::std::string::String {
  1866. if self.has_thumbnail() {
  1867. match self.one_of_thumbnail.take() {
  1868. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(v)) => v,
  1869. _ => panic!(),
  1870. }
  1871. } else {
  1872. ::std::string::String::new()
  1873. }
  1874. }
  1875. }
  1876. impl ::protobuf::Message for UpdateViewPayload {
  1877. fn is_initialized(&self) -> bool {
  1878. true
  1879. }
  1880. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1881. while !is.eof()? {
  1882. let (field_number, wire_type) = is.read_tag_unpack()?;
  1883. match field_number {
  1884. 1 => {
  1885. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_id)?;
  1886. },
  1887. 2 => {
  1888. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  1889. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1890. }
  1891. self.one_of_name = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(is.read_string()?));
  1892. },
  1893. 3 => {
  1894. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  1895. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1896. }
  1897. self.one_of_desc = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(is.read_string()?));
  1898. },
  1899. 4 => {
  1900. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  1901. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1902. }
  1903. self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(is.read_string()?));
  1904. },
  1905. _ => {
  1906. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1907. },
  1908. };
  1909. }
  1910. ::std::result::Result::Ok(())
  1911. }
  1912. // Compute sizes of nested messages
  1913. #[allow(unused_variables)]
  1914. fn compute_size(&self) -> u32 {
  1915. let mut my_size = 0;
  1916. if !self.view_id.is_empty() {
  1917. my_size += ::protobuf::rt::string_size(1, &self.view_id);
  1918. }
  1919. if let ::std::option::Option::Some(ref v) = self.one_of_name {
  1920. match v {
  1921. &UpdateViewPayload_oneof_one_of_name::name(ref v) => {
  1922. my_size += ::protobuf::rt::string_size(2, &v);
  1923. },
  1924. };
  1925. }
  1926. if let ::std::option::Option::Some(ref v) = self.one_of_desc {
  1927. match v {
  1928. &UpdateViewPayload_oneof_one_of_desc::desc(ref v) => {
  1929. my_size += ::protobuf::rt::string_size(3, &v);
  1930. },
  1931. };
  1932. }
  1933. if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
  1934. match v {
  1935. &UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
  1936. my_size += ::protobuf::rt::string_size(4, &v);
  1937. },
  1938. };
  1939. }
  1940. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1941. self.cached_size.set(my_size);
  1942. my_size
  1943. }
  1944. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1945. if !self.view_id.is_empty() {
  1946. os.write_string(1, &self.view_id)?;
  1947. }
  1948. if let ::std::option::Option::Some(ref v) = self.one_of_name {
  1949. match v {
  1950. &UpdateViewPayload_oneof_one_of_name::name(ref v) => {
  1951. os.write_string(2, v)?;
  1952. },
  1953. };
  1954. }
  1955. if let ::std::option::Option::Some(ref v) = self.one_of_desc {
  1956. match v {
  1957. &UpdateViewPayload_oneof_one_of_desc::desc(ref v) => {
  1958. os.write_string(3, v)?;
  1959. },
  1960. };
  1961. }
  1962. if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
  1963. match v {
  1964. &UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
  1965. os.write_string(4, v)?;
  1966. },
  1967. };
  1968. }
  1969. os.write_unknown_fields(self.get_unknown_fields())?;
  1970. ::std::result::Result::Ok(())
  1971. }
  1972. fn get_cached_size(&self) -> u32 {
  1973. self.cached_size.get()
  1974. }
  1975. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1976. &self.unknown_fields
  1977. }
  1978. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1979. &mut self.unknown_fields
  1980. }
  1981. fn as_any(&self) -> &dyn (::std::any::Any) {
  1982. self as &dyn (::std::any::Any)
  1983. }
  1984. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1985. self as &mut dyn (::std::any::Any)
  1986. }
  1987. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1988. self
  1989. }
  1990. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1991. Self::descriptor_static()
  1992. }
  1993. fn new() -> UpdateViewPayload {
  1994. UpdateViewPayload::new()
  1995. }
  1996. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1997. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  1998. descriptor.get(|| {
  1999. let mut fields = ::std::vec::Vec::new();
  2000. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  2001. "view_id",
  2002. |m: &UpdateViewPayload| { &m.view_id },
  2003. |m: &mut UpdateViewPayload| { &mut m.view_id },
  2004. ));
  2005. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  2006. "name",
  2007. UpdateViewPayload::has_name,
  2008. UpdateViewPayload::get_name,
  2009. ));
  2010. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  2011. "desc",
  2012. UpdateViewPayload::has_desc,
  2013. UpdateViewPayload::get_desc,
  2014. ));
  2015. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  2016. "thumbnail",
  2017. UpdateViewPayload::has_thumbnail,
  2018. UpdateViewPayload::get_thumbnail,
  2019. ));
  2020. ::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateViewPayload>(
  2021. "UpdateViewPayload",
  2022. fields,
  2023. file_descriptor_proto()
  2024. )
  2025. })
  2026. }
  2027. fn default_instance() -> &'static UpdateViewPayload {
  2028. static instance: ::protobuf::rt::LazyV2<UpdateViewPayload> = ::protobuf::rt::LazyV2::INIT;
  2029. instance.get(UpdateViewPayload::new)
  2030. }
  2031. }
  2032. impl ::protobuf::Clear for UpdateViewPayload {
  2033. fn clear(&mut self) {
  2034. self.view_id.clear();
  2035. self.one_of_name = ::std::option::Option::None;
  2036. self.one_of_desc = ::std::option::Option::None;
  2037. self.one_of_thumbnail = ::std::option::Option::None;
  2038. self.unknown_fields.clear();
  2039. }
  2040. }
  2041. impl ::std::fmt::Debug for UpdateViewPayload {
  2042. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  2043. ::protobuf::text_format::fmt(self, f)
  2044. }
  2045. }
  2046. impl ::protobuf::reflect::ProtobufValue for UpdateViewPayload {
  2047. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  2048. ::protobuf::reflect::ReflectValueRef::Message(self)
  2049. }
  2050. }
  2051. #[derive(PartialEq,Clone,Default)]
  2052. pub struct UpdateViewParams {
  2053. // message fields
  2054. pub view_id: ::std::string::String,
  2055. // message oneof groups
  2056. pub one_of_name: ::std::option::Option<UpdateViewParams_oneof_one_of_name>,
  2057. pub one_of_desc: ::std::option::Option<UpdateViewParams_oneof_one_of_desc>,
  2058. pub one_of_thumbnail: ::std::option::Option<UpdateViewParams_oneof_one_of_thumbnail>,
  2059. // special fields
  2060. pub unknown_fields: ::protobuf::UnknownFields,
  2061. pub cached_size: ::protobuf::CachedSize,
  2062. }
  2063. impl<'a> ::std::default::Default for &'a UpdateViewParams {
  2064. fn default() -> &'a UpdateViewParams {
  2065. <UpdateViewParams as ::protobuf::Message>::default_instance()
  2066. }
  2067. }
  2068. #[derive(Clone,PartialEq,Debug)]
  2069. pub enum UpdateViewParams_oneof_one_of_name {
  2070. name(::std::string::String),
  2071. }
  2072. #[derive(Clone,PartialEq,Debug)]
  2073. pub enum UpdateViewParams_oneof_one_of_desc {
  2074. desc(::std::string::String),
  2075. }
  2076. #[derive(Clone,PartialEq,Debug)]
  2077. pub enum UpdateViewParams_oneof_one_of_thumbnail {
  2078. thumbnail(::std::string::String),
  2079. }
  2080. impl UpdateViewParams {
  2081. pub fn new() -> UpdateViewParams {
  2082. ::std::default::Default::default()
  2083. }
  2084. // string view_id = 1;
  2085. pub fn get_view_id(&self) -> &str {
  2086. &self.view_id
  2087. }
  2088. pub fn clear_view_id(&mut self) {
  2089. self.view_id.clear();
  2090. }
  2091. // Param is passed by value, moved
  2092. pub fn set_view_id(&mut self, v: ::std::string::String) {
  2093. self.view_id = v;
  2094. }
  2095. // Mutable pointer to the field.
  2096. // If field is not initialized, it is initialized with default value first.
  2097. pub fn mut_view_id(&mut self) -> &mut ::std::string::String {
  2098. &mut self.view_id
  2099. }
  2100. // Take field
  2101. pub fn take_view_id(&mut self) -> ::std::string::String {
  2102. ::std::mem::replace(&mut self.view_id, ::std::string::String::new())
  2103. }
  2104. // string name = 2;
  2105. pub fn get_name(&self) -> &str {
  2106. match self.one_of_name {
  2107. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(ref v)) => v,
  2108. _ => "",
  2109. }
  2110. }
  2111. pub fn clear_name(&mut self) {
  2112. self.one_of_name = ::std::option::Option::None;
  2113. }
  2114. pub fn has_name(&self) -> bool {
  2115. match self.one_of_name {
  2116. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(..)) => true,
  2117. _ => false,
  2118. }
  2119. }
  2120. // Param is passed by value, moved
  2121. pub fn set_name(&mut self, v: ::std::string::String) {
  2122. self.one_of_name = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(v))
  2123. }
  2124. // Mutable pointer to the field.
  2125. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  2126. if let ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(_)) = self.one_of_name {
  2127. } else {
  2128. self.one_of_name = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(::std::string::String::new()));
  2129. }
  2130. match self.one_of_name {
  2131. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(ref mut v)) => v,
  2132. _ => panic!(),
  2133. }
  2134. }
  2135. // Take field
  2136. pub fn take_name(&mut self) -> ::std::string::String {
  2137. if self.has_name() {
  2138. match self.one_of_name.take() {
  2139. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(v)) => v,
  2140. _ => panic!(),
  2141. }
  2142. } else {
  2143. ::std::string::String::new()
  2144. }
  2145. }
  2146. // string desc = 3;
  2147. pub fn get_desc(&self) -> &str {
  2148. match self.one_of_desc {
  2149. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(ref v)) => v,
  2150. _ => "",
  2151. }
  2152. }
  2153. pub fn clear_desc(&mut self) {
  2154. self.one_of_desc = ::std::option::Option::None;
  2155. }
  2156. pub fn has_desc(&self) -> bool {
  2157. match self.one_of_desc {
  2158. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(..)) => true,
  2159. _ => false,
  2160. }
  2161. }
  2162. // Param is passed by value, moved
  2163. pub fn set_desc(&mut self, v: ::std::string::String) {
  2164. self.one_of_desc = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(v))
  2165. }
  2166. // Mutable pointer to the field.
  2167. pub fn mut_desc(&mut self) -> &mut ::std::string::String {
  2168. if let ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(_)) = self.one_of_desc {
  2169. } else {
  2170. self.one_of_desc = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(::std::string::String::new()));
  2171. }
  2172. match self.one_of_desc {
  2173. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(ref mut v)) => v,
  2174. _ => panic!(),
  2175. }
  2176. }
  2177. // Take field
  2178. pub fn take_desc(&mut self) -> ::std::string::String {
  2179. if self.has_desc() {
  2180. match self.one_of_desc.take() {
  2181. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(v)) => v,
  2182. _ => panic!(),
  2183. }
  2184. } else {
  2185. ::std::string::String::new()
  2186. }
  2187. }
  2188. // string thumbnail = 4;
  2189. pub fn get_thumbnail(&self) -> &str {
  2190. match self.one_of_thumbnail {
  2191. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(ref v)) => v,
  2192. _ => "",
  2193. }
  2194. }
  2195. pub fn clear_thumbnail(&mut self) {
  2196. self.one_of_thumbnail = ::std::option::Option::None;
  2197. }
  2198. pub fn has_thumbnail(&self) -> bool {
  2199. match self.one_of_thumbnail {
  2200. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(..)) => true,
  2201. _ => false,
  2202. }
  2203. }
  2204. // Param is passed by value, moved
  2205. pub fn set_thumbnail(&mut self, v: ::std::string::String) {
  2206. self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(v))
  2207. }
  2208. // Mutable pointer to the field.
  2209. pub fn mut_thumbnail(&mut self) -> &mut ::std::string::String {
  2210. if let ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(_)) = self.one_of_thumbnail {
  2211. } else {
  2212. self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(::std::string::String::new()));
  2213. }
  2214. match self.one_of_thumbnail {
  2215. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(ref mut v)) => v,
  2216. _ => panic!(),
  2217. }
  2218. }
  2219. // Take field
  2220. pub fn take_thumbnail(&mut self) -> ::std::string::String {
  2221. if self.has_thumbnail() {
  2222. match self.one_of_thumbnail.take() {
  2223. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(v)) => v,
  2224. _ => panic!(),
  2225. }
  2226. } else {
  2227. ::std::string::String::new()
  2228. }
  2229. }
  2230. }
  2231. impl ::protobuf::Message for UpdateViewParams {
  2232. fn is_initialized(&self) -> bool {
  2233. true
  2234. }
  2235. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  2236. while !is.eof()? {
  2237. let (field_number, wire_type) = is.read_tag_unpack()?;
  2238. match field_number {
  2239. 1 => {
  2240. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_id)?;
  2241. },
  2242. 2 => {
  2243. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  2244. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2245. }
  2246. self.one_of_name = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(is.read_string()?));
  2247. },
  2248. 3 => {
  2249. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  2250. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2251. }
  2252. self.one_of_desc = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(is.read_string()?));
  2253. },
  2254. 4 => {
  2255. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  2256. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2257. }
  2258. self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(is.read_string()?));
  2259. },
  2260. _ => {
  2261. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  2262. },
  2263. };
  2264. }
  2265. ::std::result::Result::Ok(())
  2266. }
  2267. // Compute sizes of nested messages
  2268. #[allow(unused_variables)]
  2269. fn compute_size(&self) -> u32 {
  2270. let mut my_size = 0;
  2271. if !self.view_id.is_empty() {
  2272. my_size += ::protobuf::rt::string_size(1, &self.view_id);
  2273. }
  2274. if let ::std::option::Option::Some(ref v) = self.one_of_name {
  2275. match v {
  2276. &UpdateViewParams_oneof_one_of_name::name(ref v) => {
  2277. my_size += ::protobuf::rt::string_size(2, &v);
  2278. },
  2279. };
  2280. }
  2281. if let ::std::option::Option::Some(ref v) = self.one_of_desc {
  2282. match v {
  2283. &UpdateViewParams_oneof_one_of_desc::desc(ref v) => {
  2284. my_size += ::protobuf::rt::string_size(3, &v);
  2285. },
  2286. };
  2287. }
  2288. if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
  2289. match v {
  2290. &UpdateViewParams_oneof_one_of_thumbnail::thumbnail(ref v) => {
  2291. my_size += ::protobuf::rt::string_size(4, &v);
  2292. },
  2293. };
  2294. }
  2295. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2296. self.cached_size.set(my_size);
  2297. my_size
  2298. }
  2299. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  2300. if !self.view_id.is_empty() {
  2301. os.write_string(1, &self.view_id)?;
  2302. }
  2303. if let ::std::option::Option::Some(ref v) = self.one_of_name {
  2304. match v {
  2305. &UpdateViewParams_oneof_one_of_name::name(ref v) => {
  2306. os.write_string(2, v)?;
  2307. },
  2308. };
  2309. }
  2310. if let ::std::option::Option::Some(ref v) = self.one_of_desc {
  2311. match v {
  2312. &UpdateViewParams_oneof_one_of_desc::desc(ref v) => {
  2313. os.write_string(3, v)?;
  2314. },
  2315. };
  2316. }
  2317. if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
  2318. match v {
  2319. &UpdateViewParams_oneof_one_of_thumbnail::thumbnail(ref v) => {
  2320. os.write_string(4, v)?;
  2321. },
  2322. };
  2323. }
  2324. os.write_unknown_fields(self.get_unknown_fields())?;
  2325. ::std::result::Result::Ok(())
  2326. }
  2327. fn get_cached_size(&self) -> u32 {
  2328. self.cached_size.get()
  2329. }
  2330. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2331. &self.unknown_fields
  2332. }
  2333. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2334. &mut self.unknown_fields
  2335. }
  2336. fn as_any(&self) -> &dyn (::std::any::Any) {
  2337. self as &dyn (::std::any::Any)
  2338. }
  2339. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  2340. self as &mut dyn (::std::any::Any)
  2341. }
  2342. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  2343. self
  2344. }
  2345. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2346. Self::descriptor_static()
  2347. }
  2348. fn new() -> UpdateViewParams {
  2349. UpdateViewParams::new()
  2350. }
  2351. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2352. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  2353. descriptor.get(|| {
  2354. let mut fields = ::std::vec::Vec::new();
  2355. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  2356. "view_id",
  2357. |m: &UpdateViewParams| { &m.view_id },
  2358. |m: &mut UpdateViewParams| { &mut m.view_id },
  2359. ));
  2360. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  2361. "name",
  2362. UpdateViewParams::has_name,
  2363. UpdateViewParams::get_name,
  2364. ));
  2365. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  2366. "desc",
  2367. UpdateViewParams::has_desc,
  2368. UpdateViewParams::get_desc,
  2369. ));
  2370. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  2371. "thumbnail",
  2372. UpdateViewParams::has_thumbnail,
  2373. UpdateViewParams::get_thumbnail,
  2374. ));
  2375. ::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateViewParams>(
  2376. "UpdateViewParams",
  2377. fields,
  2378. file_descriptor_proto()
  2379. )
  2380. })
  2381. }
  2382. fn default_instance() -> &'static UpdateViewParams {
  2383. static instance: ::protobuf::rt::LazyV2<UpdateViewParams> = ::protobuf::rt::LazyV2::INIT;
  2384. instance.get(UpdateViewParams::new)
  2385. }
  2386. }
  2387. impl ::protobuf::Clear for UpdateViewParams {
  2388. fn clear(&mut self) {
  2389. self.view_id.clear();
  2390. self.one_of_name = ::std::option::Option::None;
  2391. self.one_of_desc = ::std::option::Option::None;
  2392. self.one_of_thumbnail = ::std::option::Option::None;
  2393. self.unknown_fields.clear();
  2394. }
  2395. }
  2396. impl ::std::fmt::Debug for UpdateViewParams {
  2397. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  2398. ::protobuf::text_format::fmt(self, f)
  2399. }
  2400. }
  2401. impl ::protobuf::reflect::ProtobufValue for UpdateViewParams {
  2402. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  2403. ::protobuf::reflect::ReflectValueRef::Message(self)
  2404. }
  2405. }
  2406. #[derive(PartialEq,Clone,Default)]
  2407. pub struct MoveFolderItemPayload {
  2408. // message fields
  2409. pub item_id: ::std::string::String,
  2410. pub from: i32,
  2411. pub to: i32,
  2412. pub ty: MoveFolderItemType,
  2413. // special fields
  2414. pub unknown_fields: ::protobuf::UnknownFields,
  2415. pub cached_size: ::protobuf::CachedSize,
  2416. }
  2417. impl<'a> ::std::default::Default for &'a MoveFolderItemPayload {
  2418. fn default() -> &'a MoveFolderItemPayload {
  2419. <MoveFolderItemPayload as ::protobuf::Message>::default_instance()
  2420. }
  2421. }
  2422. impl MoveFolderItemPayload {
  2423. pub fn new() -> MoveFolderItemPayload {
  2424. ::std::default::Default::default()
  2425. }
  2426. // string item_id = 1;
  2427. pub fn get_item_id(&self) -> &str {
  2428. &self.item_id
  2429. }
  2430. pub fn clear_item_id(&mut self) {
  2431. self.item_id.clear();
  2432. }
  2433. // Param is passed by value, moved
  2434. pub fn set_item_id(&mut self, v: ::std::string::String) {
  2435. self.item_id = v;
  2436. }
  2437. // Mutable pointer to the field.
  2438. // If field is not initialized, it is initialized with default value first.
  2439. pub fn mut_item_id(&mut self) -> &mut ::std::string::String {
  2440. &mut self.item_id
  2441. }
  2442. // Take field
  2443. pub fn take_item_id(&mut self) -> ::std::string::String {
  2444. ::std::mem::replace(&mut self.item_id, ::std::string::String::new())
  2445. }
  2446. // int32 from = 2;
  2447. pub fn get_from(&self) -> i32 {
  2448. self.from
  2449. }
  2450. pub fn clear_from(&mut self) {
  2451. self.from = 0;
  2452. }
  2453. // Param is passed by value, moved
  2454. pub fn set_from(&mut self, v: i32) {
  2455. self.from = v;
  2456. }
  2457. // int32 to = 3;
  2458. pub fn get_to(&self) -> i32 {
  2459. self.to
  2460. }
  2461. pub fn clear_to(&mut self) {
  2462. self.to = 0;
  2463. }
  2464. // Param is passed by value, moved
  2465. pub fn set_to(&mut self, v: i32) {
  2466. self.to = v;
  2467. }
  2468. // .MoveFolderItemType ty = 4;
  2469. pub fn get_ty(&self) -> MoveFolderItemType {
  2470. self.ty
  2471. }
  2472. pub fn clear_ty(&mut self) {
  2473. self.ty = MoveFolderItemType::MoveApp;
  2474. }
  2475. // Param is passed by value, moved
  2476. pub fn set_ty(&mut self, v: MoveFolderItemType) {
  2477. self.ty = v;
  2478. }
  2479. }
  2480. impl ::protobuf::Message for MoveFolderItemPayload {
  2481. fn is_initialized(&self) -> bool {
  2482. true
  2483. }
  2484. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  2485. while !is.eof()? {
  2486. let (field_number, wire_type) = is.read_tag_unpack()?;
  2487. match field_number {
  2488. 1 => {
  2489. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.item_id)?;
  2490. },
  2491. 2 => {
  2492. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2493. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2494. }
  2495. let tmp = is.read_int32()?;
  2496. self.from = tmp;
  2497. },
  2498. 3 => {
  2499. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2500. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2501. }
  2502. let tmp = is.read_int32()?;
  2503. self.to = tmp;
  2504. },
  2505. 4 => {
  2506. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.ty, 4, &mut self.unknown_fields)?
  2507. },
  2508. _ => {
  2509. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  2510. },
  2511. };
  2512. }
  2513. ::std::result::Result::Ok(())
  2514. }
  2515. // Compute sizes of nested messages
  2516. #[allow(unused_variables)]
  2517. fn compute_size(&self) -> u32 {
  2518. let mut my_size = 0;
  2519. if !self.item_id.is_empty() {
  2520. my_size += ::protobuf::rt::string_size(1, &self.item_id);
  2521. }
  2522. if self.from != 0 {
  2523. my_size += ::protobuf::rt::value_size(2, self.from, ::protobuf::wire_format::WireTypeVarint);
  2524. }
  2525. if self.to != 0 {
  2526. my_size += ::protobuf::rt::value_size(3, self.to, ::protobuf::wire_format::WireTypeVarint);
  2527. }
  2528. if self.ty != MoveFolderItemType::MoveApp {
  2529. my_size += ::protobuf::rt::enum_size(4, self.ty);
  2530. }
  2531. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2532. self.cached_size.set(my_size);
  2533. my_size
  2534. }
  2535. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  2536. if !self.item_id.is_empty() {
  2537. os.write_string(1, &self.item_id)?;
  2538. }
  2539. if self.from != 0 {
  2540. os.write_int32(2, self.from)?;
  2541. }
  2542. if self.to != 0 {
  2543. os.write_int32(3, self.to)?;
  2544. }
  2545. if self.ty != MoveFolderItemType::MoveApp {
  2546. os.write_enum(4, ::protobuf::ProtobufEnum::value(&self.ty))?;
  2547. }
  2548. os.write_unknown_fields(self.get_unknown_fields())?;
  2549. ::std::result::Result::Ok(())
  2550. }
  2551. fn get_cached_size(&self) -> u32 {
  2552. self.cached_size.get()
  2553. }
  2554. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2555. &self.unknown_fields
  2556. }
  2557. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2558. &mut self.unknown_fields
  2559. }
  2560. fn as_any(&self) -> &dyn (::std::any::Any) {
  2561. self as &dyn (::std::any::Any)
  2562. }
  2563. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  2564. self as &mut dyn (::std::any::Any)
  2565. }
  2566. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  2567. self
  2568. }
  2569. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2570. Self::descriptor_static()
  2571. }
  2572. fn new() -> MoveFolderItemPayload {
  2573. MoveFolderItemPayload::new()
  2574. }
  2575. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2576. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  2577. descriptor.get(|| {
  2578. let mut fields = ::std::vec::Vec::new();
  2579. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  2580. "item_id",
  2581. |m: &MoveFolderItemPayload| { &m.item_id },
  2582. |m: &mut MoveFolderItemPayload| { &mut m.item_id },
  2583. ));
  2584. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  2585. "from",
  2586. |m: &MoveFolderItemPayload| { &m.from },
  2587. |m: &mut MoveFolderItemPayload| { &mut m.from },
  2588. ));
  2589. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  2590. "to",
  2591. |m: &MoveFolderItemPayload| { &m.to },
  2592. |m: &mut MoveFolderItemPayload| { &mut m.to },
  2593. ));
  2594. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<MoveFolderItemType>>(
  2595. "ty",
  2596. |m: &MoveFolderItemPayload| { &m.ty },
  2597. |m: &mut MoveFolderItemPayload| { &mut m.ty },
  2598. ));
  2599. ::protobuf::reflect::MessageDescriptor::new_pb_name::<MoveFolderItemPayload>(
  2600. "MoveFolderItemPayload",
  2601. fields,
  2602. file_descriptor_proto()
  2603. )
  2604. })
  2605. }
  2606. fn default_instance() -> &'static MoveFolderItemPayload {
  2607. static instance: ::protobuf::rt::LazyV2<MoveFolderItemPayload> = ::protobuf::rt::LazyV2::INIT;
  2608. instance.get(MoveFolderItemPayload::new)
  2609. }
  2610. }
  2611. impl ::protobuf::Clear for MoveFolderItemPayload {
  2612. fn clear(&mut self) {
  2613. self.item_id.clear();
  2614. self.from = 0;
  2615. self.to = 0;
  2616. self.ty = MoveFolderItemType::MoveApp;
  2617. self.unknown_fields.clear();
  2618. }
  2619. }
  2620. impl ::std::fmt::Debug for MoveFolderItemPayload {
  2621. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  2622. ::protobuf::text_format::fmt(self, f)
  2623. }
  2624. }
  2625. impl ::protobuf::reflect::ProtobufValue for MoveFolderItemPayload {
  2626. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  2627. ::protobuf::reflect::ReflectValueRef::Message(self)
  2628. }
  2629. }
  2630. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  2631. pub enum ViewDataType {
  2632. TextBlock = 0,
  2633. Grid = 1,
  2634. }
  2635. impl ::protobuf::ProtobufEnum for ViewDataType {
  2636. fn value(&self) -> i32 {
  2637. *self as i32
  2638. }
  2639. fn from_i32(value: i32) -> ::std::option::Option<ViewDataType> {
  2640. match value {
  2641. 0 => ::std::option::Option::Some(ViewDataType::TextBlock),
  2642. 1 => ::std::option::Option::Some(ViewDataType::Grid),
  2643. _ => ::std::option::Option::None
  2644. }
  2645. }
  2646. fn values() -> &'static [Self] {
  2647. static values: &'static [ViewDataType] = &[
  2648. ViewDataType::TextBlock,
  2649. ViewDataType::Grid,
  2650. ];
  2651. values
  2652. }
  2653. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  2654. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
  2655. descriptor.get(|| {
  2656. ::protobuf::reflect::EnumDescriptor::new_pb_name::<ViewDataType>("ViewDataType", file_descriptor_proto())
  2657. })
  2658. }
  2659. }
  2660. impl ::std::marker::Copy for ViewDataType {
  2661. }
  2662. impl ::std::default::Default for ViewDataType {
  2663. fn default() -> Self {
  2664. ViewDataType::TextBlock
  2665. }
  2666. }
  2667. impl ::protobuf::reflect::ProtobufValue for ViewDataType {
  2668. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  2669. ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
  2670. }
  2671. }
  2672. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  2673. pub enum MoveFolderItemType {
  2674. MoveApp = 0,
  2675. MoveView = 1,
  2676. }
  2677. impl ::protobuf::ProtobufEnum for MoveFolderItemType {
  2678. fn value(&self) -> i32 {
  2679. *self as i32
  2680. }
  2681. fn from_i32(value: i32) -> ::std::option::Option<MoveFolderItemType> {
  2682. match value {
  2683. 0 => ::std::option::Option::Some(MoveFolderItemType::MoveApp),
  2684. 1 => ::std::option::Option::Some(MoveFolderItemType::MoveView),
  2685. _ => ::std::option::Option::None
  2686. }
  2687. }
  2688. fn values() -> &'static [Self] {
  2689. static values: &'static [MoveFolderItemType] = &[
  2690. MoveFolderItemType::MoveApp,
  2691. MoveFolderItemType::MoveView,
  2692. ];
  2693. values
  2694. }
  2695. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  2696. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
  2697. descriptor.get(|| {
  2698. ::protobuf::reflect::EnumDescriptor::new_pb_name::<MoveFolderItemType>("MoveFolderItemType", file_descriptor_proto())
  2699. })
  2700. }
  2701. }
  2702. impl ::std::marker::Copy for MoveFolderItemType {
  2703. }
  2704. impl ::std::default::Default for MoveFolderItemType {
  2705. fn default() -> Self {
  2706. MoveFolderItemType::MoveApp
  2707. }
  2708. }
  2709. impl ::protobuf::reflect::ProtobufValue for MoveFolderItemType {
  2710. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  2711. ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
  2712. }
  2713. }
  2714. static file_descriptor_proto_data: &'static [u8] = b"\
  2715. \n\nview.proto\"\xf5\x02\n\x04View\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\
  2716. \x02id\x12\x20\n\x0cbelong_to_id\x18\x02\x20\x01(\tR\nbelongToId\x12\x12\
  2717. \n\x04name\x18\x03\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x04\x20\x01\
  2718. (\tR\x04desc\x12*\n\tdata_type\x18\x05\x20\x01(\x0e2\r.ViewDataTypeR\x08\
  2719. dataType\x12\x18\n\x07version\x18\x06\x20\x01(\x03R\x07version\x12-\n\nb\
  2720. elongings\x18\x07\x20\x01(\x0b2\r.RepeatedViewR\nbelongings\x12#\n\rmodi\
  2721. fied_time\x18\x08\x20\x01(\x03R\x0cmodifiedTime\x12\x1f\n\x0bcreate_time\
  2722. \x18\t\x20\x01(\x03R\ncreateTime\x12\x19\n\x08ext_data\x18\n\x20\x01(\tR\
  2723. \x07extData\x12\x1c\n\tthumbnail\x18\x0b\x20\x01(\tR\tthumbnail\x12\x1f\
  2724. \n\x0bplugin_type\x18\x0c\x20\x01(\x05R\npluginType\"+\n\x0cRepeatedView\
  2725. \x12\x1b\n\x05items\x18\x01\x20\x03(\x0b2\x05.ViewR\x05items\"\xf2\x01\n\
  2726. \x11CreateViewPayload\x12\x20\n\x0cbelong_to_id\x18\x01\x20\x01(\tR\nbel\
  2727. ongToId\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\
  2728. \x18\x03\x20\x01(\tR\x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\0R\
  2729. \tthumbnail\x12*\n\tdata_type\x18\x05\x20\x01(\x0e2\r.ViewDataTypeR\x08d\
  2730. ataType\x12\x1f\n\x0bplugin_type\x18\x06\x20\x01(\x05R\npluginType\x12\
  2731. \x12\n\x04data\x18\x07\x20\x01(\x0cR\x04dataB\x12\n\x10one_of_thumbnail\
  2732. \"\xf4\x01\n\x10CreateViewParams\x12\x20\n\x0cbelong_to_id\x18\x01\x20\
  2733. \x01(\tR\nbelongToId\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\
  2734. \x12\n\x04desc\x18\x03\x20\x01(\tR\x04desc\x12\x1c\n\tthumbnail\x18\x04\
  2735. \x20\x01(\tR\tthumbnail\x12*\n\tdata_type\x18\x05\x20\x01(\x0e2\r.ViewDa\
  2736. taTypeR\x08dataType\x12\x17\n\x07view_id\x18\x06\x20\x01(\tR\x06viewId\
  2737. \x12\x12\n\x04data\x18\x07\x20\x01(\x0cR\x04data\x12\x1f\n\x0bplugin_typ\
  2738. e\x18\x08\x20\x01(\x05R\npluginType\"\x1e\n\x06ViewId\x12\x14\n\x05value\
  2739. \x18\x01\x20\x01(\tR\x05value\"&\n\x0eRepeatedViewId\x12\x14\n\x05items\
  2740. \x18\x01\x20\x03(\tR\x05items\"\xaa\x01\n\x11UpdateViewPayload\x12\x17\n\
  2741. \x07view_id\x18\x01\x20\x01(\tR\x06viewId\x12\x14\n\x04name\x18\x02\x20\
  2742. \x01(\tH\0R\x04name\x12\x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\x04desc\
  2743. \x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\x02R\tthumbnailB\r\n\x0bone_of\
  2744. _nameB\r\n\x0bone_of_descB\x12\n\x10one_of_thumbnail\"\xa9\x01\n\x10Upda\
  2745. teViewParams\x12\x17\n\x07view_id\x18\x01\x20\x01(\tR\x06viewId\x12\x14\
  2746. \n\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\x14\n\x04desc\x18\x03\x20\
  2747. \x01(\tH\x01R\x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\x02R\tthu\
  2748. mbnailB\r\n\x0bone_of_nameB\r\n\x0bone_of_descB\x12\n\x10one_of_thumbnai\
  2749. l\"y\n\x15MoveFolderItemPayload\x12\x17\n\x07item_id\x18\x01\x20\x01(\tR\
  2750. \x06itemId\x12\x12\n\x04from\x18\x02\x20\x01(\x05R\x04from\x12\x0e\n\x02\
  2751. to\x18\x03\x20\x01(\x05R\x02to\x12#\n\x02ty\x18\x04\x20\x01(\x0e2\x13.Mo\
  2752. veFolderItemTypeR\x02ty*'\n\x0cViewDataType\x12\r\n\tTextBlock\x10\0\x12\
  2753. \x08\n\x04Grid\x10\x01*/\n\x12MoveFolderItemType\x12\x0b\n\x07MoveApp\
  2754. \x10\0\x12\x0c\n\x08MoveView\x10\x01b\x06proto3\
  2755. ";
  2756. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  2757. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  2758. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  2759. }
  2760. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  2761. file_descriptor_proto_lazy.get(|| {
  2762. parse_descriptor_proto()
  2763. })
  2764. }