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