| 6 |
| * Copyright Nikolai Kudashov, 2015. |
| 7 | */ |
| 8 |
| 9 | #ifndef MTPROTOSCHEME_H |
| 10 | #define MTPROTOSCHEME_H |
| 11 |
| 12 | #include <vector> |
| 13 | #include <memory> |
| 14 | #include <map> |
| 15 | #include <bits/unique_ptr.h> |
| 16 | #include "TLObject.h" |
| 17 |
| 18 | class ByteArray; |
| 19 | class NativeByteBuffer; |
| 20 |
| 21 | class TLClassStore { |
| 22 |
| 23 | public: |
| 24 | static TLObject *TLdeserialize(NativeByteBuffer *stream, uint32_t bytes, uint32_t constructor, bool &error); |
| 25 |
| 26 | }; |
| 27 |
| 28 | class TL_api_request : public TLObject { |
| 29 |
| 30 | public: |
| 31 | NativeByteBuffer *request = nullptr; |
| 32 |
| 33 | ~TL_api_request(); |
| 34 | bool isNeedLayer(); |
| 35 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t bytes, bool &error); |
| 36 | void serializeToStream(NativeByteBuffer *stream); |
| 37 | }; |
| 38 |
| 39 | class TL_api_response : public TLObject { |
| 40 |
| 41 | public: |
| 42 | std::unique_ptr<NativeByteBuffer> response; |
| 43 |
| 44 | void readParamsEx(NativeByteBuffer *stream, uint32_t bytes, bool &error); |
| 45 | }; |
| 46 |
| 47 | class TL_future_salt : public TLObject { |
| 48 |
| 49 | public: |
| 50 | static const uint32_t constructor = 0x0949d9dc; |
| 51 |
| 52 | int32_t valid_since; |
| 53 | int32_t valid_until; |
| 54 | int64_t salt; |
| 55 |
| 56 | static TL_future_salt *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 57 | void readParams(NativeByteBuffer *stream, bool &error); |
| 58 | }; |
| 59 |
| 60 | class TL_msgs_state_info : public TLObject { |
| 61 |
| 62 | public: |
| 63 | static const uint32_t constructor = 0x04deb57d; |
| 64 |
| 65 | int64_t req_msg_id; |
| 66 | std::unique_ptr<ByteArray> info; |
| 67 |
| 68 | static TL_msgs_state_info *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 69 | void readParams(NativeByteBuffer *stream, bool &error); |
| 70 | void serializeToStream(NativeByteBuffer *stream); |
| 71 | }; |
| 72 |
| 73 | class Server_DH_Params : public TLObject { |
| 74 |
| 75 | public: |
| 76 | std::unique_ptr<ByteArray> nonce; |
| 77 | std::unique_ptr<ByteArray> server_nonce; |
| 78 | std::unique_ptr<ByteArray> new_nonce_hash; |
| 79 | std::unique_ptr<ByteArray> encrypted_answer; |
| 80 |
| 81 | static Server_DH_Params *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 82 | }; |
| 83 |
| 84 | class TL_server_DH_params_fail : public Server_DH_Params { |
| 85 |
| 86 | public: |
| 87 | static const uint32_t constructor = 0x79cb045d; |
| 88 |
| 89 | void readParams(NativeByteBuffer *stream, bool &error); |
| 90 | }; |
| 91 |
| 92 | class TL_server_DH_params_ok : public Server_DH_Params { |
| 93 |
| 94 | public: |
| 95 | static const uint32_t constructor = 0xd0e8075c; |
| 96 |
| 97 | void readParams(NativeByteBuffer *stream, bool &error); |
| 98 | }; |
| 99 |
| 100 | class TL_resPQ : public TLObject { |
| 101 |
| 102 | public: |
| 103 | static const uint32_t constructor = 0x05162463; |
| 104 |
| 105 | std::unique_ptr<ByteArray> nonce; |
| 106 | std::unique_ptr<ByteArray> server_nonce; |
| 107 | std::unique_ptr<ByteArray> pq; |
| 108 | std::vector<int64_t> server_public_key_fingerprints; |
| 109 |
| 110 | static TL_resPQ *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 111 | void readParams(NativeByteBuffer *stream, bool &error); |
| 112 | }; |
| 113 |
| 114 | class TL_p_q_inner_data : public TLObject { |
| 115 |
| 116 | public: |
| 117 | static const uint32_t constructor = 0x83c95aec; |
| 118 |
| 119 | std::unique_ptr<ByteArray> pq; |
| 120 | std::unique_ptr<ByteArray> p; |
| 121 | std::unique_ptr<ByteArray> q; |
| 122 | std::unique_ptr<ByteArray> nonce; |
| 123 | std::unique_ptr<ByteArray> server_nonce; |
| 124 | std::unique_ptr<ByteArray> new_nonce; |
| 125 |
| 126 | void serializeToStream(NativeByteBuffer *stream); |
| 127 | }; |
| 128 |
| 129 | class TL_pong : public TLObject { |
| 130 |
| 131 | public: |
| 132 | static const uint32_t constructor = 0x347773c5; |
| 133 |
| 134 | int64_t msg_id; |
| 135 | int64_t ping_id; |
| 136 |
| 137 | static TL_pong *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 138 | void readParams(NativeByteBuffer *stream, bool &error); |
| 139 | }; |
| 140 |
| 141 | class TL_future_salts : public TLObject { |
| 142 |
| 143 | public: |
| 144 | static const uint32_t constructor = 0xae500895; |
| 145 |
| 146 | int64_t req_msg_id; |
| 147 | int32_t now; |
| 148 | std::vector<std::unique_ptr<TL_future_salt>> salts; |
| 149 |
| 150 | static TL_future_salts *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 151 | void readParams(NativeByteBuffer *stream, bool &error); |
| 152 | }; |
| 153 |
| 154 | class RpcDropAnswer : public TLObject { |
| 155 |
| 156 | public: |
| 157 | int64_t msg_id; |
| 158 | int32_t seq_no; |
| 159 | int32_t bytes; |
| 160 |
| 161 | static RpcDropAnswer *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 162 | }; |
| 163 |
| 164 | class TL_rpc_answer_unknown : public RpcDropAnswer { |
| 165 |
| 166 | public: |
| 167 | static const uint32_t constructor = 0x5e2ad36e; |
| 168 |
| 169 | void serializeToStream(NativeByteBuffer *stream); |
| 170 | }; |
| 171 |
| 172 | class TL_rpc_answer_dropped : public RpcDropAnswer { |
| 173 |
| 174 | public: |
| 175 | static const uint32_t constructor = 0xa43ad8b7; |
| 176 |
| 177 | void readParams(NativeByteBuffer *stream, bool &error); |
| 178 | }; |
| 179 |
| 180 | class TL_rpc_answer_dropped_running : public RpcDropAnswer { |
| 181 |
| 182 | public: |
| 183 | static const uint32_t constructor = 0xcd78e586; |
| 184 |
| 185 | void serializeToStream(NativeByteBuffer *stream); |
| 186 | }; |
| 187 |
| 188 | class Set_client_DH_params_answer : public TLObject { |
| 189 |
| 190 | public: |
| 191 | std::unique_ptr<ByteArray> nonce; |
| 192 | std::unique_ptr<ByteArray> server_nonce; |
| 193 | std::unique_ptr<ByteArray> new_nonce_hash2; |
| 194 | std::unique_ptr<ByteArray> new_nonce_hash3; |
| 195 | std::unique_ptr<ByteArray> new_nonce_hash1; |
| 196 |
| 197 | static Set_client_DH_params_answer *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 198 | }; |
| 199 |
| 200 | class TL_message : public TLObject { |
| 201 |
| 202 | public: |
| 203 | static const uint32_t constructor = 0x5bb8e511; |
| 204 |
| 205 | int64_t msg_id; |
| 206 | int32_t seqno; |
| 207 | int32_t bytes; |
| 208 | std::unique_ptr<TLObject> body; |
| 209 | TLObject *outgoingBody = nullptr; |
| 210 | std::unique_ptr<NativeByteBuffer> unparsedBody; |
| 211 |
| 212 | static TL_message *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 213 | void readParams(NativeByteBuffer *stream, bool &error); |
| 214 | void serializeToStream(NativeByteBuffer *stream); |
| 215 | }; |
| 216 |
| 217 | class TL_dh_gen_retry : public Set_client_DH_params_answer { |
| 218 |
| 219 | public: |
| 220 | static const uint32_t constructor = 0x46dc1fb9; |
| 221 |
| 222 | void readParams(NativeByteBuffer *stream, bool &error); |
| 223 | }; |
| 224 |
| 225 | class TL_dh_gen_fail : public Set_client_DH_params_answer { |
| 226 |
| 227 | public: |
| 228 | static const uint32_t constructor = 0xa69dae02; |
| 229 |
| 230 | void readParams(NativeByteBuffer *stream, bool &error); |
| 231 | }; |
| 232 |
| 233 | class TL_dh_gen_ok : public Set_client_DH_params_answer { |
| 234 |
| 235 | public: |
| 236 | static const uint32_t constructor = 0x3bcbf734; |
| 237 |
| 238 | void readParams(NativeByteBuffer *stream, bool &error); |
| 239 | }; |
| 240 |
| 241 | class BadMsgNotification : public TLObject { |
| 242 |
| 243 | public: |
| 244 | int64_t bad_msg_id; |
| 245 | int32_t bad_msg_seqno; |
| 246 | int32_t error_code; |
| 247 | int64_t new_server_salt; |
| 248 |
| 249 | static BadMsgNotification *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 250 | }; |
| 251 |
| 252 | class TL_bad_msg_notification : public BadMsgNotification { |
| 253 |
| 254 | public: |
| 255 | static const uint32_t constructor = 0xa7eff811; |
| 256 |
| 257 | void readParams(NativeByteBuffer *stream, bool &error); |
| 258 | }; |
| 259 |
| 260 | class TL_bad_server_salt : public BadMsgNotification { |
| 261 |
| 262 | public: |
| 263 | static const uint32_t constructor = 0xedab447b; |
| 264 |
| 265 | void readParams(NativeByteBuffer *stream, bool &error); |
| 266 | }; |
| 267 |
| 268 | class TL_msgs_state_req : public TLObject { |
| 269 |
| 270 | public: |
| 271 | static const uint32_t constructor = 0xda69fb52; |
| 272 |
| 273 | std::vector<int64_t> msg_ids; |
| 274 |
| 275 | static TL_msgs_state_req *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 276 | void readParams(NativeByteBuffer *stream, bool &error); |
| 277 | void serializeToStream(NativeByteBuffer *stream); |
| 278 | }; |
| 279 |
| 280 | class MsgDetailedInfo : public TLObject { |
| 281 |
| 282 | public: |
| 283 | int64_t answer_msg_id; |
| 284 | int32_t bytes; |
| 285 | int32_t status; |
| 286 | int64_t msg_id; |
| 287 |
| 288 | static MsgDetailedInfo *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 289 | }; |
| 290 |
| 291 | class TL_msg_new_detailed_info : public MsgDetailedInfo { |
| 292 |
| 293 | public: |
| 294 | static const uint32_t constructor = 0x809db6df; |
| 295 |
| 296 | void readParams(NativeByteBuffer *stream, bool &error); |
| 297 | }; |
| 298 |
| 299 | class TL_msg_detailed_info : public MsgDetailedInfo { |
| 300 |
| 301 | public: |
| 302 | static const uint32_t constructor = 0x276d3ec6; |
| 303 |
| 304 | void readParams(NativeByteBuffer *stream, bool &error); |
| 305 | }; |
| 306 |
| 307 | class TL_msg_copy : public TLObject { |
| 308 |
| 309 | public: |
| 310 | static const uint32_t constructor = 0xe06046b2; |
| 311 |
| 312 | std::unique_ptr<TL_message> orig_message; |
| 313 |
| 314 | static TL_msg_copy *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 315 | void readParams(NativeByteBuffer *stream, bool &error); |
| 316 | void serializeToStream(NativeByteBuffer *stream); |
| 317 | }; |
| 318 |
| 319 | class TL_msgs_all_info : public TLObject { |
| 320 |
| 321 | public: |
| 322 | static const uint32_t constructor = 0x8cc0d131; |
| 323 |
| 324 | std::vector<int64_t> msg_ids; |
| 325 | std::unique_ptr<ByteArray> info; |
| 326 |
| 327 | static TL_msgs_all_info *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 328 | void readParams(NativeByteBuffer *stream, bool &error); |
| 329 | }; |
| 330 |
| 331 | class TL_rpc_result : public TLObject { |
| 332 |
| 333 | public: |
| 334 | static const uint32_t constructor = 0xf35c6d01; |
| 335 |
| 336 | int64_t req_msg_id; |
| 337 | std::unique_ptr<TLObject> result; |
| 338 |
| 339 | void readParamsEx(NativeByteBuffer *stream, uint32_t bytes, bool &error); |
| 340 | }; |
| 341 |
| 342 | class TL_new_session_created : public TLObject { |
| 343 |
| 344 | public: |
| 345 | static const uint32_t constructor = 0x9ec20908; |
| 346 |
| 347 | int64_t first_msg_id; |
| 348 | int64_t unique_id; |
| 349 | int64_t server_salt; |
| 350 |
| 351 | void readParams(NativeByteBuffer *stream, bool &error); |
| 352 | }; |
| 353 |
| 354 | class DestroySessionRes : public TLObject { |
| 355 |
| 356 | public: |
| 357 | int64_t session_id; |
| 358 |
| 359 | static DestroySessionRes *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 360 | }; |
| 361 |
| 362 | class TL_destroy_session_ok : public DestroySessionRes { |
| 363 |
| 364 | public: |
| 365 | static const uint32_t constructor = 0xe22045fc; |
| 366 |
| 367 | void readParams(NativeByteBuffer *stream, bool &error); |
| 368 | }; |
| 369 |
| 370 | class TL_destroy_session_none : public DestroySessionRes { |
| 371 |
| 372 | public: |
| 373 | static const uint32_t constructor = 0x62d350c9; |
| 374 |
| 375 | void readParams(NativeByteBuffer *stream, bool &error); |
| 376 | }; |
| 377 |
| 378 | class TL_msgs_ack : public TLObject { |
| 379 |
| 380 | public: |
| 381 | static const uint32_t constructor = 0x62d6b459; |
| 382 |
| 383 | std::vector<int64_t> msg_ids; |
| 384 |
| 385 | static TL_msgs_ack *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 386 | void readParams(NativeByteBuffer *stream, bool &error); |
| 387 | void serializeToStream(NativeByteBuffer *stream); |
| 388 | }; |
| 389 |
| 390 | class TL_msg_container : public TLObject { |
| 391 |
| 392 | public: |
| 393 | static const uint32_t constructor = 0x73f1f8dc; |
| 394 |
| 395 | std::vector<std::unique_ptr<TL_message>> messages; |
| 396 |
| 397 | static TL_msg_container *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 398 | void readParams(NativeByteBuffer *stream, bool &error); |
| 399 | void serializeToStream(NativeByteBuffer *stream); |
| 400 | }; |
| 401 |
| 402 | class TL_msg_resend_req : public TLObject { |
| 403 |
| 404 | public: |
| 405 | static const uint32_t constructor = 0x7d861a08; |
| 406 |
| 407 | std::vector<int64_t> msg_ids; |
| 408 |
| 409 | static TL_msg_resend_req *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 410 | void readParams(NativeByteBuffer *stream, bool &error); |
| 411 | void serializeToStream(NativeByteBuffer *stream); |
| 412 | }; |
| 413 |
| 414 | class RpcError : public TLObject { |
| 415 |
| 416 | public: |
| 417 | int32_t error_code; |
| 418 | std::string error_message; |
| 419 | int64_t query_id; |
| 420 | }; |
| 421 |
| 422 | class TL_rpc_error : public RpcError { |
| 423 |
| 424 | public: |
| 425 | static const uint32_t constructor = 0x2144ca19; |
| 426 |
| 427 | void readParams(NativeByteBuffer *stream, bool &error); |
| 428 | }; |
| 429 |
| 430 | class TL_rpc_req_error : public RpcError { |
| 431 |
| 432 | public: |
| 433 | static const uint32_t constructor = 0x7ae432f5; |
| 434 |
| 435 | void readParams(NativeByteBuffer *stream, bool &error); |
| 436 | }; |
| 437 |
| 438 | class TL_client_DH_inner_data : public TLObject { |
| 439 |
| 440 | public: |
| 441 | static const uint32_t constructor = 0x6643b654; |
| 442 |
| 443 | std::unique_ptr<ByteArray> nonce; |
| 444 | std::unique_ptr<ByteArray> server_nonce; |
| 445 | int64_t retry_id; |
| 446 | std::unique_ptr<ByteArray> g_b; |
| 447 |
| 448 | void serializeToStream(NativeByteBuffer *stream); |
| 449 | }; |
| 450 |
| 451 | class TL_server_DH_inner_data : public TLObject { |
| 452 |
| 453 | public: |
| 454 | static const uint32_t constructor = 0xb5890dba; |
| 455 |
| 456 | std::unique_ptr<ByteArray> nonce; |
| 457 | std::unique_ptr<ByteArray> server_nonce; |
| 458 | uint32_t g; |
| 459 | std::unique_ptr<ByteArray> dh_prime; |
| 460 | std::unique_ptr<ByteArray> g_a; |
| 461 | int32_t server_time; |
| 462 |
| 463 | static TL_server_DH_inner_data *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 464 | void readParams(NativeByteBuffer *stream, bool &error); |
| 465 | void serializeToStream(NativeByteBuffer *stream); |
| 466 | }; |
| 467 |
| 468 | class TL_req_pq : public TLObject { |
| 469 |
| 470 | public: |
| 471 | static const uint32_t constructor = 0x60469778; |
| 472 |
| 473 | std::unique_ptr<ByteArray> nonce; |
| 474 |
| 475 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 476 | void serializeToStream(NativeByteBuffer *stream); |
| 477 | }; |
| 478 |
| 479 | class TL_req_DH_params : public TLObject { |
| 480 |
| 481 | public: |
| 482 | static const uint32_t constructor = 0xd712e4be; |
| 483 |
| 484 | std::unique_ptr<ByteArray> nonce; |
| 485 | std::unique_ptr<ByteArray> server_nonce; |
| 486 | std::unique_ptr<ByteArray> p; |
| 487 | std::unique_ptr<ByteArray> q; |
| 488 | int64_t public_key_fingerprint; |
| 489 | std::unique_ptr<ByteArray> encrypted_data; |
| 490 |
| 491 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 492 | void serializeToStream(NativeByteBuffer *stream); |
| 493 | }; |
| 494 |
| 495 | class TL_set_client_DH_params : public TLObject { |
| 496 |
| 497 | public: |
| 498 | static const uint32_t constructor = 0xf5045f1f; |
| 499 |
| 500 | std::unique_ptr<ByteArray> nonce; |
| 501 | std::unique_ptr<ByteArray> server_nonce; |
| 502 | std::unique_ptr<ByteArray> encrypted_data; |
| 503 |
| 504 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 505 | void serializeToStream(NativeByteBuffer *stream); |
| 506 | }; |
| 507 |
| 508 | class TL_rpc_drop_answer : public TLObject { |
| 509 |
| 510 | public: |
| 511 | static const uint32_t constructor = 0x58e4a740; |
| 512 |
| 513 | int64_t req_msg_id; |
| 514 |
| 515 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 516 | void serializeToStream(NativeByteBuffer *stream); |
| 517 | }; |
| 518 |
| 519 | class TL_get_future_salts : public TLObject { |
| 520 |
| 521 | public: |
| 522 | static const uint32_t constructor = 0xb921bd04; |
| 523 |
| 524 | int32_t num; |
| 525 |
| 526 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 527 | void serializeToStream(NativeByteBuffer *stream); |
| 528 | }; |
| 529 |
| 530 | class TL_ping : public TLObject { |
| 531 |
| 532 | public: |
| 533 | static const uint32_t constructor = 0x7abe77ec; |
| 534 |
| 535 | int64_t ping_id; |
| 536 |
| 537 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 538 | void serializeToStream(NativeByteBuffer *stream); |
| 539 | }; |
| 540 |
| 541 | class TL_ping_delay_disconnect : public TLObject { |
| 542 |
| 543 | public: |
| 544 | static const uint32_t constructor = 0xf3427b8c; |
| 545 |
| 546 | int64_t ping_id; |
| 547 | int32_t disconnect_delay; |
| 548 |
| 549 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 550 | void serializeToStream(NativeByteBuffer *stream); |
| 551 | }; |
| 552 |
| 553 | class TL_destroy_session : public TLObject { |
| 554 |
| 555 | public: |
| 556 | static const uint32_t constructor = 0xe7512126; |
| 557 |
| 558 | int64_t session_id; |
| 559 |
| 560 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 561 | void serializeToStream(NativeByteBuffer *stream); |
| 562 | }; |
| 563 |
| 564 | class TL_gzip_packed : public TLObject { |
| 565 |
| 566 | public: |
| 567 | static const uint32_t constructor = 0x3072cfa1; |
| 568 |
| 569 | NativeByteBuffer *packed_data_to_send = nullptr; |
| 570 | std::unique_ptr<NativeByteBuffer> packed_data; |
| 571 | std::unique_ptr<TLObject> originalRequest; |
| 572 |
| 573 | ~TL_gzip_packed(); |
| 574 | void readParams(NativeByteBuffer *stream, bool &error); |
| 575 | void serializeToStream(NativeByteBuffer *stream); |
| 576 | }; |
| 577 |
| 578 | class TL_error : public TLObject { |
| 579 |
| 580 | public: |
| 581 | static const uint32_t constructor = 0xc4b9f9bb; |
| 582 |
| 583 | int32_t code; |
| 584 | std::string text; |
| 585 |
| 586 | static TL_error *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 587 | void readParams(NativeByteBuffer *stream, bool &error); |
| 588 | void serializeToStream(NativeByteBuffer *stream); |
| 589 | }; |
| 590 |
| 591 | class TL_invokeAfterMsg : public TLObject { |
| 592 |
| 593 | public: |
| 594 | static const uint32_t constructor = 0xcb9f372d; |
| 595 |
| 596 | int64_t msg_id; |
| 597 | TLObject *outgoingQuery = nullptr; |
| 598 | std::unique_ptr<TLObject> query; |
| 599 |
| 600 | void serializeToStream(NativeByteBuffer *stream); |
| 601 | }; |
| 602 |
| 603 | class invokeWithLayer : public TLObject { |
| 604 |
| 605 | public: |
| 606 | static const uint32_t constructor = 0xda9b0d0d; |
| 607 |
| 608 | int32_t layer; |
| 609 | std::unique_ptr<TLObject> query; |
| 610 |
| 611 | void serializeToStream(NativeByteBuffer *stream); |
| 612 | }; |
| 613 |
| 614 | class initConnection : public TLObject { |
| 615 |
| 616 | public: |
| 617 | static const uint32_t constructor = 0x69796de9; |
| 618 |
| 619 | int32_t api_id; |
| 620 | std::string device_model; |
| 621 | std::string system_version; |
| 622 | std::string app_version; |
| 623 | std::string lang_code; |
| 624 | std::unique_ptr<TLObject> query; |
| 625 |
| 626 | void serializeToStream(NativeByteBuffer *stream); |
| 627 | }; |
| 628 |
| 629 | class TL_dcOption : public TLObject { |
| 630 |
| 631 | public: |
| 632 | static const uint32_t constructor = 0x5d8c6cc; |
| 633 |
| 634 | int32_t flags; |
| 635 | int32_t id; |
| 636 | std::string ip_address; |
| 637 | int32_t port; |
| 638 |
| 639 | static TL_dcOption *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 640 | void readParams(NativeByteBuffer *stream, bool &error); |
| 641 | void serializeToStream(NativeByteBuffer *stream); |
| 642 | }; |
| 643 |
| 644 | class TL_disabledFeature : public TLObject { |
| 645 |
| 646 | public: |
| 647 | static const uint32_t constructor = 0xae636f24; |
| 648 |
| 649 | std::string feature; |
| 650 | std::string description; |
| 651 |
| 652 | static TL_disabledFeature *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 653 | void readParams(NativeByteBuffer *stream, bool &error); |
| 654 | void serializeToStream(NativeByteBuffer *stream); |
| 655 | }; |
| 656 |
| 657 | class TL_config : public TLObject { |
| 658 |
| 659 | public: |
| 660 | static const uint32_t constructor = 0x317ceef4; |
| 661 |
| 662 | int32_t date; |
| 663 | int32_t expires; |
| 664 | bool test_mode; |
| 665 | int32_t this_dc; |
| 666 | std::vector<std::unique_ptr<TL_dcOption>> dc_options; |
| 667 | int32_t chat_size_max; |
| 668 | int32_t megagroup_size_max; |
| 669 | int32_t forwarded_count_max; |
| 670 | int32_t online_update_period_ms; |
| 671 | int32_t offline_blur_timeout_ms; |
| 672 | int32_t offline_idle_timeout_ms; |
| 673 | int32_t online_cloud_timeout_ms; |
| 674 | int32_t notify_cloud_delay_ms; |
| 675 | int32_t notify_default_delay_ms; |
| 676 | int32_t chat_big_size; |
| 677 | int32_t push_chat_period_ms; |
| 678 | int32_t push_chat_limit; |
| 679 | int32_t saved_gifs_limit; |
| 680 | int32_t edit_time_limit; |
| 681 | std::vector<std::unique_ptr<TL_disabledFeature>> disabled_features; |
| 682 |
| 683 | static TL_config *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 684 | void readParams(NativeByteBuffer *stream, bool &error); |
| 685 | void serializeToStream(NativeByteBuffer *stream); |
| 686 | }; |
| 687 |
| 688 | class TL_help_getConfig : public TLObject { |
| 689 |
| 690 | public: |
| 691 | static const uint32_t constructor = 0xc4f9186b; |
| 692 |
| 693 | bool isNeedLayer(); |
| 694 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 695 | void serializeToStream(NativeByteBuffer *stream); |
| 696 | }; |
| 697 |
| 698 | class Bool : public TLObject { |
| 699 |
| 700 | public: |
| 701 | static Bool *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 702 | }; |
| 703 |
| 704 | class TL_boolTrue : public Bool { |
| 705 |
| 706 | public: |
| 707 | static const uint32_t constructor = 0x997275b5; |
| 708 |
| 709 | void serializeToStream(NativeByteBuffer *stream); |
| 710 | }; |
| 711 |
| 712 | class TL_boolFalse : public Bool { |
| 713 |
| 714 | public: |
| 715 | static const uint32_t constructor = 0xbc799737; |
| 716 |
| 717 | void serializeToStream(NativeByteBuffer *stream); |
| 718 | }; |
| 719 |
| 720 | class TL_account_registerDevice : public TLObject { |
| 721 |
| 722 | public: |
| 723 | static const uint32_t constructor = 0x446c712c; |
| 724 |
| 725 | int32_t token_type; |
| 726 | std::string token; |
| 727 | std::string device_model; |
| 728 | std::string system_version; |
| 729 | std::string app_version; |
| 730 | bool app_sandbox; |
| 731 | std::string lang_code; |
| 732 |
| 733 | bool isNeedLayer(); |
| 734 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 735 | void serializeToStream(NativeByteBuffer *stream); |
| 736 | }; |
| 737 |
| 738 | class UserStatus : public TLObject { |
| 739 |
| 740 | public: |
| 741 | int32_t expires; |
| 742 |
| 743 | static UserStatus *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 744 | }; |
| 745 |
| 746 | class TL_userStatusOffline : public UserStatus { |
| 747 |
| 748 | public: |
| 749 | static const uint32_t constructor = 0x8c703f; |
| 750 |
| 751 | void readParams(NativeByteBuffer *stream, bool &error); |
| 752 | void serializeToStream(NativeByteBuffer *stream); |
| 753 | }; |
| 754 |
| 755 | class TL_userStatusLastWeek : public UserStatus { |
| 756 |
| 757 | public: |
| 758 | static const uint32_t constructor = 0x7bf09fc; |
| 759 |
| 760 | void serializeToStream(NativeByteBuffer *stream); |
| 761 | }; |
| 762 |
| 763 | class TL_userStatusEmpty : public UserStatus { |
| 764 |
| 765 | public: |
| 766 | static const uint32_t constructor = 0x9d05049; |
| 767 |
| 768 | void serializeToStream(NativeByteBuffer *stream); |
| 769 | }; |
| 770 |
| 771 | class TL_userStatusLastMonth : public UserStatus { |
| 772 |
| 773 | public: |
| 774 | static const uint32_t constructor = 0x77ebc742; |
| 775 |
| 776 | void serializeToStream(NativeByteBuffer *stream); |
| 777 | }; |
| 778 |
| 779 | class TL_userStatusOnline : public UserStatus { |
| 780 |
| 781 | public: |
| 782 | static const uint32_t constructor = 0xedb93949; |
| 783 |
| 784 | void readParams(NativeByteBuffer *stream, bool &error); |
| 785 | void serializeToStream(NativeByteBuffer *stream); |
| 786 | }; |
| 787 |
| 788 | class TL_userStatusRecently : public UserStatus { |
| 789 |
| 790 | public: |
| 791 | static const uint32_t constructor = 0xe26f42f1; |
| 792 |
| 793 | void serializeToStream(NativeByteBuffer *stream); |
| 794 | }; |
| 795 |
| 796 | class FileLocation : public TLObject { |
| 797 |
| 798 | public: |
| 799 | int32_t dc_id; |
| 800 | int64_t volume_id; |
| 801 | int32_t local_id; |
| 802 | int64_t secret; |
| 803 |
| 804 | static FileLocation *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 805 | }; |
| 806 |
| 807 | class TL_fileLocation : public FileLocation { |
| 808 |
| 809 | public: |
| 810 | static const uint32_t constructor = 0x53d69076; |
| 811 |
| 812 | void readParams(NativeByteBuffer *stream, bool &error); |
| 813 | void serializeToStream(NativeByteBuffer *stream); |
| 814 | }; |
| 815 |
| 816 | class TL_fileLocationUnavailable : public FileLocation { |
| 817 |
| 818 | public: |
| 819 | static const uint32_t constructor = 0x7c596b46; |
| 820 |
| 821 | void readParams(NativeByteBuffer *stream, bool &error); |
| 822 | void serializeToStream(NativeByteBuffer *stream); |
| 823 | }; |
| 824 |
| 825 | class UserProfilePhoto : public TLObject { |
| 826 |
| 827 | public: |
| 828 | int64_t photo_id; |
| 829 | std::unique_ptr<FileLocation> photo_small; |
| 830 | std::unique_ptr<FileLocation> photo_big; |
| 831 |
| 832 | static UserProfilePhoto *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 833 | }; |
| 834 |
| 835 | class TL_userProfilePhotoEmpty : public UserProfilePhoto { |
| 836 |
| 837 | public: |
| 838 | static const uint32_t constructor = 0x4f11bae1; |
| 839 |
| 840 | void serializeToStream(NativeByteBuffer *stream); |
| 841 | }; |
| 842 |
| 843 | class TL_userProfilePhoto : public UserProfilePhoto { |
| 844 |
| 845 | public: |
| 846 | static const uint32_t constructor = 0xd559d8c8; |
| 847 |
| 848 | void readParams(NativeByteBuffer *stream, bool &error); |
| 849 | void serializeToStream(NativeByteBuffer *stream); |
| 850 | }; |
| 851 |
| 852 | class User : public TLObject { |
| 853 |
| 854 | public: |
| 855 | int32_t id; |
| 856 | std::string first_name; |
| 857 | std::string last_name; |
| 858 | std::string username; |
| 859 | int64_t access_hash; |
| 860 | std::string phone; |
| 861 | std::unique_ptr<UserProfilePhoto> photo; |
| 862 | std::unique_ptr<UserStatus> status; |
| 863 | int32_t flags; |
| 864 | int32_t bot_info_version; |
| 865 | std::string restriction_reason; |
| 866 | std::string bot_inline_placeholder; |
| 867 |
| 868 | static User *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 869 | }; |
| 870 |
| 871 | class TL_userEmpty : public User { |
| 872 |
| 873 | public: |
| 874 | static const uint32_t constructor = 0x200250ba; |
| 875 |
| 876 | void readParams(NativeByteBuffer *stream, bool &error); |
| 877 | void serializeToStream(NativeByteBuffer *stream); |
| 878 | }; |
| 879 |
| 880 | class TL_user : public User { |
| 881 |
| 882 | public: |
| 883 | static const uint32_t constructor = 0xd10d979a; |
| 884 |
| 885 | void readParams(NativeByteBuffer *stream, bool &error); |
| 886 | void serializeToStream(NativeByteBuffer *stream); |
| 887 | }; |
| 888 |
| 889 | class TL_auth_authorization : public TLObject { |
| 890 |
| 891 | public: |
| 892 | static const uint32_t constructor = 0xff036af1; |
| 893 |
| 894 | std::unique_ptr<User> user; |
| 895 |
| 896 | static TL_auth_authorization *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 897 | void readParams(NativeByteBuffer *stream, bool &error); |
| 898 | }; |
| 899 |
| 900 | class TL_auth_exportedAuthorization : public TLObject { |
| 901 |
| 902 | public: |
| 903 | static const uint32_t constructor = 0xdf969c2d; |
| 904 |
| 905 | int32_t id; |
| 906 | std::unique_ptr<ByteArray> bytes; |
| 907 |
| 908 | static TL_auth_exportedAuthorization *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 909 | void readParams(NativeByteBuffer *stream, bool &error); |
| 910 | }; |
| 911 |
| 912 | class TL_auth_exportAuthorization : public TLObject { |
| 913 |
| 914 | public: |
| 915 | static const uint32_t constructor = 0xe5bfffcd; |
| 916 |
| 917 | int32_t dc_id; |
| 918 |
| 919 | bool isNeedLayer(); |
| 920 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 921 | void serializeToStream(NativeByteBuffer *stream); |
| 922 | }; |
| 923 |
| 924 | class TL_auth_importAuthorization : public TLObject { |
| 925 |
| 926 | public: |
| 927 | static const uint32_t constructor = 0xe3ef9613; |
| 928 |
| 929 | int32_t id; |
| 930 | std::unique_ptr<ByteArray> bytes; |
| 931 |
| 932 | bool isNeedLayer(); |
| 933 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 934 | void serializeToStream(NativeByteBuffer *stream); |
| 935 | }; |
| 936 |
| 937 | class auth_SentCode : public TLObject { |
| 938 |
| 939 | public: |
| 940 | bool phone_registered; |
| 941 | std::string phone_code_hash; |
| 942 | int32_t send_call_timeout; |
| 943 | bool is_password; |
| 944 |
| 945 | static auth_SentCode *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 946 | }; |
| 947 |
| 948 | class TL_auth_sentAppCode : public auth_SentCode { |
| 949 |
| 950 | public: |
| 951 | static const uint32_t constructor = 0xe325edcf; |
| 952 |
| 953 | void readParams(NativeByteBuffer *stream, bool &error); |
| 954 | void serializeToStream(NativeByteBuffer *stream); |
| 955 | }; |
| 956 |
| 957 | class TL_auth_sentCode : public auth_SentCode { |
| 958 |
| 959 | public: |
| 960 | static const uint32_t constructor = 0xefed51d9; |
| 961 |
| 962 | void readParams(NativeByteBuffer *stream, bool &error); |
| 963 | void serializeToStream(NativeByteBuffer *stream); |
| 964 | }; |
| 965 |
| 966 | class TL_auth_sendCode : public TLObject { |
| 967 |
| 968 | public: |
| 969 | static const uint32_t constructor = 0x768d5f4d; |
| 970 |
| 971 | std::string phone_number; |
| 972 | int32_t sms_type; |
| 973 | int32_t api_id; |
| 974 | std::string api_hash; |
| 975 | std::string lang_code; |
| 976 |
| 977 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, bool &error); |
| 978 | void serializeToStream(NativeByteBuffer *stream); |
| 979 | }; |
| 980 |
| 981 | class TL_updatesTooLong : public TLObject { |
| 982 |
| 983 | public: |
| 984 | static const uint32_t constructor = 0xe317af7e; |
| 985 |
| 986 | void serializeToStream(NativeByteBuffer *stream); |
| 987 | }; |
| 988 |
| 989 | #endif |
| 990 |