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