diff --git a/.gitignore b/.gitignore index f147edf..1184900 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,6 @@ compile_commands.json # QtCreator local machine specific files for imported projects *creator.user* + +# TDLib API Secrets +tdlibsecrets.h diff --git a/README.md b/README.md index c9b0e40..1fc9070 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,25 @@ -# harbour-fernschreiber -Fernschreiber is a Telegram client for Sailfish OS +# Fernschreiber +A Telegram client for Sailfish OS + +## Author +Sebastian J. Wolf [sebastian@ygriega.de](mailto:sebastian@ygriega.de) + +## License +Licensed under GNU GPLv3 + +## Build +Simply clone this repository and use the project file `harbour-fernschreiber.pro` to import the sources in your SailfishOS IDE. To build and run Fernschreiber or an application which is based on Fernschreiber, you need to create the file `harbour-fernschreiber/src/tdlibsecrets.h` and enter the required constants in the following format: + +``` +#ifndef TDLIBSECRETS_H +#define TDLIBSECRETS_H +const char TDLIB_API_ID[] = "42424242"; +const char TDLIB_API_HASH[] = "1234567890abcdef1234567890abcdef"; +#endif // TDLIBSECRETS_H +``` + +You get the Telegram API ID and hash as soon as you've registered your own application on [https://my.telegram.org](https://my.telegram.org). + +## Credits +This project uses +- The Telegram Database Library (TDLib) - available on [GitHub.com](https://github.com/tdlib/td). Thanks for making it available under the conditions of the Boost Software License 1.0! Details about the license of TDLib in [its license file](https://github.com/tdlib/td/blob/master/LICENSE_1_0.txt). diff --git a/harbour-fernschreiber.desktop b/harbour-fernschreiber.desktop new file mode 100644 index 0000000..d6137b8 --- /dev/null +++ b/harbour-fernschreiber.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Application +X-Nemo-Application-Type=silica-qt5 +Icon=harbour-fernschreiber +Exec=harbour-fernschreiber +Name=Fernschreiber diff --git a/harbour-fernschreiber.pro b/harbour-fernschreiber.pro new file mode 100644 index 0000000..f1fb621 --- /dev/null +++ b/harbour-fernschreiber.pro @@ -0,0 +1,74 @@ +# NOTICE: +# +# Application name defined in TARGET has a corresponding QML filename. +# If name defined in TARGET is changed, the following needs to be done +# to match new name: +# - corresponding QML filename must be changed +# - desktop icon filename must be changed +# - desktop filename must be changed +# - icon definition filename in desktop file must be changed +# - translation filenames have to be changed + +# The name of your application +TARGET = harbour-fernschreiber + +CONFIG += sailfishapp sailfishapp_i18n + +SOURCES += src/harbour-fernschreiber.cpp \ + src/tdlibwrapper.cpp + +DISTFILES += qml/harbour-fernschreiber.qml \ + qml/pages/CoverPage.qml \ + qml/pages/OverviewPage.qml \ + qml/pages/AboutPage.qml \ + rpm/harbour-fernschreiber.changes.in \ + rpm/harbour-fernschreiber.changes.run.in \ + rpm/harbour-fernschreiber.spec \ + rpm/harbour-fernschreiber.yaml \ + translations/*.ts \ + harbour-fernschreiber.desktop + +SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172 256x256 + +TRANSLATIONS += translations/harbour-fernschreiber-de.ts + +LIBS += -L$$PWD/tdlib/lib/ -ltdjson + +INCLUDEPATH += $$PWD/tdlib/include +DEPENDPATH += $$PWD/tdlib/include + +telegram.files = $$PWD/tdlib/lib +telegram.path = /usr/share/$${TARGET} + +gui.files = qml +gui.path = /usr/share/$${TARGET} + +images.files = images +images.path = /usr/share/$${TARGET} + +ICONPATH = /usr/share/icons/hicolor + +86.png.path = $${ICONPATH}/86x86/apps/ +86.png.files += icons/86x86/harbour-fernschreiber.png + +108.png.path = $${ICONPATH}/108x108/apps/ +108.png.files += icons/108x108/harbour-fernschreiber.png + +128.png.path = $${ICONPATH}/128x128/apps/ +128.png.files += icons/128x128/harbour-fernschreiber.png + +172.png.path = $${ICONPATH}/172x172/apps/ +172.png.files += icons/172x172/harbour-fernschreiber.png + +256.png.path = $${ICONPATH}/256x256/apps/ +256.png.files += icons/256x256/harbour-fernschreiber.png + +fernschreiber.desktop.path = /usr/share/applications/ +fernschreiber.desktop.files = harbour-fernschreiber.desktop + +INSTALLS += telegram 86.png 108.png 128.png 172.png 256.png \ + fernschreiber.desktop gui images + +HEADERS += \ + src/tdlibsecrets.h \ + src/tdlibwrapper.h diff --git a/icons/108x108/harbour-fernschreiber.png b/icons/108x108/harbour-fernschreiber.png new file mode 100644 index 0000000..83e6153 Binary files /dev/null and b/icons/108x108/harbour-fernschreiber.png differ diff --git a/icons/128x128/harbour-fernschreiber.png b/icons/128x128/harbour-fernschreiber.png new file mode 100644 index 0000000..5fd6a2e Binary files /dev/null and b/icons/128x128/harbour-fernschreiber.png differ diff --git a/icons/172x172/harbour-fernschreiber.png b/icons/172x172/harbour-fernschreiber.png new file mode 100644 index 0000000..bd9b9f4 Binary files /dev/null and b/icons/172x172/harbour-fernschreiber.png differ diff --git a/icons/256x256/harbour-fernschreiber.png b/icons/256x256/harbour-fernschreiber.png new file mode 100644 index 0000000..5778a31 Binary files /dev/null and b/icons/256x256/harbour-fernschreiber.png differ diff --git a/icons/86x86/harbour-fernschreiber.png b/icons/86x86/harbour-fernschreiber.png new file mode 100644 index 0000000..30ee140 Binary files /dev/null and b/icons/86x86/harbour-fernschreiber.png differ diff --git a/images/background-black.png b/images/background-black.png new file mode 100644 index 0000000..2f1216e Binary files /dev/null and b/images/background-black.png differ diff --git a/images/background-white.png b/images/background-white.png new file mode 100644 index 0000000..3347b9d Binary files /dev/null and b/images/background-white.png differ diff --git a/images/fernschreiber.png b/images/fernschreiber.png new file mode 100644 index 0000000..4870166 Binary files /dev/null and b/images/fernschreiber.png differ diff --git a/qml/harbour-fernschreiber.qml b/qml/harbour-fernschreiber.qml new file mode 100644 index 0000000..ce2015b --- /dev/null +++ b/qml/harbour-fernschreiber.qml @@ -0,0 +1,17 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 +import "pages" + +ApplicationWindow +{ + id: appWindow + + Component { + id: overviewPage + OverviewPage {} + } + + initialPage: overviewPage + cover: Qt.resolvedUrl("pages/CoverPage.qml") + allowedOrientations: defaultAllowedOrientations +} diff --git a/qml/pages/AboutPage.qml b/qml/pages/AboutPage.qml new file mode 100644 index 0000000..ed4e7fd --- /dev/null +++ b/qml/pages/AboutPage.qml @@ -0,0 +1,195 @@ +/* + Copyright (C) 2020 Sebastian J. Wolf + + This file is part of Fernschreiber. + + fernschreiber is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + fernschreiber is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Fernschreiber. If not, see . +*/ +import QtQuick 2.0 +import Sailfish.Silica 1.0 + +Page { + id: aboutPage + allowedOrientations: Orientation.All + + SilicaFlickable { + id: aboutContainer + contentHeight: column.height + anchors.fill: parent + + Column { + id: column + width: aboutPage.width + spacing: Theme.paddingLarge + + PageHeader { + title: qsTr("About Fernschreiber") + } + + Image { + id: wunderfitzImage + source: "../../images/fernschreiber.png" + anchors { + horizontalCenter: parent.horizontalCenter + } + + fillMode: Image.PreserveAspectFit + width: 2/3 * parent.width + + } + + Label { + text: "Fernschreiber 0.1" + horizontalAlignment: Text.AlignHCenter + font.pixelSize: Theme.fontSizeExtraLarge + anchors { + horizontalCenter: parent.horizontalCenter + } + } + + Label { + wrapMode: Text.Wrap + x: Theme.horizontalPageMargin + width: parent.width - ( 2 * Theme.horizontalPageMargin ) + horizontalAlignment: Text.AlignHCenter + text: qsTr("A Telegram client for Sailfish OS") + font.pixelSize: Theme.fontSizeSmall + anchors { + horizontalCenter: parent.horizontalCenter + } + } + + Label { + text: qsTr("By Sebastian J. Wolf") + font.pixelSize: Theme.fontSizeSmall + anchors { + horizontalCenter: parent.horizontalCenter + } + } + + Text { + text: "" + qsTr("Send E-Mail") + "" + anchors { + horizontalCenter: parent.horizontalCenter + } + font.pixelSize: Theme.fontSizeSmall + linkColor: Theme.highlightColor + + onLinkActivated: Qt.openUrlExternally("mailto:sebastian@ygriega.de") + } + + Separator { + width: parent.width + color: Theme.primaryColor + horizontalAlignment: Qt.AlignHCenter + } + + Label { + text: qsTr("Licensed under GNU GPLv3") + font.pixelSize: Theme.fontSizeSmall + anchors { + horizontalCenter: parent.horizontalCenter + } + } + + Text { + text: "" + qsTr("Sources on GitHub") + "" + anchors { + horizontalCenter: parent.horizontalCenter + } + font.pixelSize: Theme.fontSizeSmall + linkColor: Theme.highlightColor + + onLinkActivated: Qt.openUrlExternally("https://github.com/Wunderfitz/harbour-fernschreiber") + } + + SectionHeader { + text: qsTr("About Telegram") + } + + Label { + x: Theme.horizontalPageMargin + width: parent.width - ( 2 * Theme.horizontalPageMargin ) + text: qsTr("This product uses the Telegram API but is not endorsed or certified by Telegram") + font.pixelSize: Theme.fontSizeSmall + wrapMode: Text.Wrap + anchors { + horizontalCenter: parent.horizontalCenter + } + } + + Button { + id: flickrTosButton + text: qsTr("Terms of Service") + anchors { + horizontalCenter: parent.horizontalCenter + } + onClicked: { + Qt.openUrlExternally("https://telegram.org/tos"); + } + } + + Button { + id: flickrPrivacyButton + text: qsTr("Privacy Policy") + anchors { + horizontalCenter: parent.horizontalCenter + } + onClicked: { + Qt.openUrlExternally("https://telegram.orgprivacy") + } + } + + SectionHeader { + text: qsTr("Credits") + } + + Label { + x: Theme.horizontalPageMargin + width: parent.width - ( 2 * Theme.horizontalPageMargin ) + text: qsTr("This project uses the Telegram Database Library (TDLib). Thanks for making it available under the conditions of the Boost Software License 1.0!") + font.pixelSize: Theme.fontSizeExtraSmall + wrapMode: Text.Wrap + anchors { + horizontalCenter: parent.horizontalCenter + } + } + + Text { + text: "" + qsTr("Open Telegram Database Library on GitHub") + "" + anchors { + horizontalCenter: parent.horizontalCenter + } + font.pixelSize: Theme.fontSizeSmall + linkColor: Theme.highlightColor + + onLinkActivated: Qt.openUrlExternally("https://github.com/tdlib/td") + } + + Label { + id: separatorLabel + x: Theme.horizontalPageMargin + width: parent.width - ( 2 * Theme.horizontalPageMargin ) + font.pixelSize: Theme.fontSizeExtraSmall + wrapMode: Text.Wrap + anchors { + horizontalCenter: parent.horizontalCenter + } + } + + VerticalScrollDecorator {} + } + + } +} diff --git a/qml/pages/CoverPage.qml b/qml/pages/CoverPage.qml new file mode 100644 index 0000000..0f02f8d --- /dev/null +++ b/qml/pages/CoverPage.qml @@ -0,0 +1,43 @@ +/* + Copyright (C) 2020 Sebastian J. Wolf + + This file is part of Fernschreiber. + + fernschreiber is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + fernschreiber is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Fernschreiber. If not, see . +*/ +import QtQuick 2.5 +import Sailfish.Silica 1.0 + +CoverBackground { + + id: coverPage + + Image { + id: backgroundImage + source: "../../images/background" + ( Theme.colorScheme ? "-black" : "-white" ) + ".png" + anchors { + verticalCenter: parent.verticalCenter + + bottom: parent.bottom + bottomMargin: Theme.paddingMedium + + right: parent.right + rightMargin: Theme.paddingMedium + } + + fillMode: Image.PreserveAspectFit + opacity: 0.15 + } + +} diff --git a/qml/pages/OverviewPage.qml b/qml/pages/OverviewPage.qml new file mode 100644 index 0000000..c74487a --- /dev/null +++ b/qml/pages/OverviewPage.qml @@ -0,0 +1,56 @@ +/* + Copyright (C) 2020 Sebastian J. Wolf + + This file is part of Fernschreiber. + + fernschreiber is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + fernschreiber is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Fernschreiber. If not, see . +*/ +import QtQuick 2.5 +import QtGraphicalEffects 1.0 +import QtMultimedia 5.0 +import Sailfish.Silica 1.0 +import Nemo.Notifications 1.0 + + +Page { + id: overviewPage + allowedOrientations: Orientation.All + + SilicaFlickable { + id: aboutContainer + contentHeight: column.height + anchors.fill: parent + + PullDownMenu { + MenuItem { + text: qsTr("About Fernschreiber") + onClicked: pageStack.push(Qt.resolvedUrl("../pages/AboutPage.qml")) + } + } + + Column { + id: column + width: parent.width + spacing: Theme.paddingLarge + + PageHeader { + title: qsTr("Welcome to Fernschreiber") + } + + VerticalScrollDecorator {} + } + + } + +} diff --git a/rpm/harbour-fernschreiber.changes.in b/rpm/harbour-fernschreiber.changes.in new file mode 100644 index 0000000..3814394 --- /dev/null +++ b/rpm/harbour-fernschreiber.changes.in @@ -0,0 +1,18 @@ +# Rename this file as harbour-fernschreiber.changes to include changelog +# entries in your RPM file. +# +# Add new changelog entries following the format below. +# Add newest entries to the top of the list. +# Separate entries from eachother with a blank line. +# +# Alternatively, if your changelog is automatically generated (e.g. with +# the git-change-log command provided with Sailfish OS SDK), create a +# harbour-fernschreiber.changes.run script to let mb2 run the required commands for you. + +# * date Author's Name version-release +# - Summary of changes + +* Sun Apr 13 2014 Jack Tar 0.0.1-1 +- Scrubbed the deck +- Hoisted the sails + diff --git a/rpm/harbour-fernschreiber.changes.run.in b/rpm/harbour-fernschreiber.changes.run.in new file mode 100644 index 0000000..60865e3 --- /dev/null +++ b/rpm/harbour-fernschreiber.changes.run.in @@ -0,0 +1,25 @@ +#!/bin/bash +# +# Rename this file as harbour-fernschreiber.changes.run to let mb2 automatically +# generate changelog from well formatted Git commit messages and tag +# annotations. + +git-change-log + +# Here are some basic examples how to change from the default behavior. Run +# git-change-log --help inside the Sailfish OS SDK chroot or build engine to +# learn all the options git-change-log accepts. + +# Use a subset of tags +#git-change-log --tags refs/tags/my-prefix/* + +# Group entries by minor revision, suppress headlines for patch-level revisions +#git-change-log --dense '/[0-9]+.[0-9+$' + +# Trim very old changes +#git-change-log --since 2014-04-01 +#echo '[ Some changelog entries trimmed for brevity ]' + +# Use the subjects (first lines) of tag annotations when no entry would be +# included for a revision otherwise +#git-change-log --auto-add-annotations diff --git a/rpm/harbour-fernschreiber.spec b/rpm/harbour-fernschreiber.spec new file mode 100644 index 0000000..1b6997f --- /dev/null +++ b/rpm/harbour-fernschreiber.spec @@ -0,0 +1,69 @@ +# +# Do NOT Edit the Auto-generated Part! +# Generated by: spectacle version 0.27 +# + +Name: harbour-fernschreiber + +# >> macros +%define __provides_exclude_from ^%{_datadir}/.*$ +%define __requires_exclude ^libtdjson.*$ +# << macros + +Summary: Fernschreiber is a Telegram client for Sailfish OS +Version: 0.1 +Release: 1 +Group: Qt/Qt +License: LICENSE +URL: http://werkwolf.eu/ +Source0: %{name}-%{version}.tar.bz2 +Source100: harbour-fernschreiber.yaml +Requires: sailfishsilica-qt5 >= 0.10.9 +BuildRequires: pkgconfig(sailfishapp) >= 1.0.2 +BuildRequires: pkgconfig(Qt5Core) +BuildRequires: pkgconfig(Qt5Qml) +BuildRequires: pkgconfig(Qt5Quick) +BuildRequires: desktop-file-utils + +%description +Fernschreiber is a Telegram client for Sailfish OS + + +%prep +%setup -q -n %{name}-%{version} + +# >> setup +# << setup + +%build +# >> build pre +# << build pre + +%qmake5 + +make %{?_smp_mflags} + +# >> build post +# << build post + +%install +rm -rf %{buildroot} +# >> install pre +# << install pre +%qmake5_install + +# >> install post +# << install post + +desktop-file-install --delete-original \ + --dir %{buildroot}%{_datadir}/applications \ + %{buildroot}%{_datadir}/applications/*.desktop + +%files +%defattr(-,root,root,-) +%{_bindir} +%{_datadir}/%{name} +%{_datadir}/applications/%{name}.desktop +%{_datadir}/icons/hicolor/*/apps/%{name}.png +# >> files +# << files diff --git a/rpm/harbour-fernschreiber.yaml b/rpm/harbour-fernschreiber.yaml new file mode 100644 index 0000000..78944c6 --- /dev/null +++ b/rpm/harbour-fernschreiber.yaml @@ -0,0 +1,43 @@ +Name: harbour-fernschreiber +Summary: Fernschreiber is a Telegram client for Sailfish OS +Version: 0.1 +Release: 1 +# The contents of the Group field should be one of the groups listed here: +# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS +Group: Qt/Qt +URL: http://werkwolf.eu/ +License: LICENSE +# This must be generated before uploading a package to a remote build service. +# Usually this line does not need to be modified. +Sources: +- '%{name}-%{version}.tar.bz2' +Description: | + Fernschreiber is a Telegram client for Sailfish OS +Configure: none +Builder: qmake5 + +# This section specifies build dependencies that are resolved using pkgconfig. +# This is the preferred way of specifying build dependencies for your package. +PkgConfigBR: + - sailfishapp >= 1.0.2 + - Qt5Core + - Qt5Qml + - Qt5Quick + +# Build dependencies without a pkgconfig setup can be listed here +# PkgBR: +# - package-needed-to-build + +# Runtime dependencies which are not automatically detected +Requires: + - sailfishsilica-qt5 >= 0.10.9 + +# All installed files +Files: + - '%{_bindir}' + - '%{_datadir}/%{name}' + - '%{_datadir}/applications/%{name}.desktop' + - '%{_datadir}/icons/hicolor/*/apps/%{name}.png' + +# For more information about yaml and what's supported in Sailfish OS +# build system, please see https://wiki.merproject.org/wiki/Spectacle diff --git a/src/harbour-fernschreiber.cpp b/src/harbour-fernschreiber.cpp new file mode 100644 index 0000000..00d6f34 --- /dev/null +++ b/src/harbour-fernschreiber.cpp @@ -0,0 +1,47 @@ +/* + Copyright (C) 2020 Sebastian J. Wolf + + This file is part of Fernschreiber. + + fernschreiber is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + fernschreiber is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Fernschreiber. If not, see . +*/ + +#ifdef QT_QML_DEBUG +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include "tdlibwrapper.h" + +int main(int argc, char *argv[]) +{ + QScopedPointer app(SailfishApp::application(argc, argv)); + QScopedPointer view(SailfishApp::createView()); + + QQmlContext *context = view.data()->rootContext(); + + TDLibWrapper tdLibWrapper; + context->setContextProperty("tdLibWrapper", &tdLibWrapper); + + view->setSource(SailfishApp::pathTo("qml/harbour-fernschreiber.qml")); + view->show(); + return app->exec(); +} diff --git a/src/tdlibwrapper.cpp b/src/tdlibwrapper.cpp new file mode 100644 index 0000000..241303a --- /dev/null +++ b/src/tdlibwrapper.cpp @@ -0,0 +1,40 @@ +/* + Copyright (C) 2020 Sebastian J. Wolf + + This file is part of Fernschreiber. + + fernschreiber is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + fernschreiber is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Fernschreiber. If not, see . +*/ + +#include "tdlibwrapper.h" + +TDLibWrapper::TDLibWrapper(QObject *parent) : QObject(parent) +{ + qDebug() << "[TDLibWrapper] Initializing TD Lib..."; + this->tdLibClient = td_json_client_create(); + //this->testIt(); +} + +TDLibWrapper::~TDLibWrapper() +{ + qDebug() << "[TDLibWrapper] Destroying TD Lib..."; + td_json_client_destroy(this->tdLibClient); +} + +void TDLibWrapper::testIt() +{ + qDebug() << "[TDLibWrapper] Test it!"; + td_json_client_send(this->tdLibClient, "BLUBB"); +} + diff --git a/src/tdlibwrapper.h b/src/tdlibwrapper.h new file mode 100644 index 0000000..fa9d021 --- /dev/null +++ b/src/tdlibwrapper.h @@ -0,0 +1,27 @@ +#ifndef TDLIBWRAPPER_H +#define TDLIBWRAPPER_H + +#include +#include +#include + +class TDLibWrapper : public QObject +{ + Q_OBJECT +public: + explicit TDLibWrapper(QObject *parent = nullptr); + ~TDLibWrapper(); + + Q_INVOKABLE void testIt(); + +signals: + +public slots: + + +private: + void *tdLibClient; + +}; + +#endif // TDLIBWRAPPER_H diff --git a/tdlib/include/td/telegram/Client.h b/tdlib/include/td/telegram/Client.h new file mode 100644 index 0000000..ac49f15 --- /dev/null +++ b/tdlib/include/td/telegram/Client.h @@ -0,0 +1,134 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2020 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +///\file + +#include "td/telegram/td_api.h" +#include "td/telegram/td_api.hpp" + +#include +#include + +namespace td { + +/** + * Native C++ interface for interaction with TDLib. + * + * The TDLib instance is created for the lifetime of the Client object. + * Requests to TDLib can be sent using the Client::send method from any thread. + * New updates and responses to requests can be received using the Client::receive method from any thread, + * this function shouldn't be called simultaneously from two different threads. Also note that all updates and + * responses to requests should be applied in the same order as they were received, to ensure consistency. + * Given this information, it's advisable to call this function from a dedicated thread. + * Some service TDLib requests can be executed synchronously from any thread by using the Client::execute method. + * + * General pattern of usage: + * \code + * std::shared_ptr client = std::make_shared(); + * // somehow share the client with other threads, which will be able to send requests via client->send + * + * const double WAIT_TIMEOUT = 10.0; // seconds + * bool is_closed = false; // should be set to true, when updateAuthorizationState with + * // authorizationStateClosed is received + * while (!is_closed) { + * auto response = client->receive(WAIT_TIMEOUT); + * if (response.object == nullptr) { + * continue; + * } + * + * if (response.id == 0) { + * // process response.object as an incoming update of type td_api::Update + * } else { + * // process response.object as an answer to a sent request with id response.id + * } + * } + * \endcode + */ +class Client final { + public: + /** + * Creates a new TDLib client. + */ + Client(); + + /** + * A request to the TDLib. + */ + struct Request { + /** + * Request identifier. + * Responses to TDLib requests will have the same id as the corresponding request. + * Updates from TDLib will have id == 0, incoming requests are thus disallowed to have id == 0. + */ + std::uint64_t id; + + /** + * TDLib API function representing a request to TDLib. + */ + td_api::object_ptr function; + }; + + /** + * Sends request to TDLib. May be called from any thread. + * \param[in] request Request to TDLib. + */ + void send(Request &&request); + + /** + * A response to a request, or an incoming update from TDLib. + */ + struct Response { + /** + * TDLib request identifier, which corresponds to the response or 0 for incoming updates from TDLib. + */ + std::uint64_t id; + + /** + * TDLib API object representing a response to a TDLib request or an incoming update. + */ + td_api::object_ptr object; + }; + + /** + * Receives incoming updates and request responses from TDLib. May be called from any thread, but shouldn't be + * called simultaneously from two different threads. + * \param[in] timeout The maximum number of seconds allowed for this function to wait for new data. + * \return An incoming update or request response. The object returned in the response may be a nullptr + * if the timeout expires. + */ + Response receive(double timeout); + + /** + * Synchronously executes TDLib requests. Only a few requests can be executed synchronously. + * May be called from any thread. + * \param[in] request Request to the TDLib. + * \return The request response. + */ + static Response execute(Request &&request); + + /** + * Destroys the client and TDLib instance. + */ + ~Client(); + + /** + * Move constructor. + */ + Client(Client &&other); + + /** + * Move assignment operator. + */ + Client &operator=(Client &&other); + + private: + class Impl; + std::unique_ptr impl_; +}; + +} // namespace td diff --git a/tdlib/include/td/telegram/Log.h b/tdlib/include/td/telegram/Log.h new file mode 100644 index 0000000..14923ab --- /dev/null +++ b/tdlib/include/td/telegram/Log.h @@ -0,0 +1,85 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2020 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +/** + * \file + * C++ interface for managing the internal logging of TDLib. + * By default TDLib writes logs to stderr or an OS specific log and uses a verbosity level of 5. + */ + +#include +#include + +namespace td { + +/** + * Interface for managing the internal logging of TDLib. + * By default TDLib writes logs to stderr or an OS specific log and uses a verbosity level of 5. + * These functions are deprecated since TDLib 1.4.0 in favor of the td::td_api::setLogVerbosityLevel, + * td::td_api::setLogStream and other synchronous requests for managing the intrenal TDLib logging. + */ +class Log { + public: + /** + * Sets the path to the file to where the internal TDLib log will be written. + * By default TDLib writes logs to stderr or an OS specific log. + * Use this method to write the log to a file instead. + * + * \deprecated Use synchronous td::td_api::setLogStream request instead. + * \param[in] file_path Path to a file where the internal TDLib log will be written. Use an empty path to + * switch back to the default logging behaviour. + * \return True on success, or false otherwise, i.e. if the file can't be opened for writing. + */ + static bool set_file_path(std::string file_path); + + /** + * Sets the maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated. + * Unused if log is not written to a file. Defaults to 10 MB. + * + * \deprecated Use synchronous td::td_api::setLogStream request instead. + * \param[in] max_file_size The maximum size of the file to where the internal TDLib log is written before the file + * will be auto-rotated. Should be positive. + */ + static void set_max_file_size(std::int64_t max_file_size); + + /** + * Sets the verbosity level of the internal logging of TDLib. + * By default the TDLib uses a verbosity level of 5 for logging. + * + * \deprecated Use synchronous td::td_api::setLogVerbosityLevel request instead. + * \param[in] new_verbosity_level New value of the verbosity level for logging. + * Value 0 corresponds to fatal errors, + * value 1 corresponds to errors, + * value 2 corresponds to warnings and debug warnings, + * value 3 corresponds to informational, + * value 4 corresponds to debug, + * value 5 corresponds to verbose debug, + * value greater than 5 and up to 1024 can be used to enable even more logging. + */ + static void set_verbosity_level(int new_verbosity_level); + + /** + * A type of callback function that will be called when a fatal error happens. + * + * \param error_message Null-terminated string with a description of a happened fatal error. + */ + using FatalErrorCallbackPtr = void (*)(const char *error_message); + + /** + * Sets the callback that will be called when a fatal error happens. + * None of the TDLib methods can be called from the callback. + * The TDLib will crash as soon as callback returns. + * By default the callback is not set. + * + * \param[in] callback Callback that will be called when a fatal error happens. + * Pass nullptr to remove the callback. + */ + static void set_fatal_error_callback(FatalErrorCallbackPtr callback); +}; + +} // namespace td diff --git a/tdlib/include/td/telegram/td_api.h b/tdlib/include/td/telegram/td_api.h new file mode 100644 index 0000000..9c8b66e --- /dev/null +++ b/tdlib/include/td/telegram/td_api.h @@ -0,0 +1,20173 @@ +#pragma once + +#include "td/tl/TlObject.h" + +#include + +#include +#include +#include + +namespace td { +class TlStorerToString; + +namespace td_api { + +using BaseObject = ::td::TlObject; + +template +using object_ptr = ::td::tl_object_ptr; + +template +object_ptr make_object(Args &&... args) { + return object_ptr(new Type(std::forward(args)...)); +} + +template +object_ptr move_object_as(FromType &&from) { + return object_ptr(static_cast(from.release())); +} + +std::string to_string(const BaseObject &value); + +template +std::string to_string(const object_ptr &value) { + if (value == nullptr) { + return "null"; + } + + return to_string(*value); +} + +class accountTtl; + +class address; + +class animation; + +class animations; + +class audio; + +class authenticationCodeInfo; + +class AuthenticationCodeType; + +class AuthorizationState; + +class autoDownloadSettings; + +class autoDownloadSettingsPresets; + +class background; + +class BackgroundFill; + +class BackgroundType; + +class backgrounds; + +class basicGroup; + +class basicGroupFullInfo; + +class botCommand; + +class botInfo; + +class call; + +class callConnection; + +class CallDiscardReason; + +class callId; + +class CallProblem; + +class callProtocol; + +class CallState; + +class callbackQueryAnswer; + +class CallbackQueryPayload; + +class CanTransferOwnershipResult; + +class chat; + +class ChatAction; + +class ChatActionBar; + +class chatAdministrator; + +class chatAdministrators; + +class chatEvent; + +class ChatEventAction; + +class chatEventLogFilters; + +class chatEvents; + +class chatInviteLink; + +class chatInviteLinkInfo; + +class ChatList; + +class chatLocation; + +class chatMember; + +class ChatMemberStatus; + +class chatMembers; + +class ChatMembersFilter; + +class chatNearby; + +class chatNotificationSettings; + +class chatPermissions; + +class chatPhoto; + +class ChatReportReason; + +class ChatType; + +class chats; + +class chatsNearby; + +class CheckChatUsernameResult; + +class connectedWebsite; + +class connectedWebsites; + +class ConnectionState; + +class contact; + +class count; + +class customRequestResult; + +class databaseStatistics; + +class date; + +class datedFile; + +class deepLinkInfo; + +class DeviceToken; + +class document; + +class draftMessage; + +class emailAddressAuthenticationCodeInfo; + +class emojis; + +class encryptedCredentials; + +class encryptedPassportElement; + +class error; + +class file; + +class filePart; + +class FileType; + +class formattedText; + +class foundMessages; + +class game; + +class gameHighScore; + +class gameHighScores; + +class hashtags; + +class httpUrl; + +class identityDocument; + +class importedContacts; + +class inlineKeyboardButton; + +class InlineKeyboardButtonType; + +class InlineQueryResult; + +class inlineQueryResults; + +class InputBackground; + +class InputCredentials; + +class InputFile; + +class inputIdentityDocument; + +class InputInlineQueryResult; + +class InputMessageContent; + +class InputPassportElement; + +class inputPassportElementError; + +class InputPassportElementErrorSource; + +class inputPersonalDocument; + +class inputSticker; + +class inputThumbnail; + +class invoice; + +class jsonObjectMember; + +class JsonValue; + +class keyboardButton; + +class KeyboardButtonType; + +class labeledPricePart; + +class languagePackInfo; + +class languagePackString; + +class LanguagePackStringValue; + +class languagePackStrings; + +class localFile; + +class localizationTargetInfo; + +class location; + +class LogStream; + +class logTags; + +class logVerbosityLevel; + +class LoginUrlInfo; + +class MaskPoint; + +class maskPosition; + +class message; + +class MessageContent; + +class messageForwardInfo; + +class MessageForwardOrigin; + +class messageLinkInfo; + +class MessageSchedulingState; + +class MessageSendingState; + +class messages; + +class minithumbnail; + +class networkStatistics; + +class NetworkStatisticsEntry; + +class NetworkType; + +class notification; + +class notificationGroup; + +class NotificationGroupType; + +class NotificationSettingsScope; + +class NotificationType; + +class ok; + +class OptionValue; + +class orderInfo; + +class PageBlock; + +class pageBlockCaption; + +class PageBlockHorizontalAlignment; + +class pageBlockListItem; + +class pageBlockRelatedArticle; + +class pageBlockTableCell; + +class PageBlockVerticalAlignment; + +class passportAuthorizationForm; + +class PassportElement; + +class passportElementError; + +class PassportElementErrorSource; + +class PassportElementType; + +class passportElements; + +class passportElementsWithErrors; + +class passportRequiredElement; + +class passportSuitableElement; + +class passwordState; + +class paymentForm; + +class paymentReceipt; + +class paymentResult; + +class paymentsProviderStripe; + +class personalDetails; + +class personalDocument; + +class phoneNumberAuthenticationSettings; + +class photo; + +class photoSize; + +class poll; + +class pollOption; + +class PollType; + +class profilePhoto; + +class proxies; + +class proxy; + +class ProxyType; + +class PublicChatType; + +class publicMessageLink; + +class PushMessageContent; + +class pushReceiverId; + +class recoveryEmailAddress; + +class remoteFile; + +class ReplyMarkup; + +class RichText; + +class savedCredentials; + +class scopeNotificationSettings; + +class SearchMessagesFilter; + +class seconds; + +class secretChat; + +class SecretChatState; + +class sendMessageOptions; + +class session; + +class sessions; + +class shippingOption; + +class sticker; + +class stickerSet; + +class stickerSetInfo; + +class stickerSets; + +class stickers; + +class storageStatistics; + +class storageStatisticsByChat; + +class storageStatisticsByFileType; + +class storageStatisticsFast; + +class supergroup; + +class supergroupFullInfo; + +class SupergroupMembersFilter; + +class tMeUrl; + +class TMeUrlType; + +class tMeUrls; + +class tdlibParameters; + +class temporaryPasswordState; + +class termsOfService; + +class testBytes; + +class testInt; + +class testString; + +class testVectorInt; + +class testVectorIntObject; + +class testVectorString; + +class testVectorStringObject; + +class text; + +class textEntities; + +class textEntity; + +class TextEntityType; + +class TextParseMode; + +class TopChatCategory; + +class Update; + +class updates; + +class user; + +class userFullInfo; + +class UserPrivacySetting; + +class UserPrivacySettingRule; + +class userPrivacySettingRules; + +class userProfilePhoto; + +class userProfilePhotos; + +class UserStatus; + +class UserType; + +class users; + +class validatedOrderInfo; + +class venue; + +class video; + +class videoNote; + +class voiceNote; + +class webPage; + +class webPageInstantView; + +class Object; + +class Object: public TlObject { + public: +}; + +class Function: public TlObject { + public: +}; + +class accountTtl final : public Object { + public: + std::int32_t days_; + + accountTtl(); + + explicit accountTtl(std::int32_t days_); + + static const std::int32_t ID = 1324495492; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class address final : public Object { + public: + std::string country_code_; + std::string state_; + std::string city_; + std::string street_line1_; + std::string street_line2_; + std::string postal_code_; + + address(); + + address(std::string const &country_code_, std::string const &state_, std::string const &city_, std::string const &street_line1_, std::string const &street_line2_, std::string const &postal_code_); + + static const std::int32_t ID = -2043654342; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class animation final : public Object { + public: + std::int32_t duration_; + std::int32_t width_; + std::int32_t height_; + std::string file_name_; + std::string mime_type_; + object_ptr minithumbnail_; + object_ptr thumbnail_; + object_ptr animation_; + + animation(); + + animation(std::int32_t duration_, std::int32_t width_, std::int32_t height_, std::string const &file_name_, std::string const &mime_type_, object_ptr &&minithumbnail_, object_ptr &&thumbnail_, object_ptr &&animation_); + + static const std::int32_t ID = -1629245379; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class animations final : public Object { + public: + std::vector> animations_; + + animations(); + + explicit animations(std::vector> &&animations_); + + static const std::int32_t ID = 344216945; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class audio final : public Object { + public: + std::int32_t duration_; + std::string title_; + std::string performer_; + std::string file_name_; + std::string mime_type_; + object_ptr album_cover_minithumbnail_; + object_ptr album_cover_thumbnail_; + object_ptr audio_; + + audio(); + + audio(std::int32_t duration_, std::string const &title_, std::string const &performer_, std::string const &file_name_, std::string const &mime_type_, object_ptr &&album_cover_minithumbnail_, object_ptr &&album_cover_thumbnail_, object_ptr &&audio_); + + static const std::int32_t ID = 1475294302; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authenticationCodeInfo final : public Object { + public: + std::string phone_number_; + object_ptr type_; + object_ptr next_type_; + std::int32_t timeout_; + + authenticationCodeInfo(); + + authenticationCodeInfo(std::string const &phone_number_, object_ptr &&type_, object_ptr &&next_type_, std::int32_t timeout_); + + static const std::int32_t ID = -860345416; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class AuthenticationCodeType: public Object { + public: +}; + +class authenticationCodeTypeTelegramMessage final : public AuthenticationCodeType { + public: + std::int32_t length_; + + authenticationCodeTypeTelegramMessage(); + + explicit authenticationCodeTypeTelegramMessage(std::int32_t length_); + + static const std::int32_t ID = 2079628074; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authenticationCodeTypeSms final : public AuthenticationCodeType { + public: + std::int32_t length_; + + authenticationCodeTypeSms(); + + explicit authenticationCodeTypeSms(std::int32_t length_); + + static const std::int32_t ID = 962650760; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authenticationCodeTypeCall final : public AuthenticationCodeType { + public: + std::int32_t length_; + + authenticationCodeTypeCall(); + + explicit authenticationCodeTypeCall(std::int32_t length_); + + static const std::int32_t ID = 1636265063; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authenticationCodeTypeFlashCall final : public AuthenticationCodeType { + public: + std::string pattern_; + + authenticationCodeTypeFlashCall(); + + explicit authenticationCodeTypeFlashCall(std::string const &pattern_); + + static const std::int32_t ID = 1395882402; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class AuthorizationState: public Object { + public: +}; + +class authorizationStateWaitTdlibParameters final : public AuthorizationState { + public: + + authorizationStateWaitTdlibParameters(); + + static const std::int32_t ID = 904720988; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authorizationStateWaitEncryptionKey final : public AuthorizationState { + public: + bool is_encrypted_; + + authorizationStateWaitEncryptionKey(); + + explicit authorizationStateWaitEncryptionKey(bool is_encrypted_); + + static const std::int32_t ID = 612103496; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authorizationStateWaitPhoneNumber final : public AuthorizationState { + public: + + authorizationStateWaitPhoneNumber(); + + static const std::int32_t ID = 306402531; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authorizationStateWaitCode final : public AuthorizationState { + public: + object_ptr code_info_; + + authorizationStateWaitCode(); + + explicit authorizationStateWaitCode(object_ptr &&code_info_); + + static const std::int32_t ID = 52643073; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authorizationStateWaitOtherDeviceConfirmation final : public AuthorizationState { + public: + std::string link_; + + authorizationStateWaitOtherDeviceConfirmation(); + + explicit authorizationStateWaitOtherDeviceConfirmation(std::string const &link_); + + static const std::int32_t ID = 860166378; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authorizationStateWaitRegistration final : public AuthorizationState { + public: + object_ptr terms_of_service_; + + authorizationStateWaitRegistration(); + + explicit authorizationStateWaitRegistration(object_ptr &&terms_of_service_); + + static const std::int32_t ID = 550350511; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authorizationStateWaitPassword final : public AuthorizationState { + public: + std::string password_hint_; + bool has_recovery_email_address_; + std::string recovery_email_address_pattern_; + + authorizationStateWaitPassword(); + + authorizationStateWaitPassword(std::string const &password_hint_, bool has_recovery_email_address_, std::string const &recovery_email_address_pattern_); + + static const std::int32_t ID = 187548796; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authorizationStateReady final : public AuthorizationState { + public: + + authorizationStateReady(); + + static const std::int32_t ID = -1834871737; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authorizationStateLoggingOut final : public AuthorizationState { + public: + + authorizationStateLoggingOut(); + + static const std::int32_t ID = 154449270; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authorizationStateClosing final : public AuthorizationState { + public: + + authorizationStateClosing(); + + static const std::int32_t ID = 445855311; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authorizationStateClosed final : public AuthorizationState { + public: + + authorizationStateClosed(); + + static const std::int32_t ID = 1526047584; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class autoDownloadSettings final : public Object { + public: + bool is_auto_download_enabled_; + std::int32_t max_photo_file_size_; + std::int32_t max_video_file_size_; + std::int32_t max_other_file_size_; + std::int32_t video_upload_bitrate_; + bool preload_large_videos_; + bool preload_next_audio_; + bool use_less_data_for_calls_; + + autoDownloadSettings(); + + autoDownloadSettings(bool is_auto_download_enabled_, std::int32_t max_photo_file_size_, std::int32_t max_video_file_size_, std::int32_t max_other_file_size_, std::int32_t video_upload_bitrate_, bool preload_large_videos_, bool preload_next_audio_, bool use_less_data_for_calls_); + + static const std::int32_t ID = -2144418333; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class autoDownloadSettingsPresets final : public Object { + public: + object_ptr low_; + object_ptr medium_; + object_ptr high_; + + autoDownloadSettingsPresets(); + + autoDownloadSettingsPresets(object_ptr &&low_, object_ptr &&medium_, object_ptr &&high_); + + static const std::int32_t ID = -782099166; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class background final : public Object { + public: + std::int64_t id_; + bool is_default_; + bool is_dark_; + std::string name_; + object_ptr document_; + object_ptr type_; + + background(); + + background(std::int64_t id_, bool is_default_, bool is_dark_, std::string const &name_, object_ptr &&document_, object_ptr &&type_); + + static const std::int32_t ID = -429971172; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class BackgroundFill: public Object { + public: +}; + +class backgroundFillSolid final : public BackgroundFill { + public: + std::int32_t color_; + + backgroundFillSolid(); + + explicit backgroundFillSolid(std::int32_t color_); + + static const std::int32_t ID = 1010678813; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class backgroundFillGradient final : public BackgroundFill { + public: + std::int32_t top_color_; + std::int32_t bottom_color_; + std::int32_t rotation_angle_; + + backgroundFillGradient(); + + backgroundFillGradient(std::int32_t top_color_, std::int32_t bottom_color_, std::int32_t rotation_angle_); + + static const std::int32_t ID = -1839206017; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class BackgroundType: public Object { + public: +}; + +class backgroundTypeWallpaper final : public BackgroundType { + public: + bool is_blurred_; + bool is_moving_; + + backgroundTypeWallpaper(); + + backgroundTypeWallpaper(bool is_blurred_, bool is_moving_); + + static const std::int32_t ID = 1972128891; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class backgroundTypePattern final : public BackgroundType { + public: + object_ptr fill_; + std::int32_t intensity_; + bool is_moving_; + + backgroundTypePattern(); + + backgroundTypePattern(object_ptr &&fill_, std::int32_t intensity_, bool is_moving_); + + static const std::int32_t ID = 649993914; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class backgroundTypeFill final : public BackgroundType { + public: + object_ptr fill_; + + backgroundTypeFill(); + + explicit backgroundTypeFill(object_ptr &&fill_); + + static const std::int32_t ID = 993008684; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class backgrounds final : public Object { + public: + std::vector> backgrounds_; + + backgrounds(); + + explicit backgrounds(std::vector> &&backgrounds_); + + static const std::int32_t ID = 724728704; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class basicGroup final : public Object { + public: + std::int32_t id_; + std::int32_t member_count_; + object_ptr status_; + bool is_active_; + std::int32_t upgraded_to_supergroup_id_; + + basicGroup(); + + basicGroup(std::int32_t id_, std::int32_t member_count_, object_ptr &&status_, bool is_active_, std::int32_t upgraded_to_supergroup_id_); + + static const std::int32_t ID = -317839045; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class basicGroupFullInfo final : public Object { + public: + std::string description_; + std::int32_t creator_user_id_; + std::vector> members_; + std::string invite_link_; + + basicGroupFullInfo(); + + basicGroupFullInfo(std::string const &description_, std::int32_t creator_user_id_, std::vector> &&members_, std::string const &invite_link_); + + static const std::int32_t ID = 161500149; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class botCommand final : public Object { + public: + std::string command_; + std::string description_; + + botCommand(); + + botCommand(std::string const &command_, std::string const &description_); + + static const std::int32_t ID = -1032140601; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class botInfo final : public Object { + public: + std::string description_; + std::vector> commands_; + + botInfo(); + + botInfo(std::string const &description_, std::vector> &&commands_); + + static const std::int32_t ID = 1296528907; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class call final : public Object { + public: + std::int32_t id_; + std::int32_t user_id_; + bool is_outgoing_; + object_ptr state_; + + call(); + + call(std::int32_t id_, std::int32_t user_id_, bool is_outgoing_, object_ptr &&state_); + + static const std::int32_t ID = -1837599107; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callConnection final : public Object { + public: + std::int64_t id_; + std::string ip_; + std::string ipv6_; + std::int32_t port_; + std::string peer_tag_; + + callConnection(); + + callConnection(std::int64_t id_, std::string const &ip_, std::string const &ipv6_, std::int32_t port_, std::string const &peer_tag_); + + static const std::int32_t ID = 1318542714; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class CallDiscardReason: public Object { + public: +}; + +class callDiscardReasonEmpty final : public CallDiscardReason { + public: + + callDiscardReasonEmpty(); + + static const std::int32_t ID = -1258917949; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callDiscardReasonMissed final : public CallDiscardReason { + public: + + callDiscardReasonMissed(); + + static const std::int32_t ID = 1680358012; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callDiscardReasonDeclined final : public CallDiscardReason { + public: + + callDiscardReasonDeclined(); + + static const std::int32_t ID = -1729926094; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callDiscardReasonDisconnected final : public CallDiscardReason { + public: + + callDiscardReasonDisconnected(); + + static const std::int32_t ID = -1342872670; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callDiscardReasonHungUp final : public CallDiscardReason { + public: + + callDiscardReasonHungUp(); + + static const std::int32_t ID = 438216166; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callId final : public Object { + public: + std::int32_t id_; + + callId(); + + explicit callId(std::int32_t id_); + + static const std::int32_t ID = 65717769; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class CallProblem: public Object { + public: +}; + +class callProblemEcho final : public CallProblem { + public: + + callProblemEcho(); + + static const std::int32_t ID = 801116548; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callProblemNoise final : public CallProblem { + public: + + callProblemNoise(); + + static const std::int32_t ID = 1053065359; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callProblemInterruptions final : public CallProblem { + public: + + callProblemInterruptions(); + + static const std::int32_t ID = 1119493218; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callProblemDistortedSpeech final : public CallProblem { + public: + + callProblemDistortedSpeech(); + + static const std::int32_t ID = 379960581; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callProblemSilentLocal final : public CallProblem { + public: + + callProblemSilentLocal(); + + static const std::int32_t ID = 253652790; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callProblemSilentRemote final : public CallProblem { + public: + + callProblemSilentRemote(); + + static const std::int32_t ID = 573634714; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callProblemDropped final : public CallProblem { + public: + + callProblemDropped(); + + static const std::int32_t ID = -1207311487; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callProtocol final : public Object { + public: + bool udp_p2p_; + bool udp_reflector_; + std::int32_t min_layer_; + std::int32_t max_layer_; + + callProtocol(); + + callProtocol(bool udp_p2p_, bool udp_reflector_, std::int32_t min_layer_, std::int32_t max_layer_); + + static const std::int32_t ID = -1042830667; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class CallState: public Object { + public: +}; + +class callStatePending final : public CallState { + public: + bool is_created_; + bool is_received_; + + callStatePending(); + + callStatePending(bool is_created_, bool is_received_); + + static const std::int32_t ID = 1073048620; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callStateExchangingKeys final : public CallState { + public: + + callStateExchangingKeys(); + + static const std::int32_t ID = -1848149403; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callStateReady final : public CallState { + public: + object_ptr protocol_; + std::vector> connections_; + std::string config_; + std::string encryption_key_; + std::vector emojis_; + bool allow_p2p_; + + callStateReady(); + + callStateReady(object_ptr &&protocol_, std::vector> &&connections_, std::string const &config_, std::string const &encryption_key_, std::vector &&emojis_, bool allow_p2p_); + + static const std::int32_t ID = 1848397705; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callStateHangingUp final : public CallState { + public: + + callStateHangingUp(); + + static const std::int32_t ID = -2133790038; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callStateDiscarded final : public CallState { + public: + object_ptr reason_; + bool need_rating_; + bool need_debug_information_; + + callStateDiscarded(); + + callStateDiscarded(object_ptr &&reason_, bool need_rating_, bool need_debug_information_); + + static const std::int32_t ID = -190853167; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callStateError final : public CallState { + public: + object_ptr error_; + + callStateError(); + + explicit callStateError(object_ptr &&error_); + + static const std::int32_t ID = -975215467; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callbackQueryAnswer final : public Object { + public: + std::string text_; + bool show_alert_; + std::string url_; + + callbackQueryAnswer(); + + callbackQueryAnswer(std::string const &text_, bool show_alert_, std::string const &url_); + + static const std::int32_t ID = 360867933; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class CallbackQueryPayload: public Object { + public: +}; + +class callbackQueryPayloadData final : public CallbackQueryPayload { + public: + std::string data_; + + callbackQueryPayloadData(); + + explicit callbackQueryPayloadData(std::string const &data_); + + static const std::int32_t ID = -1977729946; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class callbackQueryPayloadGame final : public CallbackQueryPayload { + public: + std::string game_short_name_; + + callbackQueryPayloadGame(); + + explicit callbackQueryPayloadGame(std::string const &game_short_name_); + + static const std::int32_t ID = 1303571512; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class CanTransferOwnershipResult: public Object { + public: +}; + +class canTransferOwnershipResultOk final : public CanTransferOwnershipResult { + public: + + canTransferOwnershipResultOk(); + + static const std::int32_t ID = -89881021; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class canTransferOwnershipResultPasswordNeeded final : public CanTransferOwnershipResult { + public: + + canTransferOwnershipResultPasswordNeeded(); + + static const std::int32_t ID = 1548372703; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class canTransferOwnershipResultPasswordTooFresh final : public CanTransferOwnershipResult { + public: + std::int32_t retry_after_; + + canTransferOwnershipResultPasswordTooFresh(); + + explicit canTransferOwnershipResultPasswordTooFresh(std::int32_t retry_after_); + + static const std::int32_t ID = 811440913; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class canTransferOwnershipResultSessionTooFresh final : public CanTransferOwnershipResult { + public: + std::int32_t retry_after_; + + canTransferOwnershipResultSessionTooFresh(); + + explicit canTransferOwnershipResultSessionTooFresh(std::int32_t retry_after_); + + static const std::int32_t ID = 984664289; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chat final : public Object { + public: + std::int64_t id_; + object_ptr type_; + object_ptr chat_list_; + std::string title_; + object_ptr photo_; + object_ptr permissions_; + object_ptr last_message_; + std::int64_t order_; + bool is_pinned_; + bool is_marked_as_unread_; + bool is_sponsored_; + bool has_scheduled_messages_; + bool can_be_deleted_only_for_self_; + bool can_be_deleted_for_all_users_; + bool can_be_reported_; + bool default_disable_notification_; + std::int32_t unread_count_; + std::int64_t last_read_inbox_message_id_; + std::int64_t last_read_outbox_message_id_; + std::int32_t unread_mention_count_; + object_ptr notification_settings_; + object_ptr action_bar_; + std::int64_t pinned_message_id_; + std::int64_t reply_markup_message_id_; + object_ptr draft_message_; + std::string client_data_; + + chat(); + + chat(std::int64_t id_, object_ptr &&type_, object_ptr &&chat_list_, std::string const &title_, object_ptr &&photo_, object_ptr &&permissions_, object_ptr &&last_message_, std::int64_t order_, bool is_pinned_, bool is_marked_as_unread_, bool is_sponsored_, bool has_scheduled_messages_, bool can_be_deleted_only_for_self_, bool can_be_deleted_for_all_users_, bool can_be_reported_, bool default_disable_notification_, std::int32_t unread_count_, std::int64_t last_read_inbox_message_id_, std::int64_t last_read_outbox_message_id_, std::int32_t unread_mention_count_, object_ptr &¬ification_settings_, object_ptr &&action_bar_, std::int64_t pinned_message_id_, std::int64_t reply_markup_message_id_, object_ptr &&draft_message_, std::string const &client_data_); + + static const std::int32_t ID = -861487386; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ChatAction: public Object { + public: +}; + +class chatActionTyping final : public ChatAction { + public: + + chatActionTyping(); + + static const std::int32_t ID = 380122167; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionRecordingVideo final : public ChatAction { + public: + + chatActionRecordingVideo(); + + static const std::int32_t ID = 216553362; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionUploadingVideo final : public ChatAction { + public: + std::int32_t progress_; + + chatActionUploadingVideo(); + + explicit chatActionUploadingVideo(std::int32_t progress_); + + static const std::int32_t ID = 1234185270; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionRecordingVoiceNote final : public ChatAction { + public: + + chatActionRecordingVoiceNote(); + + static const std::int32_t ID = -808850058; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionUploadingVoiceNote final : public ChatAction { + public: + std::int32_t progress_; + + chatActionUploadingVoiceNote(); + + explicit chatActionUploadingVoiceNote(std::int32_t progress_); + + static const std::int32_t ID = -613643666; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionUploadingPhoto final : public ChatAction { + public: + std::int32_t progress_; + + chatActionUploadingPhoto(); + + explicit chatActionUploadingPhoto(std::int32_t progress_); + + static const std::int32_t ID = 654240583; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionUploadingDocument final : public ChatAction { + public: + std::int32_t progress_; + + chatActionUploadingDocument(); + + explicit chatActionUploadingDocument(std::int32_t progress_); + + static const std::int32_t ID = 167884362; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionChoosingLocation final : public ChatAction { + public: + + chatActionChoosingLocation(); + + static const std::int32_t ID = -2017893596; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionChoosingContact final : public ChatAction { + public: + + chatActionChoosingContact(); + + static const std::int32_t ID = -1222507496; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionStartPlayingGame final : public ChatAction { + public: + + chatActionStartPlayingGame(); + + static const std::int32_t ID = -865884164; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionRecordingVideoNote final : public ChatAction { + public: + + chatActionRecordingVideoNote(); + + static const std::int32_t ID = 16523393; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionUploadingVideoNote final : public ChatAction { + public: + std::int32_t progress_; + + chatActionUploadingVideoNote(); + + explicit chatActionUploadingVideoNote(std::int32_t progress_); + + static const std::int32_t ID = 1172364918; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionCancel final : public ChatAction { + public: + + chatActionCancel(); + + static const std::int32_t ID = 1160523958; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ChatActionBar: public Object { + public: +}; + +class chatActionBarReportSpam final : public ChatActionBar { + public: + + chatActionBarReportSpam(); + + static const std::int32_t ID = -1603417249; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionBarReportUnrelatedLocation final : public ChatActionBar { + public: + + chatActionBarReportUnrelatedLocation(); + + static const std::int32_t ID = 758175489; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionBarReportAddBlock final : public ChatActionBar { + public: + + chatActionBarReportAddBlock(); + + static const std::int32_t ID = -87894249; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionBarAddContact final : public ChatActionBar { + public: + + chatActionBarAddContact(); + + static const std::int32_t ID = -733325295; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatActionBarSharePhoneNumber final : public ChatActionBar { + public: + + chatActionBarSharePhoneNumber(); + + static const std::int32_t ID = 35188697; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatAdministrator final : public Object { + public: + std::int32_t user_id_; + std::string custom_title_; + bool is_owner_; + + chatAdministrator(); + + chatAdministrator(std::int32_t user_id_, std::string const &custom_title_, bool is_owner_); + + static const std::int32_t ID = 487220942; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatAdministrators final : public Object { + public: + std::vector> administrators_; + + chatAdministrators(); + + explicit chatAdministrators(std::vector> &&administrators_); + + static const std::int32_t ID = -2126186435; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEvent final : public Object { + public: + std::int64_t id_; + std::int32_t date_; + std::int32_t user_id_; + object_ptr action_; + + chatEvent(); + + chatEvent(std::int64_t id_, std::int32_t date_, std::int32_t user_id_, object_ptr &&action_); + + static const std::int32_t ID = -609912404; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ChatEventAction: public Object { + public: +}; + +class chatEventMessageEdited final : public ChatEventAction { + public: + object_ptr old_message_; + object_ptr new_message_; + + chatEventMessageEdited(); + + chatEventMessageEdited(object_ptr &&old_message_, object_ptr &&new_message_); + + static const std::int32_t ID = -430967304; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventMessageDeleted final : public ChatEventAction { + public: + object_ptr message_; + + chatEventMessageDeleted(); + + explicit chatEventMessageDeleted(object_ptr &&message_); + + static const std::int32_t ID = -892974601; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventPollStopped final : public ChatEventAction { + public: + object_ptr message_; + + chatEventPollStopped(); + + explicit chatEventPollStopped(object_ptr &&message_); + + static const std::int32_t ID = 2009893861; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventMessagePinned final : public ChatEventAction { + public: + object_ptr message_; + + chatEventMessagePinned(); + + explicit chatEventMessagePinned(object_ptr &&message_); + + static const std::int32_t ID = 438742298; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventMessageUnpinned final : public ChatEventAction { + public: + + chatEventMessageUnpinned(); + + static const std::int32_t ID = 2002594849; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventMemberJoined final : public ChatEventAction { + public: + + chatEventMemberJoined(); + + static const std::int32_t ID = -235468508; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventMemberLeft final : public ChatEventAction { + public: + + chatEventMemberLeft(); + + static const std::int32_t ID = -948420593; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventMemberInvited final : public ChatEventAction { + public: + std::int32_t user_id_; + object_ptr status_; + + chatEventMemberInvited(); + + chatEventMemberInvited(std::int32_t user_id_, object_ptr &&status_); + + static const std::int32_t ID = -2093688706; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventMemberPromoted final : public ChatEventAction { + public: + std::int32_t user_id_; + object_ptr old_status_; + object_ptr new_status_; + + chatEventMemberPromoted(); + + chatEventMemberPromoted(std::int32_t user_id_, object_ptr &&old_status_, object_ptr &&new_status_); + + static const std::int32_t ID = 1887176186; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventMemberRestricted final : public ChatEventAction { + public: + std::int32_t user_id_; + object_ptr old_status_; + object_ptr new_status_; + + chatEventMemberRestricted(); + + chatEventMemberRestricted(std::int32_t user_id_, object_ptr &&old_status_, object_ptr &&new_status_); + + static const std::int32_t ID = 584946294; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventTitleChanged final : public ChatEventAction { + public: + std::string old_title_; + std::string new_title_; + + chatEventTitleChanged(); + + chatEventTitleChanged(std::string const &old_title_, std::string const &new_title_); + + static const std::int32_t ID = 1134103250; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventPermissionsChanged final : public ChatEventAction { + public: + object_ptr old_permissions_; + object_ptr new_permissions_; + + chatEventPermissionsChanged(); + + chatEventPermissionsChanged(object_ptr &&old_permissions_, object_ptr &&new_permissions_); + + static const std::int32_t ID = -1311557720; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventDescriptionChanged final : public ChatEventAction { + public: + std::string old_description_; + std::string new_description_; + + chatEventDescriptionChanged(); + + chatEventDescriptionChanged(std::string const &old_description_, std::string const &new_description_); + + static const std::int32_t ID = 39112478; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventUsernameChanged final : public ChatEventAction { + public: + std::string old_username_; + std::string new_username_; + + chatEventUsernameChanged(); + + chatEventUsernameChanged(std::string const &old_username_, std::string const &new_username_); + + static const std::int32_t ID = 1728558443; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventPhotoChanged final : public ChatEventAction { + public: + object_ptr old_photo_; + object_ptr new_photo_; + + chatEventPhotoChanged(); + + chatEventPhotoChanged(object_ptr &&old_photo_, object_ptr &&new_photo_); + + static const std::int32_t ID = 1037662734; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventInvitesToggled final : public ChatEventAction { + public: + bool can_invite_users_; + + chatEventInvitesToggled(); + + explicit chatEventInvitesToggled(bool can_invite_users_); + + static const std::int32_t ID = -62548373; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventLinkedChatChanged final : public ChatEventAction { + public: + std::int64_t old_linked_chat_id_; + std::int64_t new_linked_chat_id_; + + chatEventLinkedChatChanged(); + + chatEventLinkedChatChanged(std::int64_t old_linked_chat_id_, std::int64_t new_linked_chat_id_); + + static const std::int32_t ID = 1797419439; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventSlowModeDelayChanged final : public ChatEventAction { + public: + std::int32_t old_slow_mode_delay_; + std::int32_t new_slow_mode_delay_; + + chatEventSlowModeDelayChanged(); + + chatEventSlowModeDelayChanged(std::int32_t old_slow_mode_delay_, std::int32_t new_slow_mode_delay_); + + static const std::int32_t ID = -1653195765; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventSignMessagesToggled final : public ChatEventAction { + public: + bool sign_messages_; + + chatEventSignMessagesToggled(); + + explicit chatEventSignMessagesToggled(bool sign_messages_); + + static const std::int32_t ID = -1313265634; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventStickerSetChanged final : public ChatEventAction { + public: + std::int64_t old_sticker_set_id_; + std::int64_t new_sticker_set_id_; + + chatEventStickerSetChanged(); + + chatEventStickerSetChanged(std::int64_t old_sticker_set_id_, std::int64_t new_sticker_set_id_); + + static const std::int32_t ID = -1243130481; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventLocationChanged final : public ChatEventAction { + public: + object_ptr old_location_; + object_ptr new_location_; + + chatEventLocationChanged(); + + chatEventLocationChanged(object_ptr &&old_location_, object_ptr &&new_location_); + + static const std::int32_t ID = -405930674; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventIsAllHistoryAvailableToggled final : public ChatEventAction { + public: + bool is_all_history_available_; + + chatEventIsAllHistoryAvailableToggled(); + + explicit chatEventIsAllHistoryAvailableToggled(bool is_all_history_available_); + + static const std::int32_t ID = -1599063019; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventLogFilters final : public Object { + public: + bool message_edits_; + bool message_deletions_; + bool message_pins_; + bool member_joins_; + bool member_leaves_; + bool member_invites_; + bool member_promotions_; + bool member_restrictions_; + bool info_changes_; + bool setting_changes_; + + chatEventLogFilters(); + + chatEventLogFilters(bool message_edits_, bool message_deletions_, bool message_pins_, bool member_joins_, bool member_leaves_, bool member_invites_, bool member_promotions_, bool member_restrictions_, bool info_changes_, bool setting_changes_); + + static const std::int32_t ID = 941939684; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEvents final : public Object { + public: + std::vector> events_; + + chatEvents(); + + explicit chatEvents(std::vector> &&events_); + + static const std::int32_t ID = -585329664; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatInviteLink final : public Object { + public: + std::string invite_link_; + + chatInviteLink(); + + explicit chatInviteLink(std::string const &invite_link_); + + static const std::int32_t ID = -882072492; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatInviteLinkInfo final : public Object { + public: + std::int64_t chat_id_; + object_ptr type_; + std::string title_; + object_ptr photo_; + std::int32_t member_count_; + std::vector member_user_ids_; + bool is_public_; + + chatInviteLinkInfo(); + + chatInviteLinkInfo(std::int64_t chat_id_, object_ptr &&type_, std::string const &title_, object_ptr &&photo_, std::int32_t member_count_, std::vector &&member_user_ids_, bool is_public_); + + static const std::int32_t ID = -323394424; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ChatList: public Object { + public: +}; + +class chatListMain final : public ChatList { + public: + + chatListMain(); + + static const std::int32_t ID = -400991316; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatListArchive final : public ChatList { + public: + + chatListArchive(); + + static const std::int32_t ID = 362770115; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatLocation final : public Object { + public: + object_ptr location_; + std::string address_; + + chatLocation(); + + chatLocation(object_ptr &&location_, std::string const &address_); + + static const std::int32_t ID = -1566863583; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMember final : public Object { + public: + std::int32_t user_id_; + std::int32_t inviter_user_id_; + std::int32_t joined_chat_date_; + object_ptr status_; + object_ptr bot_info_; + + chatMember(); + + chatMember(std::int32_t user_id_, std::int32_t inviter_user_id_, std::int32_t joined_chat_date_, object_ptr &&status_, object_ptr &&bot_info_); + + static const std::int32_t ID = -806137076; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ChatMemberStatus: public Object { + public: +}; + +class chatMemberStatusCreator final : public ChatMemberStatus { + public: + std::string custom_title_; + bool is_member_; + + chatMemberStatusCreator(); + + chatMemberStatusCreator(std::string const &custom_title_, bool is_member_); + + static const std::int32_t ID = 2038475849; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMemberStatusAdministrator final : public ChatMemberStatus { + public: + std::string custom_title_; + bool can_be_edited_; + bool can_change_info_; + bool can_post_messages_; + bool can_edit_messages_; + bool can_delete_messages_; + bool can_invite_users_; + bool can_restrict_members_; + bool can_pin_messages_; + bool can_promote_members_; + + chatMemberStatusAdministrator(); + + chatMemberStatusAdministrator(std::string const &custom_title_, bool can_be_edited_, bool can_change_info_, bool can_post_messages_, bool can_edit_messages_, bool can_delete_messages_, bool can_invite_users_, bool can_restrict_members_, bool can_pin_messages_, bool can_promote_members_); + + static const std::int32_t ID = 1800612058; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMemberStatusMember final : public ChatMemberStatus { + public: + + chatMemberStatusMember(); + + static const std::int32_t ID = 844723285; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMemberStatusRestricted final : public ChatMemberStatus { + public: + bool is_member_; + std::int32_t restricted_until_date_; + object_ptr permissions_; + + chatMemberStatusRestricted(); + + chatMemberStatusRestricted(bool is_member_, std::int32_t restricted_until_date_, object_ptr &&permissions_); + + static const std::int32_t ID = 1661432998; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMemberStatusLeft final : public ChatMemberStatus { + public: + + chatMemberStatusLeft(); + + static const std::int32_t ID = -5815259; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMemberStatusBanned final : public ChatMemberStatus { + public: + std::int32_t banned_until_date_; + + chatMemberStatusBanned(); + + explicit chatMemberStatusBanned(std::int32_t banned_until_date_); + + static const std::int32_t ID = -1653518666; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMembers final : public Object { + public: + std::int32_t total_count_; + std::vector> members_; + + chatMembers(); + + chatMembers(std::int32_t total_count_, std::vector> &&members_); + + static const std::int32_t ID = -497558622; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ChatMembersFilter: public Object { + public: +}; + +class chatMembersFilterContacts final : public ChatMembersFilter { + public: + + chatMembersFilterContacts(); + + static const std::int32_t ID = 1774485671; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMembersFilterAdministrators final : public ChatMembersFilter { + public: + + chatMembersFilterAdministrators(); + + static const std::int32_t ID = -1266893796; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMembersFilterMembers final : public ChatMembersFilter { + public: + + chatMembersFilterMembers(); + + static const std::int32_t ID = 670504342; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMembersFilterRestricted final : public ChatMembersFilter { + public: + + chatMembersFilterRestricted(); + + static const std::int32_t ID = 1256282813; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMembersFilterBanned final : public ChatMembersFilter { + public: + + chatMembersFilterBanned(); + + static const std::int32_t ID = -1863102648; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMembersFilterBots final : public ChatMembersFilter { + public: + + chatMembersFilterBots(); + + static const std::int32_t ID = -1422567288; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatNearby final : public Object { + public: + std::int64_t chat_id_; + std::int32_t distance_; + + chatNearby(); + + chatNearby(std::int64_t chat_id_, std::int32_t distance_); + + static const std::int32_t ID = 48120405; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatNotificationSettings final : public Object { + public: + bool use_default_mute_for_; + std::int32_t mute_for_; + bool use_default_sound_; + std::string sound_; + bool use_default_show_preview_; + bool show_preview_; + bool use_default_disable_pinned_message_notifications_; + bool disable_pinned_message_notifications_; + bool use_default_disable_mention_notifications_; + bool disable_mention_notifications_; + + chatNotificationSettings(); + + chatNotificationSettings(bool use_default_mute_for_, std::int32_t mute_for_, bool use_default_sound_, std::string const &sound_, bool use_default_show_preview_, bool show_preview_, bool use_default_disable_pinned_message_notifications_, bool disable_pinned_message_notifications_, bool use_default_disable_mention_notifications_, bool disable_mention_notifications_); + + static const std::int32_t ID = 1503183218; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatPermissions final : public Object { + public: + bool can_send_messages_; + bool can_send_media_messages_; + bool can_send_polls_; + bool can_send_other_messages_; + bool can_add_web_page_previews_; + bool can_change_info_; + bool can_invite_users_; + bool can_pin_messages_; + + chatPermissions(); + + chatPermissions(bool can_send_messages_, bool can_send_media_messages_, bool can_send_polls_, bool can_send_other_messages_, bool can_add_web_page_previews_, bool can_change_info_, bool can_invite_users_, bool can_pin_messages_); + + static const std::int32_t ID = 1584650463; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatPhoto final : public Object { + public: + object_ptr small_; + object_ptr big_; + + chatPhoto(); + + chatPhoto(object_ptr &&small_, object_ptr &&big_); + + static const std::int32_t ID = -217062456; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ChatReportReason: public Object { + public: +}; + +class chatReportReasonSpam final : public ChatReportReason { + public: + + chatReportReasonSpam(); + + static const std::int32_t ID = -510848863; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatReportReasonViolence final : public ChatReportReason { + public: + + chatReportReasonViolence(); + + static const std::int32_t ID = -1330235395; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatReportReasonPornography final : public ChatReportReason { + public: + + chatReportReasonPornography(); + + static const std::int32_t ID = 722614385; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatReportReasonChildAbuse final : public ChatReportReason { + public: + + chatReportReasonChildAbuse(); + + static const std::int32_t ID = -1070686531; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatReportReasonCopyright final : public ChatReportReason { + public: + + chatReportReasonCopyright(); + + static const std::int32_t ID = 986898080; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatReportReasonUnrelatedLocation final : public ChatReportReason { + public: + + chatReportReasonUnrelatedLocation(); + + static const std::int32_t ID = 2632403; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatReportReasonCustom final : public ChatReportReason { + public: + std::string text_; + + chatReportReasonCustom(); + + explicit chatReportReasonCustom(std::string const &text_); + + static const std::int32_t ID = 544575454; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ChatType: public Object { + public: +}; + +class chatTypePrivate final : public ChatType { + public: + std::int32_t user_id_; + + chatTypePrivate(); + + explicit chatTypePrivate(std::int32_t user_id_); + + static const std::int32_t ID = 1700720838; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatTypeBasicGroup final : public ChatType { + public: + std::int32_t basic_group_id_; + + chatTypeBasicGroup(); + + explicit chatTypeBasicGroup(std::int32_t basic_group_id_); + + static const std::int32_t ID = 21815278; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatTypeSupergroup final : public ChatType { + public: + std::int32_t supergroup_id_; + bool is_channel_; + + chatTypeSupergroup(); + + chatTypeSupergroup(std::int32_t supergroup_id_, bool is_channel_); + + static const std::int32_t ID = 955152366; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatTypeSecret final : public ChatType { + public: + std::int32_t secret_chat_id_; + std::int32_t user_id_; + + chatTypeSecret(); + + chatTypeSecret(std::int32_t secret_chat_id_, std::int32_t user_id_); + + static const std::int32_t ID = 136722563; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chats final : public Object { + public: + std::vector chat_ids_; + + chats(); + + explicit chats(std::vector &&chat_ids_); + + static const std::int32_t ID = -1687756019; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatsNearby final : public Object { + public: + std::vector> users_nearby_; + std::vector> supergroups_nearby_; + + chatsNearby(); + + chatsNearby(std::vector> &&users_nearby_, std::vector> &&supergroups_nearby_); + + static const std::int32_t ID = 187746081; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class CheckChatUsernameResult: public Object { + public: +}; + +class checkChatUsernameResultOk final : public CheckChatUsernameResult { + public: + + checkChatUsernameResultOk(); + + static const std::int32_t ID = -1498956964; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class checkChatUsernameResultUsernameInvalid final : public CheckChatUsernameResult { + public: + + checkChatUsernameResultUsernameInvalid(); + + static const std::int32_t ID = -636979370; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class checkChatUsernameResultUsernameOccupied final : public CheckChatUsernameResult { + public: + + checkChatUsernameResultUsernameOccupied(); + + static const std::int32_t ID = 1320892201; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class checkChatUsernameResultPublicChatsTooMuch final : public CheckChatUsernameResult { + public: + + checkChatUsernameResultPublicChatsTooMuch(); + + static const std::int32_t ID = 858247741; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class checkChatUsernameResultPublicGroupsUnavailable final : public CheckChatUsernameResult { + public: + + checkChatUsernameResultPublicGroupsUnavailable(); + + static const std::int32_t ID = -51833641; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class connectedWebsite final : public Object { + public: + std::int64_t id_; + std::string domain_name_; + std::int32_t bot_user_id_; + std::string browser_; + std::string platform_; + std::int32_t log_in_date_; + std::int32_t last_active_date_; + std::string ip_; + std::string location_; + + connectedWebsite(); + + connectedWebsite(std::int64_t id_, std::string const &domain_name_, std::int32_t bot_user_id_, std::string const &browser_, std::string const &platform_, std::int32_t log_in_date_, std::int32_t last_active_date_, std::string const &ip_, std::string const &location_); + + static const std::int32_t ID = -1538986855; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class connectedWebsites final : public Object { + public: + std::vector> websites_; + + connectedWebsites(); + + explicit connectedWebsites(std::vector> &&websites_); + + static const std::int32_t ID = -1727949694; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ConnectionState: public Object { + public: +}; + +class connectionStateWaitingForNetwork final : public ConnectionState { + public: + + connectionStateWaitingForNetwork(); + + static const std::int32_t ID = 1695405912; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class connectionStateConnectingToProxy final : public ConnectionState { + public: + + connectionStateConnectingToProxy(); + + static const std::int32_t ID = -93187239; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class connectionStateConnecting final : public ConnectionState { + public: + + connectionStateConnecting(); + + static const std::int32_t ID = -1298400670; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class connectionStateUpdating final : public ConnectionState { + public: + + connectionStateUpdating(); + + static const std::int32_t ID = -188104009; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class connectionStateReady final : public ConnectionState { + public: + + connectionStateReady(); + + static const std::int32_t ID = 48608492; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class contact final : public Object { + public: + std::string phone_number_; + std::string first_name_; + std::string last_name_; + std::string vcard_; + std::int32_t user_id_; + + contact(); + + contact(std::string const &phone_number_, std::string const &first_name_, std::string const &last_name_, std::string const &vcard_, std::int32_t user_id_); + + static const std::int32_t ID = -1483002540; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class count final : public Object { + public: + std::int32_t count_; + + count(); + + explicit count(std::int32_t count_); + + static const std::int32_t ID = 1295577348; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class customRequestResult final : public Object { + public: + std::string result_; + + customRequestResult(); + + explicit customRequestResult(std::string const &result_); + + static const std::int32_t ID = -2009960452; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class databaseStatistics final : public Object { + public: + std::string statistics_; + + databaseStatistics(); + + explicit databaseStatistics(std::string const &statistics_); + + static const std::int32_t ID = -1123912880; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class date final : public Object { + public: + std::int32_t day_; + std::int32_t month_; + std::int32_t year_; + + date(); + + date(std::int32_t day_, std::int32_t month_, std::int32_t year_); + + static const std::int32_t ID = -277956960; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class datedFile final : public Object { + public: + object_ptr file_; + std::int32_t date_; + + datedFile(); + + datedFile(object_ptr &&file_, std::int32_t date_); + + static const std::int32_t ID = -1840795491; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class deepLinkInfo final : public Object { + public: + object_ptr text_; + bool need_update_application_; + + deepLinkInfo(); + + deepLinkInfo(object_ptr &&text_, bool need_update_application_); + + static const std::int32_t ID = 1864081662; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class DeviceToken: public Object { + public: +}; + +class deviceTokenFirebaseCloudMessaging final : public DeviceToken { + public: + std::string token_; + bool encrypt_; + + deviceTokenFirebaseCloudMessaging(); + + deviceTokenFirebaseCloudMessaging(std::string const &token_, bool encrypt_); + + static const std::int32_t ID = -797881849; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class deviceTokenApplePush final : public DeviceToken { + public: + std::string device_token_; + bool is_app_sandbox_; + + deviceTokenApplePush(); + + deviceTokenApplePush(std::string const &device_token_, bool is_app_sandbox_); + + static const std::int32_t ID = 387541955; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class deviceTokenApplePushVoIP final : public DeviceToken { + public: + std::string device_token_; + bool is_app_sandbox_; + bool encrypt_; + + deviceTokenApplePushVoIP(); + + deviceTokenApplePushVoIP(std::string const &device_token_, bool is_app_sandbox_, bool encrypt_); + + static const std::int32_t ID = 804275689; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class deviceTokenWindowsPush final : public DeviceToken { + public: + std::string access_token_; + + deviceTokenWindowsPush(); + + explicit deviceTokenWindowsPush(std::string const &access_token_); + + static const std::int32_t ID = -1410514289; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class deviceTokenMicrosoftPush final : public DeviceToken { + public: + std::string channel_uri_; + + deviceTokenMicrosoftPush(); + + explicit deviceTokenMicrosoftPush(std::string const &channel_uri_); + + static const std::int32_t ID = 1224269900; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class deviceTokenMicrosoftPushVoIP final : public DeviceToken { + public: + std::string channel_uri_; + + deviceTokenMicrosoftPushVoIP(); + + explicit deviceTokenMicrosoftPushVoIP(std::string const &channel_uri_); + + static const std::int32_t ID = -785603759; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class deviceTokenWebPush final : public DeviceToken { + public: + std::string endpoint_; + std::string p256dh_base64url_; + std::string auth_base64url_; + + deviceTokenWebPush(); + + deviceTokenWebPush(std::string const &endpoint_, std::string const &p256dh_base64url_, std::string const &auth_base64url_); + + static const std::int32_t ID = -1694507273; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class deviceTokenSimplePush final : public DeviceToken { + public: + std::string endpoint_; + + deviceTokenSimplePush(); + + explicit deviceTokenSimplePush(std::string const &endpoint_); + + static const std::int32_t ID = 49584736; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class deviceTokenUbuntuPush final : public DeviceToken { + public: + std::string token_; + + deviceTokenUbuntuPush(); + + explicit deviceTokenUbuntuPush(std::string const &token_); + + static const std::int32_t ID = 1782320422; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class deviceTokenBlackBerryPush final : public DeviceToken { + public: + std::string token_; + + deviceTokenBlackBerryPush(); + + explicit deviceTokenBlackBerryPush(std::string const &token_); + + static const std::int32_t ID = 1559167234; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class deviceTokenTizenPush final : public DeviceToken { + public: + std::string reg_id_; + + deviceTokenTizenPush(); + + explicit deviceTokenTizenPush(std::string const ®_id_); + + static const std::int32_t ID = -1359947213; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class document final : public Object { + public: + std::string file_name_; + std::string mime_type_; + object_ptr minithumbnail_; + object_ptr thumbnail_; + object_ptr document_; + + document(); + + document(std::string const &file_name_, std::string const &mime_type_, object_ptr &&minithumbnail_, object_ptr &&thumbnail_, object_ptr &&document_); + + static const std::int32_t ID = 21881988; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class draftMessage final : public Object { + public: + std::int64_t reply_to_message_id_; + object_ptr input_message_text_; + + draftMessage(); + + draftMessage(std::int64_t reply_to_message_id_, object_ptr &&input_message_text_); + + static const std::int32_t ID = 1902914742; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class emailAddressAuthenticationCodeInfo final : public Object { + public: + std::string email_address_pattern_; + std::int32_t length_; + + emailAddressAuthenticationCodeInfo(); + + emailAddressAuthenticationCodeInfo(std::string const &email_address_pattern_, std::int32_t length_); + + static const std::int32_t ID = 1151066659; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class emojis final : public Object { + public: + std::vector emojis_; + + emojis(); + + explicit emojis(std::vector &&emojis_); + + static const std::int32_t ID = 950339552; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class encryptedCredentials final : public Object { + public: + std::string data_; + std::string hash_; + std::string secret_; + + encryptedCredentials(); + + encryptedCredentials(std::string const &data_, std::string const &hash_, std::string const &secret_); + + static const std::int32_t ID = 1331106766; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class encryptedPassportElement final : public Object { + public: + object_ptr type_; + std::string data_; + object_ptr front_side_; + object_ptr reverse_side_; + object_ptr selfie_; + std::vector> translation_; + std::vector> files_; + std::string value_; + std::string hash_; + + encryptedPassportElement(); + + encryptedPassportElement(object_ptr &&type_, std::string const &data_, object_ptr &&front_side_, object_ptr &&reverse_side_, object_ptr &&selfie_, std::vector> &&translation_, std::vector> &&files_, std::string const &value_, std::string const &hash_); + + static const std::int32_t ID = 2002386193; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class error final : public Object { + public: + std::int32_t code_; + std::string message_; + + error(); + + error(std::int32_t code_, std::string const &message_); + + static const std::int32_t ID = -1679978726; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class file final : public Object { + public: + std::int32_t id_; + std::int32_t size_; + std::int32_t expected_size_; + object_ptr local_; + object_ptr remote_; + + file(); + + file(std::int32_t id_, std::int32_t size_, std::int32_t expected_size_, object_ptr &&local_, object_ptr &&remote_); + + static const std::int32_t ID = 766337656; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class filePart final : public Object { + public: + std::string data_; + + filePart(); + + explicit filePart(std::string const &data_); + + static const std::int32_t ID = 911821878; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class FileType: public Object { + public: +}; + +class fileTypeNone final : public FileType { + public: + + fileTypeNone(); + + static const std::int32_t ID = 2003009189; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeAnimation final : public FileType { + public: + + fileTypeAnimation(); + + static const std::int32_t ID = -290816582; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeAudio final : public FileType { + public: + + fileTypeAudio(); + + static const std::int32_t ID = -709112160; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeDocument final : public FileType { + public: + + fileTypeDocument(); + + static const std::int32_t ID = -564722929; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypePhoto final : public FileType { + public: + + fileTypePhoto(); + + static const std::int32_t ID = -1718914651; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeProfilePhoto final : public FileType { + public: + + fileTypeProfilePhoto(); + + static const std::int32_t ID = 1795089315; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeSecret final : public FileType { + public: + + fileTypeSecret(); + + static const std::int32_t ID = -1871899401; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeSecretThumbnail final : public FileType { + public: + + fileTypeSecretThumbnail(); + + static const std::int32_t ID = -1401326026; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeSecure final : public FileType { + public: + + fileTypeSecure(); + + static const std::int32_t ID = -1419133146; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeSticker final : public FileType { + public: + + fileTypeSticker(); + + static const std::int32_t ID = 475233385; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeThumbnail final : public FileType { + public: + + fileTypeThumbnail(); + + static const std::int32_t ID = -12443298; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeUnknown final : public FileType { + public: + + fileTypeUnknown(); + + static const std::int32_t ID = -2011566768; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeVideo final : public FileType { + public: + + fileTypeVideo(); + + static const std::int32_t ID = 1430816539; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeVideoNote final : public FileType { + public: + + fileTypeVideoNote(); + + static const std::int32_t ID = -518412385; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeVoiceNote final : public FileType { + public: + + fileTypeVoiceNote(); + + static const std::int32_t ID = -588681661; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileTypeWallpaper final : public FileType { + public: + + fileTypeWallpaper(); + + static const std::int32_t ID = 1854930076; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class formattedText final : public Object { + public: + std::string text_; + std::vector> entities_; + + formattedText(); + + formattedText(std::string const &text_, std::vector> &&entities_); + + static const std::int32_t ID = -252624564; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class foundMessages final : public Object { + public: + std::vector> messages_; + std::int64_t next_from_search_id_; + + foundMessages(); + + foundMessages(std::vector> &&messages_, std::int64_t next_from_search_id_); + + static const std::int32_t ID = 2135623881; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class game final : public Object { + public: + std::int64_t id_; + std::string short_name_; + std::string title_; + object_ptr text_; + std::string description_; + object_ptr photo_; + object_ptr animation_; + + game(); + + game(std::int64_t id_, std::string const &short_name_, std::string const &title_, object_ptr &&text_, std::string const &description_, object_ptr &&photo_, object_ptr &&animation_); + + static const std::int32_t ID = -1565597752; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class gameHighScore final : public Object { + public: + std::int32_t position_; + std::int32_t user_id_; + std::int32_t score_; + + gameHighScore(); + + gameHighScore(std::int32_t position_, std::int32_t user_id_, std::int32_t score_); + + static const std::int32_t ID = -30778358; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class gameHighScores final : public Object { + public: + std::vector> scores_; + + gameHighScores(); + + explicit gameHighScores(std::vector> &&scores_); + + static const std::int32_t ID = -725770727; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class hashtags final : public Object { + public: + std::vector hashtags_; + + hashtags(); + + explicit hashtags(std::vector &&hashtags_); + + static const std::int32_t ID = 676798885; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class httpUrl final : public Object { + public: + std::string url_; + + httpUrl(); + + explicit httpUrl(std::string const &url_); + + static const std::int32_t ID = -2018019930; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class identityDocument final : public Object { + public: + std::string number_; + object_ptr expiry_date_; + object_ptr front_side_; + object_ptr reverse_side_; + object_ptr selfie_; + std::vector> translation_; + + identityDocument(); + + identityDocument(std::string const &number_, object_ptr &&expiry_date_, object_ptr &&front_side_, object_ptr &&reverse_side_, object_ptr &&selfie_, std::vector> &&translation_); + + static const std::int32_t ID = 445952972; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class importedContacts final : public Object { + public: + std::vector user_ids_; + std::vector importer_count_; + + importedContacts(); + + importedContacts(std::vector &&user_ids_, std::vector &&importer_count_); + + static const std::int32_t ID = -741685354; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineKeyboardButton final : public Object { + public: + std::string text_; + object_ptr type_; + + inlineKeyboardButton(); + + inlineKeyboardButton(std::string const &text_, object_ptr &&type_); + + static const std::int32_t ID = -372105704; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class InlineKeyboardButtonType: public Object { + public: +}; + +class inlineKeyboardButtonTypeUrl final : public InlineKeyboardButtonType { + public: + std::string url_; + + inlineKeyboardButtonTypeUrl(); + + explicit inlineKeyboardButtonTypeUrl(std::string const &url_); + + static const std::int32_t ID = 1130741420; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineKeyboardButtonTypeLoginUrl final : public InlineKeyboardButtonType { + public: + std::string url_; + std::int32_t id_; + std::string forward_text_; + + inlineKeyboardButtonTypeLoginUrl(); + + inlineKeyboardButtonTypeLoginUrl(std::string const &url_, std::int32_t id_, std::string const &forward_text_); + + static const std::int32_t ID = 281435539; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineKeyboardButtonTypeCallback final : public InlineKeyboardButtonType { + public: + std::string data_; + + inlineKeyboardButtonTypeCallback(); + + explicit inlineKeyboardButtonTypeCallback(std::string const &data_); + + static const std::int32_t ID = -1127515139; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineKeyboardButtonTypeCallbackGame final : public InlineKeyboardButtonType { + public: + + inlineKeyboardButtonTypeCallbackGame(); + + static const std::int32_t ID = -383429528; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineKeyboardButtonTypeSwitchInline final : public InlineKeyboardButtonType { + public: + std::string query_; + bool in_current_chat_; + + inlineKeyboardButtonTypeSwitchInline(); + + inlineKeyboardButtonTypeSwitchInline(std::string const &query_, bool in_current_chat_); + + static const std::int32_t ID = -2035563307; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineKeyboardButtonTypeBuy final : public InlineKeyboardButtonType { + public: + + inlineKeyboardButtonTypeBuy(); + + static const std::int32_t ID = 1360739440; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class InlineQueryResult: public Object { + public: +}; + +class inlineQueryResultArticle final : public InlineQueryResult { + public: + std::string id_; + std::string url_; + bool hide_url_; + std::string title_; + std::string description_; + object_ptr thumbnail_; + + inlineQueryResultArticle(); + + inlineQueryResultArticle(std::string const &id_, std::string const &url_, bool hide_url_, std::string const &title_, std::string const &description_, object_ptr &&thumbnail_); + + static const std::int32_t ID = -518366710; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineQueryResultContact final : public InlineQueryResult { + public: + std::string id_; + object_ptr contact_; + object_ptr thumbnail_; + + inlineQueryResultContact(); + + inlineQueryResultContact(std::string const &id_, object_ptr &&contact_, object_ptr &&thumbnail_); + + static const std::int32_t ID = 410081985; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineQueryResultLocation final : public InlineQueryResult { + public: + std::string id_; + object_ptr location_; + std::string title_; + object_ptr thumbnail_; + + inlineQueryResultLocation(); + + inlineQueryResultLocation(std::string const &id_, object_ptr &&location_, std::string const &title_, object_ptr &&thumbnail_); + + static const std::int32_t ID = -158305341; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineQueryResultVenue final : public InlineQueryResult { + public: + std::string id_; + object_ptr venue_; + object_ptr thumbnail_; + + inlineQueryResultVenue(); + + inlineQueryResultVenue(std::string const &id_, object_ptr &&venue_, object_ptr &&thumbnail_); + + static const std::int32_t ID = -1592932211; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineQueryResultGame final : public InlineQueryResult { + public: + std::string id_; + object_ptr game_; + + inlineQueryResultGame(); + + inlineQueryResultGame(std::string const &id_, object_ptr &&game_); + + static const std::int32_t ID = 1706916987; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineQueryResultAnimation final : public InlineQueryResult { + public: + std::string id_; + object_ptr animation_; + std::string title_; + + inlineQueryResultAnimation(); + + inlineQueryResultAnimation(std::string const &id_, object_ptr &&animation_, std::string const &title_); + + static const std::int32_t ID = 2009984267; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineQueryResultAudio final : public InlineQueryResult { + public: + std::string id_; + object_ptr