| 6 |
| * Copyright Nikolai Kudashov, 2015-2018. |
| 7 | */ |
| 8 |
| 9 | #ifndef APISCHEME_H |
| 10 | #define APISCHEME_H |
| 11 |
| 12 | #include <vector> |
| 13 | #include <memory> |
| 14 | #include "TLObject.h" |
| 15 |
| 16 | class ByteArray; |
| 17 | class NativeByteBuffer; |
| 18 |
| 19 | class Bool : public TLObject { |
| 20 |
| 21 | public: |
| 22 | static Bool *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 23 | }; |
| 24 |
| 25 | class TL_boolTrue : public Bool { |
| 26 |
| 27 | public: |
| 28 | static const uint32_t constructor = 0x997275b5; |
| 29 |
| 30 | void serializeToStream(NativeByteBuffer *stream); |
| 31 | }; |
| 32 |
| 33 | class TL_boolFalse : public Bool { |
| 34 |
| 35 | public: |
| 36 | static const uint32_t constructor = 0xbc799737; |
| 37 |
| 38 | void serializeToStream(NativeByteBuffer *stream); |
| 39 | }; |
| 40 |
| 41 | class TL_dcOption : public TLObject { |
| 42 |
| 43 | public: |
| 44 | static const uint32_t constructor = 0x18b7a10d; |
| 45 |
| 46 | int32_t flags; |
| 47 | bool ipv6; |
| 48 | bool media_only; |
| 49 | bool tcpo_only; |
| 50 | bool cdn; |
| 51 | bool isStatic; |
| 52 | int32_t id; |
| 53 | std::string ip_address; |
| 54 | int32_t port; |
| 55 | std::unique_ptr<ByteArray> secret; |
| 56 |
| 57 | static TL_dcOption *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 58 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 59 | void serializeToStream(NativeByteBuffer *stream); |
| 60 | }; |
| 61 |
| 62 | class TL_cdnPublicKey : public TLObject { |
| 63 |
| 64 | public: |
| 65 | static const uint32_t constructor = 0xc982eaba; |
| 66 |
| 67 | int32_t dc_id; |
| 68 | std::string public_key; |
| 69 |
| 70 | static TL_cdnPublicKey *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 71 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 72 | void serializeToStream(NativeByteBuffer *stream); |
| 73 | }; |
| 74 |
| 75 | class TL_cdnConfig : public TLObject { |
| 76 |
| 77 | public: |
| 78 | static const uint32_t constructor = 0x5725e40a; |
| 79 |
| 80 | std::vector<std::unique_ptr<TL_cdnPublicKey>> public_keys; |
| 81 |
| 82 | static TL_cdnConfig *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 83 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 84 | void serializeToStream(NativeByteBuffer *stream); |
| 85 | }; |
| 86 |
| 87 | class TL_help_getCdnConfig : public TLObject { |
| 88 |
| 89 | public: |
| 90 | static const uint32_t constructor = 0x52029342; |
| 91 |
| 92 | bool isNeedLayer(); |
| 93 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 94 | void serializeToStream(NativeByteBuffer *stream); |
| 95 | }; |
| 96 |
| 97 | class TL_config : public TLObject { |
| 98 |
| 99 | public: |
| 100 | static const uint32_t constructor = 0x330b4067; |
| 101 |
| 102 | int32_t flags; |
| 103 | int32_t date; |
| 104 | int32_t expires; |
| 105 | bool test_mode; |
| 106 | int32_t this_dc; |
| 107 | std::vector<std::unique_ptr<TL_dcOption>> dc_options; |
| 108 | std::string dc_txt_domain_name; |
| 109 | int32_t chat_size_max; |
| 110 | int32_t megagroup_size_max; |
| 111 | int32_t forwarded_count_max; |
| 112 | int32_t online_update_period_ms; |
| 113 | int32_t offline_blur_timeout_ms; |
| 114 | int32_t offline_idle_timeout_ms; |
| 115 | int32_t online_cloud_timeout_ms; |
| 116 | int32_t notify_cloud_delay_ms; |
| 117 | int32_t notify_default_delay_ms; |
| 118 | int32_t push_chat_period_ms; |
| 119 | int32_t push_chat_limit; |
| 120 | int32_t saved_gifs_limit; |
| 121 | int32_t edit_time_limit; |
| 122 | int32_t revoke_time_limit; |
| 123 | int32_t revoke_pm_time_limit; |
| 124 | int32_t rating_e_decay; |
| 125 | int32_t stickers_recent_limit; |
| 126 | int32_t stickers_faved_limit; |
| 127 | int32_t channels_read_media_period; |
| 128 | int32_t tmp_sessions; |
| 129 | int32_t pinned_dialogs_count_max; |
| 130 | int32_t pinned_infolder_count_max; |
| 131 | int32_t call_receive_timeout_ms; |
| 132 | int32_t call_ring_timeout_ms; |
| 133 | int32_t call_connect_timeout_ms; |
| 134 | int32_t call_packet_timeout_ms; |
| 135 | std::string me_url_prefix; |
| 136 | std::string autoupdate_url_prefix; |
| 137 | std::string gif_search_username; |
| 138 | std::string venue_search_username; |
| 139 | std::string img_search_username; |
| 140 | std::string static_maps_provider; |
| 141 | int32_t caption_length_max; |
| 142 | int32_t message_length_max; |
| 143 | int32_t webfile_dc_id; |
| 144 | std::string suggested_lang_code; |
| 145 | int32_t lang_pack_version; |
| 146 | int32_t base_lang_pack_version; |
| 147 |
| 148 | static TL_config *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 149 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 150 | void serializeToStream(NativeByteBuffer *stream); |
| 151 | }; |
| 152 |
| 153 | class TL_help_getConfig : public TLObject { |
| 154 |
| 155 | public: |
| 156 | static const uint32_t constructor = 0xc4f9186b; |
| 157 |
| 158 | bool isNeedLayer(); |
| 159 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 160 | void serializeToStream(NativeByteBuffer *stream); |
| 161 | }; |
| 162 |
| 163 | class TL_account_registerDevice : public TLObject { |
| 164 |
| 165 | public: |
| 166 | static const uint32_t constructor = 0x637ea878; |
| 167 |
| 168 | int32_t token_type; |
| 169 | std::string token; |
| 170 |
| 171 | bool isNeedLayer(); |
| 172 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 173 | void serializeToStream(NativeByteBuffer *stream); |
| 174 | }; |
| 175 |
| 176 | class UserStatus : public TLObject { |
| 177 |
| 178 | public: |
| 179 | int32_t expires; |
| 180 |
| 181 | static UserStatus *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 182 | }; |
| 183 |
| 184 | class TL_userStatusOffline : public UserStatus { |
| 185 |
| 186 | public: |
| 187 | static const uint32_t constructor = 0x8c703f; |
| 188 |
| 189 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 190 | void serializeToStream(NativeByteBuffer *stream); |
| 191 | }; |
| 192 |
| 193 | class TL_userStatusLastWeek : public UserStatus { |
| 194 |
| 195 | public: |
| 196 | static const uint32_t constructor = 0x7bf09fc; |
| 197 |
| 198 | void serializeToStream(NativeByteBuffer *stream); |
| 199 | }; |
| 200 |
| 201 | class TL_userStatusEmpty : public UserStatus { |
| 202 |
| 203 | public: |
| 204 | static const uint32_t constructor = 0x9d05049; |
| 205 |
| 206 | void serializeToStream(NativeByteBuffer *stream); |
| 207 | }; |
| 208 |
| 209 | class TL_userStatusLastMonth : public UserStatus { |
| 210 |
| 211 | public: |
| 212 | static const uint32_t constructor = 0x77ebc742; |
| 213 |
| 214 | void serializeToStream(NativeByteBuffer *stream); |
| 215 | }; |
| 216 |
| 217 | class TL_userStatusOnline : public UserStatus { |
| 218 |
| 219 | public: |
| 220 | static const uint32_t constructor = 0xedb93949; |
| 221 |
| 222 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 223 | void serializeToStream(NativeByteBuffer *stream); |
| 224 | }; |
| 225 |
| 226 | class TL_userStatusRecently : public UserStatus { |
| 227 |
| 228 | public: |
| 229 | static const uint32_t constructor = 0xe26f42f1; |
| 230 |
| 231 | void serializeToStream(NativeByteBuffer *stream); |
| 232 | }; |
| 233 |
| 234 | class FileLocation : public TLObject { |
| 235 |
| 236 | public: |
| 237 | int64_t volume_id; |
| 238 | int32_t local_id; |
| 239 |
| 240 | static FileLocation *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 241 | }; |
| 242 |
| 243 | class TL_fileLocationToBeDeprecated : public FileLocation { |
| 244 |
| 245 | public: |
| 246 | static const uint32_t constructor = 0xbc7fc6cd; |
| 247 |
| 248 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 249 | void serializeToStream(NativeByteBuffer *stream); |
| 250 | }; |
| 251 |
| 252 | class UserProfilePhoto : public TLObject { |
| 253 |
| 254 | public: |
| 255 | int64_t photo_id; |
| 256 | std::unique_ptr<FileLocation> photo_small; |
| 257 | std::unique_ptr<FileLocation> photo_big; |
| 258 | int32_t dc_id; |
| 259 |
| 260 | static UserProfilePhoto *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 261 | }; |
| 262 |
| 263 | class TL_userProfilePhotoEmpty : public UserProfilePhoto { |
| 264 |
| 265 | public: |
| 266 | static const uint32_t constructor = 0x4f11bae1; |
| 267 |
| 268 | void serializeToStream(NativeByteBuffer *stream); |
| 269 | }; |
| 270 |
| 271 | class TL_userProfilePhoto : public UserProfilePhoto { |
| 272 |
| 273 | public: |
| 274 | static const uint32_t constructor = 0xecd75d8c; |
| 275 |
| 276 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 277 | void serializeToStream(NativeByteBuffer *stream); |
| 278 | }; |
| 279 |
| 280 | class User : public TLObject { |
| 281 |
| 282 | public: |
| 283 | int32_t id; |
| 284 | std::string first_name; |
| 285 | std::string last_name; |
| 286 | std::string username; |
| 287 | int64_t access_hash; |
| 288 | std::string phone; |
| 289 | std::unique_ptr<UserProfilePhoto> photo; |
| 290 | std::unique_ptr<UserStatus> status; |
| 291 | int32_t flags; |
| 292 | int32_t bot_info_version; |
| 293 | std::string restriction_reason; |
| 294 | std::string bot_inline_placeholder; |
| 295 | std::string lang_code; |
| 296 |
| 297 | static User *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 298 | }; |
| 299 |
| 300 | class TL_userEmpty : public User { |
| 301 |
| 302 | public: |
| 303 | static const uint32_t constructor = 0x200250ba; |
| 304 |
| 305 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 306 | void serializeToStream(NativeByteBuffer *stream); |
| 307 | }; |
| 308 |
| 309 | class TL_user : public User { |
| 310 |
| 311 | public: |
| 312 | static const uint32_t constructor = 0x2e13f4c3; |
| 313 |
| 314 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 315 | void serializeToStream(NativeByteBuffer *stream); |
| 316 | }; |
| 317 |
| 318 | class TL_auth_authorization : public TLObject { |
| 319 |
| 320 | public: |
| 321 | static const uint32_t constructor = 0xcd050916; |
| 322 |
| 323 | int32_t flags; |
| 324 | int32_t tmp_sessions; |
| 325 | std::unique_ptr<User> user; |
| 326 |
| 327 | static TL_auth_authorization *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 328 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 329 | }; |
| 330 |
| 331 | class TL_auth_exportedAuthorization : public TLObject { |
| 332 |
| 333 | public: |
| 334 | static const uint32_t constructor = 0xdf969c2d; |
| 335 |
| 336 | int32_t id; |
| 337 | std::unique_ptr<ByteArray> bytes; |
| 338 |
| 339 | static TL_auth_exportedAuthorization *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 340 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 341 | }; |
| 342 |
| 343 | class TL_auth_exportAuthorization : public TLObject { |
| 344 |
| 345 | public: |
| 346 | static const uint32_t constructor = 0xe5bfffcd; |
| 347 |
| 348 | int32_t dc_id; |
| 349 |
| 350 | bool isNeedLayer(); |
| 351 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 352 | void serializeToStream(NativeByteBuffer *stream); |
| 353 | }; |
| 354 |
| 355 | class TL_auth_importAuthorization : public TLObject { |
| 356 |
| 357 | public: |
| 358 | static const uint32_t constructor = 0xe3ef9613; |
| 359 |
| 360 | int32_t id; |
| 361 | std::unique_ptr<ByteArray> bytes; |
| 362 |
| 363 | bool isNeedLayer(); |
| 364 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 365 | void serializeToStream(NativeByteBuffer *stream); |
| 366 | }; |
| 367 |
| 368 | class TL_updatesTooLong : public TLObject { |
| 369 |
| 370 | public: |
| 371 | static const uint32_t constructor = 0xe317af7e; |
| 372 |
| 373 | void serializeToStream(NativeByteBuffer *stream); |
| 374 | }; |
| 375 |
| 376 | #endif |
| 377 |