view.rs 88 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643
  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 view_type: ViewType,
  29. pub version: i64,
  30. pub belongings: ::protobuf::SingularPtrField<RepeatedView>,
  31. pub modified_time: i64,
  32. pub create_time: i64,
  33. // special fields
  34. pub unknown_fields: ::protobuf::UnknownFields,
  35. pub cached_size: ::protobuf::CachedSize,
  36. }
  37. impl<'a> ::std::default::Default for &'a View {
  38. fn default() -> &'a View {
  39. <View as ::protobuf::Message>::default_instance()
  40. }
  41. }
  42. impl View {
  43. pub fn new() -> View {
  44. ::std::default::Default::default()
  45. }
  46. // string id = 1;
  47. pub fn get_id(&self) -> &str {
  48. &self.id
  49. }
  50. pub fn clear_id(&mut self) {
  51. self.id.clear();
  52. }
  53. // Param is passed by value, moved
  54. pub fn set_id(&mut self, v: ::std::string::String) {
  55. self.id = v;
  56. }
  57. // Mutable pointer to the field.
  58. // If field is not initialized, it is initialized with default value first.
  59. pub fn mut_id(&mut self) -> &mut ::std::string::String {
  60. &mut self.id
  61. }
  62. // Take field
  63. pub fn take_id(&mut self) -> ::std::string::String {
  64. ::std::mem::replace(&mut self.id, ::std::string::String::new())
  65. }
  66. // string belong_to_id = 2;
  67. pub fn get_belong_to_id(&self) -> &str {
  68. &self.belong_to_id
  69. }
  70. pub fn clear_belong_to_id(&mut self) {
  71. self.belong_to_id.clear();
  72. }
  73. // Param is passed by value, moved
  74. pub fn set_belong_to_id(&mut self, v: ::std::string::String) {
  75. self.belong_to_id = v;
  76. }
  77. // Mutable pointer to the field.
  78. // If field is not initialized, it is initialized with default value first.
  79. pub fn mut_belong_to_id(&mut self) -> &mut ::std::string::String {
  80. &mut self.belong_to_id
  81. }
  82. // Take field
  83. pub fn take_belong_to_id(&mut self) -> ::std::string::String {
  84. ::std::mem::replace(&mut self.belong_to_id, ::std::string::String::new())
  85. }
  86. // string name = 3;
  87. pub fn get_name(&self) -> &str {
  88. &self.name
  89. }
  90. pub fn clear_name(&mut self) {
  91. self.name.clear();
  92. }
  93. // Param is passed by value, moved
  94. pub fn set_name(&mut self, v: ::std::string::String) {
  95. self.name = v;
  96. }
  97. // Mutable pointer to the field.
  98. // If field is not initialized, it is initialized with default value first.
  99. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  100. &mut self.name
  101. }
  102. // Take field
  103. pub fn take_name(&mut self) -> ::std::string::String {
  104. ::std::mem::replace(&mut self.name, ::std::string::String::new())
  105. }
  106. // string desc = 4;
  107. pub fn get_desc(&self) -> &str {
  108. &self.desc
  109. }
  110. pub fn clear_desc(&mut self) {
  111. self.desc.clear();
  112. }
  113. // Param is passed by value, moved
  114. pub fn set_desc(&mut self, v: ::std::string::String) {
  115. self.desc = v;
  116. }
  117. // Mutable pointer to the field.
  118. // If field is not initialized, it is initialized with default value first.
  119. pub fn mut_desc(&mut self) -> &mut ::std::string::String {
  120. &mut self.desc
  121. }
  122. // Take field
  123. pub fn take_desc(&mut self) -> ::std::string::String {
  124. ::std::mem::replace(&mut self.desc, ::std::string::String::new())
  125. }
  126. // .ViewType view_type = 5;
  127. pub fn get_view_type(&self) -> ViewType {
  128. self.view_type
  129. }
  130. pub fn clear_view_type(&mut self) {
  131. self.view_type = ViewType::Blank;
  132. }
  133. // Param is passed by value, moved
  134. pub fn set_view_type(&mut self, v: ViewType) {
  135. self.view_type = v;
  136. }
  137. // int64 version = 6;
  138. pub fn get_version(&self) -> i64 {
  139. self.version
  140. }
  141. pub fn clear_version(&mut self) {
  142. self.version = 0;
  143. }
  144. // Param is passed by value, moved
  145. pub fn set_version(&mut self, v: i64) {
  146. self.version = v;
  147. }
  148. // .RepeatedView belongings = 7;
  149. pub fn get_belongings(&self) -> &RepeatedView {
  150. self.belongings.as_ref().unwrap_or_else(|| <RepeatedView as ::protobuf::Message>::default_instance())
  151. }
  152. pub fn clear_belongings(&mut self) {
  153. self.belongings.clear();
  154. }
  155. pub fn has_belongings(&self) -> bool {
  156. self.belongings.is_some()
  157. }
  158. // Param is passed by value, moved
  159. pub fn set_belongings(&mut self, v: RepeatedView) {
  160. self.belongings = ::protobuf::SingularPtrField::some(v);
  161. }
  162. // Mutable pointer to the field.
  163. // If field is not initialized, it is initialized with default value first.
  164. pub fn mut_belongings(&mut self) -> &mut RepeatedView {
  165. if self.belongings.is_none() {
  166. self.belongings.set_default();
  167. }
  168. self.belongings.as_mut().unwrap()
  169. }
  170. // Take field
  171. pub fn take_belongings(&mut self) -> RepeatedView {
  172. self.belongings.take().unwrap_or_else(|| RepeatedView::new())
  173. }
  174. // int64 modified_time = 8;
  175. pub fn get_modified_time(&self) -> i64 {
  176. self.modified_time
  177. }
  178. pub fn clear_modified_time(&mut self) {
  179. self.modified_time = 0;
  180. }
  181. // Param is passed by value, moved
  182. pub fn set_modified_time(&mut self, v: i64) {
  183. self.modified_time = v;
  184. }
  185. // int64 create_time = 9;
  186. pub fn get_create_time(&self) -> i64 {
  187. self.create_time
  188. }
  189. pub fn clear_create_time(&mut self) {
  190. self.create_time = 0;
  191. }
  192. // Param is passed by value, moved
  193. pub fn set_create_time(&mut self, v: i64) {
  194. self.create_time = v;
  195. }
  196. }
  197. impl ::protobuf::Message for View {
  198. fn is_initialized(&self) -> bool {
  199. for v in &self.belongings {
  200. if !v.is_initialized() {
  201. return false;
  202. }
  203. };
  204. true
  205. }
  206. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  207. while !is.eof()? {
  208. let (field_number, wire_type) = is.read_tag_unpack()?;
  209. match field_number {
  210. 1 => {
  211. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?;
  212. },
  213. 2 => {
  214. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.belong_to_id)?;
  215. },
  216. 3 => {
  217. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
  218. },
  219. 4 => {
  220. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.desc)?;
  221. },
  222. 5 => {
  223. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.view_type, 5, &mut self.unknown_fields)?
  224. },
  225. 6 => {
  226. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  227. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  228. }
  229. let tmp = is.read_int64()?;
  230. self.version = tmp;
  231. },
  232. 7 => {
  233. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.belongings)?;
  234. },
  235. 8 => {
  236. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  237. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  238. }
  239. let tmp = is.read_int64()?;
  240. self.modified_time = tmp;
  241. },
  242. 9 => {
  243. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  244. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  245. }
  246. let tmp = is.read_int64()?;
  247. self.create_time = tmp;
  248. },
  249. _ => {
  250. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  251. },
  252. };
  253. }
  254. ::std::result::Result::Ok(())
  255. }
  256. // Compute sizes of nested messages
  257. #[allow(unused_variables)]
  258. fn compute_size(&self) -> u32 {
  259. let mut my_size = 0;
  260. if !self.id.is_empty() {
  261. my_size += ::protobuf::rt::string_size(1, &self.id);
  262. }
  263. if !self.belong_to_id.is_empty() {
  264. my_size += ::protobuf::rt::string_size(2, &self.belong_to_id);
  265. }
  266. if !self.name.is_empty() {
  267. my_size += ::protobuf::rt::string_size(3, &self.name);
  268. }
  269. if !self.desc.is_empty() {
  270. my_size += ::protobuf::rt::string_size(4, &self.desc);
  271. }
  272. if self.view_type != ViewType::Blank {
  273. my_size += ::protobuf::rt::enum_size(5, self.view_type);
  274. }
  275. if self.version != 0 {
  276. my_size += ::protobuf::rt::value_size(6, self.version, ::protobuf::wire_format::WireTypeVarint);
  277. }
  278. if let Some(ref v) = self.belongings.as_ref() {
  279. let len = v.compute_size();
  280. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  281. }
  282. if self.modified_time != 0 {
  283. my_size += ::protobuf::rt::value_size(8, self.modified_time, ::protobuf::wire_format::WireTypeVarint);
  284. }
  285. if self.create_time != 0 {
  286. my_size += ::protobuf::rt::value_size(9, self.create_time, ::protobuf::wire_format::WireTypeVarint);
  287. }
  288. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  289. self.cached_size.set(my_size);
  290. my_size
  291. }
  292. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  293. if !self.id.is_empty() {
  294. os.write_string(1, &self.id)?;
  295. }
  296. if !self.belong_to_id.is_empty() {
  297. os.write_string(2, &self.belong_to_id)?;
  298. }
  299. if !self.name.is_empty() {
  300. os.write_string(3, &self.name)?;
  301. }
  302. if !self.desc.is_empty() {
  303. os.write_string(4, &self.desc)?;
  304. }
  305. if self.view_type != ViewType::Blank {
  306. os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.view_type))?;
  307. }
  308. if self.version != 0 {
  309. os.write_int64(6, self.version)?;
  310. }
  311. if let Some(ref v) = self.belongings.as_ref() {
  312. os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  313. os.write_raw_varint32(v.get_cached_size())?;
  314. v.write_to_with_cached_sizes(os)?;
  315. }
  316. if self.modified_time != 0 {
  317. os.write_int64(8, self.modified_time)?;
  318. }
  319. if self.create_time != 0 {
  320. os.write_int64(9, self.create_time)?;
  321. }
  322. os.write_unknown_fields(self.get_unknown_fields())?;
  323. ::std::result::Result::Ok(())
  324. }
  325. fn get_cached_size(&self) -> u32 {
  326. self.cached_size.get()
  327. }
  328. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  329. &self.unknown_fields
  330. }
  331. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  332. &mut self.unknown_fields
  333. }
  334. fn as_any(&self) -> &dyn (::std::any::Any) {
  335. self as &dyn (::std::any::Any)
  336. }
  337. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  338. self as &mut dyn (::std::any::Any)
  339. }
  340. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  341. self
  342. }
  343. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  344. Self::descriptor_static()
  345. }
  346. fn new() -> View {
  347. View::new()
  348. }
  349. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  350. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  351. descriptor.get(|| {
  352. let mut fields = ::std::vec::Vec::new();
  353. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  354. "id",
  355. |m: &View| { &m.id },
  356. |m: &mut View| { &mut m.id },
  357. ));
  358. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  359. "belong_to_id",
  360. |m: &View| { &m.belong_to_id },
  361. |m: &mut View| { &mut m.belong_to_id },
  362. ));
  363. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  364. "name",
  365. |m: &View| { &m.name },
  366. |m: &mut View| { &mut m.name },
  367. ));
  368. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  369. "desc",
  370. |m: &View| { &m.desc },
  371. |m: &mut View| { &mut m.desc },
  372. ));
  373. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ViewType>>(
  374. "view_type",
  375. |m: &View| { &m.view_type },
  376. |m: &mut View| { &mut m.view_type },
  377. ));
  378. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
  379. "version",
  380. |m: &View| { &m.version },
  381. |m: &mut View| { &mut m.version },
  382. ));
  383. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<RepeatedView>>(
  384. "belongings",
  385. |m: &View| { &m.belongings },
  386. |m: &mut View| { &mut m.belongings },
  387. ));
  388. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
  389. "modified_time",
  390. |m: &View| { &m.modified_time },
  391. |m: &mut View| { &mut m.modified_time },
  392. ));
  393. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
  394. "create_time",
  395. |m: &View| { &m.create_time },
  396. |m: &mut View| { &mut m.create_time },
  397. ));
  398. ::protobuf::reflect::MessageDescriptor::new_pb_name::<View>(
  399. "View",
  400. fields,
  401. file_descriptor_proto()
  402. )
  403. })
  404. }
  405. fn default_instance() -> &'static View {
  406. static instance: ::protobuf::rt::LazyV2<View> = ::protobuf::rt::LazyV2::INIT;
  407. instance.get(View::new)
  408. }
  409. }
  410. impl ::protobuf::Clear for View {
  411. fn clear(&mut self) {
  412. self.id.clear();
  413. self.belong_to_id.clear();
  414. self.name.clear();
  415. self.desc.clear();
  416. self.view_type = ViewType::Blank;
  417. self.version = 0;
  418. self.belongings.clear();
  419. self.modified_time = 0;
  420. self.create_time = 0;
  421. self.unknown_fields.clear();
  422. }
  423. }
  424. impl ::std::fmt::Debug for View {
  425. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  426. ::protobuf::text_format::fmt(self, f)
  427. }
  428. }
  429. impl ::protobuf::reflect::ProtobufValue for View {
  430. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  431. ::protobuf::reflect::ReflectValueRef::Message(self)
  432. }
  433. }
  434. #[derive(PartialEq,Clone,Default)]
  435. pub struct RepeatedView {
  436. // message fields
  437. pub items: ::protobuf::RepeatedField<View>,
  438. // special fields
  439. pub unknown_fields: ::protobuf::UnknownFields,
  440. pub cached_size: ::protobuf::CachedSize,
  441. }
  442. impl<'a> ::std::default::Default for &'a RepeatedView {
  443. fn default() -> &'a RepeatedView {
  444. <RepeatedView as ::protobuf::Message>::default_instance()
  445. }
  446. }
  447. impl RepeatedView {
  448. pub fn new() -> RepeatedView {
  449. ::std::default::Default::default()
  450. }
  451. // repeated .View items = 1;
  452. pub fn get_items(&self) -> &[View] {
  453. &self.items
  454. }
  455. pub fn clear_items(&mut self) {
  456. self.items.clear();
  457. }
  458. // Param is passed by value, moved
  459. pub fn set_items(&mut self, v: ::protobuf::RepeatedField<View>) {
  460. self.items = v;
  461. }
  462. // Mutable pointer to the field.
  463. pub fn mut_items(&mut self) -> &mut ::protobuf::RepeatedField<View> {
  464. &mut self.items
  465. }
  466. // Take field
  467. pub fn take_items(&mut self) -> ::protobuf::RepeatedField<View> {
  468. ::std::mem::replace(&mut self.items, ::protobuf::RepeatedField::new())
  469. }
  470. }
  471. impl ::protobuf::Message for RepeatedView {
  472. fn is_initialized(&self) -> bool {
  473. for v in &self.items {
  474. if !v.is_initialized() {
  475. return false;
  476. }
  477. };
  478. true
  479. }
  480. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  481. while !is.eof()? {
  482. let (field_number, wire_type) = is.read_tag_unpack()?;
  483. match field_number {
  484. 1 => {
  485. ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.items)?;
  486. },
  487. _ => {
  488. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  489. },
  490. };
  491. }
  492. ::std::result::Result::Ok(())
  493. }
  494. // Compute sizes of nested messages
  495. #[allow(unused_variables)]
  496. fn compute_size(&self) -> u32 {
  497. let mut my_size = 0;
  498. for value in &self.items {
  499. let len = value.compute_size();
  500. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  501. };
  502. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  503. self.cached_size.set(my_size);
  504. my_size
  505. }
  506. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  507. for v in &self.items {
  508. os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  509. os.write_raw_varint32(v.get_cached_size())?;
  510. v.write_to_with_cached_sizes(os)?;
  511. };
  512. os.write_unknown_fields(self.get_unknown_fields())?;
  513. ::std::result::Result::Ok(())
  514. }
  515. fn get_cached_size(&self) -> u32 {
  516. self.cached_size.get()
  517. }
  518. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  519. &self.unknown_fields
  520. }
  521. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  522. &mut self.unknown_fields
  523. }
  524. fn as_any(&self) -> &dyn (::std::any::Any) {
  525. self as &dyn (::std::any::Any)
  526. }
  527. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  528. self as &mut dyn (::std::any::Any)
  529. }
  530. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  531. self
  532. }
  533. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  534. Self::descriptor_static()
  535. }
  536. fn new() -> RepeatedView {
  537. RepeatedView::new()
  538. }
  539. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  540. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  541. descriptor.get(|| {
  542. let mut fields = ::std::vec::Vec::new();
  543. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<View>>(
  544. "items",
  545. |m: &RepeatedView| { &m.items },
  546. |m: &mut RepeatedView| { &mut m.items },
  547. ));
  548. ::protobuf::reflect::MessageDescriptor::new_pb_name::<RepeatedView>(
  549. "RepeatedView",
  550. fields,
  551. file_descriptor_proto()
  552. )
  553. })
  554. }
  555. fn default_instance() -> &'static RepeatedView {
  556. static instance: ::protobuf::rt::LazyV2<RepeatedView> = ::protobuf::rt::LazyV2::INIT;
  557. instance.get(RepeatedView::new)
  558. }
  559. }
  560. impl ::protobuf::Clear for RepeatedView {
  561. fn clear(&mut self) {
  562. self.items.clear();
  563. self.unknown_fields.clear();
  564. }
  565. }
  566. impl ::std::fmt::Debug for RepeatedView {
  567. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  568. ::protobuf::text_format::fmt(self, f)
  569. }
  570. }
  571. impl ::protobuf::reflect::ProtobufValue for RepeatedView {
  572. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  573. ::protobuf::reflect::ReflectValueRef::Message(self)
  574. }
  575. }
  576. #[derive(PartialEq,Clone,Default)]
  577. pub struct CreateViewPayload {
  578. // message fields
  579. pub belong_to_id: ::std::string::String,
  580. pub name: ::std::string::String,
  581. pub desc: ::std::string::String,
  582. pub view_type: ViewType,
  583. // message oneof groups
  584. pub one_of_thumbnail: ::std::option::Option<CreateViewPayload_oneof_one_of_thumbnail>,
  585. // special fields
  586. pub unknown_fields: ::protobuf::UnknownFields,
  587. pub cached_size: ::protobuf::CachedSize,
  588. }
  589. impl<'a> ::std::default::Default for &'a CreateViewPayload {
  590. fn default() -> &'a CreateViewPayload {
  591. <CreateViewPayload as ::protobuf::Message>::default_instance()
  592. }
  593. }
  594. #[derive(Clone,PartialEq,Debug)]
  595. pub enum CreateViewPayload_oneof_one_of_thumbnail {
  596. thumbnail(::std::string::String),
  597. }
  598. impl CreateViewPayload {
  599. pub fn new() -> CreateViewPayload {
  600. ::std::default::Default::default()
  601. }
  602. // string belong_to_id = 1;
  603. pub fn get_belong_to_id(&self) -> &str {
  604. &self.belong_to_id
  605. }
  606. pub fn clear_belong_to_id(&mut self) {
  607. self.belong_to_id.clear();
  608. }
  609. // Param is passed by value, moved
  610. pub fn set_belong_to_id(&mut self, v: ::std::string::String) {
  611. self.belong_to_id = v;
  612. }
  613. // Mutable pointer to the field.
  614. // If field is not initialized, it is initialized with default value first.
  615. pub fn mut_belong_to_id(&mut self) -> &mut ::std::string::String {
  616. &mut self.belong_to_id
  617. }
  618. // Take field
  619. pub fn take_belong_to_id(&mut self) -> ::std::string::String {
  620. ::std::mem::replace(&mut self.belong_to_id, ::std::string::String::new())
  621. }
  622. // string name = 2;
  623. pub fn get_name(&self) -> &str {
  624. &self.name
  625. }
  626. pub fn clear_name(&mut self) {
  627. self.name.clear();
  628. }
  629. // Param is passed by value, moved
  630. pub fn set_name(&mut self, v: ::std::string::String) {
  631. self.name = v;
  632. }
  633. // Mutable pointer to the field.
  634. // If field is not initialized, it is initialized with default value first.
  635. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  636. &mut self.name
  637. }
  638. // Take field
  639. pub fn take_name(&mut self) -> ::std::string::String {
  640. ::std::mem::replace(&mut self.name, ::std::string::String::new())
  641. }
  642. // string desc = 3;
  643. pub fn get_desc(&self) -> &str {
  644. &self.desc
  645. }
  646. pub fn clear_desc(&mut self) {
  647. self.desc.clear();
  648. }
  649. // Param is passed by value, moved
  650. pub fn set_desc(&mut self, v: ::std::string::String) {
  651. self.desc = v;
  652. }
  653. // Mutable pointer to the field.
  654. // If field is not initialized, it is initialized with default value first.
  655. pub fn mut_desc(&mut self) -> &mut ::std::string::String {
  656. &mut self.desc
  657. }
  658. // Take field
  659. pub fn take_desc(&mut self) -> ::std::string::String {
  660. ::std::mem::replace(&mut self.desc, ::std::string::String::new())
  661. }
  662. // string thumbnail = 4;
  663. pub fn get_thumbnail(&self) -> &str {
  664. match self.one_of_thumbnail {
  665. ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v)) => v,
  666. _ => "",
  667. }
  668. }
  669. pub fn clear_thumbnail(&mut self) {
  670. self.one_of_thumbnail = ::std::option::Option::None;
  671. }
  672. pub fn has_thumbnail(&self) -> bool {
  673. match self.one_of_thumbnail {
  674. ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(..)) => true,
  675. _ => false,
  676. }
  677. }
  678. // Param is passed by value, moved
  679. pub fn set_thumbnail(&mut self, v: ::std::string::String) {
  680. self.one_of_thumbnail = ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(v))
  681. }
  682. // Mutable pointer to the field.
  683. pub fn mut_thumbnail(&mut self) -> &mut ::std::string::String {
  684. if let ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(_)) = self.one_of_thumbnail {
  685. } else {
  686. self.one_of_thumbnail = ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(::std::string::String::new()));
  687. }
  688. match self.one_of_thumbnail {
  689. ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref mut v)) => v,
  690. _ => panic!(),
  691. }
  692. }
  693. // Take field
  694. pub fn take_thumbnail(&mut self) -> ::std::string::String {
  695. if self.has_thumbnail() {
  696. match self.one_of_thumbnail.take() {
  697. ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(v)) => v,
  698. _ => panic!(),
  699. }
  700. } else {
  701. ::std::string::String::new()
  702. }
  703. }
  704. // .ViewType view_type = 5;
  705. pub fn get_view_type(&self) -> ViewType {
  706. self.view_type
  707. }
  708. pub fn clear_view_type(&mut self) {
  709. self.view_type = ViewType::Blank;
  710. }
  711. // Param is passed by value, moved
  712. pub fn set_view_type(&mut self, v: ViewType) {
  713. self.view_type = v;
  714. }
  715. }
  716. impl ::protobuf::Message for CreateViewPayload {
  717. fn is_initialized(&self) -> bool {
  718. true
  719. }
  720. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  721. while !is.eof()? {
  722. let (field_number, wire_type) = is.read_tag_unpack()?;
  723. match field_number {
  724. 1 => {
  725. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.belong_to_id)?;
  726. },
  727. 2 => {
  728. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
  729. },
  730. 3 => {
  731. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.desc)?;
  732. },
  733. 4 => {
  734. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  735. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  736. }
  737. self.one_of_thumbnail = ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(is.read_string()?));
  738. },
  739. 5 => {
  740. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.view_type, 5, &mut self.unknown_fields)?
  741. },
  742. _ => {
  743. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  744. },
  745. };
  746. }
  747. ::std::result::Result::Ok(())
  748. }
  749. // Compute sizes of nested messages
  750. #[allow(unused_variables)]
  751. fn compute_size(&self) -> u32 {
  752. let mut my_size = 0;
  753. if !self.belong_to_id.is_empty() {
  754. my_size += ::protobuf::rt::string_size(1, &self.belong_to_id);
  755. }
  756. if !self.name.is_empty() {
  757. my_size += ::protobuf::rt::string_size(2, &self.name);
  758. }
  759. if !self.desc.is_empty() {
  760. my_size += ::protobuf::rt::string_size(3, &self.desc);
  761. }
  762. if self.view_type != ViewType::Blank {
  763. my_size += ::protobuf::rt::enum_size(5, self.view_type);
  764. }
  765. if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
  766. match v {
  767. &CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
  768. my_size += ::protobuf::rt::string_size(4, &v);
  769. },
  770. };
  771. }
  772. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  773. self.cached_size.set(my_size);
  774. my_size
  775. }
  776. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  777. if !self.belong_to_id.is_empty() {
  778. os.write_string(1, &self.belong_to_id)?;
  779. }
  780. if !self.name.is_empty() {
  781. os.write_string(2, &self.name)?;
  782. }
  783. if !self.desc.is_empty() {
  784. os.write_string(3, &self.desc)?;
  785. }
  786. if self.view_type != ViewType::Blank {
  787. os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.view_type))?;
  788. }
  789. if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
  790. match v {
  791. &CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
  792. os.write_string(4, v)?;
  793. },
  794. };
  795. }
  796. os.write_unknown_fields(self.get_unknown_fields())?;
  797. ::std::result::Result::Ok(())
  798. }
  799. fn get_cached_size(&self) -> u32 {
  800. self.cached_size.get()
  801. }
  802. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  803. &self.unknown_fields
  804. }
  805. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  806. &mut self.unknown_fields
  807. }
  808. fn as_any(&self) -> &dyn (::std::any::Any) {
  809. self as &dyn (::std::any::Any)
  810. }
  811. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  812. self as &mut dyn (::std::any::Any)
  813. }
  814. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  815. self
  816. }
  817. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  818. Self::descriptor_static()
  819. }
  820. fn new() -> CreateViewPayload {
  821. CreateViewPayload::new()
  822. }
  823. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  824. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  825. descriptor.get(|| {
  826. let mut fields = ::std::vec::Vec::new();
  827. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  828. "belong_to_id",
  829. |m: &CreateViewPayload| { &m.belong_to_id },
  830. |m: &mut CreateViewPayload| { &mut m.belong_to_id },
  831. ));
  832. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  833. "name",
  834. |m: &CreateViewPayload| { &m.name },
  835. |m: &mut CreateViewPayload| { &mut m.name },
  836. ));
  837. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  838. "desc",
  839. |m: &CreateViewPayload| { &m.desc },
  840. |m: &mut CreateViewPayload| { &mut m.desc },
  841. ));
  842. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  843. "thumbnail",
  844. CreateViewPayload::has_thumbnail,
  845. CreateViewPayload::get_thumbnail,
  846. ));
  847. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ViewType>>(
  848. "view_type",
  849. |m: &CreateViewPayload| { &m.view_type },
  850. |m: &mut CreateViewPayload| { &mut m.view_type },
  851. ));
  852. ::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewPayload>(
  853. "CreateViewPayload",
  854. fields,
  855. file_descriptor_proto()
  856. )
  857. })
  858. }
  859. fn default_instance() -> &'static CreateViewPayload {
  860. static instance: ::protobuf::rt::LazyV2<CreateViewPayload> = ::protobuf::rt::LazyV2::INIT;
  861. instance.get(CreateViewPayload::new)
  862. }
  863. }
  864. impl ::protobuf::Clear for CreateViewPayload {
  865. fn clear(&mut self) {
  866. self.belong_to_id.clear();
  867. self.name.clear();
  868. self.desc.clear();
  869. self.one_of_thumbnail = ::std::option::Option::None;
  870. self.view_type = ViewType::Blank;
  871. self.unknown_fields.clear();
  872. }
  873. }
  874. impl ::std::fmt::Debug for CreateViewPayload {
  875. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  876. ::protobuf::text_format::fmt(self, f)
  877. }
  878. }
  879. impl ::protobuf::reflect::ProtobufValue for CreateViewPayload {
  880. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  881. ::protobuf::reflect::ReflectValueRef::Message(self)
  882. }
  883. }
  884. #[derive(PartialEq,Clone,Default)]
  885. pub struct CreateViewParams {
  886. // message fields
  887. pub belong_to_id: ::std::string::String,
  888. pub name: ::std::string::String,
  889. pub desc: ::std::string::String,
  890. pub thumbnail: ::std::string::String,
  891. pub view_type: ViewType,
  892. pub view_data: ::std::string::String,
  893. pub view_id: ::std::string::String,
  894. // special fields
  895. pub unknown_fields: ::protobuf::UnknownFields,
  896. pub cached_size: ::protobuf::CachedSize,
  897. }
  898. impl<'a> ::std::default::Default for &'a CreateViewParams {
  899. fn default() -> &'a CreateViewParams {
  900. <CreateViewParams as ::protobuf::Message>::default_instance()
  901. }
  902. }
  903. impl CreateViewParams {
  904. pub fn new() -> CreateViewParams {
  905. ::std::default::Default::default()
  906. }
  907. // string belong_to_id = 1;
  908. pub fn get_belong_to_id(&self) -> &str {
  909. &self.belong_to_id
  910. }
  911. pub fn clear_belong_to_id(&mut self) {
  912. self.belong_to_id.clear();
  913. }
  914. // Param is passed by value, moved
  915. pub fn set_belong_to_id(&mut self, v: ::std::string::String) {
  916. self.belong_to_id = v;
  917. }
  918. // Mutable pointer to the field.
  919. // If field is not initialized, it is initialized with default value first.
  920. pub fn mut_belong_to_id(&mut self) -> &mut ::std::string::String {
  921. &mut self.belong_to_id
  922. }
  923. // Take field
  924. pub fn take_belong_to_id(&mut self) -> ::std::string::String {
  925. ::std::mem::replace(&mut self.belong_to_id, ::std::string::String::new())
  926. }
  927. // string name = 2;
  928. pub fn get_name(&self) -> &str {
  929. &self.name
  930. }
  931. pub fn clear_name(&mut self) {
  932. self.name.clear();
  933. }
  934. // Param is passed by value, moved
  935. pub fn set_name(&mut self, v: ::std::string::String) {
  936. self.name = v;
  937. }
  938. // Mutable pointer to the field.
  939. // If field is not initialized, it is initialized with default value first.
  940. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  941. &mut self.name
  942. }
  943. // Take field
  944. pub fn take_name(&mut self) -> ::std::string::String {
  945. ::std::mem::replace(&mut self.name, ::std::string::String::new())
  946. }
  947. // string desc = 3;
  948. pub fn get_desc(&self) -> &str {
  949. &self.desc
  950. }
  951. pub fn clear_desc(&mut self) {
  952. self.desc.clear();
  953. }
  954. // Param is passed by value, moved
  955. pub fn set_desc(&mut self, v: ::std::string::String) {
  956. self.desc = v;
  957. }
  958. // Mutable pointer to the field.
  959. // If field is not initialized, it is initialized with default value first.
  960. pub fn mut_desc(&mut self) -> &mut ::std::string::String {
  961. &mut self.desc
  962. }
  963. // Take field
  964. pub fn take_desc(&mut self) -> ::std::string::String {
  965. ::std::mem::replace(&mut self.desc, ::std::string::String::new())
  966. }
  967. // string thumbnail = 4;
  968. pub fn get_thumbnail(&self) -> &str {
  969. &self.thumbnail
  970. }
  971. pub fn clear_thumbnail(&mut self) {
  972. self.thumbnail.clear();
  973. }
  974. // Param is passed by value, moved
  975. pub fn set_thumbnail(&mut self, v: ::std::string::String) {
  976. self.thumbnail = v;
  977. }
  978. // Mutable pointer to the field.
  979. // If field is not initialized, it is initialized with default value first.
  980. pub fn mut_thumbnail(&mut self) -> &mut ::std::string::String {
  981. &mut self.thumbnail
  982. }
  983. // Take field
  984. pub fn take_thumbnail(&mut self) -> ::std::string::String {
  985. ::std::mem::replace(&mut self.thumbnail, ::std::string::String::new())
  986. }
  987. // .ViewType view_type = 5;
  988. pub fn get_view_type(&self) -> ViewType {
  989. self.view_type
  990. }
  991. pub fn clear_view_type(&mut self) {
  992. self.view_type = ViewType::Blank;
  993. }
  994. // Param is passed by value, moved
  995. pub fn set_view_type(&mut self, v: ViewType) {
  996. self.view_type = v;
  997. }
  998. // string view_data = 6;
  999. pub fn get_view_data(&self) -> &str {
  1000. &self.view_data
  1001. }
  1002. pub fn clear_view_data(&mut self) {
  1003. self.view_data.clear();
  1004. }
  1005. // Param is passed by value, moved
  1006. pub fn set_view_data(&mut self, v: ::std::string::String) {
  1007. self.view_data = v;
  1008. }
  1009. // Mutable pointer to the field.
  1010. // If field is not initialized, it is initialized with default value first.
  1011. pub fn mut_view_data(&mut self) -> &mut ::std::string::String {
  1012. &mut self.view_data
  1013. }
  1014. // Take field
  1015. pub fn take_view_data(&mut self) -> ::std::string::String {
  1016. ::std::mem::replace(&mut self.view_data, ::std::string::String::new())
  1017. }
  1018. // string view_id = 7;
  1019. pub fn get_view_id(&self) -> &str {
  1020. &self.view_id
  1021. }
  1022. pub fn clear_view_id(&mut self) {
  1023. self.view_id.clear();
  1024. }
  1025. // Param is passed by value, moved
  1026. pub fn set_view_id(&mut self, v: ::std::string::String) {
  1027. self.view_id = v;
  1028. }
  1029. // Mutable pointer to the field.
  1030. // If field is not initialized, it is initialized with default value first.
  1031. pub fn mut_view_id(&mut self) -> &mut ::std::string::String {
  1032. &mut self.view_id
  1033. }
  1034. // Take field
  1035. pub fn take_view_id(&mut self) -> ::std::string::String {
  1036. ::std::mem::replace(&mut self.view_id, ::std::string::String::new())
  1037. }
  1038. }
  1039. impl ::protobuf::Message for CreateViewParams {
  1040. fn is_initialized(&self) -> bool {
  1041. true
  1042. }
  1043. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1044. while !is.eof()? {
  1045. let (field_number, wire_type) = is.read_tag_unpack()?;
  1046. match field_number {
  1047. 1 => {
  1048. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.belong_to_id)?;
  1049. },
  1050. 2 => {
  1051. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
  1052. },
  1053. 3 => {
  1054. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.desc)?;
  1055. },
  1056. 4 => {
  1057. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.thumbnail)?;
  1058. },
  1059. 5 => {
  1060. ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.view_type, 5, &mut self.unknown_fields)?
  1061. },
  1062. 6 => {
  1063. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_data)?;
  1064. },
  1065. 7 => {
  1066. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_id)?;
  1067. },
  1068. _ => {
  1069. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1070. },
  1071. };
  1072. }
  1073. ::std::result::Result::Ok(())
  1074. }
  1075. // Compute sizes of nested messages
  1076. #[allow(unused_variables)]
  1077. fn compute_size(&self) -> u32 {
  1078. let mut my_size = 0;
  1079. if !self.belong_to_id.is_empty() {
  1080. my_size += ::protobuf::rt::string_size(1, &self.belong_to_id);
  1081. }
  1082. if !self.name.is_empty() {
  1083. my_size += ::protobuf::rt::string_size(2, &self.name);
  1084. }
  1085. if !self.desc.is_empty() {
  1086. my_size += ::protobuf::rt::string_size(3, &self.desc);
  1087. }
  1088. if !self.thumbnail.is_empty() {
  1089. my_size += ::protobuf::rt::string_size(4, &self.thumbnail);
  1090. }
  1091. if self.view_type != ViewType::Blank {
  1092. my_size += ::protobuf::rt::enum_size(5, self.view_type);
  1093. }
  1094. if !self.view_data.is_empty() {
  1095. my_size += ::protobuf::rt::string_size(6, &self.view_data);
  1096. }
  1097. if !self.view_id.is_empty() {
  1098. my_size += ::protobuf::rt::string_size(7, &self.view_id);
  1099. }
  1100. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1101. self.cached_size.set(my_size);
  1102. my_size
  1103. }
  1104. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1105. if !self.belong_to_id.is_empty() {
  1106. os.write_string(1, &self.belong_to_id)?;
  1107. }
  1108. if !self.name.is_empty() {
  1109. os.write_string(2, &self.name)?;
  1110. }
  1111. if !self.desc.is_empty() {
  1112. os.write_string(3, &self.desc)?;
  1113. }
  1114. if !self.thumbnail.is_empty() {
  1115. os.write_string(4, &self.thumbnail)?;
  1116. }
  1117. if self.view_type != ViewType::Blank {
  1118. os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.view_type))?;
  1119. }
  1120. if !self.view_data.is_empty() {
  1121. os.write_string(6, &self.view_data)?;
  1122. }
  1123. if !self.view_id.is_empty() {
  1124. os.write_string(7, &self.view_id)?;
  1125. }
  1126. os.write_unknown_fields(self.get_unknown_fields())?;
  1127. ::std::result::Result::Ok(())
  1128. }
  1129. fn get_cached_size(&self) -> u32 {
  1130. self.cached_size.get()
  1131. }
  1132. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1133. &self.unknown_fields
  1134. }
  1135. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1136. &mut self.unknown_fields
  1137. }
  1138. fn as_any(&self) -> &dyn (::std::any::Any) {
  1139. self as &dyn (::std::any::Any)
  1140. }
  1141. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1142. self as &mut dyn (::std::any::Any)
  1143. }
  1144. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1145. self
  1146. }
  1147. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1148. Self::descriptor_static()
  1149. }
  1150. fn new() -> CreateViewParams {
  1151. CreateViewParams::new()
  1152. }
  1153. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1154. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  1155. descriptor.get(|| {
  1156. let mut fields = ::std::vec::Vec::new();
  1157. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1158. "belong_to_id",
  1159. |m: &CreateViewParams| { &m.belong_to_id },
  1160. |m: &mut CreateViewParams| { &mut m.belong_to_id },
  1161. ));
  1162. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1163. "name",
  1164. |m: &CreateViewParams| { &m.name },
  1165. |m: &mut CreateViewParams| { &mut m.name },
  1166. ));
  1167. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1168. "desc",
  1169. |m: &CreateViewParams| { &m.desc },
  1170. |m: &mut CreateViewParams| { &mut m.desc },
  1171. ));
  1172. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1173. "thumbnail",
  1174. |m: &CreateViewParams| { &m.thumbnail },
  1175. |m: &mut CreateViewParams| { &mut m.thumbnail },
  1176. ));
  1177. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ViewType>>(
  1178. "view_type",
  1179. |m: &CreateViewParams| { &m.view_type },
  1180. |m: &mut CreateViewParams| { &mut m.view_type },
  1181. ));
  1182. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1183. "view_data",
  1184. |m: &CreateViewParams| { &m.view_data },
  1185. |m: &mut CreateViewParams| { &mut m.view_data },
  1186. ));
  1187. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1188. "view_id",
  1189. |m: &CreateViewParams| { &m.view_id },
  1190. |m: &mut CreateViewParams| { &mut m.view_id },
  1191. ));
  1192. ::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewParams>(
  1193. "CreateViewParams",
  1194. fields,
  1195. file_descriptor_proto()
  1196. )
  1197. })
  1198. }
  1199. fn default_instance() -> &'static CreateViewParams {
  1200. static instance: ::protobuf::rt::LazyV2<CreateViewParams> = ::protobuf::rt::LazyV2::INIT;
  1201. instance.get(CreateViewParams::new)
  1202. }
  1203. }
  1204. impl ::protobuf::Clear for CreateViewParams {
  1205. fn clear(&mut self) {
  1206. self.belong_to_id.clear();
  1207. self.name.clear();
  1208. self.desc.clear();
  1209. self.thumbnail.clear();
  1210. self.view_type = ViewType::Blank;
  1211. self.view_data.clear();
  1212. self.view_id.clear();
  1213. self.unknown_fields.clear();
  1214. }
  1215. }
  1216. impl ::std::fmt::Debug for CreateViewParams {
  1217. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1218. ::protobuf::text_format::fmt(self, f)
  1219. }
  1220. }
  1221. impl ::protobuf::reflect::ProtobufValue for CreateViewParams {
  1222. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  1223. ::protobuf::reflect::ReflectValueRef::Message(self)
  1224. }
  1225. }
  1226. #[derive(PartialEq,Clone,Default)]
  1227. pub struct ViewId {
  1228. // message fields
  1229. pub value: ::std::string::String,
  1230. // special fields
  1231. pub unknown_fields: ::protobuf::UnknownFields,
  1232. pub cached_size: ::protobuf::CachedSize,
  1233. }
  1234. impl<'a> ::std::default::Default for &'a ViewId {
  1235. fn default() -> &'a ViewId {
  1236. <ViewId as ::protobuf::Message>::default_instance()
  1237. }
  1238. }
  1239. impl ViewId {
  1240. pub fn new() -> ViewId {
  1241. ::std::default::Default::default()
  1242. }
  1243. // string value = 1;
  1244. pub fn get_value(&self) -> &str {
  1245. &self.value
  1246. }
  1247. pub fn clear_value(&mut self) {
  1248. self.value.clear();
  1249. }
  1250. // Param is passed by value, moved
  1251. pub fn set_value(&mut self, v: ::std::string::String) {
  1252. self.value = v;
  1253. }
  1254. // Mutable pointer to the field.
  1255. // If field is not initialized, it is initialized with default value first.
  1256. pub fn mut_value(&mut self) -> &mut ::std::string::String {
  1257. &mut self.value
  1258. }
  1259. // Take field
  1260. pub fn take_value(&mut self) -> ::std::string::String {
  1261. ::std::mem::replace(&mut self.value, ::std::string::String::new())
  1262. }
  1263. }
  1264. impl ::protobuf::Message for ViewId {
  1265. fn is_initialized(&self) -> bool {
  1266. true
  1267. }
  1268. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1269. while !is.eof()? {
  1270. let (field_number, wire_type) = is.read_tag_unpack()?;
  1271. match field_number {
  1272. 1 => {
  1273. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.value)?;
  1274. },
  1275. _ => {
  1276. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1277. },
  1278. };
  1279. }
  1280. ::std::result::Result::Ok(())
  1281. }
  1282. // Compute sizes of nested messages
  1283. #[allow(unused_variables)]
  1284. fn compute_size(&self) -> u32 {
  1285. let mut my_size = 0;
  1286. if !self.value.is_empty() {
  1287. my_size += ::protobuf::rt::string_size(1, &self.value);
  1288. }
  1289. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1290. self.cached_size.set(my_size);
  1291. my_size
  1292. }
  1293. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1294. if !self.value.is_empty() {
  1295. os.write_string(1, &self.value)?;
  1296. }
  1297. os.write_unknown_fields(self.get_unknown_fields())?;
  1298. ::std::result::Result::Ok(())
  1299. }
  1300. fn get_cached_size(&self) -> u32 {
  1301. self.cached_size.get()
  1302. }
  1303. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1304. &self.unknown_fields
  1305. }
  1306. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1307. &mut self.unknown_fields
  1308. }
  1309. fn as_any(&self) -> &dyn (::std::any::Any) {
  1310. self as &dyn (::std::any::Any)
  1311. }
  1312. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1313. self as &mut dyn (::std::any::Any)
  1314. }
  1315. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1316. self
  1317. }
  1318. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1319. Self::descriptor_static()
  1320. }
  1321. fn new() -> ViewId {
  1322. ViewId::new()
  1323. }
  1324. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1325. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  1326. descriptor.get(|| {
  1327. let mut fields = ::std::vec::Vec::new();
  1328. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1329. "value",
  1330. |m: &ViewId| { &m.value },
  1331. |m: &mut ViewId| { &mut m.value },
  1332. ));
  1333. ::protobuf::reflect::MessageDescriptor::new_pb_name::<ViewId>(
  1334. "ViewId",
  1335. fields,
  1336. file_descriptor_proto()
  1337. )
  1338. })
  1339. }
  1340. fn default_instance() -> &'static ViewId {
  1341. static instance: ::protobuf::rt::LazyV2<ViewId> = ::protobuf::rt::LazyV2::INIT;
  1342. instance.get(ViewId::new)
  1343. }
  1344. }
  1345. impl ::protobuf::Clear for ViewId {
  1346. fn clear(&mut self) {
  1347. self.value.clear();
  1348. self.unknown_fields.clear();
  1349. }
  1350. }
  1351. impl ::std::fmt::Debug for ViewId {
  1352. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1353. ::protobuf::text_format::fmt(self, f)
  1354. }
  1355. }
  1356. impl ::protobuf::reflect::ProtobufValue for ViewId {
  1357. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  1358. ::protobuf::reflect::ReflectValueRef::Message(self)
  1359. }
  1360. }
  1361. #[derive(PartialEq,Clone,Default)]
  1362. pub struct RepeatedViewId {
  1363. // message fields
  1364. pub items: ::protobuf::RepeatedField<::std::string::String>,
  1365. // special fields
  1366. pub unknown_fields: ::protobuf::UnknownFields,
  1367. pub cached_size: ::protobuf::CachedSize,
  1368. }
  1369. impl<'a> ::std::default::Default for &'a RepeatedViewId {
  1370. fn default() -> &'a RepeatedViewId {
  1371. <RepeatedViewId as ::protobuf::Message>::default_instance()
  1372. }
  1373. }
  1374. impl RepeatedViewId {
  1375. pub fn new() -> RepeatedViewId {
  1376. ::std::default::Default::default()
  1377. }
  1378. // repeated string items = 1;
  1379. pub fn get_items(&self) -> &[::std::string::String] {
  1380. &self.items
  1381. }
  1382. pub fn clear_items(&mut self) {
  1383. self.items.clear();
  1384. }
  1385. // Param is passed by value, moved
  1386. pub fn set_items(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
  1387. self.items = v;
  1388. }
  1389. // Mutable pointer to the field.
  1390. pub fn mut_items(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
  1391. &mut self.items
  1392. }
  1393. // Take field
  1394. pub fn take_items(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
  1395. ::std::mem::replace(&mut self.items, ::protobuf::RepeatedField::new())
  1396. }
  1397. }
  1398. impl ::protobuf::Message for RepeatedViewId {
  1399. fn is_initialized(&self) -> bool {
  1400. true
  1401. }
  1402. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1403. while !is.eof()? {
  1404. let (field_number, wire_type) = is.read_tag_unpack()?;
  1405. match field_number {
  1406. 1 => {
  1407. ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.items)?;
  1408. },
  1409. _ => {
  1410. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1411. },
  1412. };
  1413. }
  1414. ::std::result::Result::Ok(())
  1415. }
  1416. // Compute sizes of nested messages
  1417. #[allow(unused_variables)]
  1418. fn compute_size(&self) -> u32 {
  1419. let mut my_size = 0;
  1420. for value in &self.items {
  1421. my_size += ::protobuf::rt::string_size(1, &value);
  1422. };
  1423. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1424. self.cached_size.set(my_size);
  1425. my_size
  1426. }
  1427. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1428. for v in &self.items {
  1429. os.write_string(1, &v)?;
  1430. };
  1431. os.write_unknown_fields(self.get_unknown_fields())?;
  1432. ::std::result::Result::Ok(())
  1433. }
  1434. fn get_cached_size(&self) -> u32 {
  1435. self.cached_size.get()
  1436. }
  1437. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1438. &self.unknown_fields
  1439. }
  1440. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1441. &mut self.unknown_fields
  1442. }
  1443. fn as_any(&self) -> &dyn (::std::any::Any) {
  1444. self as &dyn (::std::any::Any)
  1445. }
  1446. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1447. self as &mut dyn (::std::any::Any)
  1448. }
  1449. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1450. self
  1451. }
  1452. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1453. Self::descriptor_static()
  1454. }
  1455. fn new() -> RepeatedViewId {
  1456. RepeatedViewId::new()
  1457. }
  1458. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1459. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  1460. descriptor.get(|| {
  1461. let mut fields = ::std::vec::Vec::new();
  1462. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1463. "items",
  1464. |m: &RepeatedViewId| { &m.items },
  1465. |m: &mut RepeatedViewId| { &mut m.items },
  1466. ));
  1467. ::protobuf::reflect::MessageDescriptor::new_pb_name::<RepeatedViewId>(
  1468. "RepeatedViewId",
  1469. fields,
  1470. file_descriptor_proto()
  1471. )
  1472. })
  1473. }
  1474. fn default_instance() -> &'static RepeatedViewId {
  1475. static instance: ::protobuf::rt::LazyV2<RepeatedViewId> = ::protobuf::rt::LazyV2::INIT;
  1476. instance.get(RepeatedViewId::new)
  1477. }
  1478. }
  1479. impl ::protobuf::Clear for RepeatedViewId {
  1480. fn clear(&mut self) {
  1481. self.items.clear();
  1482. self.unknown_fields.clear();
  1483. }
  1484. }
  1485. impl ::std::fmt::Debug for RepeatedViewId {
  1486. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1487. ::protobuf::text_format::fmt(self, f)
  1488. }
  1489. }
  1490. impl ::protobuf::reflect::ProtobufValue for RepeatedViewId {
  1491. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  1492. ::protobuf::reflect::ReflectValueRef::Message(self)
  1493. }
  1494. }
  1495. #[derive(PartialEq,Clone,Default)]
  1496. pub struct UpdateViewPayload {
  1497. // message fields
  1498. pub view_id: ::std::string::String,
  1499. // message oneof groups
  1500. pub one_of_name: ::std::option::Option<UpdateViewPayload_oneof_one_of_name>,
  1501. pub one_of_desc: ::std::option::Option<UpdateViewPayload_oneof_one_of_desc>,
  1502. pub one_of_thumbnail: ::std::option::Option<UpdateViewPayload_oneof_one_of_thumbnail>,
  1503. // special fields
  1504. pub unknown_fields: ::protobuf::UnknownFields,
  1505. pub cached_size: ::protobuf::CachedSize,
  1506. }
  1507. impl<'a> ::std::default::Default for &'a UpdateViewPayload {
  1508. fn default() -> &'a UpdateViewPayload {
  1509. <UpdateViewPayload as ::protobuf::Message>::default_instance()
  1510. }
  1511. }
  1512. #[derive(Clone,PartialEq,Debug)]
  1513. pub enum UpdateViewPayload_oneof_one_of_name {
  1514. name(::std::string::String),
  1515. }
  1516. #[derive(Clone,PartialEq,Debug)]
  1517. pub enum UpdateViewPayload_oneof_one_of_desc {
  1518. desc(::std::string::String),
  1519. }
  1520. #[derive(Clone,PartialEq,Debug)]
  1521. pub enum UpdateViewPayload_oneof_one_of_thumbnail {
  1522. thumbnail(::std::string::String),
  1523. }
  1524. impl UpdateViewPayload {
  1525. pub fn new() -> UpdateViewPayload {
  1526. ::std::default::Default::default()
  1527. }
  1528. // string view_id = 1;
  1529. pub fn get_view_id(&self) -> &str {
  1530. &self.view_id
  1531. }
  1532. pub fn clear_view_id(&mut self) {
  1533. self.view_id.clear();
  1534. }
  1535. // Param is passed by value, moved
  1536. pub fn set_view_id(&mut self, v: ::std::string::String) {
  1537. self.view_id = v;
  1538. }
  1539. // Mutable pointer to the field.
  1540. // If field is not initialized, it is initialized with default value first.
  1541. pub fn mut_view_id(&mut self) -> &mut ::std::string::String {
  1542. &mut self.view_id
  1543. }
  1544. // Take field
  1545. pub fn take_view_id(&mut self) -> ::std::string::String {
  1546. ::std::mem::replace(&mut self.view_id, ::std::string::String::new())
  1547. }
  1548. // string name = 2;
  1549. pub fn get_name(&self) -> &str {
  1550. match self.one_of_name {
  1551. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(ref v)) => v,
  1552. _ => "",
  1553. }
  1554. }
  1555. pub fn clear_name(&mut self) {
  1556. self.one_of_name = ::std::option::Option::None;
  1557. }
  1558. pub fn has_name(&self) -> bool {
  1559. match self.one_of_name {
  1560. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(..)) => true,
  1561. _ => false,
  1562. }
  1563. }
  1564. // Param is passed by value, moved
  1565. pub fn set_name(&mut self, v: ::std::string::String) {
  1566. self.one_of_name = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(v))
  1567. }
  1568. // Mutable pointer to the field.
  1569. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  1570. if let ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(_)) = self.one_of_name {
  1571. } else {
  1572. self.one_of_name = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(::std::string::String::new()));
  1573. }
  1574. match self.one_of_name {
  1575. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(ref mut v)) => v,
  1576. _ => panic!(),
  1577. }
  1578. }
  1579. // Take field
  1580. pub fn take_name(&mut self) -> ::std::string::String {
  1581. if self.has_name() {
  1582. match self.one_of_name.take() {
  1583. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(v)) => v,
  1584. _ => panic!(),
  1585. }
  1586. } else {
  1587. ::std::string::String::new()
  1588. }
  1589. }
  1590. // string desc = 3;
  1591. pub fn get_desc(&self) -> &str {
  1592. match self.one_of_desc {
  1593. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(ref v)) => v,
  1594. _ => "",
  1595. }
  1596. }
  1597. pub fn clear_desc(&mut self) {
  1598. self.one_of_desc = ::std::option::Option::None;
  1599. }
  1600. pub fn has_desc(&self) -> bool {
  1601. match self.one_of_desc {
  1602. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(..)) => true,
  1603. _ => false,
  1604. }
  1605. }
  1606. // Param is passed by value, moved
  1607. pub fn set_desc(&mut self, v: ::std::string::String) {
  1608. self.one_of_desc = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(v))
  1609. }
  1610. // Mutable pointer to the field.
  1611. pub fn mut_desc(&mut self) -> &mut ::std::string::String {
  1612. if let ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(_)) = self.one_of_desc {
  1613. } else {
  1614. self.one_of_desc = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(::std::string::String::new()));
  1615. }
  1616. match self.one_of_desc {
  1617. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(ref mut v)) => v,
  1618. _ => panic!(),
  1619. }
  1620. }
  1621. // Take field
  1622. pub fn take_desc(&mut self) -> ::std::string::String {
  1623. if self.has_desc() {
  1624. match self.one_of_desc.take() {
  1625. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(v)) => v,
  1626. _ => panic!(),
  1627. }
  1628. } else {
  1629. ::std::string::String::new()
  1630. }
  1631. }
  1632. // string thumbnail = 4;
  1633. pub fn get_thumbnail(&self) -> &str {
  1634. match self.one_of_thumbnail {
  1635. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v)) => v,
  1636. _ => "",
  1637. }
  1638. }
  1639. pub fn clear_thumbnail(&mut self) {
  1640. self.one_of_thumbnail = ::std::option::Option::None;
  1641. }
  1642. pub fn has_thumbnail(&self) -> bool {
  1643. match self.one_of_thumbnail {
  1644. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(..)) => true,
  1645. _ => false,
  1646. }
  1647. }
  1648. // Param is passed by value, moved
  1649. pub fn set_thumbnail(&mut self, v: ::std::string::String) {
  1650. self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(v))
  1651. }
  1652. // Mutable pointer to the field.
  1653. pub fn mut_thumbnail(&mut self) -> &mut ::std::string::String {
  1654. if let ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(_)) = self.one_of_thumbnail {
  1655. } else {
  1656. self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(::std::string::String::new()));
  1657. }
  1658. match self.one_of_thumbnail {
  1659. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(ref mut v)) => v,
  1660. _ => panic!(),
  1661. }
  1662. }
  1663. // Take field
  1664. pub fn take_thumbnail(&mut self) -> ::std::string::String {
  1665. if self.has_thumbnail() {
  1666. match self.one_of_thumbnail.take() {
  1667. ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(v)) => v,
  1668. _ => panic!(),
  1669. }
  1670. } else {
  1671. ::std::string::String::new()
  1672. }
  1673. }
  1674. }
  1675. impl ::protobuf::Message for UpdateViewPayload {
  1676. fn is_initialized(&self) -> bool {
  1677. true
  1678. }
  1679. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1680. while !is.eof()? {
  1681. let (field_number, wire_type) = is.read_tag_unpack()?;
  1682. match field_number {
  1683. 1 => {
  1684. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_id)?;
  1685. },
  1686. 2 => {
  1687. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  1688. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1689. }
  1690. self.one_of_name = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(is.read_string()?));
  1691. },
  1692. 3 => {
  1693. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  1694. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1695. }
  1696. self.one_of_desc = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(is.read_string()?));
  1697. },
  1698. 4 => {
  1699. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  1700. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1701. }
  1702. self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(is.read_string()?));
  1703. },
  1704. _ => {
  1705. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1706. },
  1707. };
  1708. }
  1709. ::std::result::Result::Ok(())
  1710. }
  1711. // Compute sizes of nested messages
  1712. #[allow(unused_variables)]
  1713. fn compute_size(&self) -> u32 {
  1714. let mut my_size = 0;
  1715. if !self.view_id.is_empty() {
  1716. my_size += ::protobuf::rt::string_size(1, &self.view_id);
  1717. }
  1718. if let ::std::option::Option::Some(ref v) = self.one_of_name {
  1719. match v {
  1720. &UpdateViewPayload_oneof_one_of_name::name(ref v) => {
  1721. my_size += ::protobuf::rt::string_size(2, &v);
  1722. },
  1723. };
  1724. }
  1725. if let ::std::option::Option::Some(ref v) = self.one_of_desc {
  1726. match v {
  1727. &UpdateViewPayload_oneof_one_of_desc::desc(ref v) => {
  1728. my_size += ::protobuf::rt::string_size(3, &v);
  1729. },
  1730. };
  1731. }
  1732. if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
  1733. match v {
  1734. &UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
  1735. my_size += ::protobuf::rt::string_size(4, &v);
  1736. },
  1737. };
  1738. }
  1739. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1740. self.cached_size.set(my_size);
  1741. my_size
  1742. }
  1743. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1744. if !self.view_id.is_empty() {
  1745. os.write_string(1, &self.view_id)?;
  1746. }
  1747. if let ::std::option::Option::Some(ref v) = self.one_of_name {
  1748. match v {
  1749. &UpdateViewPayload_oneof_one_of_name::name(ref v) => {
  1750. os.write_string(2, v)?;
  1751. },
  1752. };
  1753. }
  1754. if let ::std::option::Option::Some(ref v) = self.one_of_desc {
  1755. match v {
  1756. &UpdateViewPayload_oneof_one_of_desc::desc(ref v) => {
  1757. os.write_string(3, v)?;
  1758. },
  1759. };
  1760. }
  1761. if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
  1762. match v {
  1763. &UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
  1764. os.write_string(4, v)?;
  1765. },
  1766. };
  1767. }
  1768. os.write_unknown_fields(self.get_unknown_fields())?;
  1769. ::std::result::Result::Ok(())
  1770. }
  1771. fn get_cached_size(&self) -> u32 {
  1772. self.cached_size.get()
  1773. }
  1774. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1775. &self.unknown_fields
  1776. }
  1777. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1778. &mut self.unknown_fields
  1779. }
  1780. fn as_any(&self) -> &dyn (::std::any::Any) {
  1781. self as &dyn (::std::any::Any)
  1782. }
  1783. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1784. self as &mut dyn (::std::any::Any)
  1785. }
  1786. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1787. self
  1788. }
  1789. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1790. Self::descriptor_static()
  1791. }
  1792. fn new() -> UpdateViewPayload {
  1793. UpdateViewPayload::new()
  1794. }
  1795. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1796. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  1797. descriptor.get(|| {
  1798. let mut fields = ::std::vec::Vec::new();
  1799. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1800. "view_id",
  1801. |m: &UpdateViewPayload| { &m.view_id },
  1802. |m: &mut UpdateViewPayload| { &mut m.view_id },
  1803. ));
  1804. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  1805. "name",
  1806. UpdateViewPayload::has_name,
  1807. UpdateViewPayload::get_name,
  1808. ));
  1809. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  1810. "desc",
  1811. UpdateViewPayload::has_desc,
  1812. UpdateViewPayload::get_desc,
  1813. ));
  1814. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  1815. "thumbnail",
  1816. UpdateViewPayload::has_thumbnail,
  1817. UpdateViewPayload::get_thumbnail,
  1818. ));
  1819. ::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateViewPayload>(
  1820. "UpdateViewPayload",
  1821. fields,
  1822. file_descriptor_proto()
  1823. )
  1824. })
  1825. }
  1826. fn default_instance() -> &'static UpdateViewPayload {
  1827. static instance: ::protobuf::rt::LazyV2<UpdateViewPayload> = ::protobuf::rt::LazyV2::INIT;
  1828. instance.get(UpdateViewPayload::new)
  1829. }
  1830. }
  1831. impl ::protobuf::Clear for UpdateViewPayload {
  1832. fn clear(&mut self) {
  1833. self.view_id.clear();
  1834. self.one_of_name = ::std::option::Option::None;
  1835. self.one_of_desc = ::std::option::Option::None;
  1836. self.one_of_thumbnail = ::std::option::Option::None;
  1837. self.unknown_fields.clear();
  1838. }
  1839. }
  1840. impl ::std::fmt::Debug for UpdateViewPayload {
  1841. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1842. ::protobuf::text_format::fmt(self, f)
  1843. }
  1844. }
  1845. impl ::protobuf::reflect::ProtobufValue for UpdateViewPayload {
  1846. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  1847. ::protobuf::reflect::ReflectValueRef::Message(self)
  1848. }
  1849. }
  1850. #[derive(PartialEq,Clone,Default)]
  1851. pub struct UpdateViewParams {
  1852. // message fields
  1853. pub view_id: ::std::string::String,
  1854. // message oneof groups
  1855. pub one_of_name: ::std::option::Option<UpdateViewParams_oneof_one_of_name>,
  1856. pub one_of_desc: ::std::option::Option<UpdateViewParams_oneof_one_of_desc>,
  1857. pub one_of_thumbnail: ::std::option::Option<UpdateViewParams_oneof_one_of_thumbnail>,
  1858. // special fields
  1859. pub unknown_fields: ::protobuf::UnknownFields,
  1860. pub cached_size: ::protobuf::CachedSize,
  1861. }
  1862. impl<'a> ::std::default::Default for &'a UpdateViewParams {
  1863. fn default() -> &'a UpdateViewParams {
  1864. <UpdateViewParams as ::protobuf::Message>::default_instance()
  1865. }
  1866. }
  1867. #[derive(Clone,PartialEq,Debug)]
  1868. pub enum UpdateViewParams_oneof_one_of_name {
  1869. name(::std::string::String),
  1870. }
  1871. #[derive(Clone,PartialEq,Debug)]
  1872. pub enum UpdateViewParams_oneof_one_of_desc {
  1873. desc(::std::string::String),
  1874. }
  1875. #[derive(Clone,PartialEq,Debug)]
  1876. pub enum UpdateViewParams_oneof_one_of_thumbnail {
  1877. thumbnail(::std::string::String),
  1878. }
  1879. impl UpdateViewParams {
  1880. pub fn new() -> UpdateViewParams {
  1881. ::std::default::Default::default()
  1882. }
  1883. // string view_id = 1;
  1884. pub fn get_view_id(&self) -> &str {
  1885. &self.view_id
  1886. }
  1887. pub fn clear_view_id(&mut self) {
  1888. self.view_id.clear();
  1889. }
  1890. // Param is passed by value, moved
  1891. pub fn set_view_id(&mut self, v: ::std::string::String) {
  1892. self.view_id = v;
  1893. }
  1894. // Mutable pointer to the field.
  1895. // If field is not initialized, it is initialized with default value first.
  1896. pub fn mut_view_id(&mut self) -> &mut ::std::string::String {
  1897. &mut self.view_id
  1898. }
  1899. // Take field
  1900. pub fn take_view_id(&mut self) -> ::std::string::String {
  1901. ::std::mem::replace(&mut self.view_id, ::std::string::String::new())
  1902. }
  1903. // string name = 2;
  1904. pub fn get_name(&self) -> &str {
  1905. match self.one_of_name {
  1906. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(ref v)) => v,
  1907. _ => "",
  1908. }
  1909. }
  1910. pub fn clear_name(&mut self) {
  1911. self.one_of_name = ::std::option::Option::None;
  1912. }
  1913. pub fn has_name(&self) -> bool {
  1914. match self.one_of_name {
  1915. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(..)) => true,
  1916. _ => false,
  1917. }
  1918. }
  1919. // Param is passed by value, moved
  1920. pub fn set_name(&mut self, v: ::std::string::String) {
  1921. self.one_of_name = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(v))
  1922. }
  1923. // Mutable pointer to the field.
  1924. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  1925. if let ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(_)) = self.one_of_name {
  1926. } else {
  1927. self.one_of_name = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(::std::string::String::new()));
  1928. }
  1929. match self.one_of_name {
  1930. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(ref mut v)) => v,
  1931. _ => panic!(),
  1932. }
  1933. }
  1934. // Take field
  1935. pub fn take_name(&mut self) -> ::std::string::String {
  1936. if self.has_name() {
  1937. match self.one_of_name.take() {
  1938. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(v)) => v,
  1939. _ => panic!(),
  1940. }
  1941. } else {
  1942. ::std::string::String::new()
  1943. }
  1944. }
  1945. // string desc = 3;
  1946. pub fn get_desc(&self) -> &str {
  1947. match self.one_of_desc {
  1948. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(ref v)) => v,
  1949. _ => "",
  1950. }
  1951. }
  1952. pub fn clear_desc(&mut self) {
  1953. self.one_of_desc = ::std::option::Option::None;
  1954. }
  1955. pub fn has_desc(&self) -> bool {
  1956. match self.one_of_desc {
  1957. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(..)) => true,
  1958. _ => false,
  1959. }
  1960. }
  1961. // Param is passed by value, moved
  1962. pub fn set_desc(&mut self, v: ::std::string::String) {
  1963. self.one_of_desc = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(v))
  1964. }
  1965. // Mutable pointer to the field.
  1966. pub fn mut_desc(&mut self) -> &mut ::std::string::String {
  1967. if let ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(_)) = self.one_of_desc {
  1968. } else {
  1969. self.one_of_desc = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(::std::string::String::new()));
  1970. }
  1971. match self.one_of_desc {
  1972. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(ref mut v)) => v,
  1973. _ => panic!(),
  1974. }
  1975. }
  1976. // Take field
  1977. pub fn take_desc(&mut self) -> ::std::string::String {
  1978. if self.has_desc() {
  1979. match self.one_of_desc.take() {
  1980. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(v)) => v,
  1981. _ => panic!(),
  1982. }
  1983. } else {
  1984. ::std::string::String::new()
  1985. }
  1986. }
  1987. // string thumbnail = 4;
  1988. pub fn get_thumbnail(&self) -> &str {
  1989. match self.one_of_thumbnail {
  1990. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(ref v)) => v,
  1991. _ => "",
  1992. }
  1993. }
  1994. pub fn clear_thumbnail(&mut self) {
  1995. self.one_of_thumbnail = ::std::option::Option::None;
  1996. }
  1997. pub fn has_thumbnail(&self) -> bool {
  1998. match self.one_of_thumbnail {
  1999. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(..)) => true,
  2000. _ => false,
  2001. }
  2002. }
  2003. // Param is passed by value, moved
  2004. pub fn set_thumbnail(&mut self, v: ::std::string::String) {
  2005. self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(v))
  2006. }
  2007. // Mutable pointer to the field.
  2008. pub fn mut_thumbnail(&mut self) -> &mut ::std::string::String {
  2009. if let ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(_)) = self.one_of_thumbnail {
  2010. } else {
  2011. self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(::std::string::String::new()));
  2012. }
  2013. match self.one_of_thumbnail {
  2014. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(ref mut v)) => v,
  2015. _ => panic!(),
  2016. }
  2017. }
  2018. // Take field
  2019. pub fn take_thumbnail(&mut self) -> ::std::string::String {
  2020. if self.has_thumbnail() {
  2021. match self.one_of_thumbnail.take() {
  2022. ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(v)) => v,
  2023. _ => panic!(),
  2024. }
  2025. } else {
  2026. ::std::string::String::new()
  2027. }
  2028. }
  2029. }
  2030. impl ::protobuf::Message for UpdateViewParams {
  2031. fn is_initialized(&self) -> bool {
  2032. true
  2033. }
  2034. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  2035. while !is.eof()? {
  2036. let (field_number, wire_type) = is.read_tag_unpack()?;
  2037. match field_number {
  2038. 1 => {
  2039. ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_id)?;
  2040. },
  2041. 2 => {
  2042. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  2043. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2044. }
  2045. self.one_of_name = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_name::name(is.read_string()?));
  2046. },
  2047. 3 => {
  2048. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  2049. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2050. }
  2051. self.one_of_desc = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_desc::desc(is.read_string()?));
  2052. },
  2053. 4 => {
  2054. if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
  2055. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2056. }
  2057. self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewParams_oneof_one_of_thumbnail::thumbnail(is.read_string()?));
  2058. },
  2059. _ => {
  2060. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  2061. },
  2062. };
  2063. }
  2064. ::std::result::Result::Ok(())
  2065. }
  2066. // Compute sizes of nested messages
  2067. #[allow(unused_variables)]
  2068. fn compute_size(&self) -> u32 {
  2069. let mut my_size = 0;
  2070. if !self.view_id.is_empty() {
  2071. my_size += ::protobuf::rt::string_size(1, &self.view_id);
  2072. }
  2073. if let ::std::option::Option::Some(ref v) = self.one_of_name {
  2074. match v {
  2075. &UpdateViewParams_oneof_one_of_name::name(ref v) => {
  2076. my_size += ::protobuf::rt::string_size(2, &v);
  2077. },
  2078. };
  2079. }
  2080. if let ::std::option::Option::Some(ref v) = self.one_of_desc {
  2081. match v {
  2082. &UpdateViewParams_oneof_one_of_desc::desc(ref v) => {
  2083. my_size += ::protobuf::rt::string_size(3, &v);
  2084. },
  2085. };
  2086. }
  2087. if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
  2088. match v {
  2089. &UpdateViewParams_oneof_one_of_thumbnail::thumbnail(ref v) => {
  2090. my_size += ::protobuf::rt::string_size(4, &v);
  2091. },
  2092. };
  2093. }
  2094. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2095. self.cached_size.set(my_size);
  2096. my_size
  2097. }
  2098. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  2099. if !self.view_id.is_empty() {
  2100. os.write_string(1, &self.view_id)?;
  2101. }
  2102. if let ::std::option::Option::Some(ref v) = self.one_of_name {
  2103. match v {
  2104. &UpdateViewParams_oneof_one_of_name::name(ref v) => {
  2105. os.write_string(2, v)?;
  2106. },
  2107. };
  2108. }
  2109. if let ::std::option::Option::Some(ref v) = self.one_of_desc {
  2110. match v {
  2111. &UpdateViewParams_oneof_one_of_desc::desc(ref v) => {
  2112. os.write_string(3, v)?;
  2113. },
  2114. };
  2115. }
  2116. if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
  2117. match v {
  2118. &UpdateViewParams_oneof_one_of_thumbnail::thumbnail(ref v) => {
  2119. os.write_string(4, v)?;
  2120. },
  2121. };
  2122. }
  2123. os.write_unknown_fields(self.get_unknown_fields())?;
  2124. ::std::result::Result::Ok(())
  2125. }
  2126. fn get_cached_size(&self) -> u32 {
  2127. self.cached_size.get()
  2128. }
  2129. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2130. &self.unknown_fields
  2131. }
  2132. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2133. &mut self.unknown_fields
  2134. }
  2135. fn as_any(&self) -> &dyn (::std::any::Any) {
  2136. self as &dyn (::std::any::Any)
  2137. }
  2138. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  2139. self as &mut dyn (::std::any::Any)
  2140. }
  2141. fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  2142. self
  2143. }
  2144. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2145. Self::descriptor_static()
  2146. }
  2147. fn new() -> UpdateViewParams {
  2148. UpdateViewParams::new()
  2149. }
  2150. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2151. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
  2152. descriptor.get(|| {
  2153. let mut fields = ::std::vec::Vec::new();
  2154. fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  2155. "view_id",
  2156. |m: &UpdateViewParams| { &m.view_id },
  2157. |m: &mut UpdateViewParams| { &mut m.view_id },
  2158. ));
  2159. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  2160. "name",
  2161. UpdateViewParams::has_name,
  2162. UpdateViewParams::get_name,
  2163. ));
  2164. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  2165. "desc",
  2166. UpdateViewParams::has_desc,
  2167. UpdateViewParams::get_desc,
  2168. ));
  2169. fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
  2170. "thumbnail",
  2171. UpdateViewParams::has_thumbnail,
  2172. UpdateViewParams::get_thumbnail,
  2173. ));
  2174. ::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateViewParams>(
  2175. "UpdateViewParams",
  2176. fields,
  2177. file_descriptor_proto()
  2178. )
  2179. })
  2180. }
  2181. fn default_instance() -> &'static UpdateViewParams {
  2182. static instance: ::protobuf::rt::LazyV2<UpdateViewParams> = ::protobuf::rt::LazyV2::INIT;
  2183. instance.get(UpdateViewParams::new)
  2184. }
  2185. }
  2186. impl ::protobuf::Clear for UpdateViewParams {
  2187. fn clear(&mut self) {
  2188. self.view_id.clear();
  2189. self.one_of_name = ::std::option::Option::None;
  2190. self.one_of_desc = ::std::option::Option::None;
  2191. self.one_of_thumbnail = ::std::option::Option::None;
  2192. self.unknown_fields.clear();
  2193. }
  2194. }
  2195. impl ::std::fmt::Debug for UpdateViewParams {
  2196. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  2197. ::protobuf::text_format::fmt(self, f)
  2198. }
  2199. }
  2200. impl ::protobuf::reflect::ProtobufValue for UpdateViewParams {
  2201. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  2202. ::protobuf::reflect::ReflectValueRef::Message(self)
  2203. }
  2204. }
  2205. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  2206. pub enum ViewType {
  2207. Blank = 0,
  2208. Doc = 1,
  2209. }
  2210. impl ::protobuf::ProtobufEnum for ViewType {
  2211. fn value(&self) -> i32 {
  2212. *self as i32
  2213. }
  2214. fn from_i32(value: i32) -> ::std::option::Option<ViewType> {
  2215. match value {
  2216. 0 => ::std::option::Option::Some(ViewType::Blank),
  2217. 1 => ::std::option::Option::Some(ViewType::Doc),
  2218. _ => ::std::option::Option::None
  2219. }
  2220. }
  2221. fn values() -> &'static [Self] {
  2222. static values: &'static [ViewType] = &[
  2223. ViewType::Blank,
  2224. ViewType::Doc,
  2225. ];
  2226. values
  2227. }
  2228. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  2229. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
  2230. descriptor.get(|| {
  2231. ::protobuf::reflect::EnumDescriptor::new_pb_name::<ViewType>("ViewType", file_descriptor_proto())
  2232. })
  2233. }
  2234. }
  2235. impl ::std::marker::Copy for ViewType {
  2236. }
  2237. impl ::std::default::Default for ViewType {
  2238. fn default() -> Self {
  2239. ViewType::Blank
  2240. }
  2241. }
  2242. impl ::protobuf::reflect::ProtobufValue for ViewType {
  2243. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  2244. ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
  2245. }
  2246. }
  2247. static file_descriptor_proto_data: &'static [u8] = b"\
  2248. \n\nview.proto\"\x97\x02\n\x04View\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\
  2249. \x02id\x12\x20\n\x0cbelong_to_id\x18\x02\x20\x01(\tR\nbelongToId\x12\x12\
  2250. \n\x04name\x18\x03\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x04\x20\x01\
  2251. (\tR\x04desc\x12&\n\tview_type\x18\x05\x20\x01(\x0e2\t.ViewTypeR\x08view\
  2252. Type\x12\x18\n\x07version\x18\x06\x20\x01(\x03R\x07version\x12-\n\nbelon\
  2253. gings\x18\x07\x20\x01(\x0b2\r.RepeatedViewR\nbelongings\x12#\n\rmodified\
  2254. _time\x18\x08\x20\x01(\x03R\x0cmodifiedTime\x12\x1f\n\x0bcreate_time\x18\
  2255. \t\x20\x01(\x03R\ncreateTime\"+\n\x0cRepeatedView\x12\x1b\n\x05items\x18\
  2256. \x01\x20\x03(\x0b2\x05.ViewR\x05items\"\xb9\x01\n\x11CreateViewPayload\
  2257. \x12\x20\n\x0cbelong_to_id\x18\x01\x20\x01(\tR\nbelongToId\x12\x12\n\x04\
  2258. name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\
  2259. \x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\0R\tthumbnail\x12&\n\t\
  2260. view_type\x18\x05\x20\x01(\x0e2\t.ViewTypeR\x08viewTypeB\x12\n\x10one_of\
  2261. _thumbnail\"\xd8\x01\n\x10CreateViewParams\x12\x20\n\x0cbelong_to_id\x18\
  2262. \x01\x20\x01(\tR\nbelongToId\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04na\
  2263. me\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\x04desc\x12\x1c\n\tthumbnail\
  2264. \x18\x04\x20\x01(\tR\tthumbnail\x12&\n\tview_type\x18\x05\x20\x01(\x0e2\
  2265. \t.ViewTypeR\x08viewType\x12\x1b\n\tview_data\x18\x06\x20\x01(\tR\x08vie\
  2266. wData\x12\x17\n\x07view_id\x18\x07\x20\x01(\tR\x06viewId\"\x1e\n\x06View\
  2267. Id\x12\x14\n\x05value\x18\x01\x20\x01(\tR\x05value\"&\n\x0eRepeatedViewI\
  2268. d\x12\x14\n\x05items\x18\x01\x20\x03(\tR\x05items\"\xaa\x01\n\x11UpdateV\
  2269. iewPayload\x12\x17\n\x07view_id\x18\x01\x20\x01(\tR\x06viewId\x12\x14\n\
  2270. \x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\x14\n\x04desc\x18\x03\x20\
  2271. \x01(\tH\x01R\x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\x02R\tthu\
  2272. mbnailB\r\n\x0bone_of_nameB\r\n\x0bone_of_descB\x12\n\x10one_of_thumbnai\
  2273. l\"\xa9\x01\n\x10UpdateViewParams\x12\x17\n\x07view_id\x18\x01\x20\x01(\
  2274. \tR\x06viewId\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\x14\n\
  2275. \x04desc\x18\x03\x20\x01(\tH\x01R\x04desc\x12\x1e\n\tthumbnail\x18\x04\
  2276. \x20\x01(\tH\x02R\tthumbnailB\r\n\x0bone_of_nameB\r\n\x0bone_of_descB\
  2277. \x12\n\x10one_of_thumbnail*\x1e\n\x08ViewType\x12\t\n\x05Blank\x10\0\x12\
  2278. \x07\n\x03Doc\x10\x01b\x06proto3\
  2279. ";
  2280. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  2281. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  2282. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  2283. }
  2284. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  2285. file_descriptor_proto_lazy.get(|| {
  2286. parse_descriptor_proto()
  2287. })
  2288. }