code.rs 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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 `code.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(Clone,PartialEq,Eq,Debug,Hash)]
  22. pub enum ErrorCode {
  23. Internal = 0,
  24. UserUnauthorized = 2,
  25. RecordNotFound = 3,
  26. UserIdIsEmpty = 4,
  27. WorkspaceNameInvalid = 100,
  28. WorkspaceIdInvalid = 101,
  29. AppColorStyleInvalid = 102,
  30. WorkspaceDescTooLong = 103,
  31. WorkspaceNameTooLong = 104,
  32. AppIdInvalid = 110,
  33. AppNameInvalid = 111,
  34. ViewNameInvalid = 120,
  35. ViewThumbnailInvalid = 121,
  36. ViewIdInvalid = 122,
  37. ViewDescTooLong = 123,
  38. ViewDataInvalid = 124,
  39. ViewNameTooLong = 125,
  40. ConnectError = 200,
  41. EmailIsEmpty = 300,
  42. EmailFormatInvalid = 301,
  43. EmailAlreadyExists = 302,
  44. PasswordIsEmpty = 303,
  45. PasswordTooLong = 304,
  46. PasswordContainsForbidCharacters = 305,
  47. PasswordFormatInvalid = 306,
  48. PasswordNotMatch = 307,
  49. UserNameTooLong = 308,
  50. UserNameContainForbiddenCharacters = 309,
  51. UserNameIsEmpty = 310,
  52. UserIdInvalid = 311,
  53. UserNotExist = 312,
  54. TextTooLong = 400,
  55. BlockIdIsEmpty = 401,
  56. RowIdIsEmpty = 402,
  57. GridIdIsEmpty = 403,
  58. InvalidData = 404,
  59. }
  60. impl ::protobuf::ProtobufEnum for ErrorCode {
  61. fn value(&self) -> i32 {
  62. *self as i32
  63. }
  64. fn from_i32(value: i32) -> ::std::option::Option<ErrorCode> {
  65. match value {
  66. 0 => ::std::option::Option::Some(ErrorCode::Internal),
  67. 2 => ::std::option::Option::Some(ErrorCode::UserUnauthorized),
  68. 3 => ::std::option::Option::Some(ErrorCode::RecordNotFound),
  69. 4 => ::std::option::Option::Some(ErrorCode::UserIdIsEmpty),
  70. 100 => ::std::option::Option::Some(ErrorCode::WorkspaceNameInvalid),
  71. 101 => ::std::option::Option::Some(ErrorCode::WorkspaceIdInvalid),
  72. 102 => ::std::option::Option::Some(ErrorCode::AppColorStyleInvalid),
  73. 103 => ::std::option::Option::Some(ErrorCode::WorkspaceDescTooLong),
  74. 104 => ::std::option::Option::Some(ErrorCode::WorkspaceNameTooLong),
  75. 110 => ::std::option::Option::Some(ErrorCode::AppIdInvalid),
  76. 111 => ::std::option::Option::Some(ErrorCode::AppNameInvalid),
  77. 120 => ::std::option::Option::Some(ErrorCode::ViewNameInvalid),
  78. 121 => ::std::option::Option::Some(ErrorCode::ViewThumbnailInvalid),
  79. 122 => ::std::option::Option::Some(ErrorCode::ViewIdInvalid),
  80. 123 => ::std::option::Option::Some(ErrorCode::ViewDescTooLong),
  81. 124 => ::std::option::Option::Some(ErrorCode::ViewDataInvalid),
  82. 125 => ::std::option::Option::Some(ErrorCode::ViewNameTooLong),
  83. 200 => ::std::option::Option::Some(ErrorCode::ConnectError),
  84. 300 => ::std::option::Option::Some(ErrorCode::EmailIsEmpty),
  85. 301 => ::std::option::Option::Some(ErrorCode::EmailFormatInvalid),
  86. 302 => ::std::option::Option::Some(ErrorCode::EmailAlreadyExists),
  87. 303 => ::std::option::Option::Some(ErrorCode::PasswordIsEmpty),
  88. 304 => ::std::option::Option::Some(ErrorCode::PasswordTooLong),
  89. 305 => ::std::option::Option::Some(ErrorCode::PasswordContainsForbidCharacters),
  90. 306 => ::std::option::Option::Some(ErrorCode::PasswordFormatInvalid),
  91. 307 => ::std::option::Option::Some(ErrorCode::PasswordNotMatch),
  92. 308 => ::std::option::Option::Some(ErrorCode::UserNameTooLong),
  93. 309 => ::std::option::Option::Some(ErrorCode::UserNameContainForbiddenCharacters),
  94. 310 => ::std::option::Option::Some(ErrorCode::UserNameIsEmpty),
  95. 311 => ::std::option::Option::Some(ErrorCode::UserIdInvalid),
  96. 312 => ::std::option::Option::Some(ErrorCode::UserNotExist),
  97. 400 => ::std::option::Option::Some(ErrorCode::TextTooLong),
  98. 401 => ::std::option::Option::Some(ErrorCode::BlockIdIsEmpty),
  99. 402 => ::std::option::Option::Some(ErrorCode::RowIdIsEmpty),
  100. 403 => ::std::option::Option::Some(ErrorCode::GridIdIsEmpty),
  101. 404 => ::std::option::Option::Some(ErrorCode::InvalidData),
  102. _ => ::std::option::Option::None
  103. }
  104. }
  105. fn values() -> &'static [Self] {
  106. static values: &'static [ErrorCode] = &[
  107. ErrorCode::Internal,
  108. ErrorCode::UserUnauthorized,
  109. ErrorCode::RecordNotFound,
  110. ErrorCode::UserIdIsEmpty,
  111. ErrorCode::WorkspaceNameInvalid,
  112. ErrorCode::WorkspaceIdInvalid,
  113. ErrorCode::AppColorStyleInvalid,
  114. ErrorCode::WorkspaceDescTooLong,
  115. ErrorCode::WorkspaceNameTooLong,
  116. ErrorCode::AppIdInvalid,
  117. ErrorCode::AppNameInvalid,
  118. ErrorCode::ViewNameInvalid,
  119. ErrorCode::ViewThumbnailInvalid,
  120. ErrorCode::ViewIdInvalid,
  121. ErrorCode::ViewDescTooLong,
  122. ErrorCode::ViewDataInvalid,
  123. ErrorCode::ViewNameTooLong,
  124. ErrorCode::ConnectError,
  125. ErrorCode::EmailIsEmpty,
  126. ErrorCode::EmailFormatInvalid,
  127. ErrorCode::EmailAlreadyExists,
  128. ErrorCode::PasswordIsEmpty,
  129. ErrorCode::PasswordTooLong,
  130. ErrorCode::PasswordContainsForbidCharacters,
  131. ErrorCode::PasswordFormatInvalid,
  132. ErrorCode::PasswordNotMatch,
  133. ErrorCode::UserNameTooLong,
  134. ErrorCode::UserNameContainForbiddenCharacters,
  135. ErrorCode::UserNameIsEmpty,
  136. ErrorCode::UserIdInvalid,
  137. ErrorCode::UserNotExist,
  138. ErrorCode::TextTooLong,
  139. ErrorCode::BlockIdIsEmpty,
  140. ErrorCode::RowIdIsEmpty,
  141. ErrorCode::GridIdIsEmpty,
  142. ErrorCode::InvalidData,
  143. ];
  144. values
  145. }
  146. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  147. static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
  148. descriptor.get(|| {
  149. ::protobuf::reflect::EnumDescriptor::new_pb_name::<ErrorCode>("ErrorCode", file_descriptor_proto())
  150. })
  151. }
  152. }
  153. impl ::std::marker::Copy for ErrorCode {
  154. }
  155. impl ::std::default::Default for ErrorCode {
  156. fn default() -> Self {
  157. ErrorCode::Internal
  158. }
  159. }
  160. impl ::protobuf::reflect::ProtobufValue for ErrorCode {
  161. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  162. ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
  163. }
  164. }
  165. static file_descriptor_proto_data: &'static [u8] = b"\
  166. \n\ncode.proto*\xb7\x06\n\tErrorCode\x12\x0c\n\x08Internal\x10\0\x12\x14\
  167. \n\x10UserUnauthorized\x10\x02\x12\x12\n\x0eRecordNotFound\x10\x03\x12\
  168. \x11\n\rUserIdIsEmpty\x10\x04\x12\x18\n\x14WorkspaceNameInvalid\x10d\x12\
  169. \x16\n\x12WorkspaceIdInvalid\x10e\x12\x18\n\x14AppColorStyleInvalid\x10f\
  170. \x12\x18\n\x14WorkspaceDescTooLong\x10g\x12\x18\n\x14WorkspaceNameTooLon\
  171. g\x10h\x12\x10\n\x0cAppIdInvalid\x10n\x12\x12\n\x0eAppNameInvalid\x10o\
  172. \x12\x13\n\x0fViewNameInvalid\x10x\x12\x18\n\x14ViewThumbnailInvalid\x10\
  173. y\x12\x11\n\rViewIdInvalid\x10z\x12\x13\n\x0fViewDescTooLong\x10{\x12\
  174. \x13\n\x0fViewDataInvalid\x10|\x12\x13\n\x0fViewNameTooLong\x10}\x12\x11\
  175. \n\x0cConnectError\x10\xc8\x01\x12\x11\n\x0cEmailIsEmpty\x10\xac\x02\x12\
  176. \x17\n\x12EmailFormatInvalid\x10\xad\x02\x12\x17\n\x12EmailAlreadyExists\
  177. \x10\xae\x02\x12\x14\n\x0fPasswordIsEmpty\x10\xaf\x02\x12\x14\n\x0fPassw\
  178. ordTooLong\x10\xb0\x02\x12%\n\x20PasswordContainsForbidCharacters\x10\
  179. \xb1\x02\x12\x1a\n\x15PasswordFormatInvalid\x10\xb2\x02\x12\x15\n\x10Pas\
  180. swordNotMatch\x10\xb3\x02\x12\x14\n\x0fUserNameTooLong\x10\xb4\x02\x12'\
  181. \n\"UserNameContainForbiddenCharacters\x10\xb5\x02\x12\x14\n\x0fUserName\
  182. IsEmpty\x10\xb6\x02\x12\x12\n\rUserIdInvalid\x10\xb7\x02\x12\x11\n\x0cUs\
  183. erNotExist\x10\xb8\x02\x12\x10\n\x0bTextTooLong\x10\x90\x03\x12\x13\n\
  184. \x0eBlockIdIsEmpty\x10\x91\x03\x12\x11\n\x0cRowIdIsEmpty\x10\x92\x03\x12\
  185. \x12\n\rGridIdIsEmpty\x10\x93\x03\x12\x10\n\x0bInvalidData\x10\x94\x03b\
  186. \x06proto3\
  187. ";
  188. static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
  189. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  190. ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
  191. }
  192. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  193. file_descriptor_proto_lazy.get(|| {
  194. parse_descriptor_proto()
  195. })
  196. }