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