#include "td_api.h"

#include "td/tl/tl_jni_object.h"

#include "td/utils/common.h"
#include "td/utils/format.h"
#include "td/utils/logging.h"
#include "td/utils/SliceBuilder.h"
#include "td/utils/tl_parsers.h"
#include "td/utils/tl_storers.h"
#include "td/utils/TlStorerToString.h"

namespace td {
namespace td_api {

std::string to_string(const BaseObject &value) {
  TlStorerToString storer;
  value.store(storer, "");
  return storer.move_as_string();
}

const char *&get_package_name_ref() {
  static const char *package_name = "Package name must be initialized first";
  return package_name;
}

const char *get_git_commit_hash() {
  return "GITDIR-NOTFOUND";
}

jclass addedProxies::Class;
jfieldID addedProxies::proxies_fieldID;

addedProxies::addedProxies()
  : proxies_()
{}

addedProxies::addedProxies(array<object_ptr<addedProxy>> &&proxies_)
  : proxies_(std::move(proxies_))
{}

const std::int32_t addedProxies::ID;

object_ptr<addedProxies> addedProxies::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<addedProxies> res = make_object<addedProxies>();
  res->proxies_ = jni::FetchVector<addedProxy>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->proxies_fieldID));
  return res;
}

void addedProxies::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { auto arr_tmp_ = jni::store_vector(env, proxies_); if (arr_tmp_) { env->SetObjectField(s, proxies_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void addedProxies::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AddedProxies");
    { s.store_vector_begin("proxies", proxies_.size()); for (const auto &_value : proxies_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

void addedProxies::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AddedProxies").c_str());
    proxies_fieldID = jni::get_field_id(env, Class, "proxies", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$AddedProxy;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass address::Class;
jfieldID address::country_code_fieldID;
jfieldID address::state_fieldID;
jfieldID address::city_fieldID;
jfieldID address::street_line1_fieldID;
jfieldID address::street_line2_fieldID;
jfieldID address::postal_code_fieldID;

address::address()
  : country_code_()
  , state_()
  , city_()
  , street_line1_()
  , street_line2_()
  , postal_code_()
{}

address::address(string const &country_code_, string const &state_, string const &city_, string const &street_line1_, string const &street_line2_, string const &postal_code_)
  : country_code_(country_code_)
  , state_(state_)
  , city_(city_)
  , street_line1_(street_line1_)
  , street_line2_(street_line2_)
  , postal_code_(postal_code_)
{}

const std::int32_t address::ID;

object_ptr<address> address::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<address> res = make_object<address>();
  res->country_code_ = jni::fetch_string(env, p, res->country_code_fieldID);
  res->state_ = jni::fetch_string(env, p, res->state_fieldID);
  res->city_ = jni::fetch_string(env, p, res->city_fieldID);
  res->street_line1_ = jni::fetch_string(env, p, res->street_line1_fieldID);
  res->street_line2_ = jni::fetch_string(env, p, res->street_line2_fieldID);
  res->postal_code_ = jni::fetch_string(env, p, res->postal_code_fieldID);
  return res;
}

void address::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, country_code_); if (nextString) { env->SetObjectField(s, country_code_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, state_); if (nextString) { env->SetObjectField(s, state_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, city_); if (nextString) { env->SetObjectField(s, city_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, street_line1_); if (nextString) { env->SetObjectField(s, street_line1_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, street_line2_); if (nextString) { env->SetObjectField(s, street_line2_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, postal_code_); if (nextString) { env->SetObjectField(s, postal_code_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void address::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "Address");
    s.store_field("countryCode", country_code_);
    s.store_field("state", state_);
    s.store_field("city", city_);
    s.store_field("streetLine1", street_line1_);
    s.store_field("streetLine2", street_line2_);
    s.store_field("postalCode", postal_code_);
    s.store_class_end();
  }
}

void address::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$Address").c_str());
    country_code_fieldID = jni::get_field_id(env, Class, "countryCode", "Ljava/lang/String;");
    state_fieldID = jni::get_field_id(env, Class, "state", "Ljava/lang/String;");
    city_fieldID = jni::get_field_id(env, Class, "city", "Ljava/lang/String;");
    street_line1_fieldID = jni::get_field_id(env, Class, "streetLine1", "Ljava/lang/String;");
    street_line2_fieldID = jni::get_field_id(env, Class, "streetLine2", "Ljava/lang/String;");
    postal_code_fieldID = jni::get_field_id(env, Class, "postalCode", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass animatedChatPhoto::Class;
jfieldID animatedChatPhoto::length_fieldID;
jfieldID animatedChatPhoto::file_fieldID;
jfieldID animatedChatPhoto::main_frame_timestamp_fieldID;

animatedChatPhoto::animatedChatPhoto()
  : length_()
  , file_()
  , main_frame_timestamp_()
{}

animatedChatPhoto::animatedChatPhoto(int32 length_, object_ptr<file> &&file_, double main_frame_timestamp_)
  : length_(length_)
  , file_(std::move(file_))
  , main_frame_timestamp_(main_frame_timestamp_)
{}

const std::int32_t animatedChatPhoto::ID;

object_ptr<animatedChatPhoto> animatedChatPhoto::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<animatedChatPhoto> res = make_object<animatedChatPhoto>();
  res->length_ = env->GetIntField(p, res->length_fieldID);
  res->file_ = jni::fetch_tl_object<file>(env, jni::fetch_object(env, p, res->file_fieldID));
  res->main_frame_timestamp_ = env->GetDoubleField(p, res->main_frame_timestamp_fieldID);
  return res;
}

void animatedChatPhoto::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, length_fieldID, length_);
  if (file_ != nullptr) { jobject next; file_->store(env, next); if (next) { env->SetObjectField(s, file_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetDoubleField(s, main_frame_timestamp_fieldID, main_frame_timestamp_);
}

void animatedChatPhoto::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AnimatedChatPhoto");
    s.store_field("length", length_);
    s.store_object_field("file", static_cast<const BaseObject *>(file_.get()));
    s.store_field("mainFrameTimestamp", main_frame_timestamp_);
    s.store_class_end();
  }
}

void animatedChatPhoto::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AnimatedChatPhoto").c_str());
    length_fieldID = jni::get_field_id(env, Class, "length", "I");
    file_fieldID = jni::get_field_id(env, Class, "file", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$File;").c_str());
    main_frame_timestamp_fieldID = jni::get_field_id(env, Class, "mainFrameTimestamp", "D");
    return true;
  }();
  (void)is_inited;
}

jclass attachmentMenuBotColor::Class;
jfieldID attachmentMenuBotColor::light_color_fieldID;
jfieldID attachmentMenuBotColor::dark_color_fieldID;

attachmentMenuBotColor::attachmentMenuBotColor()
  : light_color_()
  , dark_color_()
{}

attachmentMenuBotColor::attachmentMenuBotColor(int32 light_color_, int32 dark_color_)
  : light_color_(light_color_)
  , dark_color_(dark_color_)
{}

const std::int32_t attachmentMenuBotColor::ID;

object_ptr<attachmentMenuBotColor> attachmentMenuBotColor::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<attachmentMenuBotColor> res = make_object<attachmentMenuBotColor>();
  res->light_color_ = env->GetIntField(p, res->light_color_fieldID);
  res->dark_color_ = env->GetIntField(p, res->dark_color_fieldID);
  return res;
}

void attachmentMenuBotColor::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, light_color_fieldID, light_color_);
  env->SetIntField(s, dark_color_fieldID, dark_color_);
}

void attachmentMenuBotColor::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AttachmentMenuBotColor");
    s.store_field("lightColor", light_color_);
    s.store_field("darkColor", dark_color_);
    s.store_class_end();
  }
}

void attachmentMenuBotColor::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AttachmentMenuBotColor").c_str());
    light_color_fieldID = jni::get_field_id(env, Class, "lightColor", "I");
    dark_color_fieldID = jni::get_field_id(env, Class, "darkColor", "I");
    return true;
  }();
  (void)is_inited;
}

jclass attributeCraftPersistenceProbability::Class;
jfieldID attributeCraftPersistenceProbability::persistence_chance_per_mille_fieldID;

attributeCraftPersistenceProbability::attributeCraftPersistenceProbability()
  : persistence_chance_per_mille_()
{}

attributeCraftPersistenceProbability::attributeCraftPersistenceProbability(array<int32> &&persistence_chance_per_mille_)
  : persistence_chance_per_mille_(std::move(persistence_chance_per_mille_))
{}

const std::int32_t attributeCraftPersistenceProbability::ID;

object_ptr<attributeCraftPersistenceProbability> attributeCraftPersistenceProbability::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<attributeCraftPersistenceProbability> res = make_object<attributeCraftPersistenceProbability>();
  res->persistence_chance_per_mille_ = jni::fetch_vector(env, (jintArray)jni::fetch_object(env, p, res->persistence_chance_per_mille_fieldID));
  return res;
}

void attributeCraftPersistenceProbability::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { auto arr_tmp_ = jni::store_vector(env, persistence_chance_per_mille_); if (arr_tmp_) { env->SetObjectField(s, persistence_chance_per_mille_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void attributeCraftPersistenceProbability::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AttributeCraftPersistenceProbability");
    { s.store_vector_begin("persistenceChancePerMille", persistence_chance_per_mille_.size()); for (const auto &_value : persistence_chance_per_mille_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

void attributeCraftPersistenceProbability::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AttributeCraftPersistenceProbability").c_str());
    persistence_chance_per_mille_fieldID = jni::get_field_id(env, Class, "persistenceChancePerMille", "[I");
    return true;
  }();
  (void)is_inited;
}

jclass AuthenticationCodeType::Class;

object_ptr<AuthenticationCodeType> AuthenticationCodeType::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case authenticationCodeTypeTelegramMessage::ID:
      return authenticationCodeTypeTelegramMessage::fetch(env, p);
    case authenticationCodeTypeSms::ID:
      return authenticationCodeTypeSms::fetch(env, p);
    case authenticationCodeTypeSmsWord::ID:
      return authenticationCodeTypeSmsWord::fetch(env, p);
    case authenticationCodeTypeSmsPhrase::ID:
      return authenticationCodeTypeSmsPhrase::fetch(env, p);
    case authenticationCodeTypeCall::ID:
      return authenticationCodeTypeCall::fetch(env, p);
    case authenticationCodeTypeFlashCall::ID:
      return authenticationCodeTypeFlashCall::fetch(env, p);
    case authenticationCodeTypeMissedCall::ID:
      return authenticationCodeTypeMissedCall::fetch(env, p);
    case authenticationCodeTypeFragment::ID:
      return authenticationCodeTypeFragment::fetch(env, p);
    case authenticationCodeTypeFirebaseAndroid::ID:
      return authenticationCodeTypeFirebaseAndroid::fetch(env, p);
    case authenticationCodeTypeFirebaseIos::ID:
      return authenticationCodeTypeFirebaseIos::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void AuthenticationCodeType::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthenticationCodeType").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass authenticationCodeTypeTelegramMessage::Class;
jfieldID authenticationCodeTypeTelegramMessage::length_fieldID;

authenticationCodeTypeTelegramMessage::authenticationCodeTypeTelegramMessage()
  : length_()
{}

authenticationCodeTypeTelegramMessage::authenticationCodeTypeTelegramMessage(int32 length_)
  : length_(length_)
{}

const std::int32_t authenticationCodeTypeTelegramMessage::ID;

object_ptr<AuthenticationCodeType> authenticationCodeTypeTelegramMessage::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authenticationCodeTypeTelegramMessage> res = make_object<authenticationCodeTypeTelegramMessage>();
  res->length_ = env->GetIntField(p, res->length_fieldID);
  return std::move(res);
}

void authenticationCodeTypeTelegramMessage::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, length_fieldID, length_);
}

void authenticationCodeTypeTelegramMessage::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthenticationCodeTypeTelegramMessage");
    s.store_field("length", length_);
    s.store_class_end();
  }
}

void authenticationCodeTypeTelegramMessage::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthenticationCodeTypeTelegramMessage").c_str());
    length_fieldID = jni::get_field_id(env, Class, "length", "I");
    return true;
  }();
  (void)is_inited;
}

jclass authenticationCodeTypeSms::Class;
jfieldID authenticationCodeTypeSms::length_fieldID;

authenticationCodeTypeSms::authenticationCodeTypeSms()
  : length_()
{}

authenticationCodeTypeSms::authenticationCodeTypeSms(int32 length_)
  : length_(length_)
{}

const std::int32_t authenticationCodeTypeSms::ID;

object_ptr<AuthenticationCodeType> authenticationCodeTypeSms::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authenticationCodeTypeSms> res = make_object<authenticationCodeTypeSms>();
  res->length_ = env->GetIntField(p, res->length_fieldID);
  return std::move(res);
}

void authenticationCodeTypeSms::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, length_fieldID, length_);
}

void authenticationCodeTypeSms::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthenticationCodeTypeSms");
    s.store_field("length", length_);
    s.store_class_end();
  }
}

void authenticationCodeTypeSms::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthenticationCodeTypeSms").c_str());
    length_fieldID = jni::get_field_id(env, Class, "length", "I");
    return true;
  }();
  (void)is_inited;
}

jclass authenticationCodeTypeSmsWord::Class;
jfieldID authenticationCodeTypeSmsWord::first_letter_fieldID;

authenticationCodeTypeSmsWord::authenticationCodeTypeSmsWord()
  : first_letter_()
{}

authenticationCodeTypeSmsWord::authenticationCodeTypeSmsWord(string const &first_letter_)
  : first_letter_(first_letter_)
{}

const std::int32_t authenticationCodeTypeSmsWord::ID;

object_ptr<AuthenticationCodeType> authenticationCodeTypeSmsWord::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authenticationCodeTypeSmsWord> res = make_object<authenticationCodeTypeSmsWord>();
  res->first_letter_ = jni::fetch_string(env, p, res->first_letter_fieldID);
  return std::move(res);
}

void authenticationCodeTypeSmsWord::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, first_letter_); if (nextString) { env->SetObjectField(s, first_letter_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void authenticationCodeTypeSmsWord::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthenticationCodeTypeSmsWord");
    s.store_field("firstLetter", first_letter_);
    s.store_class_end();
  }
}

void authenticationCodeTypeSmsWord::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthenticationCodeTypeSmsWord").c_str());
    first_letter_fieldID = jni::get_field_id(env, Class, "firstLetter", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass authenticationCodeTypeSmsPhrase::Class;
jfieldID authenticationCodeTypeSmsPhrase::first_word_fieldID;

authenticationCodeTypeSmsPhrase::authenticationCodeTypeSmsPhrase()
  : first_word_()
{}

authenticationCodeTypeSmsPhrase::authenticationCodeTypeSmsPhrase(string const &first_word_)
  : first_word_(first_word_)
{}

const std::int32_t authenticationCodeTypeSmsPhrase::ID;

object_ptr<AuthenticationCodeType> authenticationCodeTypeSmsPhrase::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authenticationCodeTypeSmsPhrase> res = make_object<authenticationCodeTypeSmsPhrase>();
  res->first_word_ = jni::fetch_string(env, p, res->first_word_fieldID);
  return std::move(res);
}

void authenticationCodeTypeSmsPhrase::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, first_word_); if (nextString) { env->SetObjectField(s, first_word_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void authenticationCodeTypeSmsPhrase::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthenticationCodeTypeSmsPhrase");
    s.store_field("firstWord", first_word_);
    s.store_class_end();
  }
}

void authenticationCodeTypeSmsPhrase::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthenticationCodeTypeSmsPhrase").c_str());
    first_word_fieldID = jni::get_field_id(env, Class, "firstWord", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass authenticationCodeTypeCall::Class;
jfieldID authenticationCodeTypeCall::length_fieldID;

authenticationCodeTypeCall::authenticationCodeTypeCall()
  : length_()
{}

authenticationCodeTypeCall::authenticationCodeTypeCall(int32 length_)
  : length_(length_)
{}

const std::int32_t authenticationCodeTypeCall::ID;

object_ptr<AuthenticationCodeType> authenticationCodeTypeCall::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authenticationCodeTypeCall> res = make_object<authenticationCodeTypeCall>();
  res->length_ = env->GetIntField(p, res->length_fieldID);
  return std::move(res);
}

void authenticationCodeTypeCall::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, length_fieldID, length_);
}

void authenticationCodeTypeCall::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthenticationCodeTypeCall");
    s.store_field("length", length_);
    s.store_class_end();
  }
}

void authenticationCodeTypeCall::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthenticationCodeTypeCall").c_str());
    length_fieldID = jni::get_field_id(env, Class, "length", "I");
    return true;
  }();
  (void)is_inited;
}

jclass authenticationCodeTypeFlashCall::Class;
jfieldID authenticationCodeTypeFlashCall::pattern_fieldID;

authenticationCodeTypeFlashCall::authenticationCodeTypeFlashCall()
  : pattern_()
{}

authenticationCodeTypeFlashCall::authenticationCodeTypeFlashCall(string const &pattern_)
  : pattern_(pattern_)
{}

const std::int32_t authenticationCodeTypeFlashCall::ID;

object_ptr<AuthenticationCodeType> authenticationCodeTypeFlashCall::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authenticationCodeTypeFlashCall> res = make_object<authenticationCodeTypeFlashCall>();
  res->pattern_ = jni::fetch_string(env, p, res->pattern_fieldID);
  return std::move(res);
}

void authenticationCodeTypeFlashCall::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, pattern_); if (nextString) { env->SetObjectField(s, pattern_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void authenticationCodeTypeFlashCall::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthenticationCodeTypeFlashCall");
    s.store_field("pattern", pattern_);
    s.store_class_end();
  }
}

void authenticationCodeTypeFlashCall::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthenticationCodeTypeFlashCall").c_str());
    pattern_fieldID = jni::get_field_id(env, Class, "pattern", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass authenticationCodeTypeMissedCall::Class;
jfieldID authenticationCodeTypeMissedCall::phone_number_prefix_fieldID;
jfieldID authenticationCodeTypeMissedCall::length_fieldID;

authenticationCodeTypeMissedCall::authenticationCodeTypeMissedCall()
  : phone_number_prefix_()
  , length_()
{}

authenticationCodeTypeMissedCall::authenticationCodeTypeMissedCall(string const &phone_number_prefix_, int32 length_)
  : phone_number_prefix_(phone_number_prefix_)
  , length_(length_)
{}

const std::int32_t authenticationCodeTypeMissedCall::ID;

object_ptr<AuthenticationCodeType> authenticationCodeTypeMissedCall::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authenticationCodeTypeMissedCall> res = make_object<authenticationCodeTypeMissedCall>();
  res->phone_number_prefix_ = jni::fetch_string(env, p, res->phone_number_prefix_fieldID);
  res->length_ = env->GetIntField(p, res->length_fieldID);
  return std::move(res);
}

void authenticationCodeTypeMissedCall::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, phone_number_prefix_); if (nextString) { env->SetObjectField(s, phone_number_prefix_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetIntField(s, length_fieldID, length_);
}

void authenticationCodeTypeMissedCall::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthenticationCodeTypeMissedCall");
    s.store_field("phoneNumberPrefix", phone_number_prefix_);
    s.store_field("length", length_);
    s.store_class_end();
  }
}

void authenticationCodeTypeMissedCall::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthenticationCodeTypeMissedCall").c_str());
    phone_number_prefix_fieldID = jni::get_field_id(env, Class, "phoneNumberPrefix", "Ljava/lang/String;");
    length_fieldID = jni::get_field_id(env, Class, "length", "I");
    return true;
  }();
  (void)is_inited;
}

jclass authenticationCodeTypeFragment::Class;
jfieldID authenticationCodeTypeFragment::url_fieldID;
jfieldID authenticationCodeTypeFragment::length_fieldID;

authenticationCodeTypeFragment::authenticationCodeTypeFragment()
  : url_()
  , length_()
{}

authenticationCodeTypeFragment::authenticationCodeTypeFragment(string const &url_, int32 length_)
  : url_(url_)
  , length_(length_)
{}

const std::int32_t authenticationCodeTypeFragment::ID;

object_ptr<AuthenticationCodeType> authenticationCodeTypeFragment::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authenticationCodeTypeFragment> res = make_object<authenticationCodeTypeFragment>();
  res->url_ = jni::fetch_string(env, p, res->url_fieldID);
  res->length_ = env->GetIntField(p, res->length_fieldID);
  return std::move(res);
}

void authenticationCodeTypeFragment::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, url_); if (nextString) { env->SetObjectField(s, url_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetIntField(s, length_fieldID, length_);
}

void authenticationCodeTypeFragment::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthenticationCodeTypeFragment");
    s.store_field("url", url_);
    s.store_field("length", length_);
    s.store_class_end();
  }
}

void authenticationCodeTypeFragment::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthenticationCodeTypeFragment").c_str());
    url_fieldID = jni::get_field_id(env, Class, "url", "Ljava/lang/String;");
    length_fieldID = jni::get_field_id(env, Class, "length", "I");
    return true;
  }();
  (void)is_inited;
}

jclass authenticationCodeTypeFirebaseAndroid::Class;
jfieldID authenticationCodeTypeFirebaseAndroid::device_verification_parameters_fieldID;
jfieldID authenticationCodeTypeFirebaseAndroid::length_fieldID;

authenticationCodeTypeFirebaseAndroid::authenticationCodeTypeFirebaseAndroid()
  : device_verification_parameters_()
  , length_()
{}

authenticationCodeTypeFirebaseAndroid::authenticationCodeTypeFirebaseAndroid(object_ptr<FirebaseDeviceVerificationParameters> &&device_verification_parameters_, int32 length_)
  : device_verification_parameters_(std::move(device_verification_parameters_))
  , length_(length_)
{}

const std::int32_t authenticationCodeTypeFirebaseAndroid::ID;

object_ptr<AuthenticationCodeType> authenticationCodeTypeFirebaseAndroid::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authenticationCodeTypeFirebaseAndroid> res = make_object<authenticationCodeTypeFirebaseAndroid>();
  res->device_verification_parameters_ = jni::fetch_tl_object<FirebaseDeviceVerificationParameters>(env, jni::fetch_object(env, p, res->device_verification_parameters_fieldID));
  res->length_ = env->GetIntField(p, res->length_fieldID);
  return std::move(res);
}

void authenticationCodeTypeFirebaseAndroid::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (device_verification_parameters_ != nullptr) { jobject next; device_verification_parameters_->store(env, next); if (next) { env->SetObjectField(s, device_verification_parameters_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetIntField(s, length_fieldID, length_);
}

void authenticationCodeTypeFirebaseAndroid::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthenticationCodeTypeFirebaseAndroid");
    s.store_object_field("deviceVerificationParameters", static_cast<const BaseObject *>(device_verification_parameters_.get()));
    s.store_field("length", length_);
    s.store_class_end();
  }
}

void authenticationCodeTypeFirebaseAndroid::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthenticationCodeTypeFirebaseAndroid").c_str());
    device_verification_parameters_fieldID = jni::get_field_id(env, Class, "deviceVerificationParameters", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$FirebaseDeviceVerificationParameters;").c_str());
    length_fieldID = jni::get_field_id(env, Class, "length", "I");
    return true;
  }();
  (void)is_inited;
}

jclass authenticationCodeTypeFirebaseIos::Class;
jfieldID authenticationCodeTypeFirebaseIos::receipt_fieldID;
jfieldID authenticationCodeTypeFirebaseIos::push_timeout_fieldID;
jfieldID authenticationCodeTypeFirebaseIos::length_fieldID;

authenticationCodeTypeFirebaseIos::authenticationCodeTypeFirebaseIos()
  : receipt_()
  , push_timeout_()
  , length_()
{}

authenticationCodeTypeFirebaseIos::authenticationCodeTypeFirebaseIos(string const &receipt_, int32 push_timeout_, int32 length_)
  : receipt_(receipt_)
  , push_timeout_(push_timeout_)
  , length_(length_)
{}

const std::int32_t authenticationCodeTypeFirebaseIos::ID;

object_ptr<AuthenticationCodeType> authenticationCodeTypeFirebaseIos::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authenticationCodeTypeFirebaseIos> res = make_object<authenticationCodeTypeFirebaseIos>();
  res->receipt_ = jni::fetch_string(env, p, res->receipt_fieldID);
  res->push_timeout_ = env->GetIntField(p, res->push_timeout_fieldID);
  res->length_ = env->GetIntField(p, res->length_fieldID);
  return std::move(res);
}

void authenticationCodeTypeFirebaseIos::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, receipt_); if (nextString) { env->SetObjectField(s, receipt_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetIntField(s, push_timeout_fieldID, push_timeout_);
  env->SetIntField(s, length_fieldID, length_);
}

void authenticationCodeTypeFirebaseIos::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthenticationCodeTypeFirebaseIos");
    s.store_field("receipt", receipt_);
    s.store_field("pushTimeout", push_timeout_);
    s.store_field("length", length_);
    s.store_class_end();
  }
}

void authenticationCodeTypeFirebaseIos::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthenticationCodeTypeFirebaseIos").c_str());
    receipt_fieldID = jni::get_field_id(env, Class, "receipt", "Ljava/lang/String;");
    push_timeout_fieldID = jni::get_field_id(env, Class, "pushTimeout", "I");
    length_fieldID = jni::get_field_id(env, Class, "length", "I");
    return true;
  }();
  (void)is_inited;
}

jclass AuthorizationState::Class;

object_ptr<AuthorizationState> AuthorizationState::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case authorizationStateWaitTdlibParameters::ID:
      return authorizationStateWaitTdlibParameters::fetch(env, p);
    case authorizationStateWaitPhoneNumber::ID:
      return authorizationStateWaitPhoneNumber::fetch(env, p);
    case authorizationStateWaitPremiumPurchase::ID:
      return authorizationStateWaitPremiumPurchase::fetch(env, p);
    case authorizationStateWaitEmailAddress::ID:
      return authorizationStateWaitEmailAddress::fetch(env, p);
    case authorizationStateWaitEmailCode::ID:
      return authorizationStateWaitEmailCode::fetch(env, p);
    case authorizationStateWaitCode::ID:
      return authorizationStateWaitCode::fetch(env, p);
    case authorizationStateWaitOtherDeviceConfirmation::ID:
      return authorizationStateWaitOtherDeviceConfirmation::fetch(env, p);
    case authorizationStateWaitRegistration::ID:
      return authorizationStateWaitRegistration::fetch(env, p);
    case authorizationStateWaitPassword::ID:
      return authorizationStateWaitPassword::fetch(env, p);
    case authorizationStateReady::ID:
      return authorizationStateReady::fetch(env, p);
    case authorizationStateLoggingOut::ID:
      return authorizationStateLoggingOut::fetch(env, p);
    case authorizationStateClosing::ID:
      return authorizationStateClosing::fetch(env, p);
    case authorizationStateClosed::ID:
      return authorizationStateClosed::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void AuthorizationState::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationState").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateWaitTdlibParameters::Class;

authorizationStateWaitTdlibParameters::authorizationStateWaitTdlibParameters() {
}

const std::int32_t authorizationStateWaitTdlibParameters::ID;

object_ptr<AuthorizationState> authorizationStateWaitTdlibParameters::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<authorizationStateWaitTdlibParameters>();
}

void authorizationStateWaitTdlibParameters::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void authorizationStateWaitTdlibParameters::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateWaitTdlibParameters");
    s.store_class_end();
  }
}

void authorizationStateWaitTdlibParameters::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateWaitTdlibParameters").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateWaitPhoneNumber::Class;

authorizationStateWaitPhoneNumber::authorizationStateWaitPhoneNumber() {
}

const std::int32_t authorizationStateWaitPhoneNumber::ID;

object_ptr<AuthorizationState> authorizationStateWaitPhoneNumber::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<authorizationStateWaitPhoneNumber>();
}

void authorizationStateWaitPhoneNumber::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void authorizationStateWaitPhoneNumber::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateWaitPhoneNumber");
    s.store_class_end();
  }
}

void authorizationStateWaitPhoneNumber::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateWaitPhoneNumber").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateWaitPremiumPurchase::Class;
jfieldID authorizationStateWaitPremiumPurchase::store_product_id_fieldID;
jfieldID authorizationStateWaitPremiumPurchase::premium_day_count_fieldID;
jfieldID authorizationStateWaitPremiumPurchase::support_email_address_fieldID;
jfieldID authorizationStateWaitPremiumPurchase::support_email_subject_fieldID;

authorizationStateWaitPremiumPurchase::authorizationStateWaitPremiumPurchase()
  : store_product_id_()
  , premium_day_count_()
  , support_email_address_()
  , support_email_subject_()
{}

authorizationStateWaitPremiumPurchase::authorizationStateWaitPremiumPurchase(string const &store_product_id_, int32 premium_day_count_, string const &support_email_address_, string const &support_email_subject_)
  : store_product_id_(store_product_id_)
  , premium_day_count_(premium_day_count_)
  , support_email_address_(support_email_address_)
  , support_email_subject_(support_email_subject_)
{}

const std::int32_t authorizationStateWaitPremiumPurchase::ID;

object_ptr<AuthorizationState> authorizationStateWaitPremiumPurchase::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authorizationStateWaitPremiumPurchase> res = make_object<authorizationStateWaitPremiumPurchase>();
  res->store_product_id_ = jni::fetch_string(env, p, res->store_product_id_fieldID);
  res->premium_day_count_ = env->GetIntField(p, res->premium_day_count_fieldID);
  res->support_email_address_ = jni::fetch_string(env, p, res->support_email_address_fieldID);
  res->support_email_subject_ = jni::fetch_string(env, p, res->support_email_subject_fieldID);
  return std::move(res);
}

void authorizationStateWaitPremiumPurchase::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, store_product_id_); if (nextString) { env->SetObjectField(s, store_product_id_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetIntField(s, premium_day_count_fieldID, premium_day_count_);
  { jstring nextString = jni::to_jstring(env, support_email_address_); if (nextString) { env->SetObjectField(s, support_email_address_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, support_email_subject_); if (nextString) { env->SetObjectField(s, support_email_subject_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void authorizationStateWaitPremiumPurchase::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateWaitPremiumPurchase");
    s.store_field("storeProductId", store_product_id_);
    s.store_field("premiumDayCount", premium_day_count_);
    s.store_field("supportEmailAddress", support_email_address_);
    s.store_field("supportEmailSubject", support_email_subject_);
    s.store_class_end();
  }
}

void authorizationStateWaitPremiumPurchase::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateWaitPremiumPurchase").c_str());
    store_product_id_fieldID = jni::get_field_id(env, Class, "storeProductId", "Ljava/lang/String;");
    premium_day_count_fieldID = jni::get_field_id(env, Class, "premiumDayCount", "I");
    support_email_address_fieldID = jni::get_field_id(env, Class, "supportEmailAddress", "Ljava/lang/String;");
    support_email_subject_fieldID = jni::get_field_id(env, Class, "supportEmailSubject", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateWaitEmailAddress::Class;
jfieldID authorizationStateWaitEmailAddress::allow_apple_id_fieldID;
jfieldID authorizationStateWaitEmailAddress::allow_google_id_fieldID;

authorizationStateWaitEmailAddress::authorizationStateWaitEmailAddress()
  : allow_apple_id_()
  , allow_google_id_()
{}

authorizationStateWaitEmailAddress::authorizationStateWaitEmailAddress(bool allow_apple_id_, bool allow_google_id_)
  : allow_apple_id_(allow_apple_id_)
  , allow_google_id_(allow_google_id_)
{}

const std::int32_t authorizationStateWaitEmailAddress::ID;

object_ptr<AuthorizationState> authorizationStateWaitEmailAddress::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authorizationStateWaitEmailAddress> res = make_object<authorizationStateWaitEmailAddress>();
  res->allow_apple_id_ = (env->GetBooleanField(p, res->allow_apple_id_fieldID) != 0);
  res->allow_google_id_ = (env->GetBooleanField(p, res->allow_google_id_fieldID) != 0);
  return std::move(res);
}

void authorizationStateWaitEmailAddress::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetBooleanField(s, allow_apple_id_fieldID, allow_apple_id_);
  env->SetBooleanField(s, allow_google_id_fieldID, allow_google_id_);
}

void authorizationStateWaitEmailAddress::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateWaitEmailAddress");
    s.store_field("allowAppleId", allow_apple_id_);
    s.store_field("allowGoogleId", allow_google_id_);
    s.store_class_end();
  }
}

void authorizationStateWaitEmailAddress::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateWaitEmailAddress").c_str());
    allow_apple_id_fieldID = jni::get_field_id(env, Class, "allowAppleId", "Z");
    allow_google_id_fieldID = jni::get_field_id(env, Class, "allowGoogleId", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateWaitEmailCode::Class;
jfieldID authorizationStateWaitEmailCode::allow_apple_id_fieldID;
jfieldID authorizationStateWaitEmailCode::allow_google_id_fieldID;
jfieldID authorizationStateWaitEmailCode::code_info_fieldID;
jfieldID authorizationStateWaitEmailCode::email_address_reset_state_fieldID;

authorizationStateWaitEmailCode::authorizationStateWaitEmailCode()
  : allow_apple_id_()
  , allow_google_id_()
  , code_info_()
  , email_address_reset_state_()
{}

authorizationStateWaitEmailCode::authorizationStateWaitEmailCode(bool allow_apple_id_, bool allow_google_id_, object_ptr<emailAddressAuthenticationCodeInfo> &&code_info_, object_ptr<EmailAddressResetState> &&email_address_reset_state_)
  : allow_apple_id_(allow_apple_id_)
  , allow_google_id_(allow_google_id_)
  , code_info_(std::move(code_info_))
  , email_address_reset_state_(std::move(email_address_reset_state_))
{}

const std::int32_t authorizationStateWaitEmailCode::ID;

object_ptr<AuthorizationState> authorizationStateWaitEmailCode::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authorizationStateWaitEmailCode> res = make_object<authorizationStateWaitEmailCode>();
  res->allow_apple_id_ = (env->GetBooleanField(p, res->allow_apple_id_fieldID) != 0);
  res->allow_google_id_ = (env->GetBooleanField(p, res->allow_google_id_fieldID) != 0);
  res->code_info_ = jni::fetch_tl_object<emailAddressAuthenticationCodeInfo>(env, jni::fetch_object(env, p, res->code_info_fieldID));
  res->email_address_reset_state_ = jni::fetch_tl_object<EmailAddressResetState>(env, jni::fetch_object(env, p, res->email_address_reset_state_fieldID));
  return std::move(res);
}

void authorizationStateWaitEmailCode::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetBooleanField(s, allow_apple_id_fieldID, allow_apple_id_);
  env->SetBooleanField(s, allow_google_id_fieldID, allow_google_id_);
  if (code_info_ != nullptr) { jobject next; code_info_->store(env, next); if (next) { env->SetObjectField(s, code_info_fieldID, next); env->DeleteLocalRef(next); } }
  if (email_address_reset_state_ != nullptr) { jobject next; email_address_reset_state_->store(env, next); if (next) { env->SetObjectField(s, email_address_reset_state_fieldID, next); env->DeleteLocalRef(next); } }
}

void authorizationStateWaitEmailCode::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateWaitEmailCode");
    s.store_field("allowAppleId", allow_apple_id_);
    s.store_field("allowGoogleId", allow_google_id_);
    s.store_object_field("codeInfo", static_cast<const BaseObject *>(code_info_.get()));
    s.store_object_field("emailAddressResetState", static_cast<const BaseObject *>(email_address_reset_state_.get()));
    s.store_class_end();
  }
}

void authorizationStateWaitEmailCode::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateWaitEmailCode").c_str());
    allow_apple_id_fieldID = jni::get_field_id(env, Class, "allowAppleId", "Z");
    allow_google_id_fieldID = jni::get_field_id(env, Class, "allowGoogleId", "Z");
    code_info_fieldID = jni::get_field_id(env, Class, "codeInfo", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$EmailAddressAuthenticationCodeInfo;").c_str());
    email_address_reset_state_fieldID = jni::get_field_id(env, Class, "emailAddressResetState", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$EmailAddressResetState;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateWaitCode::Class;
jfieldID authorizationStateWaitCode::code_info_fieldID;

authorizationStateWaitCode::authorizationStateWaitCode()
  : code_info_()
{}

authorizationStateWaitCode::authorizationStateWaitCode(object_ptr<authenticationCodeInfo> &&code_info_)
  : code_info_(std::move(code_info_))
{}

const std::int32_t authorizationStateWaitCode::ID;

object_ptr<AuthorizationState> authorizationStateWaitCode::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authorizationStateWaitCode> res = make_object<authorizationStateWaitCode>();
  res->code_info_ = jni::fetch_tl_object<authenticationCodeInfo>(env, jni::fetch_object(env, p, res->code_info_fieldID));
  return std::move(res);
}

void authorizationStateWaitCode::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (code_info_ != nullptr) { jobject next; code_info_->store(env, next); if (next) { env->SetObjectField(s, code_info_fieldID, next); env->DeleteLocalRef(next); } }
}

void authorizationStateWaitCode::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateWaitCode");
    s.store_object_field("codeInfo", static_cast<const BaseObject *>(code_info_.get()));
    s.store_class_end();
  }
}

void authorizationStateWaitCode::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateWaitCode").c_str());
    code_info_fieldID = jni::get_field_id(env, Class, "codeInfo", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$AuthenticationCodeInfo;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateWaitOtherDeviceConfirmation::Class;
jfieldID authorizationStateWaitOtherDeviceConfirmation::link_fieldID;

authorizationStateWaitOtherDeviceConfirmation::authorizationStateWaitOtherDeviceConfirmation()
  : link_()
{}

authorizationStateWaitOtherDeviceConfirmation::authorizationStateWaitOtherDeviceConfirmation(string const &link_)
  : link_(link_)
{}

const std::int32_t authorizationStateWaitOtherDeviceConfirmation::ID;

object_ptr<AuthorizationState> authorizationStateWaitOtherDeviceConfirmation::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authorizationStateWaitOtherDeviceConfirmation> res = make_object<authorizationStateWaitOtherDeviceConfirmation>();
  res->link_ = jni::fetch_string(env, p, res->link_fieldID);
  return std::move(res);
}

void authorizationStateWaitOtherDeviceConfirmation::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, link_); if (nextString) { env->SetObjectField(s, link_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void authorizationStateWaitOtherDeviceConfirmation::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateWaitOtherDeviceConfirmation");
    s.store_field("link", link_);
    s.store_class_end();
  }
}

void authorizationStateWaitOtherDeviceConfirmation::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateWaitOtherDeviceConfirmation").c_str());
    link_fieldID = jni::get_field_id(env, Class, "link", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateWaitRegistration::Class;
jfieldID authorizationStateWaitRegistration::terms_of_service_fieldID;

authorizationStateWaitRegistration::authorizationStateWaitRegistration()
  : terms_of_service_()
{}

authorizationStateWaitRegistration::authorizationStateWaitRegistration(object_ptr<termsOfService> &&terms_of_service_)
  : terms_of_service_(std::move(terms_of_service_))
{}

const std::int32_t authorizationStateWaitRegistration::ID;

object_ptr<AuthorizationState> authorizationStateWaitRegistration::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authorizationStateWaitRegistration> res = make_object<authorizationStateWaitRegistration>();
  res->terms_of_service_ = jni::fetch_tl_object<termsOfService>(env, jni::fetch_object(env, p, res->terms_of_service_fieldID));
  return std::move(res);
}

void authorizationStateWaitRegistration::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (terms_of_service_ != nullptr) { jobject next; terms_of_service_->store(env, next); if (next) { env->SetObjectField(s, terms_of_service_fieldID, next); env->DeleteLocalRef(next); } }
}

void authorizationStateWaitRegistration::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateWaitRegistration");
    s.store_object_field("termsOfService", static_cast<const BaseObject *>(terms_of_service_.get()));
    s.store_class_end();
  }
}

void authorizationStateWaitRegistration::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateWaitRegistration").c_str());
    terms_of_service_fieldID = jni::get_field_id(env, Class, "termsOfService", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$TermsOfService;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateWaitPassword::Class;
jfieldID authorizationStateWaitPassword::password_hint_fieldID;
jfieldID authorizationStateWaitPassword::has_recovery_email_address_fieldID;
jfieldID authorizationStateWaitPassword::has_passport_data_fieldID;
jfieldID authorizationStateWaitPassword::recovery_email_address_pattern_fieldID;

authorizationStateWaitPassword::authorizationStateWaitPassword()
  : password_hint_()
  , has_recovery_email_address_()
  , has_passport_data_()
  , recovery_email_address_pattern_()
{}

authorizationStateWaitPassword::authorizationStateWaitPassword(string const &password_hint_, bool has_recovery_email_address_, bool has_passport_data_, string const &recovery_email_address_pattern_)
  : password_hint_(password_hint_)
  , has_recovery_email_address_(has_recovery_email_address_)
  , has_passport_data_(has_passport_data_)
  , recovery_email_address_pattern_(recovery_email_address_pattern_)
{}

const std::int32_t authorizationStateWaitPassword::ID;

object_ptr<AuthorizationState> authorizationStateWaitPassword::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<authorizationStateWaitPassword> res = make_object<authorizationStateWaitPassword>();
  res->password_hint_ = jni::fetch_string(env, p, res->password_hint_fieldID);
  res->has_recovery_email_address_ = (env->GetBooleanField(p, res->has_recovery_email_address_fieldID) != 0);
  res->has_passport_data_ = (env->GetBooleanField(p, res->has_passport_data_fieldID) != 0);
  res->recovery_email_address_pattern_ = jni::fetch_string(env, p, res->recovery_email_address_pattern_fieldID);
  return std::move(res);
}

void authorizationStateWaitPassword::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, password_hint_); if (nextString) { env->SetObjectField(s, password_hint_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetBooleanField(s, has_recovery_email_address_fieldID, has_recovery_email_address_);
  env->SetBooleanField(s, has_passport_data_fieldID, has_passport_data_);
  { jstring nextString = jni::to_jstring(env, recovery_email_address_pattern_); if (nextString) { env->SetObjectField(s, recovery_email_address_pattern_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void authorizationStateWaitPassword::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateWaitPassword");
    s.store_field("passwordHint", password_hint_);
    s.store_field("hasRecoveryEmailAddress", has_recovery_email_address_);
    s.store_field("hasPassportData", has_passport_data_);
    s.store_field("recoveryEmailAddressPattern", recovery_email_address_pattern_);
    s.store_class_end();
  }
}

void authorizationStateWaitPassword::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateWaitPassword").c_str());
    password_hint_fieldID = jni::get_field_id(env, Class, "passwordHint", "Ljava/lang/String;");
    has_recovery_email_address_fieldID = jni::get_field_id(env, Class, "hasRecoveryEmailAddress", "Z");
    has_passport_data_fieldID = jni::get_field_id(env, Class, "hasPassportData", "Z");
    recovery_email_address_pattern_fieldID = jni::get_field_id(env, Class, "recoveryEmailAddressPattern", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateReady::Class;

authorizationStateReady::authorizationStateReady() {
}

const std::int32_t authorizationStateReady::ID;

object_ptr<AuthorizationState> authorizationStateReady::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<authorizationStateReady>();
}

void authorizationStateReady::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void authorizationStateReady::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateReady");
    s.store_class_end();
  }
}

void authorizationStateReady::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateReady").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateLoggingOut::Class;

authorizationStateLoggingOut::authorizationStateLoggingOut() {
}

const std::int32_t authorizationStateLoggingOut::ID;

object_ptr<AuthorizationState> authorizationStateLoggingOut::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<authorizationStateLoggingOut>();
}

void authorizationStateLoggingOut::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void authorizationStateLoggingOut::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateLoggingOut");
    s.store_class_end();
  }
}

void authorizationStateLoggingOut::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateLoggingOut").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateClosing::Class;

authorizationStateClosing::authorizationStateClosing() {
}

const std::int32_t authorizationStateClosing::ID;

object_ptr<AuthorizationState> authorizationStateClosing::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<authorizationStateClosing>();
}

void authorizationStateClosing::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void authorizationStateClosing::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateClosing");
    s.store_class_end();
  }
}

void authorizationStateClosing::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateClosing").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass authorizationStateClosed::Class;

authorizationStateClosed::authorizationStateClosed() {
}

const std::int32_t authorizationStateClosed::ID;

object_ptr<AuthorizationState> authorizationStateClosed::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<authorizationStateClosed>();
}

void authorizationStateClosed::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void authorizationStateClosed::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AuthorizationStateClosed");
    s.store_class_end();
  }
}

void authorizationStateClosed::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AuthorizationStateClosed").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass BackgroundType::Class;

object_ptr<BackgroundType> BackgroundType::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case backgroundTypeWallpaper::ID:
      return backgroundTypeWallpaper::fetch(env, p);
    case backgroundTypePattern::ID:
      return backgroundTypePattern::fetch(env, p);
    case backgroundTypeFill::ID:
      return backgroundTypeFill::fetch(env, p);
    case backgroundTypeChatTheme::ID:
      return backgroundTypeChatTheme::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void BackgroundType::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$BackgroundType").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass backgroundTypeWallpaper::Class;
jfieldID backgroundTypeWallpaper::is_blurred_fieldID;
jfieldID backgroundTypeWallpaper::is_moving_fieldID;

backgroundTypeWallpaper::backgroundTypeWallpaper()
  : is_blurred_()
  , is_moving_()
{}

backgroundTypeWallpaper::backgroundTypeWallpaper(bool is_blurred_, bool is_moving_)
  : is_blurred_(is_blurred_)
  , is_moving_(is_moving_)
{}

const std::int32_t backgroundTypeWallpaper::ID;

object_ptr<BackgroundType> backgroundTypeWallpaper::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<backgroundTypeWallpaper> res = make_object<backgroundTypeWallpaper>();
  res->is_blurred_ = (env->GetBooleanField(p, res->is_blurred_fieldID) != 0);
  res->is_moving_ = (env->GetBooleanField(p, res->is_moving_fieldID) != 0);
  return std::move(res);
}

void backgroundTypeWallpaper::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetBooleanField(s, is_blurred_fieldID, is_blurred_);
  env->SetBooleanField(s, is_moving_fieldID, is_moving_);
}

void backgroundTypeWallpaper::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "BackgroundTypeWallpaper");
    s.store_field("isBlurred", is_blurred_);
    s.store_field("isMoving", is_moving_);
    s.store_class_end();
  }
}

void backgroundTypeWallpaper::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$BackgroundTypeWallpaper").c_str());
    is_blurred_fieldID = jni::get_field_id(env, Class, "isBlurred", "Z");
    is_moving_fieldID = jni::get_field_id(env, Class, "isMoving", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass backgroundTypePattern::Class;
jfieldID backgroundTypePattern::fill_fieldID;
jfieldID backgroundTypePattern::intensity_fieldID;
jfieldID backgroundTypePattern::is_inverted_fieldID;
jfieldID backgroundTypePattern::is_moving_fieldID;

backgroundTypePattern::backgroundTypePattern()
  : fill_()
  , intensity_()
  , is_inverted_()
  , is_moving_()
{}

backgroundTypePattern::backgroundTypePattern(object_ptr<BackgroundFill> &&fill_, int32 intensity_, bool is_inverted_, bool is_moving_)
  : fill_(std::move(fill_))
  , intensity_(intensity_)
  , is_inverted_(is_inverted_)
  , is_moving_(is_moving_)
{}

const std::int32_t backgroundTypePattern::ID;

object_ptr<BackgroundType> backgroundTypePattern::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<backgroundTypePattern> res = make_object<backgroundTypePattern>();
  res->fill_ = jni::fetch_tl_object<BackgroundFill>(env, jni::fetch_object(env, p, res->fill_fieldID));
  res->intensity_ = env->GetIntField(p, res->intensity_fieldID);
  res->is_inverted_ = (env->GetBooleanField(p, res->is_inverted_fieldID) != 0);
  res->is_moving_ = (env->GetBooleanField(p, res->is_moving_fieldID) != 0);
  return std::move(res);
}

void backgroundTypePattern::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (fill_ != nullptr) { jobject next; fill_->store(env, next); if (next) { env->SetObjectField(s, fill_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetIntField(s, intensity_fieldID, intensity_);
  env->SetBooleanField(s, is_inverted_fieldID, is_inverted_);
  env->SetBooleanField(s, is_moving_fieldID, is_moving_);
}

void backgroundTypePattern::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "BackgroundTypePattern");
    s.store_object_field("fill", static_cast<const BaseObject *>(fill_.get()));
    s.store_field("intensity", intensity_);
    s.store_field("isInverted", is_inverted_);
    s.store_field("isMoving", is_moving_);
    s.store_class_end();
  }
}

void backgroundTypePattern::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$BackgroundTypePattern").c_str());
    fill_fieldID = jni::get_field_id(env, Class, "fill", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$BackgroundFill;").c_str());
    intensity_fieldID = jni::get_field_id(env, Class, "intensity", "I");
    is_inverted_fieldID = jni::get_field_id(env, Class, "isInverted", "Z");
    is_moving_fieldID = jni::get_field_id(env, Class, "isMoving", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass backgroundTypeFill::Class;
jfieldID backgroundTypeFill::fill_fieldID;

backgroundTypeFill::backgroundTypeFill()
  : fill_()
{}

backgroundTypeFill::backgroundTypeFill(object_ptr<BackgroundFill> &&fill_)
  : fill_(std::move(fill_))
{}

const std::int32_t backgroundTypeFill::ID;

object_ptr<BackgroundType> backgroundTypeFill::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<backgroundTypeFill> res = make_object<backgroundTypeFill>();
  res->fill_ = jni::fetch_tl_object<BackgroundFill>(env, jni::fetch_object(env, p, res->fill_fieldID));
  return std::move(res);
}

void backgroundTypeFill::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (fill_ != nullptr) { jobject next; fill_->store(env, next); if (next) { env->SetObjectField(s, fill_fieldID, next); env->DeleteLocalRef(next); } }
}

void backgroundTypeFill::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "BackgroundTypeFill");
    s.store_object_field("fill", static_cast<const BaseObject *>(fill_.get()));
    s.store_class_end();
  }
}

void backgroundTypeFill::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$BackgroundTypeFill").c_str());
    fill_fieldID = jni::get_field_id(env, Class, "fill", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$BackgroundFill;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass backgroundTypeChatTheme::Class;
jfieldID backgroundTypeChatTheme::theme_name_fieldID;

backgroundTypeChatTheme::backgroundTypeChatTheme()
  : theme_name_()
{}

backgroundTypeChatTheme::backgroundTypeChatTheme(string const &theme_name_)
  : theme_name_(theme_name_)
{}

const std::int32_t backgroundTypeChatTheme::ID;

object_ptr<BackgroundType> backgroundTypeChatTheme::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<backgroundTypeChatTheme> res = make_object<backgroundTypeChatTheme>();
  res->theme_name_ = jni::fetch_string(env, p, res->theme_name_fieldID);
  return std::move(res);
}

void backgroundTypeChatTheme::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, theme_name_); if (nextString) { env->SetObjectField(s, theme_name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void backgroundTypeChatTheme::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "BackgroundTypeChatTheme");
    s.store_field("themeName", theme_name_);
    s.store_class_end();
  }
}

void backgroundTypeChatTheme::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$BackgroundTypeChatTheme").c_str());
    theme_name_fieldID = jni::get_field_id(env, Class, "themeName", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass businessFeatures::Class;
jfieldID businessFeatures::features_fieldID;

businessFeatures::businessFeatures()
  : features_()
{}

businessFeatures::businessFeatures(array<object_ptr<BusinessFeature>> &&features_)
  : features_(std::move(features_))
{}

const std::int32_t businessFeatures::ID;

object_ptr<businessFeatures> businessFeatures::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<businessFeatures> res = make_object<businessFeatures>();
  res->features_ = jni::FetchVector<BusinessFeature>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->features_fieldID));
  return res;
}

void businessFeatures::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { auto arr_tmp_ = jni::store_vector(env, features_); if (arr_tmp_) { env->SetObjectField(s, features_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void businessFeatures::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "BusinessFeatures");
    { s.store_vector_begin("features", features_.size()); for (const auto &_value : features_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

void businessFeatures::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$BusinessFeatures").c_str());
    features_fieldID = jni::get_field_id(env, Class, "features", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$BusinessFeature;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass CallDiscardReason::Class;

object_ptr<CallDiscardReason> CallDiscardReason::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case callDiscardReasonEmpty::ID:
      return callDiscardReasonEmpty::fetch(env, p);
    case callDiscardReasonMissed::ID:
      return callDiscardReasonMissed::fetch(env, p);
    case callDiscardReasonDeclined::ID:
      return callDiscardReasonDeclined::fetch(env, p);
    case callDiscardReasonDisconnected::ID:
      return callDiscardReasonDisconnected::fetch(env, p);
    case callDiscardReasonHungUp::ID:
      return callDiscardReasonHungUp::fetch(env, p);
    case callDiscardReasonUpgradeToGroupCall::ID:
      return callDiscardReasonUpgradeToGroupCall::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void CallDiscardReason::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallDiscardReason").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass callDiscardReasonEmpty::Class;

callDiscardReasonEmpty::callDiscardReasonEmpty() {
}

const std::int32_t callDiscardReasonEmpty::ID;

object_ptr<CallDiscardReason> callDiscardReasonEmpty::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<callDiscardReasonEmpty>();
}

void callDiscardReasonEmpty::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void callDiscardReasonEmpty::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CallDiscardReasonEmpty");
    s.store_class_end();
  }
}

void callDiscardReasonEmpty::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallDiscardReasonEmpty").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass callDiscardReasonMissed::Class;

callDiscardReasonMissed::callDiscardReasonMissed() {
}

const std::int32_t callDiscardReasonMissed::ID;

object_ptr<CallDiscardReason> callDiscardReasonMissed::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<callDiscardReasonMissed>();
}

void callDiscardReasonMissed::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void callDiscardReasonMissed::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CallDiscardReasonMissed");
    s.store_class_end();
  }
}

void callDiscardReasonMissed::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallDiscardReasonMissed").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass callDiscardReasonDeclined::Class;

callDiscardReasonDeclined::callDiscardReasonDeclined() {
}

const std::int32_t callDiscardReasonDeclined::ID;

object_ptr<CallDiscardReason> callDiscardReasonDeclined::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<callDiscardReasonDeclined>();
}

void callDiscardReasonDeclined::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void callDiscardReasonDeclined::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CallDiscardReasonDeclined");
    s.store_class_end();
  }
}

void callDiscardReasonDeclined::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallDiscardReasonDeclined").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass callDiscardReasonDisconnected::Class;

callDiscardReasonDisconnected::callDiscardReasonDisconnected() {
}

const std::int32_t callDiscardReasonDisconnected::ID;

object_ptr<CallDiscardReason> callDiscardReasonDisconnected::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<callDiscardReasonDisconnected>();
}

void callDiscardReasonDisconnected::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void callDiscardReasonDisconnected::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CallDiscardReasonDisconnected");
    s.store_class_end();
  }
}

void callDiscardReasonDisconnected::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallDiscardReasonDisconnected").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass callDiscardReasonHungUp::Class;

callDiscardReasonHungUp::callDiscardReasonHungUp() {
}

const std::int32_t callDiscardReasonHungUp::ID;

object_ptr<CallDiscardReason> callDiscardReasonHungUp::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<callDiscardReasonHungUp>();
}

void callDiscardReasonHungUp::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void callDiscardReasonHungUp::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CallDiscardReasonHungUp");
    s.store_class_end();
  }
}

void callDiscardReasonHungUp::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallDiscardReasonHungUp").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass callDiscardReasonUpgradeToGroupCall::Class;
jfieldID callDiscardReasonUpgradeToGroupCall::invite_link_fieldID;

callDiscardReasonUpgradeToGroupCall::callDiscardReasonUpgradeToGroupCall()
  : invite_link_()
{}

callDiscardReasonUpgradeToGroupCall::callDiscardReasonUpgradeToGroupCall(string const &invite_link_)
  : invite_link_(invite_link_)
{}

const std::int32_t callDiscardReasonUpgradeToGroupCall::ID;

object_ptr<CallDiscardReason> callDiscardReasonUpgradeToGroupCall::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<callDiscardReasonUpgradeToGroupCall> res = make_object<callDiscardReasonUpgradeToGroupCall>();
  res->invite_link_ = jni::fetch_string(env, p, res->invite_link_fieldID);
  return std::move(res);
}

void callDiscardReasonUpgradeToGroupCall::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, invite_link_); if (nextString) { env->SetObjectField(s, invite_link_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void callDiscardReasonUpgradeToGroupCall::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CallDiscardReasonUpgradeToGroupCall");
    s.store_field("inviteLink", invite_link_);
    s.store_class_end();
  }
}

void callDiscardReasonUpgradeToGroupCall::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallDiscardReasonUpgradeToGroupCall").c_str());
    invite_link_fieldID = jni::get_field_id(env, Class, "inviteLink", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass CallState::Class;

object_ptr<CallState> CallState::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case callStatePending::ID:
      return callStatePending::fetch(env, p);
    case callStateExchangingKeys::ID:
      return callStateExchangingKeys::fetch(env, p);
    case callStateReady::ID:
      return callStateReady::fetch(env, p);
    case callStateHangingUp::ID:
      return callStateHangingUp::fetch(env, p);
    case callStateDiscarded::ID:
      return callStateDiscarded::fetch(env, p);
    case callStateError::ID:
      return callStateError::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void CallState::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallState").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass callStatePending::Class;
jfieldID callStatePending::is_created_fieldID;
jfieldID callStatePending::is_received_fieldID;

callStatePending::callStatePending()
  : is_created_()
  , is_received_()
{}

callStatePending::callStatePending(bool is_created_, bool is_received_)
  : is_created_(is_created_)
  , is_received_(is_received_)
{}

const std::int32_t callStatePending::ID;

object_ptr<CallState> callStatePending::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<callStatePending> res = make_object<callStatePending>();
  res->is_created_ = (env->GetBooleanField(p, res->is_created_fieldID) != 0);
  res->is_received_ = (env->GetBooleanField(p, res->is_received_fieldID) != 0);
  return std::move(res);
}

void callStatePending::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetBooleanField(s, is_created_fieldID, is_created_);
  env->SetBooleanField(s, is_received_fieldID, is_received_);
}

void callStatePending::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CallStatePending");
    s.store_field("isCreated", is_created_);
    s.store_field("isReceived", is_received_);
    s.store_class_end();
  }
}

void callStatePending::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallStatePending").c_str());
    is_created_fieldID = jni::get_field_id(env, Class, "isCreated", "Z");
    is_received_fieldID = jni::get_field_id(env, Class, "isReceived", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass callStateExchangingKeys::Class;

callStateExchangingKeys::callStateExchangingKeys() {
}

const std::int32_t callStateExchangingKeys::ID;

object_ptr<CallState> callStateExchangingKeys::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<callStateExchangingKeys>();
}

void callStateExchangingKeys::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void callStateExchangingKeys::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CallStateExchangingKeys");
    s.store_class_end();
  }
}

void callStateExchangingKeys::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallStateExchangingKeys").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass callStateReady::Class;
jfieldID callStateReady::protocol_fieldID;
jfieldID callStateReady::servers_fieldID;
jfieldID callStateReady::config_fieldID;
jfieldID callStateReady::encryption_key_fieldID;
jfieldID callStateReady::emojis_fieldID;
jfieldID callStateReady::allow_p2p_fieldID;
jfieldID callStateReady::is_group_call_supported_fieldID;
jfieldID callStateReady::custom_parameters_fieldID;

callStateReady::callStateReady()
  : protocol_()
  , servers_()
  , config_()
  , encryption_key_()
  , emojis_()
  , allow_p2p_()
  , is_group_call_supported_()
  , custom_parameters_()
{}

callStateReady::callStateReady(object_ptr<callProtocol> &&protocol_, array<object_ptr<callServer>> &&servers_, string const &config_, bytes const &encryption_key_, array<string> &&emojis_, bool allow_p2p_, bool is_group_call_supported_, string const &custom_parameters_)
  : protocol_(std::move(protocol_))
  , servers_(std::move(servers_))
  , config_(config_)
  , encryption_key_(std::move(encryption_key_))
  , emojis_(std::move(emojis_))
  , allow_p2p_(allow_p2p_)
  , is_group_call_supported_(is_group_call_supported_)
  , custom_parameters_(custom_parameters_)
{}

const std::int32_t callStateReady::ID;

object_ptr<CallState> callStateReady::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<callStateReady> res = make_object<callStateReady>();
  res->protocol_ = jni::fetch_tl_object<callProtocol>(env, jni::fetch_object(env, p, res->protocol_fieldID));
  res->servers_ = jni::FetchVector<callServer>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->servers_fieldID));
  res->config_ = jni::fetch_string(env, p, res->config_fieldID);
  res->encryption_key_ = jni::from_bytes(env, (jbyteArray)jni::fetch_object(env, p, res->encryption_key_fieldID));
  res->emojis_ = jni::FetchVector<string>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->emojis_fieldID));
  res->allow_p2p_ = (env->GetBooleanField(p, res->allow_p2p_fieldID) != 0);
  res->is_group_call_supported_ = (env->GetBooleanField(p, res->is_group_call_supported_fieldID) != 0);
  res->custom_parameters_ = jni::fetch_string(env, p, res->custom_parameters_fieldID);
  return std::move(res);
}

void callStateReady::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (protocol_ != nullptr) { jobject next; protocol_->store(env, next); if (next) { env->SetObjectField(s, protocol_fieldID, next); env->DeleteLocalRef(next); } }
  { auto arr_tmp_ = jni::store_vector(env, servers_); if (arr_tmp_) { env->SetObjectField(s, servers_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  { jstring nextString = jni::to_jstring(env, config_); if (nextString) { env->SetObjectField(s, config_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jbyteArray nextBytes = jni::to_bytes(env, encryption_key_); if (nextBytes) { env->SetObjectField(s, encryption_key_fieldID, nextBytes); env->DeleteLocalRef(nextBytes); } }
  { auto arr_tmp_ = jni::store_vector(env, emojis_); if (arr_tmp_) { env->SetObjectField(s, emojis_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  env->SetBooleanField(s, allow_p2p_fieldID, allow_p2p_);
  env->SetBooleanField(s, is_group_call_supported_fieldID, is_group_call_supported_);
  { jstring nextString = jni::to_jstring(env, custom_parameters_); if (nextString) { env->SetObjectField(s, custom_parameters_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void callStateReady::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CallStateReady");
    s.store_object_field("protocol", static_cast<const BaseObject *>(protocol_.get()));
    { s.store_vector_begin("servers", servers_.size()); for (const auto &_value : servers_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_field("config", config_);
    s.store_bytes_field("encryptionKey", encryption_key_);
    { s.store_vector_begin("emojis", emojis_.size()); for (const auto &_value : emojis_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_field("allowP2p", allow_p2p_);
    s.store_field("isGroupCallSupported", is_group_call_supported_);
    s.store_field("customParameters", custom_parameters_);
    s.store_class_end();
  }
}

void callStateReady::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallStateReady").c_str());
    protocol_fieldID = jni::get_field_id(env, Class, "protocol", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$CallProtocol;").c_str());
    servers_fieldID = jni::get_field_id(env, Class, "servers", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$CallServer;").c_str());
    config_fieldID = jni::get_field_id(env, Class, "config", "Ljava/lang/String;");
    encryption_key_fieldID = jni::get_field_id(env, Class, "encryptionKey", "[B");
    emojis_fieldID = jni::get_field_id(env, Class, "emojis", "[Ljava/lang/String;");
    allow_p2p_fieldID = jni::get_field_id(env, Class, "allowP2p", "Z");
    is_group_call_supported_fieldID = jni::get_field_id(env, Class, "isGroupCallSupported", "Z");
    custom_parameters_fieldID = jni::get_field_id(env, Class, "customParameters", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass callStateHangingUp::Class;

callStateHangingUp::callStateHangingUp() {
}

const std::int32_t callStateHangingUp::ID;

object_ptr<CallState> callStateHangingUp::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<callStateHangingUp>();
}

void callStateHangingUp::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void callStateHangingUp::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CallStateHangingUp");
    s.store_class_end();
  }
}

void callStateHangingUp::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallStateHangingUp").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass callStateDiscarded::Class;
jfieldID callStateDiscarded::reason_fieldID;
jfieldID callStateDiscarded::need_rating_fieldID;
jfieldID callStateDiscarded::need_debug_information_fieldID;
jfieldID callStateDiscarded::need_log_fieldID;

callStateDiscarded::callStateDiscarded()
  : reason_()
  , need_rating_()
  , need_debug_information_()
  , need_log_()
{}

callStateDiscarded::callStateDiscarded(object_ptr<CallDiscardReason> &&reason_, bool need_rating_, bool need_debug_information_, bool need_log_)
  : reason_(std::move(reason_))
  , need_rating_(need_rating_)
  , need_debug_information_(need_debug_information_)
  , need_log_(need_log_)
{}

const std::int32_t callStateDiscarded::ID;

object_ptr<CallState> callStateDiscarded::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<callStateDiscarded> res = make_object<callStateDiscarded>();
  res->reason_ = jni::fetch_tl_object<CallDiscardReason>(env, jni::fetch_object(env, p, res->reason_fieldID));
  res->need_rating_ = (env->GetBooleanField(p, res->need_rating_fieldID) != 0);
  res->need_debug_information_ = (env->GetBooleanField(p, res->need_debug_information_fieldID) != 0);
  res->need_log_ = (env->GetBooleanField(p, res->need_log_fieldID) != 0);
  return std::move(res);
}

void callStateDiscarded::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (reason_ != nullptr) { jobject next; reason_->store(env, next); if (next) { env->SetObjectField(s, reason_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetBooleanField(s, need_rating_fieldID, need_rating_);
  env->SetBooleanField(s, need_debug_information_fieldID, need_debug_information_);
  env->SetBooleanField(s, need_log_fieldID, need_log_);
}

void callStateDiscarded::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CallStateDiscarded");
    s.store_object_field("reason", static_cast<const BaseObject *>(reason_.get()));
    s.store_field("needRating", need_rating_);
    s.store_field("needDebugInformation", need_debug_information_);
    s.store_field("needLog", need_log_);
    s.store_class_end();
  }
}

void callStateDiscarded::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallStateDiscarded").c_str());
    reason_fieldID = jni::get_field_id(env, Class, "reason", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$CallDiscardReason;").c_str());
    need_rating_fieldID = jni::get_field_id(env, Class, "needRating", "Z");
    need_debug_information_fieldID = jni::get_field_id(env, Class, "needDebugInformation", "Z");
    need_log_fieldID = jni::get_field_id(env, Class, "needLog", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass callStateError::Class;
jfieldID callStateError::error_fieldID;

callStateError::callStateError()
  : error_()
{}

callStateError::callStateError(object_ptr<error> &&error_)
  : error_(std::move(error_))
{}

const std::int32_t callStateError::ID;

object_ptr<CallState> callStateError::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<callStateError> res = make_object<callStateError>();
  res->error_ = jni::fetch_tl_object<error>(env, jni::fetch_object(env, p, res->error_fieldID));
  return std::move(res);
}

void callStateError::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (error_ != nullptr) { jobject next; error_->store(env, next); if (next) { env->SetObjectField(s, error_fieldID, next); env->DeleteLocalRef(next); } }
}

void callStateError::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CallStateError");
    s.store_object_field("error", static_cast<const BaseObject *>(error_.get()));
    s.store_class_end();
  }
}

void callStateError::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CallStateError").c_str());
    error_fieldID = jni::get_field_id(env, Class, "error", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Error;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass chatEvent::Class;
jfieldID chatEvent::id_fieldID;
jfieldID chatEvent::date_fieldID;
jfieldID chatEvent::member_id_fieldID;
jfieldID chatEvent::action_fieldID;

chatEvent::chatEvent()
  : id_()
  , date_()
  , member_id_()
  , action_()
{}

chatEvent::chatEvent(int64 id_, int32 date_, object_ptr<MessageSender> &&member_id_, object_ptr<ChatEventAction> &&action_)
  : id_(id_)
  , date_(date_)
  , member_id_(std::move(member_id_))
  , action_(std::move(action_))
{}

const std::int32_t chatEvent::ID;

object_ptr<chatEvent> chatEvent::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatEvent> res = make_object<chatEvent>();
  res->id_ = env->GetLongField(p, res->id_fieldID);
  res->date_ = env->GetIntField(p, res->date_fieldID);
  res->member_id_ = jni::fetch_tl_object<MessageSender>(env, jni::fetch_object(env, p, res->member_id_fieldID));
  res->action_ = jni::fetch_tl_object<ChatEventAction>(env, jni::fetch_object(env, p, res->action_fieldID));
  return res;
}

void chatEvent::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, id_fieldID, id_);
  env->SetIntField(s, date_fieldID, date_);
  if (member_id_ != nullptr) { jobject next; member_id_->store(env, next); if (next) { env->SetObjectField(s, member_id_fieldID, next); env->DeleteLocalRef(next); } }
  if (action_ != nullptr) { jobject next; action_->store(env, next); if (next) { env->SetObjectField(s, action_fieldID, next); env->DeleteLocalRef(next); } }
}

void chatEvent::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatEvent");
    s.store_field("id", id_);
    s.store_field("date", date_);
    s.store_object_field("memberId", static_cast<const BaseObject *>(member_id_.get()));
    s.store_object_field("action", static_cast<const BaseObject *>(action_.get()));
    s.store_class_end();
  }
}

void chatEvent::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatEvent").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "J");
    date_fieldID = jni::get_field_id(env, Class, "date", "I");
    member_id_fieldID = jni::get_field_id(env, Class, "memberId", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$MessageSender;").c_str());
    action_fieldID = jni::get_field_id(env, Class, "action", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ChatEventAction;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass chatFolderInviteLinkInfo::Class;
jfieldID chatFolderInviteLinkInfo::chat_folder_info_fieldID;
jfieldID chatFolderInviteLinkInfo::missing_chat_ids_fieldID;
jfieldID chatFolderInviteLinkInfo::added_chat_ids_fieldID;

chatFolderInviteLinkInfo::chatFolderInviteLinkInfo()
  : chat_folder_info_()
  , missing_chat_ids_()
  , added_chat_ids_()
{}

chatFolderInviteLinkInfo::chatFolderInviteLinkInfo(object_ptr<chatFolderInfo> &&chat_folder_info_, array<int53> &&missing_chat_ids_, array<int53> &&added_chat_ids_)
  : chat_folder_info_(std::move(chat_folder_info_))
  , missing_chat_ids_(std::move(missing_chat_ids_))
  , added_chat_ids_(std::move(added_chat_ids_))
{}

const std::int32_t chatFolderInviteLinkInfo::ID;

object_ptr<chatFolderInviteLinkInfo> chatFolderInviteLinkInfo::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatFolderInviteLinkInfo> res = make_object<chatFolderInviteLinkInfo>();
  res->chat_folder_info_ = jni::fetch_tl_object<chatFolderInfo>(env, jni::fetch_object(env, p, res->chat_folder_info_fieldID));
  res->missing_chat_ids_ = jni::fetch_vector(env, (jlongArray)jni::fetch_object(env, p, res->missing_chat_ids_fieldID));
  res->added_chat_ids_ = jni::fetch_vector(env, (jlongArray)jni::fetch_object(env, p, res->added_chat_ids_fieldID));
  return res;
}

void chatFolderInviteLinkInfo::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (chat_folder_info_ != nullptr) { jobject next; chat_folder_info_->store(env, next); if (next) { env->SetObjectField(s, chat_folder_info_fieldID, next); env->DeleteLocalRef(next); } }
  { auto arr_tmp_ = jni::store_vector(env, missing_chat_ids_); if (arr_tmp_) { env->SetObjectField(s, missing_chat_ids_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  { auto arr_tmp_ = jni::store_vector(env, added_chat_ids_); if (arr_tmp_) { env->SetObjectField(s, added_chat_ids_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void chatFolderInviteLinkInfo::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatFolderInviteLinkInfo");
    s.store_object_field("chatFolderInfo", static_cast<const BaseObject *>(chat_folder_info_.get()));
    { s.store_vector_begin("missingChatIds", missing_chat_ids_.size()); for (const auto &_value : missing_chat_ids_) { s.store_field("", _value); } s.store_class_end(); }
    { s.store_vector_begin("addedChatIds", added_chat_ids_.size()); for (const auto &_value : added_chat_ids_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

void chatFolderInviteLinkInfo::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatFolderInviteLinkInfo").c_str());
    chat_folder_info_fieldID = jni::get_field_id(env, Class, "chatFolderInfo", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ChatFolderInfo;").c_str());
    missing_chat_ids_fieldID = jni::get_field_id(env, Class, "missingChatIds", "[J");
    added_chat_ids_fieldID = jni::get_field_id(env, Class, "addedChatIds", "[J");
    return true;
  }();
  (void)is_inited;
}

jclass chatInviteLinkMembers::Class;
jfieldID chatInviteLinkMembers::total_count_fieldID;
jfieldID chatInviteLinkMembers::members_fieldID;

chatInviteLinkMembers::chatInviteLinkMembers()
  : total_count_()
  , members_()
{}

chatInviteLinkMembers::chatInviteLinkMembers(int32 total_count_, array<object_ptr<chatInviteLinkMember>> &&members_)
  : total_count_(total_count_)
  , members_(std::move(members_))
{}

const std::int32_t chatInviteLinkMembers::ID;

object_ptr<chatInviteLinkMembers> chatInviteLinkMembers::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatInviteLinkMembers> res = make_object<chatInviteLinkMembers>();
  res->total_count_ = env->GetIntField(p, res->total_count_fieldID);
  res->members_ = jni::FetchVector<chatInviteLinkMember>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->members_fieldID));
  return res;
}

void chatInviteLinkMembers::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, total_count_fieldID, total_count_);
  { auto arr_tmp_ = jni::store_vector(env, members_); if (arr_tmp_) { env->SetObjectField(s, members_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void chatInviteLinkMembers::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatInviteLinkMembers");
    s.store_field("totalCount", total_count_);
    { s.store_vector_begin("members", members_.size()); for (const auto &_value : members_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

void chatInviteLinkMembers::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatInviteLinkMembers").c_str());
    total_count_fieldID = jni::get_field_id(env, Class, "totalCount", "I");
    members_fieldID = jni::get_field_id(env, Class, "members", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$ChatInviteLinkMember;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass chatJoinRequestsInfo::Class;
jfieldID chatJoinRequestsInfo::total_count_fieldID;
jfieldID chatJoinRequestsInfo::user_ids_fieldID;

chatJoinRequestsInfo::chatJoinRequestsInfo()
  : total_count_()
  , user_ids_()
{}

chatJoinRequestsInfo::chatJoinRequestsInfo(int32 total_count_, array<int53> &&user_ids_)
  : total_count_(total_count_)
  , user_ids_(std::move(user_ids_))
{}

const std::int32_t chatJoinRequestsInfo::ID;

object_ptr<chatJoinRequestsInfo> chatJoinRequestsInfo::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatJoinRequestsInfo> res = make_object<chatJoinRequestsInfo>();
  res->total_count_ = env->GetIntField(p, res->total_count_fieldID);
  res->user_ids_ = jni::fetch_vector(env, (jlongArray)jni::fetch_object(env, p, res->user_ids_fieldID));
  return res;
}

void chatJoinRequestsInfo::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, total_count_fieldID, total_count_);
  { auto arr_tmp_ = jni::store_vector(env, user_ids_); if (arr_tmp_) { env->SetObjectField(s, user_ids_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void chatJoinRequestsInfo::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatJoinRequestsInfo");
    s.store_field("totalCount", total_count_);
    { s.store_vector_begin("userIds", user_ids_.size()); for (const auto &_value : user_ids_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

void chatJoinRequestsInfo::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatJoinRequestsInfo").c_str());
    total_count_fieldID = jni::get_field_id(env, Class, "totalCount", "I");
    user_ids_fieldID = jni::get_field_id(env, Class, "userIds", "[J");
    return true;
  }();
  (void)is_inited;
}

jclass chatLists::Class;
jfieldID chatLists::chat_lists_fieldID;

chatLists::chatLists()
  : chat_lists_()
{}

chatLists::chatLists(array<object_ptr<ChatList>> &&chat_lists_)
  : chat_lists_(std::move(chat_lists_))
{}

const std::int32_t chatLists::ID;

object_ptr<chatLists> chatLists::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatLists> res = make_object<chatLists>();
  res->chat_lists_ = jni::FetchVector<ChatList>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->chat_lists_fieldID));
  return res;
}

void chatLists::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { auto arr_tmp_ = jni::store_vector(env, chat_lists_); if (arr_tmp_) { env->SetObjectField(s, chat_lists_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void chatLists::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatLists");
    { s.store_vector_begin("chatLists", chat_lists_.size()); for (const auto &_value : chat_lists_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

void chatLists::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatLists").c_str());
    chat_lists_fieldID = jni::get_field_id(env, Class, "chatLists", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$ChatList;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass ChatMemberStatus::Class;

object_ptr<ChatMemberStatus> ChatMemberStatus::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case chatMemberStatusCreator::ID:
      return chatMemberStatusCreator::fetch(env, p);
    case chatMemberStatusAdministrator::ID:
      return chatMemberStatusAdministrator::fetch(env, p);
    case chatMemberStatusMember::ID:
      return chatMemberStatusMember::fetch(env, p);
    case chatMemberStatusRestricted::ID:
      return chatMemberStatusRestricted::fetch(env, p);
    case chatMemberStatusLeft::ID:
      return chatMemberStatusLeft::fetch(env, p);
    case chatMemberStatusBanned::ID:
      return chatMemberStatusBanned::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void ChatMemberStatus::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatMemberStatus").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass chatMemberStatusCreator::Class;
jfieldID chatMemberStatusCreator::is_anonymous_fieldID;
jfieldID chatMemberStatusCreator::is_member_fieldID;

chatMemberStatusCreator::chatMemberStatusCreator()
  : is_anonymous_()
  , is_member_()
{}

chatMemberStatusCreator::chatMemberStatusCreator(bool is_anonymous_, bool is_member_)
  : is_anonymous_(is_anonymous_)
  , is_member_(is_member_)
{}

const std::int32_t chatMemberStatusCreator::ID;

object_ptr<ChatMemberStatus> chatMemberStatusCreator::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatMemberStatusCreator> res = make_object<chatMemberStatusCreator>();
  res->is_anonymous_ = (env->GetBooleanField(p, res->is_anonymous_fieldID) != 0);
  res->is_member_ = (env->GetBooleanField(p, res->is_member_fieldID) != 0);
  return std::move(res);
}

void chatMemberStatusCreator::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetBooleanField(s, is_anonymous_fieldID, is_anonymous_);
  env->SetBooleanField(s, is_member_fieldID, is_member_);
}

void chatMemberStatusCreator::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatMemberStatusCreator");
    s.store_field("isAnonymous", is_anonymous_);
    s.store_field("isMember", is_member_);
    s.store_class_end();
  }
}

void chatMemberStatusCreator::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatMemberStatusCreator").c_str());
    is_anonymous_fieldID = jni::get_field_id(env, Class, "isAnonymous", "Z");
    is_member_fieldID = jni::get_field_id(env, Class, "isMember", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass chatMemberStatusAdministrator::Class;
jfieldID chatMemberStatusAdministrator::can_be_edited_fieldID;
jfieldID chatMemberStatusAdministrator::rights_fieldID;

chatMemberStatusAdministrator::chatMemberStatusAdministrator()
  : can_be_edited_()
  , rights_()
{}

chatMemberStatusAdministrator::chatMemberStatusAdministrator(bool can_be_edited_, object_ptr<chatAdministratorRights> &&rights_)
  : can_be_edited_(can_be_edited_)
  , rights_(std::move(rights_))
{}

const std::int32_t chatMemberStatusAdministrator::ID;

object_ptr<ChatMemberStatus> chatMemberStatusAdministrator::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatMemberStatusAdministrator> res = make_object<chatMemberStatusAdministrator>();
  res->can_be_edited_ = (env->GetBooleanField(p, res->can_be_edited_fieldID) != 0);
  res->rights_ = jni::fetch_tl_object<chatAdministratorRights>(env, jni::fetch_object(env, p, res->rights_fieldID));
  return std::move(res);
}

void chatMemberStatusAdministrator::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetBooleanField(s, can_be_edited_fieldID, can_be_edited_);
  if (rights_ != nullptr) { jobject next; rights_->store(env, next); if (next) { env->SetObjectField(s, rights_fieldID, next); env->DeleteLocalRef(next); } }
}

void chatMemberStatusAdministrator::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatMemberStatusAdministrator");
    s.store_field("canBeEdited", can_be_edited_);
    s.store_object_field("rights", static_cast<const BaseObject *>(rights_.get()));
    s.store_class_end();
  }
}

void chatMemberStatusAdministrator::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatMemberStatusAdministrator").c_str());
    can_be_edited_fieldID = jni::get_field_id(env, Class, "canBeEdited", "Z");
    rights_fieldID = jni::get_field_id(env, Class, "rights", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ChatAdministratorRights;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass chatMemberStatusMember::Class;
jfieldID chatMemberStatusMember::member_until_date_fieldID;

chatMemberStatusMember::chatMemberStatusMember()
  : member_until_date_()
{}

chatMemberStatusMember::chatMemberStatusMember(int32 member_until_date_)
  : member_until_date_(member_until_date_)
{}

const std::int32_t chatMemberStatusMember::ID;

object_ptr<ChatMemberStatus> chatMemberStatusMember::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatMemberStatusMember> res = make_object<chatMemberStatusMember>();
  res->member_until_date_ = env->GetIntField(p, res->member_until_date_fieldID);
  return std::move(res);
}

void chatMemberStatusMember::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, member_until_date_fieldID, member_until_date_);
}

void chatMemberStatusMember::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatMemberStatusMember");
    s.store_field("memberUntilDate", member_until_date_);
    s.store_class_end();
  }
}

void chatMemberStatusMember::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatMemberStatusMember").c_str());
    member_until_date_fieldID = jni::get_field_id(env, Class, "memberUntilDate", "I");
    return true;
  }();
  (void)is_inited;
}

jclass chatMemberStatusRestricted::Class;
jfieldID chatMemberStatusRestricted::is_member_fieldID;
jfieldID chatMemberStatusRestricted::restricted_until_date_fieldID;
jfieldID chatMemberStatusRestricted::permissions_fieldID;

chatMemberStatusRestricted::chatMemberStatusRestricted()
  : is_member_()
  , restricted_until_date_()
  , permissions_()
{}

chatMemberStatusRestricted::chatMemberStatusRestricted(bool is_member_, int32 restricted_until_date_, object_ptr<chatPermissions> &&permissions_)
  : is_member_(is_member_)
  , restricted_until_date_(restricted_until_date_)
  , permissions_(std::move(permissions_))
{}

const std::int32_t chatMemberStatusRestricted::ID;

object_ptr<ChatMemberStatus> chatMemberStatusRestricted::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatMemberStatusRestricted> res = make_object<chatMemberStatusRestricted>();
  res->is_member_ = (env->GetBooleanField(p, res->is_member_fieldID) != 0);
  res->restricted_until_date_ = env->GetIntField(p, res->restricted_until_date_fieldID);
  res->permissions_ = jni::fetch_tl_object<chatPermissions>(env, jni::fetch_object(env, p, res->permissions_fieldID));
  return std::move(res);
}

void chatMemberStatusRestricted::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetBooleanField(s, is_member_fieldID, is_member_);
  env->SetIntField(s, restricted_until_date_fieldID, restricted_until_date_);
  if (permissions_ != nullptr) { jobject next; permissions_->store(env, next); if (next) { env->SetObjectField(s, permissions_fieldID, next); env->DeleteLocalRef(next); } }
}

void chatMemberStatusRestricted::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatMemberStatusRestricted");
    s.store_field("isMember", is_member_);
    s.store_field("restrictedUntilDate", restricted_until_date_);
    s.store_object_field("permissions", static_cast<const BaseObject *>(permissions_.get()));
    s.store_class_end();
  }
}

void chatMemberStatusRestricted::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatMemberStatusRestricted").c_str());
    is_member_fieldID = jni::get_field_id(env, Class, "isMember", "Z");
    restricted_until_date_fieldID = jni::get_field_id(env, Class, "restrictedUntilDate", "I");
    permissions_fieldID = jni::get_field_id(env, Class, "permissions", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ChatPermissions;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass chatMemberStatusLeft::Class;

chatMemberStatusLeft::chatMemberStatusLeft() {
}

const std::int32_t chatMemberStatusLeft::ID;

object_ptr<ChatMemberStatus> chatMemberStatusLeft::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<chatMemberStatusLeft>();
}

void chatMemberStatusLeft::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void chatMemberStatusLeft::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatMemberStatusLeft");
    s.store_class_end();
  }
}

void chatMemberStatusLeft::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatMemberStatusLeft").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass chatMemberStatusBanned::Class;
jfieldID chatMemberStatusBanned::banned_until_date_fieldID;

chatMemberStatusBanned::chatMemberStatusBanned()
  : banned_until_date_()
{}

chatMemberStatusBanned::chatMemberStatusBanned(int32 banned_until_date_)
  : banned_until_date_(banned_until_date_)
{}

const std::int32_t chatMemberStatusBanned::ID;

object_ptr<ChatMemberStatus> chatMemberStatusBanned::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatMemberStatusBanned> res = make_object<chatMemberStatusBanned>();
  res->banned_until_date_ = env->GetIntField(p, res->banned_until_date_fieldID);
  return std::move(res);
}

void chatMemberStatusBanned::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, banned_until_date_fieldID, banned_until_date_);
}

void chatMemberStatusBanned::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatMemberStatusBanned");
    s.store_field("bannedUntilDate", banned_until_date_);
    s.store_class_end();
  }
}

void chatMemberStatusBanned::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatMemberStatusBanned").c_str());
    banned_until_date_fieldID = jni::get_field_id(env, Class, "bannedUntilDate", "I");
    return true;
  }();
  (void)is_inited;
}

jclass chatNotificationSettings::Class;
jfieldID chatNotificationSettings::use_default_mute_for_fieldID;
jfieldID chatNotificationSettings::mute_for_fieldID;
jfieldID chatNotificationSettings::use_default_sound_fieldID;
jfieldID chatNotificationSettings::sound_id_fieldID;
jfieldID chatNotificationSettings::use_default_show_preview_fieldID;
jfieldID chatNotificationSettings::show_preview_fieldID;
jfieldID chatNotificationSettings::use_default_mute_stories_fieldID;
jfieldID chatNotificationSettings::mute_stories_fieldID;
jfieldID chatNotificationSettings::use_default_story_sound_fieldID;
jfieldID chatNotificationSettings::story_sound_id_fieldID;
jfieldID chatNotificationSettings::use_default_show_story_poster_fieldID;
jfieldID chatNotificationSettings::show_story_poster_fieldID;
jfieldID chatNotificationSettings::use_default_disable_pinned_message_notifications_fieldID;
jfieldID chatNotificationSettings::disable_pinned_message_notifications_fieldID;
jfieldID chatNotificationSettings::use_default_disable_mention_notifications_fieldID;
jfieldID chatNotificationSettings::disable_mention_notifications_fieldID;

chatNotificationSettings::chatNotificationSettings()
  : use_default_mute_for_()
  , mute_for_()
  , use_default_sound_()
  , sound_id_()
  , use_default_show_preview_()
  , show_preview_()
  , use_default_mute_stories_()
  , mute_stories_()
  , use_default_story_sound_()
  , story_sound_id_()
  , use_default_show_story_poster_()
  , show_story_poster_()
  , use_default_disable_pinned_message_notifications_()
  , disable_pinned_message_notifications_()
  , use_default_disable_mention_notifications_()
  , disable_mention_notifications_()
{}

chatNotificationSettings::chatNotificationSettings(bool use_default_mute_for_, int32 mute_for_, bool use_default_sound_, int64 sound_id_, bool use_default_show_preview_, bool show_preview_, bool use_default_mute_stories_, bool mute_stories_, bool use_default_story_sound_, int64 story_sound_id_, bool use_default_show_story_poster_, bool show_story_poster_, bool use_default_disable_pinned_message_notifications_, bool disable_pinned_message_notifications_, bool use_default_disable_mention_notifications_, bool disable_mention_notifications_)
  : use_default_mute_for_(use_default_mute_for_)
  , mute_for_(mute_for_)
  , use_default_sound_(use_default_sound_)
  , sound_id_(sound_id_)
  , use_default_show_preview_(use_default_show_preview_)
  , show_preview_(show_preview_)
  , use_default_mute_stories_(use_default_mute_stories_)
  , mute_stories_(mute_stories_)
  , use_default_story_sound_(use_default_story_sound_)
  , story_sound_id_(story_sound_id_)
  , use_default_show_story_poster_(use_default_show_story_poster_)
  , show_story_poster_(show_story_poster_)
  , use_default_disable_pinned_message_notifications_(use_default_disable_pinned_message_notifications_)
  , disable_pinned_message_notifications_(disable_pinned_message_notifications_)
  , use_default_disable_mention_notifications_(use_default_disable_mention_notifications_)
  , disable_mention_notifications_(disable_mention_notifications_)
{}

const std::int32_t chatNotificationSettings::ID;

object_ptr<chatNotificationSettings> chatNotificationSettings::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatNotificationSettings> res = make_object<chatNotificationSettings>();
  res->use_default_mute_for_ = (env->GetBooleanField(p, res->use_default_mute_for_fieldID) != 0);
  res->mute_for_ = env->GetIntField(p, res->mute_for_fieldID);
  res->use_default_sound_ = (env->GetBooleanField(p, res->use_default_sound_fieldID) != 0);
  res->sound_id_ = env->GetLongField(p, res->sound_id_fieldID);
  res->use_default_show_preview_ = (env->GetBooleanField(p, res->use_default_show_preview_fieldID) != 0);
  res->show_preview_ = (env->GetBooleanField(p, res->show_preview_fieldID) != 0);
  res->use_default_mute_stories_ = (env->GetBooleanField(p, res->use_default_mute_stories_fieldID) != 0);
  res->mute_stories_ = (env->GetBooleanField(p, res->mute_stories_fieldID) != 0);
  res->use_default_story_sound_ = (env->GetBooleanField(p, res->use_default_story_sound_fieldID) != 0);
  res->story_sound_id_ = env->GetLongField(p, res->story_sound_id_fieldID);
  res->use_default_show_story_poster_ = (env->GetBooleanField(p, res->use_default_show_story_poster_fieldID) != 0);
  res->show_story_poster_ = (env->GetBooleanField(p, res->show_story_poster_fieldID) != 0);
  res->use_default_disable_pinned_message_notifications_ = (env->GetBooleanField(p, res->use_default_disable_pinned_message_notifications_fieldID) != 0);
  res->disable_pinned_message_notifications_ = (env->GetBooleanField(p, res->disable_pinned_message_notifications_fieldID) != 0);
  res->use_default_disable_mention_notifications_ = (env->GetBooleanField(p, res->use_default_disable_mention_notifications_fieldID) != 0);
  res->disable_mention_notifications_ = (env->GetBooleanField(p, res->disable_mention_notifications_fieldID) != 0);
  return res;
}

void chatNotificationSettings::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetBooleanField(s, use_default_mute_for_fieldID, use_default_mute_for_);
  env->SetIntField(s, mute_for_fieldID, mute_for_);
  env->SetBooleanField(s, use_default_sound_fieldID, use_default_sound_);
  env->SetLongField(s, sound_id_fieldID, sound_id_);
  env->SetBooleanField(s, use_default_show_preview_fieldID, use_default_show_preview_);
  env->SetBooleanField(s, show_preview_fieldID, show_preview_);
  env->SetBooleanField(s, use_default_mute_stories_fieldID, use_default_mute_stories_);
  env->SetBooleanField(s, mute_stories_fieldID, mute_stories_);
  env->SetBooleanField(s, use_default_story_sound_fieldID, use_default_story_sound_);
  env->SetLongField(s, story_sound_id_fieldID, story_sound_id_);
  env->SetBooleanField(s, use_default_show_story_poster_fieldID, use_default_show_story_poster_);
  env->SetBooleanField(s, show_story_poster_fieldID, show_story_poster_);
  env->SetBooleanField(s, use_default_disable_pinned_message_notifications_fieldID, use_default_disable_pinned_message_notifications_);
  env->SetBooleanField(s, disable_pinned_message_notifications_fieldID, disable_pinned_message_notifications_);
  env->SetBooleanField(s, use_default_disable_mention_notifications_fieldID, use_default_disable_mention_notifications_);
  env->SetBooleanField(s, disable_mention_notifications_fieldID, disable_mention_notifications_);
}

void chatNotificationSettings::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatNotificationSettings");
    s.store_field("useDefaultMuteFor", use_default_mute_for_);
    s.store_field("muteFor", mute_for_);
    s.store_field("useDefaultSound", use_default_sound_);
    s.store_field("soundId", sound_id_);
    s.store_field("useDefaultShowPreview", use_default_show_preview_);
    s.store_field("showPreview", show_preview_);
    s.store_field("useDefaultMuteStories", use_default_mute_stories_);
    s.store_field("muteStories", mute_stories_);
    s.store_field("useDefaultStorySound", use_default_story_sound_);
    s.store_field("storySoundId", story_sound_id_);
    s.store_field("useDefaultShowStoryPoster", use_default_show_story_poster_);
    s.store_field("showStoryPoster", show_story_poster_);
    s.store_field("useDefaultDisablePinnedMessageNotifications", use_default_disable_pinned_message_notifications_);
    s.store_field("disablePinnedMessageNotifications", disable_pinned_message_notifications_);
    s.store_field("useDefaultDisableMentionNotifications", use_default_disable_mention_notifications_);
    s.store_field("disableMentionNotifications", disable_mention_notifications_);
    s.store_class_end();
  }
}

void chatNotificationSettings::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatNotificationSettings").c_str());
    use_default_mute_for_fieldID = jni::get_field_id(env, Class, "useDefaultMuteFor", "Z");
    mute_for_fieldID = jni::get_field_id(env, Class, "muteFor", "I");
    use_default_sound_fieldID = jni::get_field_id(env, Class, "useDefaultSound", "Z");
    sound_id_fieldID = jni::get_field_id(env, Class, "soundId", "J");
    use_default_show_preview_fieldID = jni::get_field_id(env, Class, "useDefaultShowPreview", "Z");
    show_preview_fieldID = jni::get_field_id(env, Class, "showPreview", "Z");
    use_default_mute_stories_fieldID = jni::get_field_id(env, Class, "useDefaultMuteStories", "Z");
    mute_stories_fieldID = jni::get_field_id(env, Class, "muteStories", "Z");
    use_default_story_sound_fieldID = jni::get_field_id(env, Class, "useDefaultStorySound", "Z");
    story_sound_id_fieldID = jni::get_field_id(env, Class, "storySoundId", "J");
    use_default_show_story_poster_fieldID = jni::get_field_id(env, Class, "useDefaultShowStoryPoster", "Z");
    show_story_poster_fieldID = jni::get_field_id(env, Class, "showStoryPoster", "Z");
    use_default_disable_pinned_message_notifications_fieldID = jni::get_field_id(env, Class, "useDefaultDisablePinnedMessageNotifications", "Z");
    disable_pinned_message_notifications_fieldID = jni::get_field_id(env, Class, "disablePinnedMessageNotifications", "Z");
    use_default_disable_mention_notifications_fieldID = jni::get_field_id(env, Class, "useDefaultDisableMentionNotifications", "Z");
    disable_mention_notifications_fieldID = jni::get_field_id(env, Class, "disableMentionNotifications", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass ChatSource::Class;

object_ptr<ChatSource> ChatSource::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case chatSourceMtprotoProxy::ID:
      return chatSourceMtprotoProxy::fetch(env, p);
    case chatSourcePublicServiceAnnouncement::ID:
      return chatSourcePublicServiceAnnouncement::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void ChatSource::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatSource").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass chatSourceMtprotoProxy::Class;

chatSourceMtprotoProxy::chatSourceMtprotoProxy() {
}

const std::int32_t chatSourceMtprotoProxy::ID;

object_ptr<ChatSource> chatSourceMtprotoProxy::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<chatSourceMtprotoProxy>();
}

void chatSourceMtprotoProxy::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void chatSourceMtprotoProxy::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatSourceMtprotoProxy");
    s.store_class_end();
  }
}

void chatSourceMtprotoProxy::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatSourceMtprotoProxy").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass chatSourcePublicServiceAnnouncement::Class;
jfieldID chatSourcePublicServiceAnnouncement::type_fieldID;
jfieldID chatSourcePublicServiceAnnouncement::text_fieldID;

chatSourcePublicServiceAnnouncement::chatSourcePublicServiceAnnouncement()
  : type_()
  , text_()
{}

chatSourcePublicServiceAnnouncement::chatSourcePublicServiceAnnouncement(string const &type_, string const &text_)
  : type_(type_)
  , text_(text_)
{}

const std::int32_t chatSourcePublicServiceAnnouncement::ID;

object_ptr<ChatSource> chatSourcePublicServiceAnnouncement::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatSourcePublicServiceAnnouncement> res = make_object<chatSourcePublicServiceAnnouncement>();
  res->type_ = jni::fetch_string(env, p, res->type_fieldID);
  res->text_ = jni::fetch_string(env, p, res->text_fieldID);
  return std::move(res);
}

void chatSourcePublicServiceAnnouncement::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, type_); if (nextString) { env->SetObjectField(s, type_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, text_); if (nextString) { env->SetObjectField(s, text_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void chatSourcePublicServiceAnnouncement::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatSourcePublicServiceAnnouncement");
    s.store_field("type", type_);
    s.store_field("text", text_);
    s.store_class_end();
  }
}

void chatSourcePublicServiceAnnouncement::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatSourcePublicServiceAnnouncement").c_str());
    type_fieldID = jni::get_field_id(env, Class, "type", "Ljava/lang/String;");
    text_fieldID = jni::get_field_id(env, Class, "text", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass ChatStatistics::Class;

object_ptr<ChatStatistics> ChatStatistics::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case chatStatisticsSupergroup::ID:
      return chatStatisticsSupergroup::fetch(env, p);
    case chatStatisticsChannel::ID:
      return chatStatisticsChannel::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void ChatStatistics::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatStatistics").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass chatStatisticsSupergroup::Class;
jfieldID chatStatisticsSupergroup::period_fieldID;
jfieldID chatStatisticsSupergroup::member_count_fieldID;
jfieldID chatStatisticsSupergroup::message_count_fieldID;
jfieldID chatStatisticsSupergroup::viewer_count_fieldID;
jfieldID chatStatisticsSupergroup::sender_count_fieldID;
jfieldID chatStatisticsSupergroup::member_count_graph_fieldID;
jfieldID chatStatisticsSupergroup::join_graph_fieldID;
jfieldID chatStatisticsSupergroup::join_by_source_graph_fieldID;
jfieldID chatStatisticsSupergroup::language_graph_fieldID;
jfieldID chatStatisticsSupergroup::message_content_graph_fieldID;
jfieldID chatStatisticsSupergroup::action_graph_fieldID;
jfieldID chatStatisticsSupergroup::day_graph_fieldID;
jfieldID chatStatisticsSupergroup::week_graph_fieldID;
jfieldID chatStatisticsSupergroup::top_senders_fieldID;
jfieldID chatStatisticsSupergroup::top_administrators_fieldID;
jfieldID chatStatisticsSupergroup::top_inviters_fieldID;

chatStatisticsSupergroup::chatStatisticsSupergroup()
  : period_()
  , member_count_()
  , message_count_()
  , viewer_count_()
  , sender_count_()
  , member_count_graph_()
  , join_graph_()
  , join_by_source_graph_()
  , language_graph_()
  , message_content_graph_()
  , action_graph_()
  , day_graph_()
  , week_graph_()
  , top_senders_()
  , top_administrators_()
  , top_inviters_()
{}

chatStatisticsSupergroup::chatStatisticsSupergroup(object_ptr<dateRange> &&period_, object_ptr<statisticalValue> &&member_count_, object_ptr<statisticalValue> &&message_count_, object_ptr<statisticalValue> &&viewer_count_, object_ptr<statisticalValue> &&sender_count_, object_ptr<StatisticalGraph> &&member_count_graph_, object_ptr<StatisticalGraph> &&join_graph_, object_ptr<StatisticalGraph> &&join_by_source_graph_, object_ptr<StatisticalGraph> &&language_graph_, object_ptr<StatisticalGraph> &&message_content_graph_, object_ptr<StatisticalGraph> &&action_graph_, object_ptr<StatisticalGraph> &&day_graph_, object_ptr<StatisticalGraph> &&week_graph_, array<object_ptr<chatStatisticsMessageSenderInfo>> &&top_senders_, array<object_ptr<chatStatisticsAdministratorActionsInfo>> &&top_administrators_, array<object_ptr<chatStatisticsInviterInfo>> &&top_inviters_)
  : period_(std::move(period_))
  , member_count_(std::move(member_count_))
  , message_count_(std::move(message_count_))
  , viewer_count_(std::move(viewer_count_))
  , sender_count_(std::move(sender_count_))
  , member_count_graph_(std::move(member_count_graph_))
  , join_graph_(std::move(join_graph_))
  , join_by_source_graph_(std::move(join_by_source_graph_))
  , language_graph_(std::move(language_graph_))
  , message_content_graph_(std::move(message_content_graph_))
  , action_graph_(std::move(action_graph_))
  , day_graph_(std::move(day_graph_))
  , week_graph_(std::move(week_graph_))
  , top_senders_(std::move(top_senders_))
  , top_administrators_(std::move(top_administrators_))
  , top_inviters_(std::move(top_inviters_))
{}

const std::int32_t chatStatisticsSupergroup::ID;

object_ptr<ChatStatistics> chatStatisticsSupergroup::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatStatisticsSupergroup> res = make_object<chatStatisticsSupergroup>();
  res->period_ = jni::fetch_tl_object<dateRange>(env, jni::fetch_object(env, p, res->period_fieldID));
  res->member_count_ = jni::fetch_tl_object<statisticalValue>(env, jni::fetch_object(env, p, res->member_count_fieldID));
  res->message_count_ = jni::fetch_tl_object<statisticalValue>(env, jni::fetch_object(env, p, res->message_count_fieldID));
  res->viewer_count_ = jni::fetch_tl_object<statisticalValue>(env, jni::fetch_object(env, p, res->viewer_count_fieldID));
  res->sender_count_ = jni::fetch_tl_object<statisticalValue>(env, jni::fetch_object(env, p, res->sender_count_fieldID));
  res->member_count_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->member_count_graph_fieldID));
  res->join_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->join_graph_fieldID));
  res->join_by_source_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->join_by_source_graph_fieldID));
  res->language_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->language_graph_fieldID));
  res->message_content_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->message_content_graph_fieldID));
  res->action_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->action_graph_fieldID));
  res->day_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->day_graph_fieldID));
  res->week_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->week_graph_fieldID));
  res->top_senders_ = jni::FetchVector<chatStatisticsMessageSenderInfo>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->top_senders_fieldID));
  res->top_administrators_ = jni::FetchVector<chatStatisticsAdministratorActionsInfo>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->top_administrators_fieldID));
  res->top_inviters_ = jni::FetchVector<chatStatisticsInviterInfo>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->top_inviters_fieldID));
  return std::move(res);
}

void chatStatisticsSupergroup::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (period_ != nullptr) { jobject next; period_->store(env, next); if (next) { env->SetObjectField(s, period_fieldID, next); env->DeleteLocalRef(next); } }
  if (member_count_ != nullptr) { jobject next; member_count_->store(env, next); if (next) { env->SetObjectField(s, member_count_fieldID, next); env->DeleteLocalRef(next); } }
  if (message_count_ != nullptr) { jobject next; message_count_->store(env, next); if (next) { env->SetObjectField(s, message_count_fieldID, next); env->DeleteLocalRef(next); } }
  if (viewer_count_ != nullptr) { jobject next; viewer_count_->store(env, next); if (next) { env->SetObjectField(s, viewer_count_fieldID, next); env->DeleteLocalRef(next); } }
  if (sender_count_ != nullptr) { jobject next; sender_count_->store(env, next); if (next) { env->SetObjectField(s, sender_count_fieldID, next); env->DeleteLocalRef(next); } }
  if (member_count_graph_ != nullptr) { jobject next; member_count_graph_->store(env, next); if (next) { env->SetObjectField(s, member_count_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (join_graph_ != nullptr) { jobject next; join_graph_->store(env, next); if (next) { env->SetObjectField(s, join_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (join_by_source_graph_ != nullptr) { jobject next; join_by_source_graph_->store(env, next); if (next) { env->SetObjectField(s, join_by_source_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (language_graph_ != nullptr) { jobject next; language_graph_->store(env, next); if (next) { env->SetObjectField(s, language_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (message_content_graph_ != nullptr) { jobject next; message_content_graph_->store(env, next); if (next) { env->SetObjectField(s, message_content_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (action_graph_ != nullptr) { jobject next; action_graph_->store(env, next); if (next) { env->SetObjectField(s, action_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (day_graph_ != nullptr) { jobject next; day_graph_->store(env, next); if (next) { env->SetObjectField(s, day_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (week_graph_ != nullptr) { jobject next; week_graph_->store(env, next); if (next) { env->SetObjectField(s, week_graph_fieldID, next); env->DeleteLocalRef(next); } }
  { auto arr_tmp_ = jni::store_vector(env, top_senders_); if (arr_tmp_) { env->SetObjectField(s, top_senders_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  { auto arr_tmp_ = jni::store_vector(env, top_administrators_); if (arr_tmp_) { env->SetObjectField(s, top_administrators_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  { auto arr_tmp_ = jni::store_vector(env, top_inviters_); if (arr_tmp_) { env->SetObjectField(s, top_inviters_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void chatStatisticsSupergroup::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatStatisticsSupergroup");
    s.store_object_field("period", static_cast<const BaseObject *>(period_.get()));
    s.store_object_field("memberCount", static_cast<const BaseObject *>(member_count_.get()));
    s.store_object_field("messageCount", static_cast<const BaseObject *>(message_count_.get()));
    s.store_object_field("viewerCount", static_cast<const BaseObject *>(viewer_count_.get()));
    s.store_object_field("senderCount", static_cast<const BaseObject *>(sender_count_.get()));
    s.store_object_field("memberCountGraph", static_cast<const BaseObject *>(member_count_graph_.get()));
    s.store_object_field("joinGraph", static_cast<const BaseObject *>(join_graph_.get()));
    s.store_object_field("joinBySourceGraph", static_cast<const BaseObject *>(join_by_source_graph_.get()));
    s.store_object_field("languageGraph", static_cast<const BaseObject *>(language_graph_.get()));
    s.store_object_field("messageContentGraph", static_cast<const BaseObject *>(message_content_graph_.get()));
    s.store_object_field("actionGraph", static_cast<const BaseObject *>(action_graph_.get()));
    s.store_object_field("dayGraph", static_cast<const BaseObject *>(day_graph_.get()));
    s.store_object_field("weekGraph", static_cast<const BaseObject *>(week_graph_.get()));
    { s.store_vector_begin("topSenders", top_senders_.size()); for (const auto &_value : top_senders_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    { s.store_vector_begin("topAdministrators", top_administrators_.size()); for (const auto &_value : top_administrators_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    { s.store_vector_begin("topInviters", top_inviters_.size()); for (const auto &_value : top_inviters_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

void chatStatisticsSupergroup::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatStatisticsSupergroup").c_str());
    period_fieldID = jni::get_field_id(env, Class, "period", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$DateRange;").c_str());
    member_count_fieldID = jni::get_field_id(env, Class, "memberCount", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalValue;").c_str());
    message_count_fieldID = jni::get_field_id(env, Class, "messageCount", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalValue;").c_str());
    viewer_count_fieldID = jni::get_field_id(env, Class, "viewerCount", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalValue;").c_str());
    sender_count_fieldID = jni::get_field_id(env, Class, "senderCount", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalValue;").c_str());
    member_count_graph_fieldID = jni::get_field_id(env, Class, "memberCountGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    join_graph_fieldID = jni::get_field_id(env, Class, "joinGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    join_by_source_graph_fieldID = jni::get_field_id(env, Class, "joinBySourceGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    language_graph_fieldID = jni::get_field_id(env, Class, "languageGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    message_content_graph_fieldID = jni::get_field_id(env, Class, "messageContentGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    action_graph_fieldID = jni::get_field_id(env, Class, "actionGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    day_graph_fieldID = jni::get_field_id(env, Class, "dayGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    week_graph_fieldID = jni::get_field_id(env, Class, "weekGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    top_senders_fieldID = jni::get_field_id(env, Class, "topSenders", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$ChatStatisticsMessageSenderInfo;").c_str());
    top_administrators_fieldID = jni::get_field_id(env, Class, "topAdministrators", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$ChatStatisticsAdministratorActionsInfo;").c_str());
    top_inviters_fieldID = jni::get_field_id(env, Class, "topInviters", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$ChatStatisticsInviterInfo;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass chatStatisticsChannel::Class;
jfieldID chatStatisticsChannel::period_fieldID;
jfieldID chatStatisticsChannel::member_count_fieldID;
jfieldID chatStatisticsChannel::mean_message_view_count_fieldID;
jfieldID chatStatisticsChannel::mean_message_share_count_fieldID;
jfieldID chatStatisticsChannel::mean_message_reaction_count_fieldID;
jfieldID chatStatisticsChannel::mean_story_view_count_fieldID;
jfieldID chatStatisticsChannel::mean_story_share_count_fieldID;
jfieldID chatStatisticsChannel::mean_story_reaction_count_fieldID;
jfieldID chatStatisticsChannel::enabled_notifications_percentage_fieldID;
jfieldID chatStatisticsChannel::member_count_graph_fieldID;
jfieldID chatStatisticsChannel::join_graph_fieldID;
jfieldID chatStatisticsChannel::mute_graph_fieldID;
jfieldID chatStatisticsChannel::view_count_by_hour_graph_fieldID;
jfieldID chatStatisticsChannel::view_count_by_source_graph_fieldID;
jfieldID chatStatisticsChannel::join_by_source_graph_fieldID;
jfieldID chatStatisticsChannel::language_graph_fieldID;
jfieldID chatStatisticsChannel::message_interaction_graph_fieldID;
jfieldID chatStatisticsChannel::message_reaction_graph_fieldID;
jfieldID chatStatisticsChannel::story_interaction_graph_fieldID;
jfieldID chatStatisticsChannel::story_reaction_graph_fieldID;
jfieldID chatStatisticsChannel::instant_view_interaction_graph_fieldID;
jfieldID chatStatisticsChannel::recent_interactions_fieldID;

chatStatisticsChannel::chatStatisticsChannel()
  : period_()
  , member_count_()
  , mean_message_view_count_()
  , mean_message_share_count_()
  , mean_message_reaction_count_()
  , mean_story_view_count_()
  , mean_story_share_count_()
  , mean_story_reaction_count_()
  , enabled_notifications_percentage_()
  , member_count_graph_()
  , join_graph_()
  , mute_graph_()
  , view_count_by_hour_graph_()
  , view_count_by_source_graph_()
  , join_by_source_graph_()
  , language_graph_()
  , message_interaction_graph_()
  , message_reaction_graph_()
  , story_interaction_graph_()
  , story_reaction_graph_()
  , instant_view_interaction_graph_()
  , recent_interactions_()
{}

chatStatisticsChannel::chatStatisticsChannel(object_ptr<dateRange> &&period_, object_ptr<statisticalValue> &&member_count_, object_ptr<statisticalValue> &&mean_message_view_count_, object_ptr<statisticalValue> &&mean_message_share_count_, object_ptr<statisticalValue> &&mean_message_reaction_count_, object_ptr<statisticalValue> &&mean_story_view_count_, object_ptr<statisticalValue> &&mean_story_share_count_, object_ptr<statisticalValue> &&mean_story_reaction_count_, double enabled_notifications_percentage_, object_ptr<StatisticalGraph> &&member_count_graph_, object_ptr<StatisticalGraph> &&join_graph_, object_ptr<StatisticalGraph> &&mute_graph_, object_ptr<StatisticalGraph> &&view_count_by_hour_graph_, object_ptr<StatisticalGraph> &&view_count_by_source_graph_, object_ptr<StatisticalGraph> &&join_by_source_graph_, object_ptr<StatisticalGraph> &&language_graph_, object_ptr<StatisticalGraph> &&message_interaction_graph_, object_ptr<StatisticalGraph> &&message_reaction_graph_, object_ptr<StatisticalGraph> &&story_interaction_graph_, object_ptr<StatisticalGraph> &&story_reaction_graph_, object_ptr<StatisticalGraph> &&instant_view_interaction_graph_, array<object_ptr<chatStatisticsInteractionInfo>> &&recent_interactions_)
  : period_(std::move(period_))
  , member_count_(std::move(member_count_))
  , mean_message_view_count_(std::move(mean_message_view_count_))
  , mean_message_share_count_(std::move(mean_message_share_count_))
  , mean_message_reaction_count_(std::move(mean_message_reaction_count_))
  , mean_story_view_count_(std::move(mean_story_view_count_))
  , mean_story_share_count_(std::move(mean_story_share_count_))
  , mean_story_reaction_count_(std::move(mean_story_reaction_count_))
  , enabled_notifications_percentage_(enabled_notifications_percentage_)
  , member_count_graph_(std::move(member_count_graph_))
  , join_graph_(std::move(join_graph_))
  , mute_graph_(std::move(mute_graph_))
  , view_count_by_hour_graph_(std::move(view_count_by_hour_graph_))
  , view_count_by_source_graph_(std::move(view_count_by_source_graph_))
  , join_by_source_graph_(std::move(join_by_source_graph_))
  , language_graph_(std::move(language_graph_))
  , message_interaction_graph_(std::move(message_interaction_graph_))
  , message_reaction_graph_(std::move(message_reaction_graph_))
  , story_interaction_graph_(std::move(story_interaction_graph_))
  , story_reaction_graph_(std::move(story_reaction_graph_))
  , instant_view_interaction_graph_(std::move(instant_view_interaction_graph_))
  , recent_interactions_(std::move(recent_interactions_))
{}

const std::int32_t chatStatisticsChannel::ID;

object_ptr<ChatStatistics> chatStatisticsChannel::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatStatisticsChannel> res = make_object<chatStatisticsChannel>();
  res->period_ = jni::fetch_tl_object<dateRange>(env, jni::fetch_object(env, p, res->period_fieldID));
  res->member_count_ = jni::fetch_tl_object<statisticalValue>(env, jni::fetch_object(env, p, res->member_count_fieldID));
  res->mean_message_view_count_ = jni::fetch_tl_object<statisticalValue>(env, jni::fetch_object(env, p, res->mean_message_view_count_fieldID));
  res->mean_message_share_count_ = jni::fetch_tl_object<statisticalValue>(env, jni::fetch_object(env, p, res->mean_message_share_count_fieldID));
  res->mean_message_reaction_count_ = jni::fetch_tl_object<statisticalValue>(env, jni::fetch_object(env, p, res->mean_message_reaction_count_fieldID));
  res->mean_story_view_count_ = jni::fetch_tl_object<statisticalValue>(env, jni::fetch_object(env, p, res->mean_story_view_count_fieldID));
  res->mean_story_share_count_ = jni::fetch_tl_object<statisticalValue>(env, jni::fetch_object(env, p, res->mean_story_share_count_fieldID));
  res->mean_story_reaction_count_ = jni::fetch_tl_object<statisticalValue>(env, jni::fetch_object(env, p, res->mean_story_reaction_count_fieldID));
  res->enabled_notifications_percentage_ = env->GetDoubleField(p, res->enabled_notifications_percentage_fieldID);
  res->member_count_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->member_count_graph_fieldID));
  res->join_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->join_graph_fieldID));
  res->mute_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->mute_graph_fieldID));
  res->view_count_by_hour_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->view_count_by_hour_graph_fieldID));
  res->view_count_by_source_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->view_count_by_source_graph_fieldID));
  res->join_by_source_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->join_by_source_graph_fieldID));
  res->language_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->language_graph_fieldID));
  res->message_interaction_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->message_interaction_graph_fieldID));
  res->message_reaction_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->message_reaction_graph_fieldID));
  res->story_interaction_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->story_interaction_graph_fieldID));
  res->story_reaction_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->story_reaction_graph_fieldID));
  res->instant_view_interaction_graph_ = jni::fetch_tl_object<StatisticalGraph>(env, jni::fetch_object(env, p, res->instant_view_interaction_graph_fieldID));
  res->recent_interactions_ = jni::FetchVector<chatStatisticsInteractionInfo>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->recent_interactions_fieldID));
  return std::move(res);
}

void chatStatisticsChannel::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (period_ != nullptr) { jobject next; period_->store(env, next); if (next) { env->SetObjectField(s, period_fieldID, next); env->DeleteLocalRef(next); } }
  if (member_count_ != nullptr) { jobject next; member_count_->store(env, next); if (next) { env->SetObjectField(s, member_count_fieldID, next); env->DeleteLocalRef(next); } }
  if (mean_message_view_count_ != nullptr) { jobject next; mean_message_view_count_->store(env, next); if (next) { env->SetObjectField(s, mean_message_view_count_fieldID, next); env->DeleteLocalRef(next); } }
  if (mean_message_share_count_ != nullptr) { jobject next; mean_message_share_count_->store(env, next); if (next) { env->SetObjectField(s, mean_message_share_count_fieldID, next); env->DeleteLocalRef(next); } }
  if (mean_message_reaction_count_ != nullptr) { jobject next; mean_message_reaction_count_->store(env, next); if (next) { env->SetObjectField(s, mean_message_reaction_count_fieldID, next); env->DeleteLocalRef(next); } }
  if (mean_story_view_count_ != nullptr) { jobject next; mean_story_view_count_->store(env, next); if (next) { env->SetObjectField(s, mean_story_view_count_fieldID, next); env->DeleteLocalRef(next); } }
  if (mean_story_share_count_ != nullptr) { jobject next; mean_story_share_count_->store(env, next); if (next) { env->SetObjectField(s, mean_story_share_count_fieldID, next); env->DeleteLocalRef(next); } }
  if (mean_story_reaction_count_ != nullptr) { jobject next; mean_story_reaction_count_->store(env, next); if (next) { env->SetObjectField(s, mean_story_reaction_count_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetDoubleField(s, enabled_notifications_percentage_fieldID, enabled_notifications_percentage_);
  if (member_count_graph_ != nullptr) { jobject next; member_count_graph_->store(env, next); if (next) { env->SetObjectField(s, member_count_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (join_graph_ != nullptr) { jobject next; join_graph_->store(env, next); if (next) { env->SetObjectField(s, join_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (mute_graph_ != nullptr) { jobject next; mute_graph_->store(env, next); if (next) { env->SetObjectField(s, mute_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (view_count_by_hour_graph_ != nullptr) { jobject next; view_count_by_hour_graph_->store(env, next); if (next) { env->SetObjectField(s, view_count_by_hour_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (view_count_by_source_graph_ != nullptr) { jobject next; view_count_by_source_graph_->store(env, next); if (next) { env->SetObjectField(s, view_count_by_source_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (join_by_source_graph_ != nullptr) { jobject next; join_by_source_graph_->store(env, next); if (next) { env->SetObjectField(s, join_by_source_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (language_graph_ != nullptr) { jobject next; language_graph_->store(env, next); if (next) { env->SetObjectField(s, language_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (message_interaction_graph_ != nullptr) { jobject next; message_interaction_graph_->store(env, next); if (next) { env->SetObjectField(s, message_interaction_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (message_reaction_graph_ != nullptr) { jobject next; message_reaction_graph_->store(env, next); if (next) { env->SetObjectField(s, message_reaction_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (story_interaction_graph_ != nullptr) { jobject next; story_interaction_graph_->store(env, next); if (next) { env->SetObjectField(s, story_interaction_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (story_reaction_graph_ != nullptr) { jobject next; story_reaction_graph_->store(env, next); if (next) { env->SetObjectField(s, story_reaction_graph_fieldID, next); env->DeleteLocalRef(next); } }
  if (instant_view_interaction_graph_ != nullptr) { jobject next; instant_view_interaction_graph_->store(env, next); if (next) { env->SetObjectField(s, instant_view_interaction_graph_fieldID, next); env->DeleteLocalRef(next); } }
  { auto arr_tmp_ = jni::store_vector(env, recent_interactions_); if (arr_tmp_) { env->SetObjectField(s, recent_interactions_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void chatStatisticsChannel::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatStatisticsChannel");
    s.store_object_field("period", static_cast<const BaseObject *>(period_.get()));
    s.store_object_field("memberCount", static_cast<const BaseObject *>(member_count_.get()));
    s.store_object_field("meanMessageViewCount", static_cast<const BaseObject *>(mean_message_view_count_.get()));
    s.store_object_field("meanMessageShareCount", static_cast<const BaseObject *>(mean_message_share_count_.get()));
    s.store_object_field("meanMessageReactionCount", static_cast<const BaseObject *>(mean_message_reaction_count_.get()));
    s.store_object_field("meanStoryViewCount", static_cast<const BaseObject *>(mean_story_view_count_.get()));
    s.store_object_field("meanStoryShareCount", static_cast<const BaseObject *>(mean_story_share_count_.get()));
    s.store_object_field("meanStoryReactionCount", static_cast<const BaseObject *>(mean_story_reaction_count_.get()));
    s.store_field("enabledNotificationsPercentage", enabled_notifications_percentage_);
    s.store_object_field("memberCountGraph", static_cast<const BaseObject *>(member_count_graph_.get()));
    s.store_object_field("joinGraph", static_cast<const BaseObject *>(join_graph_.get()));
    s.store_object_field("muteGraph", static_cast<const BaseObject *>(mute_graph_.get()));
    s.store_object_field("viewCountByHourGraph", static_cast<const BaseObject *>(view_count_by_hour_graph_.get()));
    s.store_object_field("viewCountBySourceGraph", static_cast<const BaseObject *>(view_count_by_source_graph_.get()));
    s.store_object_field("joinBySourceGraph", static_cast<const BaseObject *>(join_by_source_graph_.get()));
    s.store_object_field("languageGraph", static_cast<const BaseObject *>(language_graph_.get()));
    s.store_object_field("messageInteractionGraph", static_cast<const BaseObject *>(message_interaction_graph_.get()));
    s.store_object_field("messageReactionGraph", static_cast<const BaseObject *>(message_reaction_graph_.get()));
    s.store_object_field("storyInteractionGraph", static_cast<const BaseObject *>(story_interaction_graph_.get()));
    s.store_object_field("storyReactionGraph", static_cast<const BaseObject *>(story_reaction_graph_.get()));
    s.store_object_field("instantViewInteractionGraph", static_cast<const BaseObject *>(instant_view_interaction_graph_.get()));
    { s.store_vector_begin("recentInteractions", recent_interactions_.size()); for (const auto &_value : recent_interactions_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

void chatStatisticsChannel::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatStatisticsChannel").c_str());
    period_fieldID = jni::get_field_id(env, Class, "period", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$DateRange;").c_str());
    member_count_fieldID = jni::get_field_id(env, Class, "memberCount", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalValue;").c_str());
    mean_message_view_count_fieldID = jni::get_field_id(env, Class, "meanMessageViewCount", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalValue;").c_str());
    mean_message_share_count_fieldID = jni::get_field_id(env, Class, "meanMessageShareCount", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalValue;").c_str());
    mean_message_reaction_count_fieldID = jni::get_field_id(env, Class, "meanMessageReactionCount", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalValue;").c_str());
    mean_story_view_count_fieldID = jni::get_field_id(env, Class, "meanStoryViewCount", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalValue;").c_str());
    mean_story_share_count_fieldID = jni::get_field_id(env, Class, "meanStoryShareCount", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalValue;").c_str());
    mean_story_reaction_count_fieldID = jni::get_field_id(env, Class, "meanStoryReactionCount", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalValue;").c_str());
    enabled_notifications_percentage_fieldID = jni::get_field_id(env, Class, "enabledNotificationsPercentage", "D");
    member_count_graph_fieldID = jni::get_field_id(env, Class, "memberCountGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    join_graph_fieldID = jni::get_field_id(env, Class, "joinGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    mute_graph_fieldID = jni::get_field_id(env, Class, "muteGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    view_count_by_hour_graph_fieldID = jni::get_field_id(env, Class, "viewCountByHourGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    view_count_by_source_graph_fieldID = jni::get_field_id(env, Class, "viewCountBySourceGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    join_by_source_graph_fieldID = jni::get_field_id(env, Class, "joinBySourceGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    language_graph_fieldID = jni::get_field_id(env, Class, "languageGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    message_interaction_graph_fieldID = jni::get_field_id(env, Class, "messageInteractionGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    message_reaction_graph_fieldID = jni::get_field_id(env, Class, "messageReactionGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    story_interaction_graph_fieldID = jni::get_field_id(env, Class, "storyInteractionGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    story_reaction_graph_fieldID = jni::get_field_id(env, Class, "storyReactionGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    instant_view_interaction_graph_fieldID = jni::get_field_id(env, Class, "instantViewInteractionGraph", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StatisticalGraph;").c_str());
    recent_interactions_fieldID = jni::get_field_id(env, Class, "recentInteractions", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$ChatStatisticsInteractionInfo;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass chatStatisticsInviterInfo::Class;
jfieldID chatStatisticsInviterInfo::user_id_fieldID;
jfieldID chatStatisticsInviterInfo::added_member_count_fieldID;

chatStatisticsInviterInfo::chatStatisticsInviterInfo()
  : user_id_()
  , added_member_count_()
{}

chatStatisticsInviterInfo::chatStatisticsInviterInfo(int53 user_id_, int32 added_member_count_)
  : user_id_(user_id_)
  , added_member_count_(added_member_count_)
{}

const std::int32_t chatStatisticsInviterInfo::ID;

object_ptr<chatStatisticsInviterInfo> chatStatisticsInviterInfo::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<chatStatisticsInviterInfo> res = make_object<chatStatisticsInviterInfo>();
  res->user_id_ = env->GetLongField(p, res->user_id_fieldID);
  res->added_member_count_ = env->GetIntField(p, res->added_member_count_fieldID);
  return res;
}

void chatStatisticsInviterInfo::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, user_id_fieldID, user_id_);
  env->SetIntField(s, added_member_count_fieldID, added_member_count_);
}

void chatStatisticsInviterInfo::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChatStatisticsInviterInfo");
    s.store_field("userId", user_id_);
    s.store_field("addedMemberCount", added_member_count_);
    s.store_class_end();
  }
}

void chatStatisticsInviterInfo::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChatStatisticsInviterInfo").c_str());
    user_id_fieldID = jni::get_field_id(env, Class, "userId", "J");
    added_member_count_fieldID = jni::get_field_id(env, Class, "addedMemberCount", "I");
    return true;
  }();
  (void)is_inited;
}

jclass dateRange::Class;
jfieldID dateRange::start_date_fieldID;
jfieldID dateRange::end_date_fieldID;

dateRange::dateRange()
  : start_date_()
  , end_date_()
{}

dateRange::dateRange(int32 start_date_, int32 end_date_)
  : start_date_(start_date_)
  , end_date_(end_date_)
{}

const std::int32_t dateRange::ID;

object_ptr<dateRange> dateRange::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<dateRange> res = make_object<dateRange>();
  res->start_date_ = env->GetIntField(p, res->start_date_fieldID);
  res->end_date_ = env->GetIntField(p, res->end_date_fieldID);
  return res;
}

void dateRange::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, start_date_fieldID, start_date_);
  env->SetIntField(s, end_date_fieldID, end_date_);
}

void dateRange::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "DateRange");
    s.store_field("startDate", start_date_);
    s.store_field("endDate", end_date_);
    s.store_class_end();
  }
}

void dateRange::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$DateRange").c_str());
    start_date_fieldID = jni::get_field_id(env, Class, "startDate", "I");
    end_date_fieldID = jni::get_field_id(env, Class, "endDate", "I");
    return true;
  }();
  (void)is_inited;
}

jclass DateTimeFormattingType::Class;

object_ptr<DateTimeFormattingType> DateTimeFormattingType::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case dateTimeFormattingTypeRelative::ID:
      return dateTimeFormattingTypeRelative::fetch(env, p);
    case dateTimeFormattingTypeAbsolute::ID:
      return dateTimeFormattingTypeAbsolute::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void DateTimeFormattingType::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$DateTimeFormattingType").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass dateTimeFormattingTypeRelative::Class;

dateTimeFormattingTypeRelative::dateTimeFormattingTypeRelative() {
}

const std::int32_t dateTimeFormattingTypeRelative::ID;

object_ptr<DateTimeFormattingType> dateTimeFormattingTypeRelative::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<dateTimeFormattingTypeRelative>();
}

void dateTimeFormattingTypeRelative::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void dateTimeFormattingTypeRelative::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "DateTimeFormattingTypeRelative");
    s.store_class_end();
  }
}

void dateTimeFormattingTypeRelative::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$DateTimeFormattingTypeRelative").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass dateTimeFormattingTypeAbsolute::Class;
jfieldID dateTimeFormattingTypeAbsolute::time_precision_fieldID;
jfieldID dateTimeFormattingTypeAbsolute::date_precision_fieldID;
jfieldID dateTimeFormattingTypeAbsolute::show_day_of_week_fieldID;

dateTimeFormattingTypeAbsolute::dateTimeFormattingTypeAbsolute()
  : time_precision_()
  , date_precision_()
  , show_day_of_week_()
{}

dateTimeFormattingTypeAbsolute::dateTimeFormattingTypeAbsolute(object_ptr<DateTimePartPrecision> &&time_precision_, object_ptr<DateTimePartPrecision> &&date_precision_, bool show_day_of_week_)
  : time_precision_(std::move(time_precision_))
  , date_precision_(std::move(date_precision_))
  , show_day_of_week_(show_day_of_week_)
{}

const std::int32_t dateTimeFormattingTypeAbsolute::ID;

object_ptr<DateTimeFormattingType> dateTimeFormattingTypeAbsolute::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<dateTimeFormattingTypeAbsolute> res = make_object<dateTimeFormattingTypeAbsolute>();
  res->time_precision_ = jni::fetch_tl_object<DateTimePartPrecision>(env, jni::fetch_object(env, p, res->time_precision_fieldID));
  res->date_precision_ = jni::fetch_tl_object<DateTimePartPrecision>(env, jni::fetch_object(env, p, res->date_precision_fieldID));
  res->show_day_of_week_ = (env->GetBooleanField(p, res->show_day_of_week_fieldID) != 0);
  return std::move(res);
}

void dateTimeFormattingTypeAbsolute::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (time_precision_ != nullptr) { jobject next; time_precision_->store(env, next); if (next) { env->SetObjectField(s, time_precision_fieldID, next); env->DeleteLocalRef(next); } }
  if (date_precision_ != nullptr) { jobject next; date_precision_->store(env, next); if (next) { env->SetObjectField(s, date_precision_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetBooleanField(s, show_day_of_week_fieldID, show_day_of_week_);
}

void dateTimeFormattingTypeAbsolute::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "DateTimeFormattingTypeAbsolute");
    s.store_object_field("timePrecision", static_cast<const BaseObject *>(time_precision_.get()));
    s.store_object_field("datePrecision", static_cast<const BaseObject *>(date_precision_.get()));
    s.store_field("showDayOfWeek", show_day_of_week_);
    s.store_class_end();
  }
}

void dateTimeFormattingTypeAbsolute::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$DateTimeFormattingTypeAbsolute").c_str());
    time_precision_fieldID = jni::get_field_id(env, Class, "timePrecision", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$DateTimePartPrecision;").c_str());
    date_precision_fieldID = jni::get_field_id(env, Class, "datePrecision", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$DateTimePartPrecision;").c_str());
    show_day_of_week_fieldID = jni::get_field_id(env, Class, "showDayOfWeek", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass EmailAddressAuthentication::Class;

object_ptr<EmailAddressAuthentication> EmailAddressAuthentication::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case emailAddressAuthenticationCode::ID:
      return emailAddressAuthenticationCode::fetch(env, p);
    case emailAddressAuthenticationAppleId::ID:
      return emailAddressAuthenticationAppleId::fetch(env, p);
    case emailAddressAuthenticationGoogleId::ID:
      return emailAddressAuthenticationGoogleId::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void EmailAddressAuthentication::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$EmailAddressAuthentication").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass emailAddressAuthenticationCode::Class;
jfieldID emailAddressAuthenticationCode::code_fieldID;

emailAddressAuthenticationCode::emailAddressAuthenticationCode()
  : code_()
{}

emailAddressAuthenticationCode::emailAddressAuthenticationCode(string const &code_)
  : code_(code_)
{}

const std::int32_t emailAddressAuthenticationCode::ID;

object_ptr<EmailAddressAuthentication> emailAddressAuthenticationCode::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<emailAddressAuthenticationCode> res = make_object<emailAddressAuthenticationCode>();
  res->code_ = jni::fetch_string(env, p, res->code_fieldID);
  return std::move(res);
}

void emailAddressAuthenticationCode::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "EmailAddressAuthenticationCode");
    s.store_field("code", code_);
    s.store_class_end();
  }
}

void emailAddressAuthenticationCode::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$EmailAddressAuthenticationCode").c_str());
    code_fieldID = jni::get_field_id(env, Class, "code", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass emailAddressAuthenticationAppleId::Class;
jfieldID emailAddressAuthenticationAppleId::token_fieldID;

emailAddressAuthenticationAppleId::emailAddressAuthenticationAppleId()
  : token_()
{}

emailAddressAuthenticationAppleId::emailAddressAuthenticationAppleId(string const &token_)
  : token_(token_)
{}

const std::int32_t emailAddressAuthenticationAppleId::ID;

object_ptr<EmailAddressAuthentication> emailAddressAuthenticationAppleId::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<emailAddressAuthenticationAppleId> res = make_object<emailAddressAuthenticationAppleId>();
  res->token_ = jni::fetch_string(env, p, res->token_fieldID);
  return std::move(res);
}

void emailAddressAuthenticationAppleId::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "EmailAddressAuthenticationAppleId");
    s.store_field("token", token_);
    s.store_class_end();
  }
}

void emailAddressAuthenticationAppleId::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$EmailAddressAuthenticationAppleId").c_str());
    token_fieldID = jni::get_field_id(env, Class, "token", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass emailAddressAuthenticationGoogleId::Class;
jfieldID emailAddressAuthenticationGoogleId::token_fieldID;

emailAddressAuthenticationGoogleId::emailAddressAuthenticationGoogleId()
  : token_()
{}

emailAddressAuthenticationGoogleId::emailAddressAuthenticationGoogleId(string const &token_)
  : token_(token_)
{}

const std::int32_t emailAddressAuthenticationGoogleId::ID;

object_ptr<EmailAddressAuthentication> emailAddressAuthenticationGoogleId::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<emailAddressAuthenticationGoogleId> res = make_object<emailAddressAuthenticationGoogleId>();
  res->token_ = jni::fetch_string(env, p, res->token_fieldID);
  return std::move(res);
}

void emailAddressAuthenticationGoogleId::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "EmailAddressAuthenticationGoogleId");
    s.store_field("token", token_);
    s.store_class_end();
  }
}

void emailAddressAuthenticationGoogleId::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$EmailAddressAuthenticationGoogleId").c_str());
    token_fieldID = jni::get_field_id(env, Class, "token", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass encryptedCredentials::Class;
jfieldID encryptedCredentials::data_fieldID;
jfieldID encryptedCredentials::hash_fieldID;
jfieldID encryptedCredentials::secret_fieldID;

encryptedCredentials::encryptedCredentials()
  : data_()
  , hash_()
  , secret_()
{}

encryptedCredentials::encryptedCredentials(bytes const &data_, bytes const &hash_, bytes const &secret_)
  : data_(std::move(data_))
  , hash_(std::move(hash_))
  , secret_(std::move(secret_))
{}

const std::int32_t encryptedCredentials::ID;

object_ptr<encryptedCredentials> encryptedCredentials::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<encryptedCredentials> res = make_object<encryptedCredentials>();
  res->data_ = jni::from_bytes(env, (jbyteArray)jni::fetch_object(env, p, res->data_fieldID));
  res->hash_ = jni::from_bytes(env, (jbyteArray)jni::fetch_object(env, p, res->hash_fieldID));
  res->secret_ = jni::from_bytes(env, (jbyteArray)jni::fetch_object(env, p, res->secret_fieldID));
  return res;
}

void encryptedCredentials::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jbyteArray nextBytes = jni::to_bytes(env, data_); if (nextBytes) { env->SetObjectField(s, data_fieldID, nextBytes); env->DeleteLocalRef(nextBytes); } }
  { jbyteArray nextBytes = jni::to_bytes(env, hash_); if (nextBytes) { env->SetObjectField(s, hash_fieldID, nextBytes); env->DeleteLocalRef(nextBytes); } }
  { jbyteArray nextBytes = jni::to_bytes(env, secret_); if (nextBytes) { env->SetObjectField(s, secret_fieldID, nextBytes); env->DeleteLocalRef(nextBytes); } }
}

void encryptedCredentials::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "EncryptedCredentials");
    s.store_bytes_field("data", data_);
    s.store_bytes_field("hash", hash_);
    s.store_bytes_field("secret", secret_);
    s.store_class_end();
  }
}

void encryptedCredentials::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$EncryptedCredentials").c_str());
    data_fieldID = jni::get_field_id(env, Class, "data", "[B");
    hash_fieldID = jni::get_field_id(env, Class, "hash", "[B");
    secret_fieldID = jni::get_field_id(env, Class, "secret", "[B");
    return true;
  }();
  (void)is_inited;
}

jclass encryptedPassportElement::Class;
jfieldID encryptedPassportElement::type_fieldID;
jfieldID encryptedPassportElement::data_fieldID;
jfieldID encryptedPassportElement::front_side_fieldID;
jfieldID encryptedPassportElement::reverse_side_fieldID;
jfieldID encryptedPassportElement::selfie_fieldID;
jfieldID encryptedPassportElement::translation_fieldID;
jfieldID encryptedPassportElement::files_fieldID;
jfieldID encryptedPassportElement::value_fieldID;
jfieldID encryptedPassportElement::hash_fieldID;

encryptedPassportElement::encryptedPassportElement()
  : type_()
  , data_()
  , front_side_()
  , reverse_side_()
  , selfie_()
  , translation_()
  , files_()
  , value_()
  , hash_()
{}

encryptedPassportElement::encryptedPassportElement(object_ptr<PassportElementType> &&type_, bytes const &data_, object_ptr<datedFile> &&front_side_, object_ptr<datedFile> &&reverse_side_, object_ptr<datedFile> &&selfie_, array<object_ptr<datedFile>> &&translation_, array<object_ptr<datedFile>> &&files_, string const &value_, string const &hash_)
  : type_(std::move(type_))
  , data_(std::move(data_))
  , front_side_(std::move(front_side_))
  , reverse_side_(std::move(reverse_side_))
  , selfie_(std::move(selfie_))
  , translation_(std::move(translation_))
  , files_(std::move(files_))
  , value_(value_)
  , hash_(hash_)
{}

const std::int32_t encryptedPassportElement::ID;

object_ptr<encryptedPassportElement> encryptedPassportElement::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<encryptedPassportElement> res = make_object<encryptedPassportElement>();
  res->type_ = jni::fetch_tl_object<PassportElementType>(env, jni::fetch_object(env, p, res->type_fieldID));
  res->data_ = jni::from_bytes(env, (jbyteArray)jni::fetch_object(env, p, res->data_fieldID));
  res->front_side_ = jni::fetch_tl_object<datedFile>(env, jni::fetch_object(env, p, res->front_side_fieldID));
  res->reverse_side_ = jni::fetch_tl_object<datedFile>(env, jni::fetch_object(env, p, res->reverse_side_fieldID));
  res->selfie_ = jni::fetch_tl_object<datedFile>(env, jni::fetch_object(env, p, res->selfie_fieldID));
  res->translation_ = jni::FetchVector<datedFile>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->translation_fieldID));
  res->files_ = jni::FetchVector<datedFile>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->files_fieldID));
  res->value_ = jni::fetch_string(env, p, res->value_fieldID);
  res->hash_ = jni::fetch_string(env, p, res->hash_fieldID);
  return res;
}

void encryptedPassportElement::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (type_ != nullptr) { jobject next; type_->store(env, next); if (next) { env->SetObjectField(s, type_fieldID, next); env->DeleteLocalRef(next); } }
  { jbyteArray nextBytes = jni::to_bytes(env, data_); if (nextBytes) { env->SetObjectField(s, data_fieldID, nextBytes); env->DeleteLocalRef(nextBytes); } }
  if (front_side_ != nullptr) { jobject next; front_side_->store(env, next); if (next) { env->SetObjectField(s, front_side_fieldID, next); env->DeleteLocalRef(next); } }
  if (reverse_side_ != nullptr) { jobject next; reverse_side_->store(env, next); if (next) { env->SetObjectField(s, reverse_side_fieldID, next); env->DeleteLocalRef(next); } }
  if (selfie_ != nullptr) { jobject next; selfie_->store(env, next); if (next) { env->SetObjectField(s, selfie_fieldID, next); env->DeleteLocalRef(next); } }
  { auto arr_tmp_ = jni::store_vector(env, translation_); if (arr_tmp_) { env->SetObjectField(s, translation_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  { auto arr_tmp_ = jni::store_vector(env, files_); if (arr_tmp_) { env->SetObjectField(s, files_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  { jstring nextString = jni::to_jstring(env, value_); if (nextString) { env->SetObjectField(s, value_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, hash_); if (nextString) { env->SetObjectField(s, hash_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void encryptedPassportElement::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "EncryptedPassportElement");
    s.store_object_field("type", static_cast<const BaseObject *>(type_.get()));
    s.store_bytes_field("data", data_);
    s.store_object_field("frontSide", static_cast<const BaseObject *>(front_side_.get()));
    s.store_object_field("reverseSide", static_cast<const BaseObject *>(reverse_side_.get()));
    s.store_object_field("selfie", static_cast<const BaseObject *>(selfie_.get()));
    { s.store_vector_begin("translation", translation_.size()); for (const auto &_value : translation_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    { s.store_vector_begin("files", files_.size()); for (const auto &_value : files_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_field("value", value_);
    s.store_field("hash", hash_);
    s.store_class_end();
  }
}

void encryptedPassportElement::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$EncryptedPassportElement").c_str());
    type_fieldID = jni::get_field_id(env, Class, "type", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$PassportElementType;").c_str());
    data_fieldID = jni::get_field_id(env, Class, "data", "[B");
    front_side_fieldID = jni::get_field_id(env, Class, "frontSide", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$DatedFile;").c_str());
    reverse_side_fieldID = jni::get_field_id(env, Class, "reverseSide", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$DatedFile;").c_str());
    selfie_fieldID = jni::get_field_id(env, Class, "selfie", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$DatedFile;").c_str());
    translation_fieldID = jni::get_field_id(env, Class, "translation", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$DatedFile;").c_str());
    files_fieldID = jni::get_field_id(env, Class, "files", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$DatedFile;").c_str());
    value_fieldID = jni::get_field_id(env, Class, "value", "Ljava/lang/String;");
    hash_fieldID = jni::get_field_id(env, Class, "hash", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass forumTopics::Class;
jfieldID forumTopics::total_count_fieldID;
jfieldID forumTopics::topics_fieldID;
jfieldID forumTopics::next_offset_date_fieldID;
jfieldID forumTopics::next_offset_message_id_fieldID;
jfieldID forumTopics::next_offset_forum_topic_id_fieldID;

forumTopics::forumTopics()
  : total_count_()
  , topics_()
  , next_offset_date_()
  , next_offset_message_id_()
  , next_offset_forum_topic_id_()
{}

forumTopics::forumTopics(int32 total_count_, array<object_ptr<forumTopic>> &&topics_, int32 next_offset_date_, int53 next_offset_message_id_, int32 next_offset_forum_topic_id_)
  : total_count_(total_count_)
  , topics_(std::move(topics_))
  , next_offset_date_(next_offset_date_)
  , next_offset_message_id_(next_offset_message_id_)
  , next_offset_forum_topic_id_(next_offset_forum_topic_id_)
{}

const std::int32_t forumTopics::ID;

object_ptr<forumTopics> forumTopics::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<forumTopics> res = make_object<forumTopics>();
  res->total_count_ = env->GetIntField(p, res->total_count_fieldID);
  res->topics_ = jni::FetchVector<forumTopic>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->topics_fieldID));
  res->next_offset_date_ = env->GetIntField(p, res->next_offset_date_fieldID);
  res->next_offset_message_id_ = env->GetLongField(p, res->next_offset_message_id_fieldID);
  res->next_offset_forum_topic_id_ = env->GetIntField(p, res->next_offset_forum_topic_id_fieldID);
  return res;
}

void forumTopics::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, total_count_fieldID, total_count_);
  { auto arr_tmp_ = jni::store_vector(env, topics_); if (arr_tmp_) { env->SetObjectField(s, topics_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  env->SetIntField(s, next_offset_date_fieldID, next_offset_date_);
  env->SetLongField(s, next_offset_message_id_fieldID, next_offset_message_id_);
  env->SetIntField(s, next_offset_forum_topic_id_fieldID, next_offset_forum_topic_id_);
}

void forumTopics::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ForumTopics");
    s.store_field("totalCount", total_count_);
    { s.store_vector_begin("topics", topics_.size()); for (const auto &_value : topics_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_field("nextOffsetDate", next_offset_date_);
    s.store_field("nextOffsetMessageId", next_offset_message_id_);
    s.store_field("nextOffsetForumTopicId", next_offset_forum_topic_id_);
    s.store_class_end();
  }
}

void forumTopics::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ForumTopics").c_str());
    total_count_fieldID = jni::get_field_id(env, Class, "totalCount", "I");
    topics_fieldID = jni::get_field_id(env, Class, "topics", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$ForumTopic;").c_str());
    next_offset_date_fieldID = jni::get_field_id(env, Class, "nextOffsetDate", "I");
    next_offset_message_id_fieldID = jni::get_field_id(env, Class, "nextOffsetMessageId", "J");
    next_offset_forum_topic_id_fieldID = jni::get_field_id(env, Class, "nextOffsetForumTopicId", "I");
    return true;
  }();
  (void)is_inited;
}

jclass forwardSource::Class;
jfieldID forwardSource::chat_id_fieldID;
jfieldID forwardSource::message_id_fieldID;
jfieldID forwardSource::sender_id_fieldID;
jfieldID forwardSource::sender_name_fieldID;
jfieldID forwardSource::date_fieldID;
jfieldID forwardSource::is_outgoing_fieldID;

forwardSource::forwardSource()
  : chat_id_()
  , message_id_()
  , sender_id_()
  , sender_name_()
  , date_()
  , is_outgoing_()
{}

forwardSource::forwardSource(int53 chat_id_, int53 message_id_, object_ptr<MessageSender> &&sender_id_, string const &sender_name_, int32 date_, bool is_outgoing_)
  : chat_id_(chat_id_)
  , message_id_(message_id_)
  , sender_id_(std::move(sender_id_))
  , sender_name_(sender_name_)
  , date_(date_)
  , is_outgoing_(is_outgoing_)
{}

const std::int32_t forwardSource::ID;

object_ptr<forwardSource> forwardSource::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<forwardSource> res = make_object<forwardSource>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  res->sender_id_ = jni::fetch_tl_object<MessageSender>(env, jni::fetch_object(env, p, res->sender_id_fieldID));
  res->sender_name_ = jni::fetch_string(env, p, res->sender_name_fieldID);
  res->date_ = env->GetIntField(p, res->date_fieldID);
  res->is_outgoing_ = (env->GetBooleanField(p, res->is_outgoing_fieldID) != 0);
  return res;
}

void forwardSource::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, chat_id_fieldID, chat_id_);
  env->SetLongField(s, message_id_fieldID, message_id_);
  if (sender_id_ != nullptr) { jobject next; sender_id_->store(env, next); if (next) { env->SetObjectField(s, sender_id_fieldID, next); env->DeleteLocalRef(next); } }
  { jstring nextString = jni::to_jstring(env, sender_name_); if (nextString) { env->SetObjectField(s, sender_name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetIntField(s, date_fieldID, date_);
  env->SetBooleanField(s, is_outgoing_fieldID, is_outgoing_);
}

void forwardSource::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ForwardSource");
    s.store_field("chatId", chat_id_);
    s.store_field("messageId", message_id_);
    s.store_object_field("senderId", static_cast<const BaseObject *>(sender_id_.get()));
    s.store_field("senderName", sender_name_);
    s.store_field("date", date_);
    s.store_field("isOutgoing", is_outgoing_);
    s.store_class_end();
  }
}

void forwardSource::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ForwardSource").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    sender_id_fieldID = jni::get_field_id(env, Class, "senderId", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$MessageSender;").c_str());
    sender_name_fieldID = jni::get_field_id(env, Class, "senderName", "Ljava/lang/String;");
    date_fieldID = jni::get_field_id(env, Class, "date", "I");
    is_outgoing_fieldID = jni::get_field_id(env, Class, "isOutgoing", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass foundPublicPosts::Class;
jfieldID foundPublicPosts::messages_fieldID;
jfieldID foundPublicPosts::next_offset_fieldID;
jfieldID foundPublicPosts::search_limits_fieldID;
jfieldID foundPublicPosts::are_limits_exceeded_fieldID;

foundPublicPosts::foundPublicPosts()
  : messages_()
  , next_offset_()
  , search_limits_()
  , are_limits_exceeded_()
{}

foundPublicPosts::foundPublicPosts(array<object_ptr<message>> &&messages_, string const &next_offset_, object_ptr<publicPostSearchLimits> &&search_limits_, bool are_limits_exceeded_)
  : messages_(std::move(messages_))
  , next_offset_(next_offset_)
  , search_limits_(std::move(search_limits_))
  , are_limits_exceeded_(are_limits_exceeded_)
{}

const std::int32_t foundPublicPosts::ID;

object_ptr<foundPublicPosts> foundPublicPosts::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<foundPublicPosts> res = make_object<foundPublicPosts>();
  res->messages_ = jni::FetchVector<message>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->messages_fieldID));
  res->next_offset_ = jni::fetch_string(env, p, res->next_offset_fieldID);
  res->search_limits_ = jni::fetch_tl_object<publicPostSearchLimits>(env, jni::fetch_object(env, p, res->search_limits_fieldID));
  res->are_limits_exceeded_ = (env->GetBooleanField(p, res->are_limits_exceeded_fieldID) != 0);
  return res;
}

void foundPublicPosts::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { auto arr_tmp_ = jni::store_vector(env, messages_); if (arr_tmp_) { env->SetObjectField(s, messages_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  { jstring nextString = jni::to_jstring(env, next_offset_); if (nextString) { env->SetObjectField(s, next_offset_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  if (search_limits_ != nullptr) { jobject next; search_limits_->store(env, next); if (next) { env->SetObjectField(s, search_limits_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetBooleanField(s, are_limits_exceeded_fieldID, are_limits_exceeded_);
}

void foundPublicPosts::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "FoundPublicPosts");
    { s.store_vector_begin("messages", messages_.size()); for (const auto &_value : messages_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_field("nextOffset", next_offset_);
    s.store_object_field("searchLimits", static_cast<const BaseObject *>(search_limits_.get()));
    s.store_field("areLimitsExceeded", are_limits_exceeded_);
    s.store_class_end();
  }
}

void foundPublicPosts::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$FoundPublicPosts").c_str());
    messages_fieldID = jni::get_field_id(env, Class, "messages", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$Message;").c_str());
    next_offset_fieldID = jni::get_field_id(env, Class, "nextOffset", "Ljava/lang/String;");
    search_limits_fieldID = jni::get_field_id(env, Class, "searchLimits", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$PublicPostSearchLimits;").c_str());
    are_limits_exceeded_fieldID = jni::get_field_id(env, Class, "areLimitsExceeded", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass foundStories::Class;
jfieldID foundStories::total_count_fieldID;
jfieldID foundStories::stories_fieldID;
jfieldID foundStories::next_offset_fieldID;

foundStories::foundStories()
  : total_count_()
  , stories_()
  , next_offset_()
{}

foundStories::foundStories(int32 total_count_, array<object_ptr<story>> &&stories_, string const &next_offset_)
  : total_count_(total_count_)
  , stories_(std::move(stories_))
  , next_offset_(next_offset_)
{}

const std::int32_t foundStories::ID;

object_ptr<foundStories> foundStories::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<foundStories> res = make_object<foundStories>();
  res->total_count_ = env->GetIntField(p, res->total_count_fieldID);
  res->stories_ = jni::FetchVector<story>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->stories_fieldID));
  res->next_offset_ = jni::fetch_string(env, p, res->next_offset_fieldID);
  return res;
}

void foundStories::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, total_count_fieldID, total_count_);
  { auto arr_tmp_ = jni::store_vector(env, stories_); if (arr_tmp_) { env->SetObjectField(s, stories_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  { jstring nextString = jni::to_jstring(env, next_offset_); if (nextString) { env->SetObjectField(s, next_offset_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void foundStories::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "FoundStories");
    s.store_field("totalCount", total_count_);
    { s.store_vector_begin("stories", stories_.size()); for (const auto &_value : stories_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_field("nextOffset", next_offset_);
    s.store_class_end();
  }
}

void foundStories::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$FoundStories").c_str());
    total_count_fieldID = jni::get_field_id(env, Class, "totalCount", "I");
    stories_fieldID = jni::get_field_id(env, Class, "stories", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$Story;").c_str());
    next_offset_fieldID = jni::get_field_id(env, Class, "nextOffset", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass gameHighScores::Class;
jfieldID gameHighScores::scores_fieldID;

gameHighScores::gameHighScores()
  : scores_()
{}

gameHighScores::gameHighScores(array<object_ptr<gameHighScore>> &&scores_)
  : scores_(std::move(scores_))
{}

const std::int32_t gameHighScores::ID;

object_ptr<gameHighScores> gameHighScores::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<gameHighScores> res = make_object<gameHighScores>();
  res->scores_ = jni::FetchVector<gameHighScore>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->scores_fieldID));
  return res;
}

void gameHighScores::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { auto arr_tmp_ = jni::store_vector(env, scores_); if (arr_tmp_) { env->SetObjectField(s, scores_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void gameHighScores::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GameHighScores");
    { s.store_vector_begin("scores", scores_.size()); for (const auto &_value : scores_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

void gameHighScores::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GameHighScores").c_str());
    scores_fieldID = jni::get_field_id(env, Class, "scores", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$GameHighScore;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass giftBackground::Class;
jfieldID giftBackground::center_color_fieldID;
jfieldID giftBackground::edge_color_fieldID;
jfieldID giftBackground::text_color_fieldID;

giftBackground::giftBackground()
  : center_color_()
  , edge_color_()
  , text_color_()
{}

giftBackground::giftBackground(int32 center_color_, int32 edge_color_, int32 text_color_)
  : center_color_(center_color_)
  , edge_color_(edge_color_)
  , text_color_(text_color_)
{}

const std::int32_t giftBackground::ID;

object_ptr<giftBackground> giftBackground::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<giftBackground> res = make_object<giftBackground>();
  res->center_color_ = env->GetIntField(p, res->center_color_fieldID);
  res->edge_color_ = env->GetIntField(p, res->edge_color_fieldID);
  res->text_color_ = env->GetIntField(p, res->text_color_fieldID);
  return res;
}

void giftBackground::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, center_color_fieldID, center_color_);
  env->SetIntField(s, edge_color_fieldID, edge_color_);
  env->SetIntField(s, text_color_fieldID, text_color_);
}

void giftBackground::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GiftBackground");
    s.store_field("centerColor", center_color_);
    s.store_field("edgeColor", edge_color_);
    s.store_field("textColor", text_color_);
    s.store_class_end();
  }
}

void giftBackground::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GiftBackground").c_str());
    center_color_fieldID = jni::get_field_id(env, Class, "centerColor", "I");
    edge_color_fieldID = jni::get_field_id(env, Class, "edgeColor", "I");
    text_color_fieldID = jni::get_field_id(env, Class, "textColor", "I");
    return true;
  }();
  (void)is_inited;
}

jclass GiftResaleResult::Class;

object_ptr<GiftResaleResult> GiftResaleResult::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case giftResaleResultOk::ID:
      return giftResaleResultOk::fetch(env, p);
    case giftResaleResultPriceIncreased::ID:
      return giftResaleResultPriceIncreased::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void GiftResaleResult::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GiftResaleResult").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass giftResaleResultOk::Class;
jfieldID giftResaleResultOk::received_gift_id_fieldID;

giftResaleResultOk::giftResaleResultOk()
  : received_gift_id_()
{}

giftResaleResultOk::giftResaleResultOk(string const &received_gift_id_)
  : received_gift_id_(received_gift_id_)
{}

const std::int32_t giftResaleResultOk::ID;

object_ptr<GiftResaleResult> giftResaleResultOk::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<giftResaleResultOk> res = make_object<giftResaleResultOk>();
  res->received_gift_id_ = jni::fetch_string(env, p, res->received_gift_id_fieldID);
  return std::move(res);
}

void giftResaleResultOk::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, received_gift_id_); if (nextString) { env->SetObjectField(s, received_gift_id_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void giftResaleResultOk::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GiftResaleResultOk");
    s.store_field("receivedGiftId", received_gift_id_);
    s.store_class_end();
  }
}

void giftResaleResultOk::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GiftResaleResultOk").c_str());
    received_gift_id_fieldID = jni::get_field_id(env, Class, "receivedGiftId", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass giftResaleResultPriceIncreased::Class;
jfieldID giftResaleResultPriceIncreased::price_fieldID;

giftResaleResultPriceIncreased::giftResaleResultPriceIncreased()
  : price_()
{}

giftResaleResultPriceIncreased::giftResaleResultPriceIncreased(object_ptr<GiftResalePrice> &&price_)
  : price_(std::move(price_))
{}

const std::int32_t giftResaleResultPriceIncreased::ID;

object_ptr<GiftResaleResult> giftResaleResultPriceIncreased::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<giftResaleResultPriceIncreased> res = make_object<giftResaleResultPriceIncreased>();
  res->price_ = jni::fetch_tl_object<GiftResalePrice>(env, jni::fetch_object(env, p, res->price_fieldID));
  return std::move(res);
}

void giftResaleResultPriceIncreased::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (price_ != nullptr) { jobject next; price_->store(env, next); if (next) { env->SetObjectField(s, price_fieldID, next); env->DeleteLocalRef(next); } }
}

void giftResaleResultPriceIncreased::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GiftResaleResultPriceIncreased");
    s.store_object_field("price", static_cast<const BaseObject *>(price_.get()));
    s.store_class_end();
  }
}

void giftResaleResultPriceIncreased::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GiftResaleResultPriceIncreased").c_str());
    price_fieldID = jni::get_field_id(env, Class, "price", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$GiftResalePrice;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass groupCallParticipants::Class;
jfieldID groupCallParticipants::total_count_fieldID;
jfieldID groupCallParticipants::participant_ids_fieldID;

groupCallParticipants::groupCallParticipants()
  : total_count_()
  , participant_ids_()
{}

groupCallParticipants::groupCallParticipants(int32 total_count_, array<object_ptr<MessageSender>> &&participant_ids_)
  : total_count_(total_count_)
  , participant_ids_(std::move(participant_ids_))
{}

const std::int32_t groupCallParticipants::ID;

object_ptr<groupCallParticipants> groupCallParticipants::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<groupCallParticipants> res = make_object<groupCallParticipants>();
  res->total_count_ = env->GetIntField(p, res->total_count_fieldID);
  res->participant_ids_ = jni::FetchVector<MessageSender>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->participant_ids_fieldID));
  return res;
}

void groupCallParticipants::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, total_count_fieldID, total_count_);
  { auto arr_tmp_ = jni::store_vector(env, participant_ids_); if (arr_tmp_) { env->SetObjectField(s, participant_ids_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void groupCallParticipants::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GroupCallParticipants");
    s.store_field("totalCount", total_count_);
    { s.store_vector_begin("participantIds", participant_ids_.size()); for (const auto &_value : participant_ids_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

void groupCallParticipants::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GroupCallParticipants").c_str());
    total_count_fieldID = jni::get_field_id(env, Class, "totalCount", "I");
    participant_ids_fieldID = jni::get_field_id(env, Class, "participantIds", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$MessageSender;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inlineKeyboardButton::Class;
jfieldID inlineKeyboardButton::text_fieldID;
jfieldID inlineKeyboardButton::icon_custom_emoji_id_fieldID;
jfieldID inlineKeyboardButton::style_fieldID;
jfieldID inlineKeyboardButton::type_fieldID;

inlineKeyboardButton::inlineKeyboardButton()
  : text_()
  , icon_custom_emoji_id_()
  , style_()
  , type_()
{}

inlineKeyboardButton::inlineKeyboardButton(string const &text_, int64 icon_custom_emoji_id_, object_ptr<ButtonStyle> &&style_, object_ptr<InlineKeyboardButtonType> &&type_)
  : text_(text_)
  , icon_custom_emoji_id_(icon_custom_emoji_id_)
  , style_(std::move(style_))
  , type_(std::move(type_))
{}

const std::int32_t inlineKeyboardButton::ID;

object_ptr<inlineKeyboardButton> inlineKeyboardButton::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inlineKeyboardButton> res = make_object<inlineKeyboardButton>();
  res->text_ = jni::fetch_string(env, p, res->text_fieldID);
  res->icon_custom_emoji_id_ = env->GetLongField(p, res->icon_custom_emoji_id_fieldID);
  res->style_ = jni::fetch_tl_object<ButtonStyle>(env, jni::fetch_object(env, p, res->style_fieldID));
  res->type_ = jni::fetch_tl_object<InlineKeyboardButtonType>(env, jni::fetch_object(env, p, res->type_fieldID));
  return res;
}

void inlineKeyboardButton::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, text_); if (nextString) { env->SetObjectField(s, text_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetLongField(s, icon_custom_emoji_id_fieldID, icon_custom_emoji_id_);
  if (style_ != nullptr) { jobject next; style_->store(env, next); if (next) { env->SetObjectField(s, style_fieldID, next); env->DeleteLocalRef(next); } }
  if (type_ != nullptr) { jobject next; type_->store(env, next); if (next) { env->SetObjectField(s, type_fieldID, next); env->DeleteLocalRef(next); } }
}

void inlineKeyboardButton::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InlineKeyboardButton");
    s.store_field("text", text_);
    s.store_field("iconCustomEmojiId", icon_custom_emoji_id_);
    s.store_object_field("style", static_cast<const BaseObject *>(style_.get()));
    s.store_object_field("type", static_cast<const BaseObject *>(type_.get()));
    s.store_class_end();
  }
}

void inlineKeyboardButton::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InlineKeyboardButton").c_str());
    text_fieldID = jni::get_field_id(env, Class, "text", "Ljava/lang/String;");
    icon_custom_emoji_id_fieldID = jni::get_field_id(env, Class, "iconCustomEmojiId", "J");
    style_fieldID = jni::get_field_id(env, Class, "style", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ButtonStyle;").c_str());
    type_fieldID = jni::get_field_id(env, Class, "type", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InlineKeyboardButtonType;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass InputChatPhoto::Class;

object_ptr<InputChatPhoto> InputChatPhoto::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case inputChatPhotoPrevious::ID:
      return inputChatPhotoPrevious::fetch(env, p);
    case inputChatPhotoStatic::ID:
      return inputChatPhotoStatic::fetch(env, p);
    case inputChatPhotoAnimation::ID:
      return inputChatPhotoAnimation::fetch(env, p);
    case inputChatPhotoSticker::ID:
      return inputChatPhotoSticker::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void InputChatPhoto::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputChatPhoto").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputChatPhotoPrevious::Class;
jfieldID inputChatPhotoPrevious::chat_photo_id_fieldID;

inputChatPhotoPrevious::inputChatPhotoPrevious()
  : chat_photo_id_()
{}

inputChatPhotoPrevious::inputChatPhotoPrevious(int64 chat_photo_id_)
  : chat_photo_id_(chat_photo_id_)
{}

const std::int32_t inputChatPhotoPrevious::ID;

object_ptr<InputChatPhoto> inputChatPhotoPrevious::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputChatPhotoPrevious> res = make_object<inputChatPhotoPrevious>();
  res->chat_photo_id_ = env->GetLongField(p, res->chat_photo_id_fieldID);
  return std::move(res);
}

void inputChatPhotoPrevious::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputChatPhotoPrevious");
    s.store_field("chatPhotoId", chat_photo_id_);
    s.store_class_end();
  }
}

void inputChatPhotoPrevious::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputChatPhotoPrevious").c_str());
    chat_photo_id_fieldID = jni::get_field_id(env, Class, "chatPhotoId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass inputChatPhotoStatic::Class;
jfieldID inputChatPhotoStatic::photo_fieldID;

inputChatPhotoStatic::inputChatPhotoStatic()
  : photo_()
{}

inputChatPhotoStatic::inputChatPhotoStatic(object_ptr<InputFile> &&photo_)
  : photo_(std::move(photo_))
{}

const std::int32_t inputChatPhotoStatic::ID;

object_ptr<InputChatPhoto> inputChatPhotoStatic::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputChatPhotoStatic> res = make_object<inputChatPhotoStatic>();
  res->photo_ = jni::fetch_tl_object<InputFile>(env, jni::fetch_object(env, p, res->photo_fieldID));
  return std::move(res);
}

void inputChatPhotoStatic::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputChatPhotoStatic");
    s.store_object_field("photo", static_cast<const BaseObject *>(photo_.get()));
    s.store_class_end();
  }
}

void inputChatPhotoStatic::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputChatPhotoStatic").c_str());
    photo_fieldID = jni::get_field_id(env, Class, "photo", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputFile;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputChatPhotoAnimation::Class;
jfieldID inputChatPhotoAnimation::animation_fieldID;
jfieldID inputChatPhotoAnimation::main_frame_timestamp_fieldID;

inputChatPhotoAnimation::inputChatPhotoAnimation()
  : animation_()
  , main_frame_timestamp_()
{}

inputChatPhotoAnimation::inputChatPhotoAnimation(object_ptr<InputFile> &&animation_, double main_frame_timestamp_)
  : animation_(std::move(animation_))
  , main_frame_timestamp_(main_frame_timestamp_)
{}

const std::int32_t inputChatPhotoAnimation::ID;

object_ptr<InputChatPhoto> inputChatPhotoAnimation::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputChatPhotoAnimation> res = make_object<inputChatPhotoAnimation>();
  res->animation_ = jni::fetch_tl_object<InputFile>(env, jni::fetch_object(env, p, res->animation_fieldID));
  res->main_frame_timestamp_ = env->GetDoubleField(p, res->main_frame_timestamp_fieldID);
  return std::move(res);
}

void inputChatPhotoAnimation::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputChatPhotoAnimation");
    s.store_object_field("animation", static_cast<const BaseObject *>(animation_.get()));
    s.store_field("mainFrameTimestamp", main_frame_timestamp_);
    s.store_class_end();
  }
}

void inputChatPhotoAnimation::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputChatPhotoAnimation").c_str());
    animation_fieldID = jni::get_field_id(env, Class, "animation", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputFile;").c_str());
    main_frame_timestamp_fieldID = jni::get_field_id(env, Class, "mainFrameTimestamp", "D");
    return true;
  }();
  (void)is_inited;
}

jclass inputChatPhotoSticker::Class;
jfieldID inputChatPhotoSticker::sticker_fieldID;

inputChatPhotoSticker::inputChatPhotoSticker()
  : sticker_()
{}

inputChatPhotoSticker::inputChatPhotoSticker(object_ptr<chatPhotoSticker> &&sticker_)
  : sticker_(std::move(sticker_))
{}

const std::int32_t inputChatPhotoSticker::ID;

object_ptr<InputChatPhoto> inputChatPhotoSticker::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputChatPhotoSticker> res = make_object<inputChatPhotoSticker>();
  res->sticker_ = jni::fetch_tl_object<chatPhotoSticker>(env, jni::fetch_object(env, p, res->sticker_fieldID));
  return std::move(res);
}

void inputChatPhotoSticker::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputChatPhotoSticker");
    s.store_object_field("sticker", static_cast<const BaseObject *>(sticker_.get()));
    s.store_class_end();
  }
}

void inputChatPhotoSticker::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputChatPhotoSticker").c_str());
    sticker_fieldID = jni::get_field_id(env, Class, "sticker", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ChatPhotoSticker;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputChecklist::Class;
jfieldID inputChecklist::title_fieldID;
jfieldID inputChecklist::tasks_fieldID;
jfieldID inputChecklist::others_can_add_tasks_fieldID;
jfieldID inputChecklist::others_can_mark_tasks_as_done_fieldID;

inputChecklist::inputChecklist()
  : title_()
  , tasks_()
  , others_can_add_tasks_()
  , others_can_mark_tasks_as_done_()
{}

inputChecklist::inputChecklist(object_ptr<formattedText> &&title_, array<object_ptr<inputChecklistTask>> &&tasks_, bool others_can_add_tasks_, bool others_can_mark_tasks_as_done_)
  : title_(std::move(title_))
  , tasks_(std::move(tasks_))
  , others_can_add_tasks_(others_can_add_tasks_)
  , others_can_mark_tasks_as_done_(others_can_mark_tasks_as_done_)
{}

const std::int32_t inputChecklist::ID;

object_ptr<inputChecklist> inputChecklist::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputChecklist> res = make_object<inputChecklist>();
  res->title_ = jni::fetch_tl_object<formattedText>(env, jni::fetch_object(env, p, res->title_fieldID));
  res->tasks_ = jni::FetchVector<inputChecklistTask>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->tasks_fieldID));
  res->others_can_add_tasks_ = (env->GetBooleanField(p, res->others_can_add_tasks_fieldID) != 0);
  res->others_can_mark_tasks_as_done_ = (env->GetBooleanField(p, res->others_can_mark_tasks_as_done_fieldID) != 0);
  return res;
}

void inputChecklist::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (title_ != nullptr) { jobject next; title_->store(env, next); if (next) { env->SetObjectField(s, title_fieldID, next); env->DeleteLocalRef(next); } }
  { auto arr_tmp_ = jni::store_vector(env, tasks_); if (arr_tmp_) { env->SetObjectField(s, tasks_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  env->SetBooleanField(s, others_can_add_tasks_fieldID, others_can_add_tasks_);
  env->SetBooleanField(s, others_can_mark_tasks_as_done_fieldID, others_can_mark_tasks_as_done_);
}

void inputChecklist::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputChecklist");
    s.store_object_field("title", static_cast<const BaseObject *>(title_.get()));
    { s.store_vector_begin("tasks", tasks_.size()); for (const auto &_value : tasks_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_field("othersCanAddTasks", others_can_add_tasks_);
    s.store_field("othersCanMarkTasksAsDone", others_can_mark_tasks_as_done_);
    s.store_class_end();
  }
}

void inputChecklist::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputChecklist").c_str());
    title_fieldID = jni::get_field_id(env, Class, "title", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$FormattedText;").c_str());
    tasks_fieldID = jni::get_field_id(env, Class, "tasks", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$InputChecklistTask;").c_str());
    others_can_add_tasks_fieldID = jni::get_field_id(env, Class, "othersCanAddTasks", "Z");
    others_can_mark_tasks_as_done_fieldID = jni::get_field_id(env, Class, "othersCanMarkTasksAsDone", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass InputInlineQueryResult::Class;

object_ptr<InputInlineQueryResult> InputInlineQueryResult::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case inputInlineQueryResultAnimation::ID:
      return inputInlineQueryResultAnimation::fetch(env, p);
    case inputInlineQueryResultArticle::ID:
      return inputInlineQueryResultArticle::fetch(env, p);
    case inputInlineQueryResultAudio::ID:
      return inputInlineQueryResultAudio::fetch(env, p);
    case inputInlineQueryResultContact::ID:
      return inputInlineQueryResultContact::fetch(env, p);
    case inputInlineQueryResultDocument::ID:
      return inputInlineQueryResultDocument::fetch(env, p);
    case inputInlineQueryResultGame::ID:
      return inputInlineQueryResultGame::fetch(env, p);
    case inputInlineQueryResultLocation::ID:
      return inputInlineQueryResultLocation::fetch(env, p);
    case inputInlineQueryResultPhoto::ID:
      return inputInlineQueryResultPhoto::fetch(env, p);
    case inputInlineQueryResultSticker::ID:
      return inputInlineQueryResultSticker::fetch(env, p);
    case inputInlineQueryResultVenue::ID:
      return inputInlineQueryResultVenue::fetch(env, p);
    case inputInlineQueryResultVideo::ID:
      return inputInlineQueryResultVideo::fetch(env, p);
    case inputInlineQueryResultVoiceNote::ID:
      return inputInlineQueryResultVoiceNote::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void InputInlineQueryResult::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResult").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputInlineQueryResultAnimation::Class;
jfieldID inputInlineQueryResultAnimation::id_fieldID;
jfieldID inputInlineQueryResultAnimation::title_fieldID;
jfieldID inputInlineQueryResultAnimation::thumbnail_url_fieldID;
jfieldID inputInlineQueryResultAnimation::thumbnail_mime_type_fieldID;
jfieldID inputInlineQueryResultAnimation::video_url_fieldID;
jfieldID inputInlineQueryResultAnimation::video_mime_type_fieldID;
jfieldID inputInlineQueryResultAnimation::video_duration_fieldID;
jfieldID inputInlineQueryResultAnimation::video_width_fieldID;
jfieldID inputInlineQueryResultAnimation::video_height_fieldID;
jfieldID inputInlineQueryResultAnimation::reply_markup_fieldID;
jfieldID inputInlineQueryResultAnimation::input_message_content_fieldID;

inputInlineQueryResultAnimation::inputInlineQueryResultAnimation()
  : id_()
  , title_()
  , thumbnail_url_()
  , thumbnail_mime_type_()
  , video_url_()
  , video_mime_type_()
  , video_duration_()
  , video_width_()
  , video_height_()
  , reply_markup_()
  , input_message_content_()
{}

inputInlineQueryResultAnimation::inputInlineQueryResultAnimation(string const &id_, string const &title_, string const &thumbnail_url_, string const &thumbnail_mime_type_, string const &video_url_, string const &video_mime_type_, int32 video_duration_, int32 video_width_, int32 video_height_, object_ptr<ReplyMarkup> &&reply_markup_, object_ptr<InputMessageContent> &&input_message_content_)
  : id_(id_)
  , title_(title_)
  , thumbnail_url_(thumbnail_url_)
  , thumbnail_mime_type_(thumbnail_mime_type_)
  , video_url_(video_url_)
  , video_mime_type_(video_mime_type_)
  , video_duration_(video_duration_)
  , video_width_(video_width_)
  , video_height_(video_height_)
  , reply_markup_(std::move(reply_markup_))
  , input_message_content_(std::move(input_message_content_))
{}

const std::int32_t inputInlineQueryResultAnimation::ID;

object_ptr<InputInlineQueryResult> inputInlineQueryResultAnimation::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputInlineQueryResultAnimation> res = make_object<inputInlineQueryResultAnimation>();
  res->id_ = jni::fetch_string(env, p, res->id_fieldID);
  res->title_ = jni::fetch_string(env, p, res->title_fieldID);
  res->thumbnail_url_ = jni::fetch_string(env, p, res->thumbnail_url_fieldID);
  res->thumbnail_mime_type_ = jni::fetch_string(env, p, res->thumbnail_mime_type_fieldID);
  res->video_url_ = jni::fetch_string(env, p, res->video_url_fieldID);
  res->video_mime_type_ = jni::fetch_string(env, p, res->video_mime_type_fieldID);
  res->video_duration_ = env->GetIntField(p, res->video_duration_fieldID);
  res->video_width_ = env->GetIntField(p, res->video_width_fieldID);
  res->video_height_ = env->GetIntField(p, res->video_height_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  res->input_message_content_ = jni::fetch_tl_object<InputMessageContent>(env, jni::fetch_object(env, p, res->input_message_content_fieldID));
  return std::move(res);
}

void inputInlineQueryResultAnimation::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputInlineQueryResultAnimation");
    s.store_field("id", id_);
    s.store_field("title", title_);
    s.store_field("thumbnailUrl", thumbnail_url_);
    s.store_field("thumbnailMimeType", thumbnail_mime_type_);
    s.store_field("videoUrl", video_url_);
    s.store_field("videoMimeType", video_mime_type_);
    s.store_field("videoDuration", video_duration_);
    s.store_field("videoWidth", video_width_);
    s.store_field("videoHeight", video_height_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_object_field("inputMessageContent", static_cast<const BaseObject *>(input_message_content_.get()));
    s.store_class_end();
  }
}

void inputInlineQueryResultAnimation::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResultAnimation").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "Ljava/lang/String;");
    title_fieldID = jni::get_field_id(env, Class, "title", "Ljava/lang/String;");
    thumbnail_url_fieldID = jni::get_field_id(env, Class, "thumbnailUrl", "Ljava/lang/String;");
    thumbnail_mime_type_fieldID = jni::get_field_id(env, Class, "thumbnailMimeType", "Ljava/lang/String;");
    video_url_fieldID = jni::get_field_id(env, Class, "videoUrl", "Ljava/lang/String;");
    video_mime_type_fieldID = jni::get_field_id(env, Class, "videoMimeType", "Ljava/lang/String;");
    video_duration_fieldID = jni::get_field_id(env, Class, "videoDuration", "I");
    video_width_fieldID = jni::get_field_id(env, Class, "videoWidth", "I");
    video_height_fieldID = jni::get_field_id(env, Class, "videoHeight", "I");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    input_message_content_fieldID = jni::get_field_id(env, Class, "inputMessageContent", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputMessageContent;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputInlineQueryResultArticle::Class;
jfieldID inputInlineQueryResultArticle::id_fieldID;
jfieldID inputInlineQueryResultArticle::url_fieldID;
jfieldID inputInlineQueryResultArticle::title_fieldID;
jfieldID inputInlineQueryResultArticle::description_fieldID;
jfieldID inputInlineQueryResultArticle::thumbnail_url_fieldID;
jfieldID inputInlineQueryResultArticle::thumbnail_width_fieldID;
jfieldID inputInlineQueryResultArticle::thumbnail_height_fieldID;
jfieldID inputInlineQueryResultArticle::reply_markup_fieldID;
jfieldID inputInlineQueryResultArticle::input_message_content_fieldID;

inputInlineQueryResultArticle::inputInlineQueryResultArticle()
  : id_()
  , url_()
  , title_()
  , description_()
  , thumbnail_url_()
  , thumbnail_width_()
  , thumbnail_height_()
  , reply_markup_()
  , input_message_content_()
{}

inputInlineQueryResultArticle::inputInlineQueryResultArticle(string const &id_, string const &url_, string const &title_, string const &description_, string const &thumbnail_url_, int32 thumbnail_width_, int32 thumbnail_height_, object_ptr<ReplyMarkup> &&reply_markup_, object_ptr<InputMessageContent> &&input_message_content_)
  : id_(id_)
  , url_(url_)
  , title_(title_)
  , description_(description_)
  , thumbnail_url_(thumbnail_url_)
  , thumbnail_width_(thumbnail_width_)
  , thumbnail_height_(thumbnail_height_)
  , reply_markup_(std::move(reply_markup_))
  , input_message_content_(std::move(input_message_content_))
{}

const std::int32_t inputInlineQueryResultArticle::ID;

object_ptr<InputInlineQueryResult> inputInlineQueryResultArticle::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputInlineQueryResultArticle> res = make_object<inputInlineQueryResultArticle>();
  res->id_ = jni::fetch_string(env, p, res->id_fieldID);
  res->url_ = jni::fetch_string(env, p, res->url_fieldID);
  res->title_ = jni::fetch_string(env, p, res->title_fieldID);
  res->description_ = jni::fetch_string(env, p, res->description_fieldID);
  res->thumbnail_url_ = jni::fetch_string(env, p, res->thumbnail_url_fieldID);
  res->thumbnail_width_ = env->GetIntField(p, res->thumbnail_width_fieldID);
  res->thumbnail_height_ = env->GetIntField(p, res->thumbnail_height_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  res->input_message_content_ = jni::fetch_tl_object<InputMessageContent>(env, jni::fetch_object(env, p, res->input_message_content_fieldID));
  return std::move(res);
}

void inputInlineQueryResultArticle::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputInlineQueryResultArticle");
    s.store_field("id", id_);
    s.store_field("url", url_);
    s.store_field("title", title_);
    s.store_field("description", description_);
    s.store_field("thumbnailUrl", thumbnail_url_);
    s.store_field("thumbnailWidth", thumbnail_width_);
    s.store_field("thumbnailHeight", thumbnail_height_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_object_field("inputMessageContent", static_cast<const BaseObject *>(input_message_content_.get()));
    s.store_class_end();
  }
}

void inputInlineQueryResultArticle::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResultArticle").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "Ljava/lang/String;");
    url_fieldID = jni::get_field_id(env, Class, "url", "Ljava/lang/String;");
    title_fieldID = jni::get_field_id(env, Class, "title", "Ljava/lang/String;");
    description_fieldID = jni::get_field_id(env, Class, "description", "Ljava/lang/String;");
    thumbnail_url_fieldID = jni::get_field_id(env, Class, "thumbnailUrl", "Ljava/lang/String;");
    thumbnail_width_fieldID = jni::get_field_id(env, Class, "thumbnailWidth", "I");
    thumbnail_height_fieldID = jni::get_field_id(env, Class, "thumbnailHeight", "I");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    input_message_content_fieldID = jni::get_field_id(env, Class, "inputMessageContent", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputMessageContent;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputInlineQueryResultAudio::Class;
jfieldID inputInlineQueryResultAudio::id_fieldID;
jfieldID inputInlineQueryResultAudio::title_fieldID;
jfieldID inputInlineQueryResultAudio::performer_fieldID;
jfieldID inputInlineQueryResultAudio::audio_url_fieldID;
jfieldID inputInlineQueryResultAudio::audio_duration_fieldID;
jfieldID inputInlineQueryResultAudio::reply_markup_fieldID;
jfieldID inputInlineQueryResultAudio::input_message_content_fieldID;

inputInlineQueryResultAudio::inputInlineQueryResultAudio()
  : id_()
  , title_()
  , performer_()
  , audio_url_()
  , audio_duration_()
  , reply_markup_()
  , input_message_content_()
{}

inputInlineQueryResultAudio::inputInlineQueryResultAudio(string const &id_, string const &title_, string const &performer_, string const &audio_url_, int32 audio_duration_, object_ptr<ReplyMarkup> &&reply_markup_, object_ptr<InputMessageContent> &&input_message_content_)
  : id_(id_)
  , title_(title_)
  , performer_(performer_)
  , audio_url_(audio_url_)
  , audio_duration_(audio_duration_)
  , reply_markup_(std::move(reply_markup_))
  , input_message_content_(std::move(input_message_content_))
{}

const std::int32_t inputInlineQueryResultAudio::ID;

object_ptr<InputInlineQueryResult> inputInlineQueryResultAudio::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputInlineQueryResultAudio> res = make_object<inputInlineQueryResultAudio>();
  res->id_ = jni::fetch_string(env, p, res->id_fieldID);
  res->title_ = jni::fetch_string(env, p, res->title_fieldID);
  res->performer_ = jni::fetch_string(env, p, res->performer_fieldID);
  res->audio_url_ = jni::fetch_string(env, p, res->audio_url_fieldID);
  res->audio_duration_ = env->GetIntField(p, res->audio_duration_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  res->input_message_content_ = jni::fetch_tl_object<InputMessageContent>(env, jni::fetch_object(env, p, res->input_message_content_fieldID));
  return std::move(res);
}

void inputInlineQueryResultAudio::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputInlineQueryResultAudio");
    s.store_field("id", id_);
    s.store_field("title", title_);
    s.store_field("performer", performer_);
    s.store_field("audioUrl", audio_url_);
    s.store_field("audioDuration", audio_duration_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_object_field("inputMessageContent", static_cast<const BaseObject *>(input_message_content_.get()));
    s.store_class_end();
  }
}

void inputInlineQueryResultAudio::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResultAudio").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "Ljava/lang/String;");
    title_fieldID = jni::get_field_id(env, Class, "title", "Ljava/lang/String;");
    performer_fieldID = jni::get_field_id(env, Class, "performer", "Ljava/lang/String;");
    audio_url_fieldID = jni::get_field_id(env, Class, "audioUrl", "Ljava/lang/String;");
    audio_duration_fieldID = jni::get_field_id(env, Class, "audioDuration", "I");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    input_message_content_fieldID = jni::get_field_id(env, Class, "inputMessageContent", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputMessageContent;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputInlineQueryResultContact::Class;
jfieldID inputInlineQueryResultContact::id_fieldID;
jfieldID inputInlineQueryResultContact::contact_fieldID;
jfieldID inputInlineQueryResultContact::thumbnail_url_fieldID;
jfieldID inputInlineQueryResultContact::thumbnail_width_fieldID;
jfieldID inputInlineQueryResultContact::thumbnail_height_fieldID;
jfieldID inputInlineQueryResultContact::reply_markup_fieldID;
jfieldID inputInlineQueryResultContact::input_message_content_fieldID;

inputInlineQueryResultContact::inputInlineQueryResultContact()
  : id_()
  , contact_()
  , thumbnail_url_()
  , thumbnail_width_()
  , thumbnail_height_()
  , reply_markup_()
  , input_message_content_()
{}

inputInlineQueryResultContact::inputInlineQueryResultContact(string const &id_, object_ptr<contact> &&contact_, string const &thumbnail_url_, int32 thumbnail_width_, int32 thumbnail_height_, object_ptr<ReplyMarkup> &&reply_markup_, object_ptr<InputMessageContent> &&input_message_content_)
  : id_(id_)
  , contact_(std::move(contact_))
  , thumbnail_url_(thumbnail_url_)
  , thumbnail_width_(thumbnail_width_)
  , thumbnail_height_(thumbnail_height_)
  , reply_markup_(std::move(reply_markup_))
  , input_message_content_(std::move(input_message_content_))
{}

const std::int32_t inputInlineQueryResultContact::ID;

object_ptr<InputInlineQueryResult> inputInlineQueryResultContact::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputInlineQueryResultContact> res = make_object<inputInlineQueryResultContact>();
  res->id_ = jni::fetch_string(env, p, res->id_fieldID);
  res->contact_ = jni::fetch_tl_object<contact>(env, jni::fetch_object(env, p, res->contact_fieldID));
  res->thumbnail_url_ = jni::fetch_string(env, p, res->thumbnail_url_fieldID);
  res->thumbnail_width_ = env->GetIntField(p, res->thumbnail_width_fieldID);
  res->thumbnail_height_ = env->GetIntField(p, res->thumbnail_height_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  res->input_message_content_ = jni::fetch_tl_object<InputMessageContent>(env, jni::fetch_object(env, p, res->input_message_content_fieldID));
  return std::move(res);
}

void inputInlineQueryResultContact::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputInlineQueryResultContact");
    s.store_field("id", id_);
    s.store_object_field("contact", static_cast<const BaseObject *>(contact_.get()));
    s.store_field("thumbnailUrl", thumbnail_url_);
    s.store_field("thumbnailWidth", thumbnail_width_);
    s.store_field("thumbnailHeight", thumbnail_height_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_object_field("inputMessageContent", static_cast<const BaseObject *>(input_message_content_.get()));
    s.store_class_end();
  }
}

void inputInlineQueryResultContact::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResultContact").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "Ljava/lang/String;");
    contact_fieldID = jni::get_field_id(env, Class, "contact", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Contact;").c_str());
    thumbnail_url_fieldID = jni::get_field_id(env, Class, "thumbnailUrl", "Ljava/lang/String;");
    thumbnail_width_fieldID = jni::get_field_id(env, Class, "thumbnailWidth", "I");
    thumbnail_height_fieldID = jni::get_field_id(env, Class, "thumbnailHeight", "I");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    input_message_content_fieldID = jni::get_field_id(env, Class, "inputMessageContent", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputMessageContent;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputInlineQueryResultDocument::Class;
jfieldID inputInlineQueryResultDocument::id_fieldID;
jfieldID inputInlineQueryResultDocument::title_fieldID;
jfieldID inputInlineQueryResultDocument::description_fieldID;
jfieldID inputInlineQueryResultDocument::document_url_fieldID;
jfieldID inputInlineQueryResultDocument::mime_type_fieldID;
jfieldID inputInlineQueryResultDocument::thumbnail_url_fieldID;
jfieldID inputInlineQueryResultDocument::thumbnail_width_fieldID;
jfieldID inputInlineQueryResultDocument::thumbnail_height_fieldID;
jfieldID inputInlineQueryResultDocument::reply_markup_fieldID;
jfieldID inputInlineQueryResultDocument::input_message_content_fieldID;

inputInlineQueryResultDocument::inputInlineQueryResultDocument()
  : id_()
  , title_()
  , description_()
  , document_url_()
  , mime_type_()
  , thumbnail_url_()
  , thumbnail_width_()
  , thumbnail_height_()
  , reply_markup_()
  , input_message_content_()
{}

inputInlineQueryResultDocument::inputInlineQueryResultDocument(string const &id_, string const &title_, string const &description_, string const &document_url_, string const &mime_type_, string const &thumbnail_url_, int32 thumbnail_width_, int32 thumbnail_height_, object_ptr<ReplyMarkup> &&reply_markup_, object_ptr<InputMessageContent> &&input_message_content_)
  : id_(id_)
  , title_(title_)
  , description_(description_)
  , document_url_(document_url_)
  , mime_type_(mime_type_)
  , thumbnail_url_(thumbnail_url_)
  , thumbnail_width_(thumbnail_width_)
  , thumbnail_height_(thumbnail_height_)
  , reply_markup_(std::move(reply_markup_))
  , input_message_content_(std::move(input_message_content_))
{}

const std::int32_t inputInlineQueryResultDocument::ID;

object_ptr<InputInlineQueryResult> inputInlineQueryResultDocument::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputInlineQueryResultDocument> res = make_object<inputInlineQueryResultDocument>();
  res->id_ = jni::fetch_string(env, p, res->id_fieldID);
  res->title_ = jni::fetch_string(env, p, res->title_fieldID);
  res->description_ = jni::fetch_string(env, p, res->description_fieldID);
  res->document_url_ = jni::fetch_string(env, p, res->document_url_fieldID);
  res->mime_type_ = jni::fetch_string(env, p, res->mime_type_fieldID);
  res->thumbnail_url_ = jni::fetch_string(env, p, res->thumbnail_url_fieldID);
  res->thumbnail_width_ = env->GetIntField(p, res->thumbnail_width_fieldID);
  res->thumbnail_height_ = env->GetIntField(p, res->thumbnail_height_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  res->input_message_content_ = jni::fetch_tl_object<InputMessageContent>(env, jni::fetch_object(env, p, res->input_message_content_fieldID));
  return std::move(res);
}

void inputInlineQueryResultDocument::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputInlineQueryResultDocument");
    s.store_field("id", id_);
    s.store_field("title", title_);
    s.store_field("description", description_);
    s.store_field("documentUrl", document_url_);
    s.store_field("mimeType", mime_type_);
    s.store_field("thumbnailUrl", thumbnail_url_);
    s.store_field("thumbnailWidth", thumbnail_width_);
    s.store_field("thumbnailHeight", thumbnail_height_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_object_field("inputMessageContent", static_cast<const BaseObject *>(input_message_content_.get()));
    s.store_class_end();
  }
}

void inputInlineQueryResultDocument::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResultDocument").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "Ljava/lang/String;");
    title_fieldID = jni::get_field_id(env, Class, "title", "Ljava/lang/String;");
    description_fieldID = jni::get_field_id(env, Class, "description", "Ljava/lang/String;");
    document_url_fieldID = jni::get_field_id(env, Class, "documentUrl", "Ljava/lang/String;");
    mime_type_fieldID = jni::get_field_id(env, Class, "mimeType", "Ljava/lang/String;");
    thumbnail_url_fieldID = jni::get_field_id(env, Class, "thumbnailUrl", "Ljava/lang/String;");
    thumbnail_width_fieldID = jni::get_field_id(env, Class, "thumbnailWidth", "I");
    thumbnail_height_fieldID = jni::get_field_id(env, Class, "thumbnailHeight", "I");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    input_message_content_fieldID = jni::get_field_id(env, Class, "inputMessageContent", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputMessageContent;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputInlineQueryResultGame::Class;
jfieldID inputInlineQueryResultGame::id_fieldID;
jfieldID inputInlineQueryResultGame::game_short_name_fieldID;
jfieldID inputInlineQueryResultGame::reply_markup_fieldID;

inputInlineQueryResultGame::inputInlineQueryResultGame()
  : id_()
  , game_short_name_()
  , reply_markup_()
{}

inputInlineQueryResultGame::inputInlineQueryResultGame(string const &id_, string const &game_short_name_, object_ptr<ReplyMarkup> &&reply_markup_)
  : id_(id_)
  , game_short_name_(game_short_name_)
  , reply_markup_(std::move(reply_markup_))
{}

const std::int32_t inputInlineQueryResultGame::ID;

object_ptr<InputInlineQueryResult> inputInlineQueryResultGame::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputInlineQueryResultGame> res = make_object<inputInlineQueryResultGame>();
  res->id_ = jni::fetch_string(env, p, res->id_fieldID);
  res->game_short_name_ = jni::fetch_string(env, p, res->game_short_name_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  return std::move(res);
}

void inputInlineQueryResultGame::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputInlineQueryResultGame");
    s.store_field("id", id_);
    s.store_field("gameShortName", game_short_name_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_class_end();
  }
}

void inputInlineQueryResultGame::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResultGame").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "Ljava/lang/String;");
    game_short_name_fieldID = jni::get_field_id(env, Class, "gameShortName", "Ljava/lang/String;");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputInlineQueryResultLocation::Class;
jfieldID inputInlineQueryResultLocation::id_fieldID;
jfieldID inputInlineQueryResultLocation::location_fieldID;
jfieldID inputInlineQueryResultLocation::live_period_fieldID;
jfieldID inputInlineQueryResultLocation::title_fieldID;
jfieldID inputInlineQueryResultLocation::thumbnail_url_fieldID;
jfieldID inputInlineQueryResultLocation::thumbnail_width_fieldID;
jfieldID inputInlineQueryResultLocation::thumbnail_height_fieldID;
jfieldID inputInlineQueryResultLocation::reply_markup_fieldID;
jfieldID inputInlineQueryResultLocation::input_message_content_fieldID;

inputInlineQueryResultLocation::inputInlineQueryResultLocation()
  : id_()
  , location_()
  , live_period_()
  , title_()
  , thumbnail_url_()
  , thumbnail_width_()
  , thumbnail_height_()
  , reply_markup_()
  , input_message_content_()
{}

inputInlineQueryResultLocation::inputInlineQueryResultLocation(string const &id_, object_ptr<location> &&location_, int32 live_period_, string const &title_, string const &thumbnail_url_, int32 thumbnail_width_, int32 thumbnail_height_, object_ptr<ReplyMarkup> &&reply_markup_, object_ptr<InputMessageContent> &&input_message_content_)
  : id_(id_)
  , location_(std::move(location_))
  , live_period_(live_period_)
  , title_(title_)
  , thumbnail_url_(thumbnail_url_)
  , thumbnail_width_(thumbnail_width_)
  , thumbnail_height_(thumbnail_height_)
  , reply_markup_(std::move(reply_markup_))
  , input_message_content_(std::move(input_message_content_))
{}

const std::int32_t inputInlineQueryResultLocation::ID;

object_ptr<InputInlineQueryResult> inputInlineQueryResultLocation::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputInlineQueryResultLocation> res = make_object<inputInlineQueryResultLocation>();
  res->id_ = jni::fetch_string(env, p, res->id_fieldID);
  res->location_ = jni::fetch_tl_object<location>(env, jni::fetch_object(env, p, res->location_fieldID));
  res->live_period_ = env->GetIntField(p, res->live_period_fieldID);
  res->title_ = jni::fetch_string(env, p, res->title_fieldID);
  res->thumbnail_url_ = jni::fetch_string(env, p, res->thumbnail_url_fieldID);
  res->thumbnail_width_ = env->GetIntField(p, res->thumbnail_width_fieldID);
  res->thumbnail_height_ = env->GetIntField(p, res->thumbnail_height_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  res->input_message_content_ = jni::fetch_tl_object<InputMessageContent>(env, jni::fetch_object(env, p, res->input_message_content_fieldID));
  return std::move(res);
}

void inputInlineQueryResultLocation::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputInlineQueryResultLocation");
    s.store_field("id", id_);
    s.store_object_field("location", static_cast<const BaseObject *>(location_.get()));
    s.store_field("livePeriod", live_period_);
    s.store_field("title", title_);
    s.store_field("thumbnailUrl", thumbnail_url_);
    s.store_field("thumbnailWidth", thumbnail_width_);
    s.store_field("thumbnailHeight", thumbnail_height_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_object_field("inputMessageContent", static_cast<const BaseObject *>(input_message_content_.get()));
    s.store_class_end();
  }
}

void inputInlineQueryResultLocation::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResultLocation").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "Ljava/lang/String;");
    location_fieldID = jni::get_field_id(env, Class, "location", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Location;").c_str());
    live_period_fieldID = jni::get_field_id(env, Class, "livePeriod", "I");
    title_fieldID = jni::get_field_id(env, Class, "title", "Ljava/lang/String;");
    thumbnail_url_fieldID = jni::get_field_id(env, Class, "thumbnailUrl", "Ljava/lang/String;");
    thumbnail_width_fieldID = jni::get_field_id(env, Class, "thumbnailWidth", "I");
    thumbnail_height_fieldID = jni::get_field_id(env, Class, "thumbnailHeight", "I");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    input_message_content_fieldID = jni::get_field_id(env, Class, "inputMessageContent", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputMessageContent;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputInlineQueryResultPhoto::Class;
jfieldID inputInlineQueryResultPhoto::id_fieldID;
jfieldID inputInlineQueryResultPhoto::title_fieldID;
jfieldID inputInlineQueryResultPhoto::description_fieldID;
jfieldID inputInlineQueryResultPhoto::thumbnail_url_fieldID;
jfieldID inputInlineQueryResultPhoto::photo_url_fieldID;
jfieldID inputInlineQueryResultPhoto::photo_width_fieldID;
jfieldID inputInlineQueryResultPhoto::photo_height_fieldID;
jfieldID inputInlineQueryResultPhoto::reply_markup_fieldID;
jfieldID inputInlineQueryResultPhoto::input_message_content_fieldID;

inputInlineQueryResultPhoto::inputInlineQueryResultPhoto()
  : id_()
  , title_()
  , description_()
  , thumbnail_url_()
  , photo_url_()
  , photo_width_()
  , photo_height_()
  , reply_markup_()
  , input_message_content_()
{}

inputInlineQueryResultPhoto::inputInlineQueryResultPhoto(string const &id_, string const &title_, string const &description_, string const &thumbnail_url_, string const &photo_url_, int32 photo_width_, int32 photo_height_, object_ptr<ReplyMarkup> &&reply_markup_, object_ptr<InputMessageContent> &&input_message_content_)
  : id_(id_)
  , title_(title_)
  , description_(description_)
  , thumbnail_url_(thumbnail_url_)
  , photo_url_(photo_url_)
  , photo_width_(photo_width_)
  , photo_height_(photo_height_)
  , reply_markup_(std::move(reply_markup_))
  , input_message_content_(std::move(input_message_content_))
{}

const std::int32_t inputInlineQueryResultPhoto::ID;

object_ptr<InputInlineQueryResult> inputInlineQueryResultPhoto::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputInlineQueryResultPhoto> res = make_object<inputInlineQueryResultPhoto>();
  res->id_ = jni::fetch_string(env, p, res->id_fieldID);
  res->title_ = jni::fetch_string(env, p, res->title_fieldID);
  res->description_ = jni::fetch_string(env, p, res->description_fieldID);
  res->thumbnail_url_ = jni::fetch_string(env, p, res->thumbnail_url_fieldID);
  res->photo_url_ = jni::fetch_string(env, p, res->photo_url_fieldID);
  res->photo_width_ = env->GetIntField(p, res->photo_width_fieldID);
  res->photo_height_ = env->GetIntField(p, res->photo_height_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  res->input_message_content_ = jni::fetch_tl_object<InputMessageContent>(env, jni::fetch_object(env, p, res->input_message_content_fieldID));
  return std::move(res);
}

void inputInlineQueryResultPhoto::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputInlineQueryResultPhoto");
    s.store_field("id", id_);
    s.store_field("title", title_);
    s.store_field("description", description_);
    s.store_field("thumbnailUrl", thumbnail_url_);
    s.store_field("photoUrl", photo_url_);
    s.store_field("photoWidth", photo_width_);
    s.store_field("photoHeight", photo_height_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_object_field("inputMessageContent", static_cast<const BaseObject *>(input_message_content_.get()));
    s.store_class_end();
  }
}

void inputInlineQueryResultPhoto::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResultPhoto").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "Ljava/lang/String;");
    title_fieldID = jni::get_field_id(env, Class, "title", "Ljava/lang/String;");
    description_fieldID = jni::get_field_id(env, Class, "description", "Ljava/lang/String;");
    thumbnail_url_fieldID = jni::get_field_id(env, Class, "thumbnailUrl", "Ljava/lang/String;");
    photo_url_fieldID = jni::get_field_id(env, Class, "photoUrl", "Ljava/lang/String;");
    photo_width_fieldID = jni::get_field_id(env, Class, "photoWidth", "I");
    photo_height_fieldID = jni::get_field_id(env, Class, "photoHeight", "I");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    input_message_content_fieldID = jni::get_field_id(env, Class, "inputMessageContent", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputMessageContent;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputInlineQueryResultSticker::Class;
jfieldID inputInlineQueryResultSticker::id_fieldID;
jfieldID inputInlineQueryResultSticker::thumbnail_url_fieldID;
jfieldID inputInlineQueryResultSticker::sticker_url_fieldID;
jfieldID inputInlineQueryResultSticker::sticker_width_fieldID;
jfieldID inputInlineQueryResultSticker::sticker_height_fieldID;
jfieldID inputInlineQueryResultSticker::reply_markup_fieldID;
jfieldID inputInlineQueryResultSticker::input_message_content_fieldID;

inputInlineQueryResultSticker::inputInlineQueryResultSticker()
  : id_()
  , thumbnail_url_()
  , sticker_url_()
  , sticker_width_()
  , sticker_height_()
  , reply_markup_()
  , input_message_content_()
{}

inputInlineQueryResultSticker::inputInlineQueryResultSticker(string const &id_, string const &thumbnail_url_, string const &sticker_url_, int32 sticker_width_, int32 sticker_height_, object_ptr<ReplyMarkup> &&reply_markup_, object_ptr<InputMessageContent> &&input_message_content_)
  : id_(id_)
  , thumbnail_url_(thumbnail_url_)
  , sticker_url_(sticker_url_)
  , sticker_width_(sticker_width_)
  , sticker_height_(sticker_height_)
  , reply_markup_(std::move(reply_markup_))
  , input_message_content_(std::move(input_message_content_))
{}

const std::int32_t inputInlineQueryResultSticker::ID;

object_ptr<InputInlineQueryResult> inputInlineQueryResultSticker::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputInlineQueryResultSticker> res = make_object<inputInlineQueryResultSticker>();
  res->id_ = jni::fetch_string(env, p, res->id_fieldID);
  res->thumbnail_url_ = jni::fetch_string(env, p, res->thumbnail_url_fieldID);
  res->sticker_url_ = jni::fetch_string(env, p, res->sticker_url_fieldID);
  res->sticker_width_ = env->GetIntField(p, res->sticker_width_fieldID);
  res->sticker_height_ = env->GetIntField(p, res->sticker_height_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  res->input_message_content_ = jni::fetch_tl_object<InputMessageContent>(env, jni::fetch_object(env, p, res->input_message_content_fieldID));
  return std::move(res);
}

void inputInlineQueryResultSticker::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputInlineQueryResultSticker");
    s.store_field("id", id_);
    s.store_field("thumbnailUrl", thumbnail_url_);
    s.store_field("stickerUrl", sticker_url_);
    s.store_field("stickerWidth", sticker_width_);
    s.store_field("stickerHeight", sticker_height_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_object_field("inputMessageContent", static_cast<const BaseObject *>(input_message_content_.get()));
    s.store_class_end();
  }
}

void inputInlineQueryResultSticker::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResultSticker").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "Ljava/lang/String;");
    thumbnail_url_fieldID = jni::get_field_id(env, Class, "thumbnailUrl", "Ljava/lang/String;");
    sticker_url_fieldID = jni::get_field_id(env, Class, "stickerUrl", "Ljava/lang/String;");
    sticker_width_fieldID = jni::get_field_id(env, Class, "stickerWidth", "I");
    sticker_height_fieldID = jni::get_field_id(env, Class, "stickerHeight", "I");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    input_message_content_fieldID = jni::get_field_id(env, Class, "inputMessageContent", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputMessageContent;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputInlineQueryResultVenue::Class;
jfieldID inputInlineQueryResultVenue::id_fieldID;
jfieldID inputInlineQueryResultVenue::venue_fieldID;
jfieldID inputInlineQueryResultVenue::thumbnail_url_fieldID;
jfieldID inputInlineQueryResultVenue::thumbnail_width_fieldID;
jfieldID inputInlineQueryResultVenue::thumbnail_height_fieldID;
jfieldID inputInlineQueryResultVenue::reply_markup_fieldID;
jfieldID inputInlineQueryResultVenue::input_message_content_fieldID;

inputInlineQueryResultVenue::inputInlineQueryResultVenue()
  : id_()
  , venue_()
  , thumbnail_url_()
  , thumbnail_width_()
  , thumbnail_height_()
  , reply_markup_()
  , input_message_content_()
{}

inputInlineQueryResultVenue::inputInlineQueryResultVenue(string const &id_, object_ptr<venue> &&venue_, string const &thumbnail_url_, int32 thumbnail_width_, int32 thumbnail_height_, object_ptr<ReplyMarkup> &&reply_markup_, object_ptr<InputMessageContent> &&input_message_content_)
  : id_(id_)
  , venue_(std::move(venue_))
  , thumbnail_url_(thumbnail_url_)
  , thumbnail_width_(thumbnail_width_)
  , thumbnail_height_(thumbnail_height_)
  , reply_markup_(std::move(reply_markup_))
  , input_message_content_(std::move(input_message_content_))
{}

const std::int32_t inputInlineQueryResultVenue::ID;

object_ptr<InputInlineQueryResult> inputInlineQueryResultVenue::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputInlineQueryResultVenue> res = make_object<inputInlineQueryResultVenue>();
  res->id_ = jni::fetch_string(env, p, res->id_fieldID);
  res->venue_ = jni::fetch_tl_object<venue>(env, jni::fetch_object(env, p, res->venue_fieldID));
  res->thumbnail_url_ = jni::fetch_string(env, p, res->thumbnail_url_fieldID);
  res->thumbnail_width_ = env->GetIntField(p, res->thumbnail_width_fieldID);
  res->thumbnail_height_ = env->GetIntField(p, res->thumbnail_height_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  res->input_message_content_ = jni::fetch_tl_object<InputMessageContent>(env, jni::fetch_object(env, p, res->input_message_content_fieldID));
  return std::move(res);
}

void inputInlineQueryResultVenue::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputInlineQueryResultVenue");
    s.store_field("id", id_);
    s.store_object_field("venue", static_cast<const BaseObject *>(venue_.get()));
    s.store_field("thumbnailUrl", thumbnail_url_);
    s.store_field("thumbnailWidth", thumbnail_width_);
    s.store_field("thumbnailHeight", thumbnail_height_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_object_field("inputMessageContent", static_cast<const BaseObject *>(input_message_content_.get()));
    s.store_class_end();
  }
}

void inputInlineQueryResultVenue::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResultVenue").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "Ljava/lang/String;");
    venue_fieldID = jni::get_field_id(env, Class, "venue", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Venue;").c_str());
    thumbnail_url_fieldID = jni::get_field_id(env, Class, "thumbnailUrl", "Ljava/lang/String;");
    thumbnail_width_fieldID = jni::get_field_id(env, Class, "thumbnailWidth", "I");
    thumbnail_height_fieldID = jni::get_field_id(env, Class, "thumbnailHeight", "I");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    input_message_content_fieldID = jni::get_field_id(env, Class, "inputMessageContent", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputMessageContent;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputInlineQueryResultVideo::Class;
jfieldID inputInlineQueryResultVideo::id_fieldID;
jfieldID inputInlineQueryResultVideo::title_fieldID;
jfieldID inputInlineQueryResultVideo::description_fieldID;
jfieldID inputInlineQueryResultVideo::thumbnail_url_fieldID;
jfieldID inputInlineQueryResultVideo::video_url_fieldID;
jfieldID inputInlineQueryResultVideo::mime_type_fieldID;
jfieldID inputInlineQueryResultVideo::video_width_fieldID;
jfieldID inputInlineQueryResultVideo::video_height_fieldID;
jfieldID inputInlineQueryResultVideo::video_duration_fieldID;
jfieldID inputInlineQueryResultVideo::reply_markup_fieldID;
jfieldID inputInlineQueryResultVideo::input_message_content_fieldID;

inputInlineQueryResultVideo::inputInlineQueryResultVideo()
  : id_()
  , title_()
  , description_()
  , thumbnail_url_()
  , video_url_()
  , mime_type_()
  , video_width_()
  , video_height_()
  , video_duration_()
  , reply_markup_()
  , input_message_content_()
{}

inputInlineQueryResultVideo::inputInlineQueryResultVideo(string const &id_, string const &title_, string const &description_, string const &thumbnail_url_, string const &video_url_, string const &mime_type_, int32 video_width_, int32 video_height_, int32 video_duration_, object_ptr<ReplyMarkup> &&reply_markup_, object_ptr<InputMessageContent> &&input_message_content_)
  : id_(id_)
  , title_(title_)
  , description_(description_)
  , thumbnail_url_(thumbnail_url_)
  , video_url_(video_url_)
  , mime_type_(mime_type_)
  , video_width_(video_width_)
  , video_height_(video_height_)
  , video_duration_(video_duration_)
  , reply_markup_(std::move(reply_markup_))
  , input_message_content_(std::move(input_message_content_))
{}

const std::int32_t inputInlineQueryResultVideo::ID;

object_ptr<InputInlineQueryResult> inputInlineQueryResultVideo::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputInlineQueryResultVideo> res = make_object<inputInlineQueryResultVideo>();
  res->id_ = jni::fetch_string(env, p, res->id_fieldID);
  res->title_ = jni::fetch_string(env, p, res->title_fieldID);
  res->description_ = jni::fetch_string(env, p, res->description_fieldID);
  res->thumbnail_url_ = jni::fetch_string(env, p, res->thumbnail_url_fieldID);
  res->video_url_ = jni::fetch_string(env, p, res->video_url_fieldID);
  res->mime_type_ = jni::fetch_string(env, p, res->mime_type_fieldID);
  res->video_width_ = env->GetIntField(p, res->video_width_fieldID);
  res->video_height_ = env->GetIntField(p, res->video_height_fieldID);
  res->video_duration_ = env->GetIntField(p, res->video_duration_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  res->input_message_content_ = jni::fetch_tl_object<InputMessageContent>(env, jni::fetch_object(env, p, res->input_message_content_fieldID));
  return std::move(res);
}

void inputInlineQueryResultVideo::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputInlineQueryResultVideo");
    s.store_field("id", id_);
    s.store_field("title", title_);
    s.store_field("description", description_);
    s.store_field("thumbnailUrl", thumbnail_url_);
    s.store_field("videoUrl", video_url_);
    s.store_field("mimeType", mime_type_);
    s.store_field("videoWidth", video_width_);
    s.store_field("videoHeight", video_height_);
    s.store_field("videoDuration", video_duration_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_object_field("inputMessageContent", static_cast<const BaseObject *>(input_message_content_.get()));
    s.store_class_end();
  }
}

void inputInlineQueryResultVideo::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResultVideo").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "Ljava/lang/String;");
    title_fieldID = jni::get_field_id(env, Class, "title", "Ljava/lang/String;");
    description_fieldID = jni::get_field_id(env, Class, "description", "Ljava/lang/String;");
    thumbnail_url_fieldID = jni::get_field_id(env, Class, "thumbnailUrl", "Ljava/lang/String;");
    video_url_fieldID = jni::get_field_id(env, Class, "videoUrl", "Ljava/lang/String;");
    mime_type_fieldID = jni::get_field_id(env, Class, "mimeType", "Ljava/lang/String;");
    video_width_fieldID = jni::get_field_id(env, Class, "videoWidth", "I");
    video_height_fieldID = jni::get_field_id(env, Class, "videoHeight", "I");
    video_duration_fieldID = jni::get_field_id(env, Class, "videoDuration", "I");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    input_message_content_fieldID = jni::get_field_id(env, Class, "inputMessageContent", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputMessageContent;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputInlineQueryResultVoiceNote::Class;
jfieldID inputInlineQueryResultVoiceNote::id_fieldID;
jfieldID inputInlineQueryResultVoiceNote::title_fieldID;
jfieldID inputInlineQueryResultVoiceNote::voice_note_url_fieldID;
jfieldID inputInlineQueryResultVoiceNote::voice_note_duration_fieldID;
jfieldID inputInlineQueryResultVoiceNote::reply_markup_fieldID;
jfieldID inputInlineQueryResultVoiceNote::input_message_content_fieldID;

inputInlineQueryResultVoiceNote::inputInlineQueryResultVoiceNote()
  : id_()
  , title_()
  , voice_note_url_()
  , voice_note_duration_()
  , reply_markup_()
  , input_message_content_()
{}

inputInlineQueryResultVoiceNote::inputInlineQueryResultVoiceNote(string const &id_, string const &title_, string const &voice_note_url_, int32 voice_note_duration_, object_ptr<ReplyMarkup> &&reply_markup_, object_ptr<InputMessageContent> &&input_message_content_)
  : id_(id_)
  , title_(title_)
  , voice_note_url_(voice_note_url_)
  , voice_note_duration_(voice_note_duration_)
  , reply_markup_(std::move(reply_markup_))
  , input_message_content_(std::move(input_message_content_))
{}

const std::int32_t inputInlineQueryResultVoiceNote::ID;

object_ptr<InputInlineQueryResult> inputInlineQueryResultVoiceNote::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputInlineQueryResultVoiceNote> res = make_object<inputInlineQueryResultVoiceNote>();
  res->id_ = jni::fetch_string(env, p, res->id_fieldID);
  res->title_ = jni::fetch_string(env, p, res->title_fieldID);
  res->voice_note_url_ = jni::fetch_string(env, p, res->voice_note_url_fieldID);
  res->voice_note_duration_ = env->GetIntField(p, res->voice_note_duration_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  res->input_message_content_ = jni::fetch_tl_object<InputMessageContent>(env, jni::fetch_object(env, p, res->input_message_content_fieldID));
  return std::move(res);
}

void inputInlineQueryResultVoiceNote::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputInlineQueryResultVoiceNote");
    s.store_field("id", id_);
    s.store_field("title", title_);
    s.store_field("voiceNoteUrl", voice_note_url_);
    s.store_field("voiceNoteDuration", voice_note_duration_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_object_field("inputMessageContent", static_cast<const BaseObject *>(input_message_content_.get()));
    s.store_class_end();
  }
}

void inputInlineQueryResultVoiceNote::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputInlineQueryResultVoiceNote").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "Ljava/lang/String;");
    title_fieldID = jni::get_field_id(env, Class, "title", "Ljava/lang/String;");
    voice_note_url_fieldID = jni::get_field_id(env, Class, "voiceNoteUrl", "Ljava/lang/String;");
    voice_note_duration_fieldID = jni::get_field_id(env, Class, "voiceNoteDuration", "I");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    input_message_content_fieldID = jni::get_field_id(env, Class, "inputMessageContent", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputMessageContent;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass InputMessageReplyTo::Class;

object_ptr<InputMessageReplyTo> InputMessageReplyTo::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case inputMessageReplyToMessage::ID:
      return inputMessageReplyToMessage::fetch(env, p);
    case inputMessageReplyToExternalMessage::ID:
      return inputMessageReplyToExternalMessage::fetch(env, p);
    case inputMessageReplyToStory::ID:
      return inputMessageReplyToStory::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void InputMessageReplyTo::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputMessageReplyTo").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputMessageReplyToMessage::Class;
jfieldID inputMessageReplyToMessage::message_id_fieldID;
jfieldID inputMessageReplyToMessage::quote_fieldID;
jfieldID inputMessageReplyToMessage::checklist_task_id_fieldID;
jfieldID inputMessageReplyToMessage::poll_option_id_fieldID;

inputMessageReplyToMessage::inputMessageReplyToMessage()
  : message_id_()
  , quote_()
  , checklist_task_id_()
  , poll_option_id_()
{}

inputMessageReplyToMessage::inputMessageReplyToMessage(int53 message_id_, object_ptr<inputTextQuote> &&quote_, int32 checklist_task_id_, string const &poll_option_id_)
  : message_id_(message_id_)
  , quote_(std::move(quote_))
  , checklist_task_id_(checklist_task_id_)
  , poll_option_id_(poll_option_id_)
{}

const std::int32_t inputMessageReplyToMessage::ID;

object_ptr<InputMessageReplyTo> inputMessageReplyToMessage::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputMessageReplyToMessage> res = make_object<inputMessageReplyToMessage>();
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  res->quote_ = jni::fetch_tl_object<inputTextQuote>(env, jni::fetch_object(env, p, res->quote_fieldID));
  res->checklist_task_id_ = env->GetIntField(p, res->checklist_task_id_fieldID);
  res->poll_option_id_ = jni::fetch_string(env, p, res->poll_option_id_fieldID);
  return std::move(res);
}

void inputMessageReplyToMessage::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, message_id_fieldID, message_id_);
  if (quote_ != nullptr) { jobject next; quote_->store(env, next); if (next) { env->SetObjectField(s, quote_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetIntField(s, checklist_task_id_fieldID, checklist_task_id_);
  { jstring nextString = jni::to_jstring(env, poll_option_id_); if (nextString) { env->SetObjectField(s, poll_option_id_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void inputMessageReplyToMessage::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputMessageReplyToMessage");
    s.store_field("messageId", message_id_);
    s.store_object_field("quote", static_cast<const BaseObject *>(quote_.get()));
    s.store_field("checklistTaskId", checklist_task_id_);
    s.store_field("pollOptionId", poll_option_id_);
    s.store_class_end();
  }
}

void inputMessageReplyToMessage::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputMessageReplyToMessage").c_str());
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    quote_fieldID = jni::get_field_id(env, Class, "quote", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputTextQuote;").c_str());
    checklist_task_id_fieldID = jni::get_field_id(env, Class, "checklistTaskId", "I");
    poll_option_id_fieldID = jni::get_field_id(env, Class, "pollOptionId", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass inputMessageReplyToExternalMessage::Class;
jfieldID inputMessageReplyToExternalMessage::chat_id_fieldID;
jfieldID inputMessageReplyToExternalMessage::message_id_fieldID;
jfieldID inputMessageReplyToExternalMessage::quote_fieldID;
jfieldID inputMessageReplyToExternalMessage::checklist_task_id_fieldID;
jfieldID inputMessageReplyToExternalMessage::poll_option_id_fieldID;

inputMessageReplyToExternalMessage::inputMessageReplyToExternalMessage()
  : chat_id_()
  , message_id_()
  , quote_()
  , checklist_task_id_()
  , poll_option_id_()
{}

inputMessageReplyToExternalMessage::inputMessageReplyToExternalMessage(int53 chat_id_, int53 message_id_, object_ptr<inputTextQuote> &&quote_, int32 checklist_task_id_, string const &poll_option_id_)
  : chat_id_(chat_id_)
  , message_id_(message_id_)
  , quote_(std::move(quote_))
  , checklist_task_id_(checklist_task_id_)
  , poll_option_id_(poll_option_id_)
{}

const std::int32_t inputMessageReplyToExternalMessage::ID;

object_ptr<InputMessageReplyTo> inputMessageReplyToExternalMessage::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputMessageReplyToExternalMessage> res = make_object<inputMessageReplyToExternalMessage>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  res->quote_ = jni::fetch_tl_object<inputTextQuote>(env, jni::fetch_object(env, p, res->quote_fieldID));
  res->checklist_task_id_ = env->GetIntField(p, res->checklist_task_id_fieldID);
  res->poll_option_id_ = jni::fetch_string(env, p, res->poll_option_id_fieldID);
  return std::move(res);
}

void inputMessageReplyToExternalMessage::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, chat_id_fieldID, chat_id_);
  env->SetLongField(s, message_id_fieldID, message_id_);
  if (quote_ != nullptr) { jobject next; quote_->store(env, next); if (next) { env->SetObjectField(s, quote_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetIntField(s, checklist_task_id_fieldID, checklist_task_id_);
  { jstring nextString = jni::to_jstring(env, poll_option_id_); if (nextString) { env->SetObjectField(s, poll_option_id_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void inputMessageReplyToExternalMessage::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputMessageReplyToExternalMessage");
    s.store_field("chatId", chat_id_);
    s.store_field("messageId", message_id_);
    s.store_object_field("quote", static_cast<const BaseObject *>(quote_.get()));
    s.store_field("checklistTaskId", checklist_task_id_);
    s.store_field("pollOptionId", poll_option_id_);
    s.store_class_end();
  }
}

void inputMessageReplyToExternalMessage::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputMessageReplyToExternalMessage").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    quote_fieldID = jni::get_field_id(env, Class, "quote", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputTextQuote;").c_str());
    checklist_task_id_fieldID = jni::get_field_id(env, Class, "checklistTaskId", "I");
    poll_option_id_fieldID = jni::get_field_id(env, Class, "pollOptionId", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass inputMessageReplyToStory::Class;
jfieldID inputMessageReplyToStory::story_poster_chat_id_fieldID;
jfieldID inputMessageReplyToStory::story_id_fieldID;

inputMessageReplyToStory::inputMessageReplyToStory()
  : story_poster_chat_id_()
  , story_id_()
{}

inputMessageReplyToStory::inputMessageReplyToStory(int53 story_poster_chat_id_, int32 story_id_)
  : story_poster_chat_id_(story_poster_chat_id_)
  , story_id_(story_id_)
{}

const std::int32_t inputMessageReplyToStory::ID;

object_ptr<InputMessageReplyTo> inputMessageReplyToStory::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputMessageReplyToStory> res = make_object<inputMessageReplyToStory>();
  res->story_poster_chat_id_ = env->GetLongField(p, res->story_poster_chat_id_fieldID);
  res->story_id_ = env->GetIntField(p, res->story_id_fieldID);
  return std::move(res);
}

void inputMessageReplyToStory::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, story_poster_chat_id_fieldID, story_poster_chat_id_);
  env->SetIntField(s, story_id_fieldID, story_id_);
}

void inputMessageReplyToStory::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputMessageReplyToStory");
    s.store_field("storyPosterChatId", story_poster_chat_id_);
    s.store_field("storyId", story_id_);
    s.store_class_end();
  }
}

void inputMessageReplyToStory::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputMessageReplyToStory").c_str());
    story_poster_chat_id_fieldID = jni::get_field_id(env, Class, "storyPosterChatId", "J");
    story_id_fieldID = jni::get_field_id(env, Class, "storyId", "I");
    return true;
  }();
  (void)is_inited;
}

jclass InputPollType::Class;

object_ptr<InputPollType> InputPollType::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case inputPollTypeRegular::ID:
      return inputPollTypeRegular::fetch(env, p);
    case inputPollTypeQuiz::ID:
      return inputPollTypeQuiz::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void InputPollType::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputPollType").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass inputPollTypeRegular::Class;
jfieldID inputPollTypeRegular::allow_adding_options_fieldID;

inputPollTypeRegular::inputPollTypeRegular()
  : allow_adding_options_()
{}

inputPollTypeRegular::inputPollTypeRegular(bool allow_adding_options_)
  : allow_adding_options_(allow_adding_options_)
{}

const std::int32_t inputPollTypeRegular::ID;

object_ptr<InputPollType> inputPollTypeRegular::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputPollTypeRegular> res = make_object<inputPollTypeRegular>();
  res->allow_adding_options_ = (env->GetBooleanField(p, res->allow_adding_options_fieldID) != 0);
  return std::move(res);
}

void inputPollTypeRegular::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetBooleanField(s, allow_adding_options_fieldID, allow_adding_options_);
}

void inputPollTypeRegular::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputPollTypeRegular");
    s.store_field("allowAddingOptions", allow_adding_options_);
    s.store_class_end();
  }
}

void inputPollTypeRegular::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputPollTypeRegular").c_str());
    allow_adding_options_fieldID = jni::get_field_id(env, Class, "allowAddingOptions", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass inputPollTypeQuiz::Class;
jfieldID inputPollTypeQuiz::correct_option_ids_fieldID;
jfieldID inputPollTypeQuiz::explanation_fieldID;
jfieldID inputPollTypeQuiz::explanation_media_fieldID;

inputPollTypeQuiz::inputPollTypeQuiz()
  : correct_option_ids_()
  , explanation_()
  , explanation_media_()
{}

inputPollTypeQuiz::inputPollTypeQuiz(array<int32> &&correct_option_ids_, object_ptr<formattedText> &&explanation_, object_ptr<InputMessageContent> &&explanation_media_)
  : correct_option_ids_(std::move(correct_option_ids_))
  , explanation_(std::move(explanation_))
  , explanation_media_(std::move(explanation_media_))
{}

const std::int32_t inputPollTypeQuiz::ID;

object_ptr<InputPollType> inputPollTypeQuiz::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<inputPollTypeQuiz> res = make_object<inputPollTypeQuiz>();
  res->correct_option_ids_ = jni::fetch_vector(env, (jintArray)jni::fetch_object(env, p, res->correct_option_ids_fieldID));
  res->explanation_ = jni::fetch_tl_object<formattedText>(env, jni::fetch_object(env, p, res->explanation_fieldID));
  res->explanation_media_ = jni::fetch_tl_object<InputMessageContent>(env, jni::fetch_object(env, p, res->explanation_media_fieldID));
  return std::move(res);
}

void inputPollTypeQuiz::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { auto arr_tmp_ = jni::store_vector(env, correct_option_ids_); if (arr_tmp_) { env->SetObjectField(s, correct_option_ids_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  if (explanation_ != nullptr) { jobject next; explanation_->store(env, next); if (next) { env->SetObjectField(s, explanation_fieldID, next); env->DeleteLocalRef(next); } }
  if (explanation_media_ != nullptr) { jobject next; explanation_media_->store(env, next); if (next) { env->SetObjectField(s, explanation_media_fieldID, next); env->DeleteLocalRef(next); } }
}

void inputPollTypeQuiz::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InputPollTypeQuiz");
    { s.store_vector_begin("correctOptionIds", correct_option_ids_.size()); for (const auto &_value : correct_option_ids_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_object_field("explanation", static_cast<const BaseObject *>(explanation_.get()));
    s.store_object_field("explanationMedia", static_cast<const BaseObject *>(explanation_media_.get()));
    s.store_class_end();
  }
}

void inputPollTypeQuiz::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InputPollTypeQuiz").c_str());
    correct_option_ids_fieldID = jni::get_field_id(env, Class, "correctOptionIds", "[I");
    explanation_fieldID = jni::get_field_id(env, Class, "explanation", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$FormattedText;").c_str());
    explanation_media_fieldID = jni::get_field_id(env, Class, "explanationMedia", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputMessageContent;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass InternalLinkType::Class;

object_ptr<InternalLinkType> InternalLinkType::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case internalLinkTypeAttachmentMenuBot::ID:
      return internalLinkTypeAttachmentMenuBot::fetch(env, p);
    case internalLinkTypeAuthenticationCode::ID:
      return internalLinkTypeAuthenticationCode::fetch(env, p);
    case internalLinkTypeBackground::ID:
      return internalLinkTypeBackground::fetch(env, p);
    case internalLinkTypeBotAddToChannel::ID:
      return internalLinkTypeBotAddToChannel::fetch(env, p);
    case internalLinkTypeBotStart::ID:
      return internalLinkTypeBotStart::fetch(env, p);
    case internalLinkTypeBotStartInGroup::ID:
      return internalLinkTypeBotStartInGroup::fetch(env, p);
    case internalLinkTypeBusinessChat::ID:
      return internalLinkTypeBusinessChat::fetch(env, p);
    case internalLinkTypeCallsPage::ID:
      return internalLinkTypeCallsPage::fetch(env, p);
    case internalLinkTypeChatAffiliateProgram::ID:
      return internalLinkTypeChatAffiliateProgram::fetch(env, p);
    case internalLinkTypeChatBoost::ID:
      return internalLinkTypeChatBoost::fetch(env, p);
    case internalLinkTypeChatFolderInvite::ID:
      return internalLinkTypeChatFolderInvite::fetch(env, p);
    case internalLinkTypeChatInvite::ID:
      return internalLinkTypeChatInvite::fetch(env, p);
    case internalLinkTypeChatSelection::ID:
      return internalLinkTypeChatSelection::fetch(env, p);
    case internalLinkTypeContactsPage::ID:
      return internalLinkTypeContactsPage::fetch(env, p);
    case internalLinkTypeDirectMessagesChat::ID:
      return internalLinkTypeDirectMessagesChat::fetch(env, p);
    case internalLinkTypeGame::ID:
      return internalLinkTypeGame::fetch(env, p);
    case internalLinkTypeGiftAuction::ID:
      return internalLinkTypeGiftAuction::fetch(env, p);
    case internalLinkTypeGiftCollection::ID:
      return internalLinkTypeGiftCollection::fetch(env, p);
    case internalLinkTypeGroupCall::ID:
      return internalLinkTypeGroupCall::fetch(env, p);
    case internalLinkTypeInstantView::ID:
      return internalLinkTypeInstantView::fetch(env, p);
    case internalLinkTypeInvoice::ID:
      return internalLinkTypeInvoice::fetch(env, p);
    case internalLinkTypeLanguagePack::ID:
      return internalLinkTypeLanguagePack::fetch(env, p);
    case internalLinkTypeLiveStory::ID:
      return internalLinkTypeLiveStory::fetch(env, p);
    case internalLinkTypeMainWebApp::ID:
      return internalLinkTypeMainWebApp::fetch(env, p);
    case internalLinkTypeMessage::ID:
      return internalLinkTypeMessage::fetch(env, p);
    case internalLinkTypeMessageDraft::ID:
      return internalLinkTypeMessageDraft::fetch(env, p);
    case internalLinkTypeMyProfilePage::ID:
      return internalLinkTypeMyProfilePage::fetch(env, p);
    case internalLinkTypeNewChannelChat::ID:
      return internalLinkTypeNewChannelChat::fetch(env, p);
    case internalLinkTypeNewGroupChat::ID:
      return internalLinkTypeNewGroupChat::fetch(env, p);
    case internalLinkTypeNewPrivateChat::ID:
      return internalLinkTypeNewPrivateChat::fetch(env, p);
    case internalLinkTypeNewStory::ID:
      return internalLinkTypeNewStory::fetch(env, p);
    case internalLinkTypeOauth::ID:
      return internalLinkTypeOauth::fetch(env, p);
    case internalLinkTypePassportDataRequest::ID:
      return internalLinkTypePassportDataRequest::fetch(env, p);
    case internalLinkTypePhoneNumberConfirmation::ID:
      return internalLinkTypePhoneNumberConfirmation::fetch(env, p);
    case internalLinkTypePremiumFeaturesPage::ID:
      return internalLinkTypePremiumFeaturesPage::fetch(env, p);
    case internalLinkTypePremiumGiftCode::ID:
      return internalLinkTypePremiumGiftCode::fetch(env, p);
    case internalLinkTypePremiumGiftPurchase::ID:
      return internalLinkTypePremiumGiftPurchase::fetch(env, p);
    case internalLinkTypeProxy::ID:
      return internalLinkTypeProxy::fetch(env, p);
    case internalLinkTypePublicChat::ID:
      return internalLinkTypePublicChat::fetch(env, p);
    case internalLinkTypeQrCodeAuthentication::ID:
      return internalLinkTypeQrCodeAuthentication::fetch(env, p);
    case internalLinkTypeRequestManagedBot::ID:
      return internalLinkTypeRequestManagedBot::fetch(env, p);
    case internalLinkTypeRestorePurchases::ID:
      return internalLinkTypeRestorePurchases::fetch(env, p);
    case internalLinkTypeSavedMessages::ID:
      return internalLinkTypeSavedMessages::fetch(env, p);
    case internalLinkTypeSearch::ID:
      return internalLinkTypeSearch::fetch(env, p);
    case internalLinkTypeSettings::ID:
      return internalLinkTypeSettings::fetch(env, p);
    case internalLinkTypeStarPurchase::ID:
      return internalLinkTypeStarPurchase::fetch(env, p);
    case internalLinkTypeStickerSet::ID:
      return internalLinkTypeStickerSet::fetch(env, p);
    case internalLinkTypeStory::ID:
      return internalLinkTypeStory::fetch(env, p);
    case internalLinkTypeStoryAlbum::ID:
      return internalLinkTypeStoryAlbum::fetch(env, p);
    case internalLinkTypeTextCompositionStyle::ID:
      return internalLinkTypeTextCompositionStyle::fetch(env, p);
    case internalLinkTypeTheme::ID:
      return internalLinkTypeTheme::fetch(env, p);
    case internalLinkTypeUnknownDeepLink::ID:
      return internalLinkTypeUnknownDeepLink::fetch(env, p);
    case internalLinkTypeUpgradedGift::ID:
      return internalLinkTypeUpgradedGift::fetch(env, p);
    case internalLinkTypeUserPhoneNumber::ID:
      return internalLinkTypeUserPhoneNumber::fetch(env, p);
    case internalLinkTypeUserToken::ID:
      return internalLinkTypeUserToken::fetch(env, p);
    case internalLinkTypeVideoChat::ID:
      return internalLinkTypeVideoChat::fetch(env, p);
    case internalLinkTypeWebApp::ID:
      return internalLinkTypeWebApp::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void InternalLinkType::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkType").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeAttachmentMenuBot::Class;
jfieldID internalLinkTypeAttachmentMenuBot::target_chat_fieldID;
jfieldID internalLinkTypeAttachmentMenuBot::bot_username_fieldID;
jfieldID internalLinkTypeAttachmentMenuBot::url_fieldID;

internalLinkTypeAttachmentMenuBot::internalLinkTypeAttachmentMenuBot()
  : target_chat_()
  , bot_username_()
  , url_()
{}

internalLinkTypeAttachmentMenuBot::internalLinkTypeAttachmentMenuBot(object_ptr<TargetChat> &&target_chat_, string const &bot_username_, string const &url_)
  : target_chat_(std::move(target_chat_))
  , bot_username_(bot_username_)
  , url_(url_)
{}

const std::int32_t internalLinkTypeAttachmentMenuBot::ID;

object_ptr<InternalLinkType> internalLinkTypeAttachmentMenuBot::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeAttachmentMenuBot> res = make_object<internalLinkTypeAttachmentMenuBot>();
  res->target_chat_ = jni::fetch_tl_object<TargetChat>(env, jni::fetch_object(env, p, res->target_chat_fieldID));
  res->bot_username_ = jni::fetch_string(env, p, res->bot_username_fieldID);
  res->url_ = jni::fetch_string(env, p, res->url_fieldID);
  return std::move(res);
}

void internalLinkTypeAttachmentMenuBot::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (target_chat_ != nullptr) { jobject next; target_chat_->store(env, next); if (next) { env->SetObjectField(s, target_chat_fieldID, next); env->DeleteLocalRef(next); } }
  { jstring nextString = jni::to_jstring(env, bot_username_); if (nextString) { env->SetObjectField(s, bot_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, url_); if (nextString) { env->SetObjectField(s, url_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeAttachmentMenuBot::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeAttachmentMenuBot");
    s.store_object_field("targetChat", static_cast<const BaseObject *>(target_chat_.get()));
    s.store_field("botUsername", bot_username_);
    s.store_field("url", url_);
    s.store_class_end();
  }
}

void internalLinkTypeAttachmentMenuBot::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeAttachmentMenuBot").c_str());
    target_chat_fieldID = jni::get_field_id(env, Class, "targetChat", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$TargetChat;").c_str());
    bot_username_fieldID = jni::get_field_id(env, Class, "botUsername", "Ljava/lang/String;");
    url_fieldID = jni::get_field_id(env, Class, "url", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeAuthenticationCode::Class;
jfieldID internalLinkTypeAuthenticationCode::code_fieldID;

internalLinkTypeAuthenticationCode::internalLinkTypeAuthenticationCode()
  : code_()
{}

internalLinkTypeAuthenticationCode::internalLinkTypeAuthenticationCode(string const &code_)
  : code_(code_)
{}

const std::int32_t internalLinkTypeAuthenticationCode::ID;

object_ptr<InternalLinkType> internalLinkTypeAuthenticationCode::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeAuthenticationCode> res = make_object<internalLinkTypeAuthenticationCode>();
  res->code_ = jni::fetch_string(env, p, res->code_fieldID);
  return std::move(res);
}

void internalLinkTypeAuthenticationCode::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, code_); if (nextString) { env->SetObjectField(s, code_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeAuthenticationCode::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeAuthenticationCode");
    s.store_field("code", code_);
    s.store_class_end();
  }
}

void internalLinkTypeAuthenticationCode::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeAuthenticationCode").c_str());
    code_fieldID = jni::get_field_id(env, Class, "code", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeBackground::Class;
jfieldID internalLinkTypeBackground::background_name_fieldID;

internalLinkTypeBackground::internalLinkTypeBackground()
  : background_name_()
{}

internalLinkTypeBackground::internalLinkTypeBackground(string const &background_name_)
  : background_name_(background_name_)
{}

const std::int32_t internalLinkTypeBackground::ID;

object_ptr<InternalLinkType> internalLinkTypeBackground::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeBackground> res = make_object<internalLinkTypeBackground>();
  res->background_name_ = jni::fetch_string(env, p, res->background_name_fieldID);
  return std::move(res);
}

void internalLinkTypeBackground::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, background_name_); if (nextString) { env->SetObjectField(s, background_name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeBackground::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeBackground");
    s.store_field("backgroundName", background_name_);
    s.store_class_end();
  }
}

void internalLinkTypeBackground::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeBackground").c_str());
    background_name_fieldID = jni::get_field_id(env, Class, "backgroundName", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeBotAddToChannel::Class;
jfieldID internalLinkTypeBotAddToChannel::bot_username_fieldID;
jfieldID internalLinkTypeBotAddToChannel::administrator_rights_fieldID;

internalLinkTypeBotAddToChannel::internalLinkTypeBotAddToChannel()
  : bot_username_()
  , administrator_rights_()
{}

internalLinkTypeBotAddToChannel::internalLinkTypeBotAddToChannel(string const &bot_username_, object_ptr<chatAdministratorRights> &&administrator_rights_)
  : bot_username_(bot_username_)
  , administrator_rights_(std::move(administrator_rights_))
{}

const std::int32_t internalLinkTypeBotAddToChannel::ID;

object_ptr<InternalLinkType> internalLinkTypeBotAddToChannel::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeBotAddToChannel> res = make_object<internalLinkTypeBotAddToChannel>();
  res->bot_username_ = jni::fetch_string(env, p, res->bot_username_fieldID);
  res->administrator_rights_ = jni::fetch_tl_object<chatAdministratorRights>(env, jni::fetch_object(env, p, res->administrator_rights_fieldID));
  return std::move(res);
}

void internalLinkTypeBotAddToChannel::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, bot_username_); if (nextString) { env->SetObjectField(s, bot_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  if (administrator_rights_ != nullptr) { jobject next; administrator_rights_->store(env, next); if (next) { env->SetObjectField(s, administrator_rights_fieldID, next); env->DeleteLocalRef(next); } }
}

void internalLinkTypeBotAddToChannel::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeBotAddToChannel");
    s.store_field("botUsername", bot_username_);
    s.store_object_field("administratorRights", static_cast<const BaseObject *>(administrator_rights_.get()));
    s.store_class_end();
  }
}

void internalLinkTypeBotAddToChannel::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeBotAddToChannel").c_str());
    bot_username_fieldID = jni::get_field_id(env, Class, "botUsername", "Ljava/lang/String;");
    administrator_rights_fieldID = jni::get_field_id(env, Class, "administratorRights", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ChatAdministratorRights;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeBotStart::Class;
jfieldID internalLinkTypeBotStart::bot_username_fieldID;
jfieldID internalLinkTypeBotStart::start_parameter_fieldID;
jfieldID internalLinkTypeBotStart::autostart_fieldID;

internalLinkTypeBotStart::internalLinkTypeBotStart()
  : bot_username_()
  , start_parameter_()
  , autostart_()
{}

internalLinkTypeBotStart::internalLinkTypeBotStart(string const &bot_username_, string const &start_parameter_, bool autostart_)
  : bot_username_(bot_username_)
  , start_parameter_(start_parameter_)
  , autostart_(autostart_)
{}

const std::int32_t internalLinkTypeBotStart::ID;

object_ptr<InternalLinkType> internalLinkTypeBotStart::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeBotStart> res = make_object<internalLinkTypeBotStart>();
  res->bot_username_ = jni::fetch_string(env, p, res->bot_username_fieldID);
  res->start_parameter_ = jni::fetch_string(env, p, res->start_parameter_fieldID);
  res->autostart_ = (env->GetBooleanField(p, res->autostart_fieldID) != 0);
  return std::move(res);
}

void internalLinkTypeBotStart::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, bot_username_); if (nextString) { env->SetObjectField(s, bot_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, start_parameter_); if (nextString) { env->SetObjectField(s, start_parameter_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetBooleanField(s, autostart_fieldID, autostart_);
}

void internalLinkTypeBotStart::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeBotStart");
    s.store_field("botUsername", bot_username_);
    s.store_field("startParameter", start_parameter_);
    s.store_field("autostart", autostart_);
    s.store_class_end();
  }
}

void internalLinkTypeBotStart::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeBotStart").c_str());
    bot_username_fieldID = jni::get_field_id(env, Class, "botUsername", "Ljava/lang/String;");
    start_parameter_fieldID = jni::get_field_id(env, Class, "startParameter", "Ljava/lang/String;");
    autostart_fieldID = jni::get_field_id(env, Class, "autostart", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeBotStartInGroup::Class;
jfieldID internalLinkTypeBotStartInGroup::bot_username_fieldID;
jfieldID internalLinkTypeBotStartInGroup::start_parameter_fieldID;
jfieldID internalLinkTypeBotStartInGroup::administrator_rights_fieldID;

internalLinkTypeBotStartInGroup::internalLinkTypeBotStartInGroup()
  : bot_username_()
  , start_parameter_()
  , administrator_rights_()
{}

internalLinkTypeBotStartInGroup::internalLinkTypeBotStartInGroup(string const &bot_username_, string const &start_parameter_, object_ptr<chatAdministratorRights> &&administrator_rights_)
  : bot_username_(bot_username_)
  , start_parameter_(start_parameter_)
  , administrator_rights_(std::move(administrator_rights_))
{}

const std::int32_t internalLinkTypeBotStartInGroup::ID;

object_ptr<InternalLinkType> internalLinkTypeBotStartInGroup::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeBotStartInGroup> res = make_object<internalLinkTypeBotStartInGroup>();
  res->bot_username_ = jni::fetch_string(env, p, res->bot_username_fieldID);
  res->start_parameter_ = jni::fetch_string(env, p, res->start_parameter_fieldID);
  res->administrator_rights_ = jni::fetch_tl_object<chatAdministratorRights>(env, jni::fetch_object(env, p, res->administrator_rights_fieldID));
  return std::move(res);
}

void internalLinkTypeBotStartInGroup::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, bot_username_); if (nextString) { env->SetObjectField(s, bot_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, start_parameter_); if (nextString) { env->SetObjectField(s, start_parameter_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  if (administrator_rights_ != nullptr) { jobject next; administrator_rights_->store(env, next); if (next) { env->SetObjectField(s, administrator_rights_fieldID, next); env->DeleteLocalRef(next); } }
}

void internalLinkTypeBotStartInGroup::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeBotStartInGroup");
    s.store_field("botUsername", bot_username_);
    s.store_field("startParameter", start_parameter_);
    s.store_object_field("administratorRights", static_cast<const BaseObject *>(administrator_rights_.get()));
    s.store_class_end();
  }
}

void internalLinkTypeBotStartInGroup::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeBotStartInGroup").c_str());
    bot_username_fieldID = jni::get_field_id(env, Class, "botUsername", "Ljava/lang/String;");
    start_parameter_fieldID = jni::get_field_id(env, Class, "startParameter", "Ljava/lang/String;");
    administrator_rights_fieldID = jni::get_field_id(env, Class, "administratorRights", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ChatAdministratorRights;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeBusinessChat::Class;
jfieldID internalLinkTypeBusinessChat::link_name_fieldID;

internalLinkTypeBusinessChat::internalLinkTypeBusinessChat()
  : link_name_()
{}

internalLinkTypeBusinessChat::internalLinkTypeBusinessChat(string const &link_name_)
  : link_name_(link_name_)
{}

const std::int32_t internalLinkTypeBusinessChat::ID;

object_ptr<InternalLinkType> internalLinkTypeBusinessChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeBusinessChat> res = make_object<internalLinkTypeBusinessChat>();
  res->link_name_ = jni::fetch_string(env, p, res->link_name_fieldID);
  return std::move(res);
}

void internalLinkTypeBusinessChat::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, link_name_); if (nextString) { env->SetObjectField(s, link_name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeBusinessChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeBusinessChat");
    s.store_field("linkName", link_name_);
    s.store_class_end();
  }
}

void internalLinkTypeBusinessChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeBusinessChat").c_str());
    link_name_fieldID = jni::get_field_id(env, Class, "linkName", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeCallsPage::Class;
jfieldID internalLinkTypeCallsPage::section_fieldID;

internalLinkTypeCallsPage::internalLinkTypeCallsPage()
  : section_()
{}

internalLinkTypeCallsPage::internalLinkTypeCallsPage(string const &section_)
  : section_(section_)
{}

const std::int32_t internalLinkTypeCallsPage::ID;

object_ptr<InternalLinkType> internalLinkTypeCallsPage::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeCallsPage> res = make_object<internalLinkTypeCallsPage>();
  res->section_ = jni::fetch_string(env, p, res->section_fieldID);
  return std::move(res);
}

void internalLinkTypeCallsPage::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, section_); if (nextString) { env->SetObjectField(s, section_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeCallsPage::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeCallsPage");
    s.store_field("section", section_);
    s.store_class_end();
  }
}

void internalLinkTypeCallsPage::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeCallsPage").c_str());
    section_fieldID = jni::get_field_id(env, Class, "section", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeChatAffiliateProgram::Class;
jfieldID internalLinkTypeChatAffiliateProgram::username_fieldID;
jfieldID internalLinkTypeChatAffiliateProgram::referrer_fieldID;

internalLinkTypeChatAffiliateProgram::internalLinkTypeChatAffiliateProgram()
  : username_()
  , referrer_()
{}

internalLinkTypeChatAffiliateProgram::internalLinkTypeChatAffiliateProgram(string const &username_, string const &referrer_)
  : username_(username_)
  , referrer_(referrer_)
{}

const std::int32_t internalLinkTypeChatAffiliateProgram::ID;

object_ptr<InternalLinkType> internalLinkTypeChatAffiliateProgram::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeChatAffiliateProgram> res = make_object<internalLinkTypeChatAffiliateProgram>();
  res->username_ = jni::fetch_string(env, p, res->username_fieldID);
  res->referrer_ = jni::fetch_string(env, p, res->referrer_fieldID);
  return std::move(res);
}

void internalLinkTypeChatAffiliateProgram::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, username_); if (nextString) { env->SetObjectField(s, username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, referrer_); if (nextString) { env->SetObjectField(s, referrer_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeChatAffiliateProgram::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeChatAffiliateProgram");
    s.store_field("username", username_);
    s.store_field("referrer", referrer_);
    s.store_class_end();
  }
}

void internalLinkTypeChatAffiliateProgram::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeChatAffiliateProgram").c_str());
    username_fieldID = jni::get_field_id(env, Class, "username", "Ljava/lang/String;");
    referrer_fieldID = jni::get_field_id(env, Class, "referrer", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeChatBoost::Class;
jfieldID internalLinkTypeChatBoost::url_fieldID;

internalLinkTypeChatBoost::internalLinkTypeChatBoost()
  : url_()
{}

internalLinkTypeChatBoost::internalLinkTypeChatBoost(string const &url_)
  : url_(url_)
{}

const std::int32_t internalLinkTypeChatBoost::ID;

object_ptr<InternalLinkType> internalLinkTypeChatBoost::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeChatBoost> res = make_object<internalLinkTypeChatBoost>();
  res->url_ = jni::fetch_string(env, p, res->url_fieldID);
  return std::move(res);
}

void internalLinkTypeChatBoost::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, url_); if (nextString) { env->SetObjectField(s, url_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeChatBoost::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeChatBoost");
    s.store_field("url", url_);
    s.store_class_end();
  }
}

void internalLinkTypeChatBoost::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeChatBoost").c_str());
    url_fieldID = jni::get_field_id(env, Class, "url", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeChatFolderInvite::Class;
jfieldID internalLinkTypeChatFolderInvite::invite_link_fieldID;

internalLinkTypeChatFolderInvite::internalLinkTypeChatFolderInvite()
  : invite_link_()
{}

internalLinkTypeChatFolderInvite::internalLinkTypeChatFolderInvite(string const &invite_link_)
  : invite_link_(invite_link_)
{}

const std::int32_t internalLinkTypeChatFolderInvite::ID;

object_ptr<InternalLinkType> internalLinkTypeChatFolderInvite::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeChatFolderInvite> res = make_object<internalLinkTypeChatFolderInvite>();
  res->invite_link_ = jni::fetch_string(env, p, res->invite_link_fieldID);
  return std::move(res);
}

void internalLinkTypeChatFolderInvite::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, invite_link_); if (nextString) { env->SetObjectField(s, invite_link_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeChatFolderInvite::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeChatFolderInvite");
    s.store_field("inviteLink", invite_link_);
    s.store_class_end();
  }
}

void internalLinkTypeChatFolderInvite::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeChatFolderInvite").c_str());
    invite_link_fieldID = jni::get_field_id(env, Class, "inviteLink", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeChatInvite::Class;
jfieldID internalLinkTypeChatInvite::invite_link_fieldID;

internalLinkTypeChatInvite::internalLinkTypeChatInvite()
  : invite_link_()
{}

internalLinkTypeChatInvite::internalLinkTypeChatInvite(string const &invite_link_)
  : invite_link_(invite_link_)
{}

const std::int32_t internalLinkTypeChatInvite::ID;

object_ptr<InternalLinkType> internalLinkTypeChatInvite::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeChatInvite> res = make_object<internalLinkTypeChatInvite>();
  res->invite_link_ = jni::fetch_string(env, p, res->invite_link_fieldID);
  return std::move(res);
}

void internalLinkTypeChatInvite::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, invite_link_); if (nextString) { env->SetObjectField(s, invite_link_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeChatInvite::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeChatInvite");
    s.store_field("inviteLink", invite_link_);
    s.store_class_end();
  }
}

void internalLinkTypeChatInvite::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeChatInvite").c_str());
    invite_link_fieldID = jni::get_field_id(env, Class, "inviteLink", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeChatSelection::Class;

internalLinkTypeChatSelection::internalLinkTypeChatSelection() {
}

const std::int32_t internalLinkTypeChatSelection::ID;

object_ptr<InternalLinkType> internalLinkTypeChatSelection::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<internalLinkTypeChatSelection>();
}

void internalLinkTypeChatSelection::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void internalLinkTypeChatSelection::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeChatSelection");
    s.store_class_end();
  }
}

void internalLinkTypeChatSelection::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeChatSelection").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeContactsPage::Class;
jfieldID internalLinkTypeContactsPage::section_fieldID;

internalLinkTypeContactsPage::internalLinkTypeContactsPage()
  : section_()
{}

internalLinkTypeContactsPage::internalLinkTypeContactsPage(string const &section_)
  : section_(section_)
{}

const std::int32_t internalLinkTypeContactsPage::ID;

object_ptr<InternalLinkType> internalLinkTypeContactsPage::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeContactsPage> res = make_object<internalLinkTypeContactsPage>();
  res->section_ = jni::fetch_string(env, p, res->section_fieldID);
  return std::move(res);
}

void internalLinkTypeContactsPage::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, section_); if (nextString) { env->SetObjectField(s, section_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeContactsPage::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeContactsPage");
    s.store_field("section", section_);
    s.store_class_end();
  }
}

void internalLinkTypeContactsPage::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeContactsPage").c_str());
    section_fieldID = jni::get_field_id(env, Class, "section", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeDirectMessagesChat::Class;
jfieldID internalLinkTypeDirectMessagesChat::channel_username_fieldID;

internalLinkTypeDirectMessagesChat::internalLinkTypeDirectMessagesChat()
  : channel_username_()
{}

internalLinkTypeDirectMessagesChat::internalLinkTypeDirectMessagesChat(string const &channel_username_)
  : channel_username_(channel_username_)
{}

const std::int32_t internalLinkTypeDirectMessagesChat::ID;

object_ptr<InternalLinkType> internalLinkTypeDirectMessagesChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeDirectMessagesChat> res = make_object<internalLinkTypeDirectMessagesChat>();
  res->channel_username_ = jni::fetch_string(env, p, res->channel_username_fieldID);
  return std::move(res);
}

void internalLinkTypeDirectMessagesChat::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, channel_username_); if (nextString) { env->SetObjectField(s, channel_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeDirectMessagesChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeDirectMessagesChat");
    s.store_field("channelUsername", channel_username_);
    s.store_class_end();
  }
}

void internalLinkTypeDirectMessagesChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeDirectMessagesChat").c_str());
    channel_username_fieldID = jni::get_field_id(env, Class, "channelUsername", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeGame::Class;
jfieldID internalLinkTypeGame::bot_username_fieldID;
jfieldID internalLinkTypeGame::game_short_name_fieldID;

internalLinkTypeGame::internalLinkTypeGame()
  : bot_username_()
  , game_short_name_()
{}

internalLinkTypeGame::internalLinkTypeGame(string const &bot_username_, string const &game_short_name_)
  : bot_username_(bot_username_)
  , game_short_name_(game_short_name_)
{}

const std::int32_t internalLinkTypeGame::ID;

object_ptr<InternalLinkType> internalLinkTypeGame::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeGame> res = make_object<internalLinkTypeGame>();
  res->bot_username_ = jni::fetch_string(env, p, res->bot_username_fieldID);
  res->game_short_name_ = jni::fetch_string(env, p, res->game_short_name_fieldID);
  return std::move(res);
}

void internalLinkTypeGame::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, bot_username_); if (nextString) { env->SetObjectField(s, bot_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, game_short_name_); if (nextString) { env->SetObjectField(s, game_short_name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeGame::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeGame");
    s.store_field("botUsername", bot_username_);
    s.store_field("gameShortName", game_short_name_);
    s.store_class_end();
  }
}

void internalLinkTypeGame::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeGame").c_str());
    bot_username_fieldID = jni::get_field_id(env, Class, "botUsername", "Ljava/lang/String;");
    game_short_name_fieldID = jni::get_field_id(env, Class, "gameShortName", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeGiftAuction::Class;
jfieldID internalLinkTypeGiftAuction::auction_id_fieldID;

internalLinkTypeGiftAuction::internalLinkTypeGiftAuction()
  : auction_id_()
{}

internalLinkTypeGiftAuction::internalLinkTypeGiftAuction(string const &auction_id_)
  : auction_id_(auction_id_)
{}

const std::int32_t internalLinkTypeGiftAuction::ID;

object_ptr<InternalLinkType> internalLinkTypeGiftAuction::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeGiftAuction> res = make_object<internalLinkTypeGiftAuction>();
  res->auction_id_ = jni::fetch_string(env, p, res->auction_id_fieldID);
  return std::move(res);
}

void internalLinkTypeGiftAuction::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, auction_id_); if (nextString) { env->SetObjectField(s, auction_id_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeGiftAuction::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeGiftAuction");
    s.store_field("auctionId", auction_id_);
    s.store_class_end();
  }
}

void internalLinkTypeGiftAuction::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeGiftAuction").c_str());
    auction_id_fieldID = jni::get_field_id(env, Class, "auctionId", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeGiftCollection::Class;
jfieldID internalLinkTypeGiftCollection::gift_owner_username_fieldID;
jfieldID internalLinkTypeGiftCollection::collection_id_fieldID;

internalLinkTypeGiftCollection::internalLinkTypeGiftCollection()
  : gift_owner_username_()
  , collection_id_()
{}

internalLinkTypeGiftCollection::internalLinkTypeGiftCollection(string const &gift_owner_username_, int32 collection_id_)
  : gift_owner_username_(gift_owner_username_)
  , collection_id_(collection_id_)
{}

const std::int32_t internalLinkTypeGiftCollection::ID;

object_ptr<InternalLinkType> internalLinkTypeGiftCollection::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeGiftCollection> res = make_object<internalLinkTypeGiftCollection>();
  res->gift_owner_username_ = jni::fetch_string(env, p, res->gift_owner_username_fieldID);
  res->collection_id_ = env->GetIntField(p, res->collection_id_fieldID);
  return std::move(res);
}

void internalLinkTypeGiftCollection::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, gift_owner_username_); if (nextString) { env->SetObjectField(s, gift_owner_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetIntField(s, collection_id_fieldID, collection_id_);
}

void internalLinkTypeGiftCollection::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeGiftCollection");
    s.store_field("giftOwnerUsername", gift_owner_username_);
    s.store_field("collectionId", collection_id_);
    s.store_class_end();
  }
}

void internalLinkTypeGiftCollection::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeGiftCollection").c_str());
    gift_owner_username_fieldID = jni::get_field_id(env, Class, "giftOwnerUsername", "Ljava/lang/String;");
    collection_id_fieldID = jni::get_field_id(env, Class, "collectionId", "I");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeGroupCall::Class;
jfieldID internalLinkTypeGroupCall::invite_link_fieldID;

internalLinkTypeGroupCall::internalLinkTypeGroupCall()
  : invite_link_()
{}

internalLinkTypeGroupCall::internalLinkTypeGroupCall(string const &invite_link_)
  : invite_link_(invite_link_)
{}

const std::int32_t internalLinkTypeGroupCall::ID;

object_ptr<InternalLinkType> internalLinkTypeGroupCall::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeGroupCall> res = make_object<internalLinkTypeGroupCall>();
  res->invite_link_ = jni::fetch_string(env, p, res->invite_link_fieldID);
  return std::move(res);
}

void internalLinkTypeGroupCall::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, invite_link_); if (nextString) { env->SetObjectField(s, invite_link_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeGroupCall::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeGroupCall");
    s.store_field("inviteLink", invite_link_);
    s.store_class_end();
  }
}

void internalLinkTypeGroupCall::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeGroupCall").c_str());
    invite_link_fieldID = jni::get_field_id(env, Class, "inviteLink", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeInstantView::Class;
jfieldID internalLinkTypeInstantView::url_fieldID;
jfieldID internalLinkTypeInstantView::fallback_url_fieldID;

internalLinkTypeInstantView::internalLinkTypeInstantView()
  : url_()
  , fallback_url_()
{}

internalLinkTypeInstantView::internalLinkTypeInstantView(string const &url_, string const &fallback_url_)
  : url_(url_)
  , fallback_url_(fallback_url_)
{}

const std::int32_t internalLinkTypeInstantView::ID;

object_ptr<InternalLinkType> internalLinkTypeInstantView::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeInstantView> res = make_object<internalLinkTypeInstantView>();
  res->url_ = jni::fetch_string(env, p, res->url_fieldID);
  res->fallback_url_ = jni::fetch_string(env, p, res->fallback_url_fieldID);
  return std::move(res);
}

void internalLinkTypeInstantView::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, url_); if (nextString) { env->SetObjectField(s, url_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, fallback_url_); if (nextString) { env->SetObjectField(s, fallback_url_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeInstantView::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeInstantView");
    s.store_field("url", url_);
    s.store_field("fallbackUrl", fallback_url_);
    s.store_class_end();
  }
}

void internalLinkTypeInstantView::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeInstantView").c_str());
    url_fieldID = jni::get_field_id(env, Class, "url", "Ljava/lang/String;");
    fallback_url_fieldID = jni::get_field_id(env, Class, "fallbackUrl", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeInvoice::Class;
jfieldID internalLinkTypeInvoice::invoice_name_fieldID;

internalLinkTypeInvoice::internalLinkTypeInvoice()
  : invoice_name_()
{}

internalLinkTypeInvoice::internalLinkTypeInvoice(string const &invoice_name_)
  : invoice_name_(invoice_name_)
{}

const std::int32_t internalLinkTypeInvoice::ID;

object_ptr<InternalLinkType> internalLinkTypeInvoice::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeInvoice> res = make_object<internalLinkTypeInvoice>();
  res->invoice_name_ = jni::fetch_string(env, p, res->invoice_name_fieldID);
  return std::move(res);
}

void internalLinkTypeInvoice::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, invoice_name_); if (nextString) { env->SetObjectField(s, invoice_name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeInvoice::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeInvoice");
    s.store_field("invoiceName", invoice_name_);
    s.store_class_end();
  }
}

void internalLinkTypeInvoice::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeInvoice").c_str());
    invoice_name_fieldID = jni::get_field_id(env, Class, "invoiceName", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeLanguagePack::Class;
jfieldID internalLinkTypeLanguagePack::language_pack_id_fieldID;

internalLinkTypeLanguagePack::internalLinkTypeLanguagePack()
  : language_pack_id_()
{}

internalLinkTypeLanguagePack::internalLinkTypeLanguagePack(string const &language_pack_id_)
  : language_pack_id_(language_pack_id_)
{}

const std::int32_t internalLinkTypeLanguagePack::ID;

object_ptr<InternalLinkType> internalLinkTypeLanguagePack::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeLanguagePack> res = make_object<internalLinkTypeLanguagePack>();
  res->language_pack_id_ = jni::fetch_string(env, p, res->language_pack_id_fieldID);
  return std::move(res);
}

void internalLinkTypeLanguagePack::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, language_pack_id_); if (nextString) { env->SetObjectField(s, language_pack_id_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeLanguagePack::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeLanguagePack");
    s.store_field("languagePackId", language_pack_id_);
    s.store_class_end();
  }
}

void internalLinkTypeLanguagePack::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeLanguagePack").c_str());
    language_pack_id_fieldID = jni::get_field_id(env, Class, "languagePackId", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeLiveStory::Class;
jfieldID internalLinkTypeLiveStory::story_poster_username_fieldID;

internalLinkTypeLiveStory::internalLinkTypeLiveStory()
  : story_poster_username_()
{}

internalLinkTypeLiveStory::internalLinkTypeLiveStory(string const &story_poster_username_)
  : story_poster_username_(story_poster_username_)
{}

const std::int32_t internalLinkTypeLiveStory::ID;

object_ptr<InternalLinkType> internalLinkTypeLiveStory::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeLiveStory> res = make_object<internalLinkTypeLiveStory>();
  res->story_poster_username_ = jni::fetch_string(env, p, res->story_poster_username_fieldID);
  return std::move(res);
}

void internalLinkTypeLiveStory::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, story_poster_username_); if (nextString) { env->SetObjectField(s, story_poster_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeLiveStory::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeLiveStory");
    s.store_field("storyPosterUsername", story_poster_username_);
    s.store_class_end();
  }
}

void internalLinkTypeLiveStory::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeLiveStory").c_str());
    story_poster_username_fieldID = jni::get_field_id(env, Class, "storyPosterUsername", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeMainWebApp::Class;
jfieldID internalLinkTypeMainWebApp::bot_username_fieldID;
jfieldID internalLinkTypeMainWebApp::start_parameter_fieldID;
jfieldID internalLinkTypeMainWebApp::mode_fieldID;

internalLinkTypeMainWebApp::internalLinkTypeMainWebApp()
  : bot_username_()
  , start_parameter_()
  , mode_()
{}

internalLinkTypeMainWebApp::internalLinkTypeMainWebApp(string const &bot_username_, string const &start_parameter_, object_ptr<WebAppOpenMode> &&mode_)
  : bot_username_(bot_username_)
  , start_parameter_(start_parameter_)
  , mode_(std::move(mode_))
{}

const std::int32_t internalLinkTypeMainWebApp::ID;

object_ptr<InternalLinkType> internalLinkTypeMainWebApp::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeMainWebApp> res = make_object<internalLinkTypeMainWebApp>();
  res->bot_username_ = jni::fetch_string(env, p, res->bot_username_fieldID);
  res->start_parameter_ = jni::fetch_string(env, p, res->start_parameter_fieldID);
  res->mode_ = jni::fetch_tl_object<WebAppOpenMode>(env, jni::fetch_object(env, p, res->mode_fieldID));
  return std::move(res);
}

void internalLinkTypeMainWebApp::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, bot_username_); if (nextString) { env->SetObjectField(s, bot_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, start_parameter_); if (nextString) { env->SetObjectField(s, start_parameter_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  if (mode_ != nullptr) { jobject next; mode_->store(env, next); if (next) { env->SetObjectField(s, mode_fieldID, next); env->DeleteLocalRef(next); } }
}

void internalLinkTypeMainWebApp::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeMainWebApp");
    s.store_field("botUsername", bot_username_);
    s.store_field("startParameter", start_parameter_);
    s.store_object_field("mode", static_cast<const BaseObject *>(mode_.get()));
    s.store_class_end();
  }
}

void internalLinkTypeMainWebApp::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeMainWebApp").c_str());
    bot_username_fieldID = jni::get_field_id(env, Class, "botUsername", "Ljava/lang/String;");
    start_parameter_fieldID = jni::get_field_id(env, Class, "startParameter", "Ljava/lang/String;");
    mode_fieldID = jni::get_field_id(env, Class, "mode", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$WebAppOpenMode;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeMessage::Class;
jfieldID internalLinkTypeMessage::url_fieldID;

internalLinkTypeMessage::internalLinkTypeMessage()
  : url_()
{}

internalLinkTypeMessage::internalLinkTypeMessage(string const &url_)
  : url_(url_)
{}

const std::int32_t internalLinkTypeMessage::ID;

object_ptr<InternalLinkType> internalLinkTypeMessage::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeMessage> res = make_object<internalLinkTypeMessage>();
  res->url_ = jni::fetch_string(env, p, res->url_fieldID);
  return std::move(res);
}

void internalLinkTypeMessage::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, url_); if (nextString) { env->SetObjectField(s, url_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeMessage::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeMessage");
    s.store_field("url", url_);
    s.store_class_end();
  }
}

void internalLinkTypeMessage::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeMessage").c_str());
    url_fieldID = jni::get_field_id(env, Class, "url", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeMessageDraft::Class;
jfieldID internalLinkTypeMessageDraft::text_fieldID;
jfieldID internalLinkTypeMessageDraft::contains_link_fieldID;

internalLinkTypeMessageDraft::internalLinkTypeMessageDraft()
  : text_()
  , contains_link_()
{}

internalLinkTypeMessageDraft::internalLinkTypeMessageDraft(object_ptr<formattedText> &&text_, bool contains_link_)
  : text_(std::move(text_))
  , contains_link_(contains_link_)
{}

const std::int32_t internalLinkTypeMessageDraft::ID;

object_ptr<InternalLinkType> internalLinkTypeMessageDraft::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeMessageDraft> res = make_object<internalLinkTypeMessageDraft>();
  res->text_ = jni::fetch_tl_object<formattedText>(env, jni::fetch_object(env, p, res->text_fieldID));
  res->contains_link_ = (env->GetBooleanField(p, res->contains_link_fieldID) != 0);
  return std::move(res);
}

void internalLinkTypeMessageDraft::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (text_ != nullptr) { jobject next; text_->store(env, next); if (next) { env->SetObjectField(s, text_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetBooleanField(s, contains_link_fieldID, contains_link_);
}

void internalLinkTypeMessageDraft::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeMessageDraft");
    s.store_object_field("text", static_cast<const BaseObject *>(text_.get()));
    s.store_field("containsLink", contains_link_);
    s.store_class_end();
  }
}

void internalLinkTypeMessageDraft::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeMessageDraft").c_str());
    text_fieldID = jni::get_field_id(env, Class, "text", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$FormattedText;").c_str());
    contains_link_fieldID = jni::get_field_id(env, Class, "containsLink", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeMyProfilePage::Class;
jfieldID internalLinkTypeMyProfilePage::section_fieldID;

internalLinkTypeMyProfilePage::internalLinkTypeMyProfilePage()
  : section_()
{}

internalLinkTypeMyProfilePage::internalLinkTypeMyProfilePage(string const &section_)
  : section_(section_)
{}

const std::int32_t internalLinkTypeMyProfilePage::ID;

object_ptr<InternalLinkType> internalLinkTypeMyProfilePage::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeMyProfilePage> res = make_object<internalLinkTypeMyProfilePage>();
  res->section_ = jni::fetch_string(env, p, res->section_fieldID);
  return std::move(res);
}

void internalLinkTypeMyProfilePage::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, section_); if (nextString) { env->SetObjectField(s, section_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeMyProfilePage::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeMyProfilePage");
    s.store_field("section", section_);
    s.store_class_end();
  }
}

void internalLinkTypeMyProfilePage::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeMyProfilePage").c_str());
    section_fieldID = jni::get_field_id(env, Class, "section", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeNewChannelChat::Class;

internalLinkTypeNewChannelChat::internalLinkTypeNewChannelChat() {
}

const std::int32_t internalLinkTypeNewChannelChat::ID;

object_ptr<InternalLinkType> internalLinkTypeNewChannelChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<internalLinkTypeNewChannelChat>();
}

void internalLinkTypeNewChannelChat::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void internalLinkTypeNewChannelChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeNewChannelChat");
    s.store_class_end();
  }
}

void internalLinkTypeNewChannelChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeNewChannelChat").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeNewGroupChat::Class;

internalLinkTypeNewGroupChat::internalLinkTypeNewGroupChat() {
}

const std::int32_t internalLinkTypeNewGroupChat::ID;

object_ptr<InternalLinkType> internalLinkTypeNewGroupChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<internalLinkTypeNewGroupChat>();
}

void internalLinkTypeNewGroupChat::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void internalLinkTypeNewGroupChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeNewGroupChat");
    s.store_class_end();
  }
}

void internalLinkTypeNewGroupChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeNewGroupChat").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeNewPrivateChat::Class;

internalLinkTypeNewPrivateChat::internalLinkTypeNewPrivateChat() {
}

const std::int32_t internalLinkTypeNewPrivateChat::ID;

object_ptr<InternalLinkType> internalLinkTypeNewPrivateChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<internalLinkTypeNewPrivateChat>();
}

void internalLinkTypeNewPrivateChat::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void internalLinkTypeNewPrivateChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeNewPrivateChat");
    s.store_class_end();
  }
}

void internalLinkTypeNewPrivateChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeNewPrivateChat").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeNewStory::Class;
jfieldID internalLinkTypeNewStory::content_type_fieldID;

internalLinkTypeNewStory::internalLinkTypeNewStory()
  : content_type_()
{}

internalLinkTypeNewStory::internalLinkTypeNewStory(object_ptr<StoryContentType> &&content_type_)
  : content_type_(std::move(content_type_))
{}

const std::int32_t internalLinkTypeNewStory::ID;

object_ptr<InternalLinkType> internalLinkTypeNewStory::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeNewStory> res = make_object<internalLinkTypeNewStory>();
  res->content_type_ = jni::fetch_tl_object<StoryContentType>(env, jni::fetch_object(env, p, res->content_type_fieldID));
  return std::move(res);
}

void internalLinkTypeNewStory::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (content_type_ != nullptr) { jobject next; content_type_->store(env, next); if (next) { env->SetObjectField(s, content_type_fieldID, next); env->DeleteLocalRef(next); } }
}

void internalLinkTypeNewStory::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeNewStory");
    s.store_object_field("contentType", static_cast<const BaseObject *>(content_type_.get()));
    s.store_class_end();
  }
}

void internalLinkTypeNewStory::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeNewStory").c_str());
    content_type_fieldID = jni::get_field_id(env, Class, "contentType", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StoryContentType;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeOauth::Class;
jfieldID internalLinkTypeOauth::url_fieldID;

internalLinkTypeOauth::internalLinkTypeOauth()
  : url_()
{}

internalLinkTypeOauth::internalLinkTypeOauth(string const &url_)
  : url_(url_)
{}

const std::int32_t internalLinkTypeOauth::ID;

object_ptr<InternalLinkType> internalLinkTypeOauth::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeOauth> res = make_object<internalLinkTypeOauth>();
  res->url_ = jni::fetch_string(env, p, res->url_fieldID);
  return std::move(res);
}

void internalLinkTypeOauth::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, url_); if (nextString) { env->SetObjectField(s, url_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeOauth::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeOauth");
    s.store_field("url", url_);
    s.store_class_end();
  }
}

void internalLinkTypeOauth::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeOauth").c_str());
    url_fieldID = jni::get_field_id(env, Class, "url", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypePassportDataRequest::Class;
jfieldID internalLinkTypePassportDataRequest::bot_user_id_fieldID;
jfieldID internalLinkTypePassportDataRequest::scope_fieldID;
jfieldID internalLinkTypePassportDataRequest::public_key_fieldID;
jfieldID internalLinkTypePassportDataRequest::nonce_fieldID;
jfieldID internalLinkTypePassportDataRequest::callback_url_fieldID;

internalLinkTypePassportDataRequest::internalLinkTypePassportDataRequest()
  : bot_user_id_()
  , scope_()
  , public_key_()
  , nonce_()
  , callback_url_()
{}

internalLinkTypePassportDataRequest::internalLinkTypePassportDataRequest(int53 bot_user_id_, string const &scope_, string const &public_key_, string const &nonce_, string const &callback_url_)
  : bot_user_id_(bot_user_id_)
  , scope_(scope_)
  , public_key_(public_key_)
  , nonce_(nonce_)
  , callback_url_(callback_url_)
{}

const std::int32_t internalLinkTypePassportDataRequest::ID;

object_ptr<InternalLinkType> internalLinkTypePassportDataRequest::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypePassportDataRequest> res = make_object<internalLinkTypePassportDataRequest>();
  res->bot_user_id_ = env->GetLongField(p, res->bot_user_id_fieldID);
  res->scope_ = jni::fetch_string(env, p, res->scope_fieldID);
  res->public_key_ = jni::fetch_string(env, p, res->public_key_fieldID);
  res->nonce_ = jni::fetch_string(env, p, res->nonce_fieldID);
  res->callback_url_ = jni::fetch_string(env, p, res->callback_url_fieldID);
  return std::move(res);
}

void internalLinkTypePassportDataRequest::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, bot_user_id_fieldID, bot_user_id_);
  { jstring nextString = jni::to_jstring(env, scope_); if (nextString) { env->SetObjectField(s, scope_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, public_key_); if (nextString) { env->SetObjectField(s, public_key_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, nonce_); if (nextString) { env->SetObjectField(s, nonce_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, callback_url_); if (nextString) { env->SetObjectField(s, callback_url_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypePassportDataRequest::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypePassportDataRequest");
    s.store_field("botUserId", bot_user_id_);
    s.store_field("scope", scope_);
    s.store_field("publicKey", public_key_);
    s.store_field("nonce", nonce_);
    s.store_field("callbackUrl", callback_url_);
    s.store_class_end();
  }
}

void internalLinkTypePassportDataRequest::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypePassportDataRequest").c_str());
    bot_user_id_fieldID = jni::get_field_id(env, Class, "botUserId", "J");
    scope_fieldID = jni::get_field_id(env, Class, "scope", "Ljava/lang/String;");
    public_key_fieldID = jni::get_field_id(env, Class, "publicKey", "Ljava/lang/String;");
    nonce_fieldID = jni::get_field_id(env, Class, "nonce", "Ljava/lang/String;");
    callback_url_fieldID = jni::get_field_id(env, Class, "callbackUrl", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypePhoneNumberConfirmation::Class;
jfieldID internalLinkTypePhoneNumberConfirmation::hash_fieldID;
jfieldID internalLinkTypePhoneNumberConfirmation::phone_number_fieldID;

internalLinkTypePhoneNumberConfirmation::internalLinkTypePhoneNumberConfirmation()
  : hash_()
  , phone_number_()
{}

internalLinkTypePhoneNumberConfirmation::internalLinkTypePhoneNumberConfirmation(string const &hash_, string const &phone_number_)
  : hash_(hash_)
  , phone_number_(phone_number_)
{}

const std::int32_t internalLinkTypePhoneNumberConfirmation::ID;

object_ptr<InternalLinkType> internalLinkTypePhoneNumberConfirmation::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypePhoneNumberConfirmation> res = make_object<internalLinkTypePhoneNumberConfirmation>();
  res->hash_ = jni::fetch_string(env, p, res->hash_fieldID);
  res->phone_number_ = jni::fetch_string(env, p, res->phone_number_fieldID);
  return std::move(res);
}

void internalLinkTypePhoneNumberConfirmation::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, hash_); if (nextString) { env->SetObjectField(s, hash_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, phone_number_); if (nextString) { env->SetObjectField(s, phone_number_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypePhoneNumberConfirmation::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypePhoneNumberConfirmation");
    s.store_field("hash", hash_);
    s.store_field("phoneNumber", phone_number_);
    s.store_class_end();
  }
}

void internalLinkTypePhoneNumberConfirmation::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypePhoneNumberConfirmation").c_str());
    hash_fieldID = jni::get_field_id(env, Class, "hash", "Ljava/lang/String;");
    phone_number_fieldID = jni::get_field_id(env, Class, "phoneNumber", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypePremiumFeaturesPage::Class;
jfieldID internalLinkTypePremiumFeaturesPage::referrer_fieldID;

internalLinkTypePremiumFeaturesPage::internalLinkTypePremiumFeaturesPage()
  : referrer_()
{}

internalLinkTypePremiumFeaturesPage::internalLinkTypePremiumFeaturesPage(string const &referrer_)
  : referrer_(referrer_)
{}

const std::int32_t internalLinkTypePremiumFeaturesPage::ID;

object_ptr<InternalLinkType> internalLinkTypePremiumFeaturesPage::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypePremiumFeaturesPage> res = make_object<internalLinkTypePremiumFeaturesPage>();
  res->referrer_ = jni::fetch_string(env, p, res->referrer_fieldID);
  return std::move(res);
}

void internalLinkTypePremiumFeaturesPage::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, referrer_); if (nextString) { env->SetObjectField(s, referrer_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypePremiumFeaturesPage::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypePremiumFeaturesPage");
    s.store_field("referrer", referrer_);
    s.store_class_end();
  }
}

void internalLinkTypePremiumFeaturesPage::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypePremiumFeaturesPage").c_str());
    referrer_fieldID = jni::get_field_id(env, Class, "referrer", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypePremiumGiftCode::Class;
jfieldID internalLinkTypePremiumGiftCode::code_fieldID;

internalLinkTypePremiumGiftCode::internalLinkTypePremiumGiftCode()
  : code_()
{}

internalLinkTypePremiumGiftCode::internalLinkTypePremiumGiftCode(string const &code_)
  : code_(code_)
{}

const std::int32_t internalLinkTypePremiumGiftCode::ID;

object_ptr<InternalLinkType> internalLinkTypePremiumGiftCode::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypePremiumGiftCode> res = make_object<internalLinkTypePremiumGiftCode>();
  res->code_ = jni::fetch_string(env, p, res->code_fieldID);
  return std::move(res);
}

void internalLinkTypePremiumGiftCode::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, code_); if (nextString) { env->SetObjectField(s, code_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypePremiumGiftCode::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypePremiumGiftCode");
    s.store_field("code", code_);
    s.store_class_end();
  }
}

void internalLinkTypePremiumGiftCode::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypePremiumGiftCode").c_str());
    code_fieldID = jni::get_field_id(env, Class, "code", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypePremiumGiftPurchase::Class;
jfieldID internalLinkTypePremiumGiftPurchase::referrer_fieldID;

internalLinkTypePremiumGiftPurchase::internalLinkTypePremiumGiftPurchase()
  : referrer_()
{}

internalLinkTypePremiumGiftPurchase::internalLinkTypePremiumGiftPurchase(string const &referrer_)
  : referrer_(referrer_)
{}

const std::int32_t internalLinkTypePremiumGiftPurchase::ID;

object_ptr<InternalLinkType> internalLinkTypePremiumGiftPurchase::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypePremiumGiftPurchase> res = make_object<internalLinkTypePremiumGiftPurchase>();
  res->referrer_ = jni::fetch_string(env, p, res->referrer_fieldID);
  return std::move(res);
}

void internalLinkTypePremiumGiftPurchase::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, referrer_); if (nextString) { env->SetObjectField(s, referrer_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypePremiumGiftPurchase::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypePremiumGiftPurchase");
    s.store_field("referrer", referrer_);
    s.store_class_end();
  }
}

void internalLinkTypePremiumGiftPurchase::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypePremiumGiftPurchase").c_str());
    referrer_fieldID = jni::get_field_id(env, Class, "referrer", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeProxy::Class;
jfieldID internalLinkTypeProxy::proxy_fieldID;

internalLinkTypeProxy::internalLinkTypeProxy()
  : proxy_()
{}

internalLinkTypeProxy::internalLinkTypeProxy(object_ptr<proxy> &&proxy_)
  : proxy_(std::move(proxy_))
{}

const std::int32_t internalLinkTypeProxy::ID;

object_ptr<InternalLinkType> internalLinkTypeProxy::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeProxy> res = make_object<internalLinkTypeProxy>();
  res->proxy_ = jni::fetch_tl_object<proxy>(env, jni::fetch_object(env, p, res->proxy_fieldID));
  return std::move(res);
}

void internalLinkTypeProxy::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (proxy_ != nullptr) { jobject next; proxy_->store(env, next); if (next) { env->SetObjectField(s, proxy_fieldID, next); env->DeleteLocalRef(next); } }
}

void internalLinkTypeProxy::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeProxy");
    s.store_object_field("proxy", static_cast<const BaseObject *>(proxy_.get()));
    s.store_class_end();
  }
}

void internalLinkTypeProxy::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeProxy").c_str());
    proxy_fieldID = jni::get_field_id(env, Class, "proxy", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Proxy;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypePublicChat::Class;
jfieldID internalLinkTypePublicChat::chat_username_fieldID;
jfieldID internalLinkTypePublicChat::draft_text_fieldID;
jfieldID internalLinkTypePublicChat::open_profile_fieldID;

internalLinkTypePublicChat::internalLinkTypePublicChat()
  : chat_username_()
  , draft_text_()
  , open_profile_()
{}

internalLinkTypePublicChat::internalLinkTypePublicChat(string const &chat_username_, string const &draft_text_, bool open_profile_)
  : chat_username_(chat_username_)
  , draft_text_(draft_text_)
  , open_profile_(open_profile_)
{}

const std::int32_t internalLinkTypePublicChat::ID;

object_ptr<InternalLinkType> internalLinkTypePublicChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypePublicChat> res = make_object<internalLinkTypePublicChat>();
  res->chat_username_ = jni::fetch_string(env, p, res->chat_username_fieldID);
  res->draft_text_ = jni::fetch_string(env, p, res->draft_text_fieldID);
  res->open_profile_ = (env->GetBooleanField(p, res->open_profile_fieldID) != 0);
  return std::move(res);
}

void internalLinkTypePublicChat::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, chat_username_); if (nextString) { env->SetObjectField(s, chat_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, draft_text_); if (nextString) { env->SetObjectField(s, draft_text_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetBooleanField(s, open_profile_fieldID, open_profile_);
}

void internalLinkTypePublicChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypePublicChat");
    s.store_field("chatUsername", chat_username_);
    s.store_field("draftText", draft_text_);
    s.store_field("openProfile", open_profile_);
    s.store_class_end();
  }
}

void internalLinkTypePublicChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypePublicChat").c_str());
    chat_username_fieldID = jni::get_field_id(env, Class, "chatUsername", "Ljava/lang/String;");
    draft_text_fieldID = jni::get_field_id(env, Class, "draftText", "Ljava/lang/String;");
    open_profile_fieldID = jni::get_field_id(env, Class, "openProfile", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeQrCodeAuthentication::Class;

internalLinkTypeQrCodeAuthentication::internalLinkTypeQrCodeAuthentication() {
}

const std::int32_t internalLinkTypeQrCodeAuthentication::ID;

object_ptr<InternalLinkType> internalLinkTypeQrCodeAuthentication::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<internalLinkTypeQrCodeAuthentication>();
}

void internalLinkTypeQrCodeAuthentication::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void internalLinkTypeQrCodeAuthentication::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeQrCodeAuthentication");
    s.store_class_end();
  }
}

void internalLinkTypeQrCodeAuthentication::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeQrCodeAuthentication").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeRequestManagedBot::Class;
jfieldID internalLinkTypeRequestManagedBot::manager_bot_username_fieldID;
jfieldID internalLinkTypeRequestManagedBot::suggested_bot_username_fieldID;
jfieldID internalLinkTypeRequestManagedBot::suggested_bot_name_fieldID;

internalLinkTypeRequestManagedBot::internalLinkTypeRequestManagedBot()
  : manager_bot_username_()
  , suggested_bot_username_()
  , suggested_bot_name_()
{}

internalLinkTypeRequestManagedBot::internalLinkTypeRequestManagedBot(string const &manager_bot_username_, string const &suggested_bot_username_, string const &suggested_bot_name_)
  : manager_bot_username_(manager_bot_username_)
  , suggested_bot_username_(suggested_bot_username_)
  , suggested_bot_name_(suggested_bot_name_)
{}

const std::int32_t internalLinkTypeRequestManagedBot::ID;

object_ptr<InternalLinkType> internalLinkTypeRequestManagedBot::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeRequestManagedBot> res = make_object<internalLinkTypeRequestManagedBot>();
  res->manager_bot_username_ = jni::fetch_string(env, p, res->manager_bot_username_fieldID);
  res->suggested_bot_username_ = jni::fetch_string(env, p, res->suggested_bot_username_fieldID);
  res->suggested_bot_name_ = jni::fetch_string(env, p, res->suggested_bot_name_fieldID);
  return std::move(res);
}

void internalLinkTypeRequestManagedBot::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, manager_bot_username_); if (nextString) { env->SetObjectField(s, manager_bot_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, suggested_bot_username_); if (nextString) { env->SetObjectField(s, suggested_bot_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, suggested_bot_name_); if (nextString) { env->SetObjectField(s, suggested_bot_name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeRequestManagedBot::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeRequestManagedBot");
    s.store_field("managerBotUsername", manager_bot_username_);
    s.store_field("suggestedBotUsername", suggested_bot_username_);
    s.store_field("suggestedBotName", suggested_bot_name_);
    s.store_class_end();
  }
}

void internalLinkTypeRequestManagedBot::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeRequestManagedBot").c_str());
    manager_bot_username_fieldID = jni::get_field_id(env, Class, "managerBotUsername", "Ljava/lang/String;");
    suggested_bot_username_fieldID = jni::get_field_id(env, Class, "suggestedBotUsername", "Ljava/lang/String;");
    suggested_bot_name_fieldID = jni::get_field_id(env, Class, "suggestedBotName", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeRestorePurchases::Class;

internalLinkTypeRestorePurchases::internalLinkTypeRestorePurchases() {
}

const std::int32_t internalLinkTypeRestorePurchases::ID;

object_ptr<InternalLinkType> internalLinkTypeRestorePurchases::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<internalLinkTypeRestorePurchases>();
}

void internalLinkTypeRestorePurchases::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void internalLinkTypeRestorePurchases::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeRestorePurchases");
    s.store_class_end();
  }
}

void internalLinkTypeRestorePurchases::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeRestorePurchases").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeSavedMessages::Class;

internalLinkTypeSavedMessages::internalLinkTypeSavedMessages() {
}

const std::int32_t internalLinkTypeSavedMessages::ID;

object_ptr<InternalLinkType> internalLinkTypeSavedMessages::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<internalLinkTypeSavedMessages>();
}

void internalLinkTypeSavedMessages::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void internalLinkTypeSavedMessages::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeSavedMessages");
    s.store_class_end();
  }
}

void internalLinkTypeSavedMessages::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeSavedMessages").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeSearch::Class;

internalLinkTypeSearch::internalLinkTypeSearch() {
}

const std::int32_t internalLinkTypeSearch::ID;

object_ptr<InternalLinkType> internalLinkTypeSearch::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<internalLinkTypeSearch>();
}

void internalLinkTypeSearch::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void internalLinkTypeSearch::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeSearch");
    s.store_class_end();
  }
}

void internalLinkTypeSearch::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeSearch").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeSettings::Class;
jfieldID internalLinkTypeSettings::section_fieldID;

internalLinkTypeSettings::internalLinkTypeSettings()
  : section_()
{}

internalLinkTypeSettings::internalLinkTypeSettings(object_ptr<SettingsSection> &&section_)
  : section_(std::move(section_))
{}

const std::int32_t internalLinkTypeSettings::ID;

object_ptr<InternalLinkType> internalLinkTypeSettings::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeSettings> res = make_object<internalLinkTypeSettings>();
  res->section_ = jni::fetch_tl_object<SettingsSection>(env, jni::fetch_object(env, p, res->section_fieldID));
  return std::move(res);
}

void internalLinkTypeSettings::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (section_ != nullptr) { jobject next; section_->store(env, next); if (next) { env->SetObjectField(s, section_fieldID, next); env->DeleteLocalRef(next); } }
}

void internalLinkTypeSettings::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeSettings");
    s.store_object_field("section", static_cast<const BaseObject *>(section_.get()));
    s.store_class_end();
  }
}

void internalLinkTypeSettings::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeSettings").c_str());
    section_fieldID = jni::get_field_id(env, Class, "section", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$SettingsSection;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeStarPurchase::Class;
jfieldID internalLinkTypeStarPurchase::star_count_fieldID;
jfieldID internalLinkTypeStarPurchase::purpose_fieldID;

internalLinkTypeStarPurchase::internalLinkTypeStarPurchase()
  : star_count_()
  , purpose_()
{}

internalLinkTypeStarPurchase::internalLinkTypeStarPurchase(int53 star_count_, string const &purpose_)
  : star_count_(star_count_)
  , purpose_(purpose_)
{}

const std::int32_t internalLinkTypeStarPurchase::ID;

object_ptr<InternalLinkType> internalLinkTypeStarPurchase::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeStarPurchase> res = make_object<internalLinkTypeStarPurchase>();
  res->star_count_ = env->GetLongField(p, res->star_count_fieldID);
  res->purpose_ = jni::fetch_string(env, p, res->purpose_fieldID);
  return std::move(res);
}

void internalLinkTypeStarPurchase::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, star_count_fieldID, star_count_);
  { jstring nextString = jni::to_jstring(env, purpose_); if (nextString) { env->SetObjectField(s, purpose_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeStarPurchase::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeStarPurchase");
    s.store_field("starCount", star_count_);
    s.store_field("purpose", purpose_);
    s.store_class_end();
  }
}

void internalLinkTypeStarPurchase::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeStarPurchase").c_str());
    star_count_fieldID = jni::get_field_id(env, Class, "starCount", "J");
    purpose_fieldID = jni::get_field_id(env, Class, "purpose", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeStickerSet::Class;
jfieldID internalLinkTypeStickerSet::sticker_set_name_fieldID;
jfieldID internalLinkTypeStickerSet::expect_custom_emoji_fieldID;

internalLinkTypeStickerSet::internalLinkTypeStickerSet()
  : sticker_set_name_()
  , expect_custom_emoji_()
{}

internalLinkTypeStickerSet::internalLinkTypeStickerSet(string const &sticker_set_name_, bool expect_custom_emoji_)
  : sticker_set_name_(sticker_set_name_)
  , expect_custom_emoji_(expect_custom_emoji_)
{}

const std::int32_t internalLinkTypeStickerSet::ID;

object_ptr<InternalLinkType> internalLinkTypeStickerSet::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeStickerSet> res = make_object<internalLinkTypeStickerSet>();
  res->sticker_set_name_ = jni::fetch_string(env, p, res->sticker_set_name_fieldID);
  res->expect_custom_emoji_ = (env->GetBooleanField(p, res->expect_custom_emoji_fieldID) != 0);
  return std::move(res);
}

void internalLinkTypeStickerSet::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, sticker_set_name_); if (nextString) { env->SetObjectField(s, sticker_set_name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetBooleanField(s, expect_custom_emoji_fieldID, expect_custom_emoji_);
}

void internalLinkTypeStickerSet::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeStickerSet");
    s.store_field("stickerSetName", sticker_set_name_);
    s.store_field("expectCustomEmoji", expect_custom_emoji_);
    s.store_class_end();
  }
}

void internalLinkTypeStickerSet::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeStickerSet").c_str());
    sticker_set_name_fieldID = jni::get_field_id(env, Class, "stickerSetName", "Ljava/lang/String;");
    expect_custom_emoji_fieldID = jni::get_field_id(env, Class, "expectCustomEmoji", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeStory::Class;
jfieldID internalLinkTypeStory::story_poster_username_fieldID;
jfieldID internalLinkTypeStory::story_id_fieldID;

internalLinkTypeStory::internalLinkTypeStory()
  : story_poster_username_()
  , story_id_()
{}

internalLinkTypeStory::internalLinkTypeStory(string const &story_poster_username_, int32 story_id_)
  : story_poster_username_(story_poster_username_)
  , story_id_(story_id_)
{}

const std::int32_t internalLinkTypeStory::ID;

object_ptr<InternalLinkType> internalLinkTypeStory::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeStory> res = make_object<internalLinkTypeStory>();
  res->story_poster_username_ = jni::fetch_string(env, p, res->story_poster_username_fieldID);
  res->story_id_ = env->GetIntField(p, res->story_id_fieldID);
  return std::move(res);
}

void internalLinkTypeStory::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, story_poster_username_); if (nextString) { env->SetObjectField(s, story_poster_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetIntField(s, story_id_fieldID, story_id_);
}

void internalLinkTypeStory::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeStory");
    s.store_field("storyPosterUsername", story_poster_username_);
    s.store_field("storyId", story_id_);
    s.store_class_end();
  }
}

void internalLinkTypeStory::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeStory").c_str());
    story_poster_username_fieldID = jni::get_field_id(env, Class, "storyPosterUsername", "Ljava/lang/String;");
    story_id_fieldID = jni::get_field_id(env, Class, "storyId", "I");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeStoryAlbum::Class;
jfieldID internalLinkTypeStoryAlbum::story_album_owner_username_fieldID;
jfieldID internalLinkTypeStoryAlbum::story_album_id_fieldID;

internalLinkTypeStoryAlbum::internalLinkTypeStoryAlbum()
  : story_album_owner_username_()
  , story_album_id_()
{}

internalLinkTypeStoryAlbum::internalLinkTypeStoryAlbum(string const &story_album_owner_username_, int32 story_album_id_)
  : story_album_owner_username_(story_album_owner_username_)
  , story_album_id_(story_album_id_)
{}

const std::int32_t internalLinkTypeStoryAlbum::ID;

object_ptr<InternalLinkType> internalLinkTypeStoryAlbum::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeStoryAlbum> res = make_object<internalLinkTypeStoryAlbum>();
  res->story_album_owner_username_ = jni::fetch_string(env, p, res->story_album_owner_username_fieldID);
  res->story_album_id_ = env->GetIntField(p, res->story_album_id_fieldID);
  return std::move(res);
}

void internalLinkTypeStoryAlbum::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, story_album_owner_username_); if (nextString) { env->SetObjectField(s, story_album_owner_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetIntField(s, story_album_id_fieldID, story_album_id_);
}

void internalLinkTypeStoryAlbum::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeStoryAlbum");
    s.store_field("storyAlbumOwnerUsername", story_album_owner_username_);
    s.store_field("storyAlbumId", story_album_id_);
    s.store_class_end();
  }
}

void internalLinkTypeStoryAlbum::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeStoryAlbum").c_str());
    story_album_owner_username_fieldID = jni::get_field_id(env, Class, "storyAlbumOwnerUsername", "Ljava/lang/String;");
    story_album_id_fieldID = jni::get_field_id(env, Class, "storyAlbumId", "I");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeTextCompositionStyle::Class;
jfieldID internalLinkTypeTextCompositionStyle::style_name_fieldID;

internalLinkTypeTextCompositionStyle::internalLinkTypeTextCompositionStyle()
  : style_name_()
{}

internalLinkTypeTextCompositionStyle::internalLinkTypeTextCompositionStyle(string const &style_name_)
  : style_name_(style_name_)
{}

const std::int32_t internalLinkTypeTextCompositionStyle::ID;

object_ptr<InternalLinkType> internalLinkTypeTextCompositionStyle::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeTextCompositionStyle> res = make_object<internalLinkTypeTextCompositionStyle>();
  res->style_name_ = jni::fetch_string(env, p, res->style_name_fieldID);
  return std::move(res);
}

void internalLinkTypeTextCompositionStyle::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, style_name_); if (nextString) { env->SetObjectField(s, style_name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeTextCompositionStyle::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeTextCompositionStyle");
    s.store_field("styleName", style_name_);
    s.store_class_end();
  }
}

void internalLinkTypeTextCompositionStyle::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeTextCompositionStyle").c_str());
    style_name_fieldID = jni::get_field_id(env, Class, "styleName", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeTheme::Class;
jfieldID internalLinkTypeTheme::theme_name_fieldID;

internalLinkTypeTheme::internalLinkTypeTheme()
  : theme_name_()
{}

internalLinkTypeTheme::internalLinkTypeTheme(string const &theme_name_)
  : theme_name_(theme_name_)
{}

const std::int32_t internalLinkTypeTheme::ID;

object_ptr<InternalLinkType> internalLinkTypeTheme::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeTheme> res = make_object<internalLinkTypeTheme>();
  res->theme_name_ = jni::fetch_string(env, p, res->theme_name_fieldID);
  return std::move(res);
}

void internalLinkTypeTheme::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, theme_name_); if (nextString) { env->SetObjectField(s, theme_name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeTheme::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeTheme");
    s.store_field("themeName", theme_name_);
    s.store_class_end();
  }
}

void internalLinkTypeTheme::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeTheme").c_str());
    theme_name_fieldID = jni::get_field_id(env, Class, "themeName", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeUnknownDeepLink::Class;
jfieldID internalLinkTypeUnknownDeepLink::link_fieldID;

internalLinkTypeUnknownDeepLink::internalLinkTypeUnknownDeepLink()
  : link_()
{}

internalLinkTypeUnknownDeepLink::internalLinkTypeUnknownDeepLink(string const &link_)
  : link_(link_)
{}

const std::int32_t internalLinkTypeUnknownDeepLink::ID;

object_ptr<InternalLinkType> internalLinkTypeUnknownDeepLink::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeUnknownDeepLink> res = make_object<internalLinkTypeUnknownDeepLink>();
  res->link_ = jni::fetch_string(env, p, res->link_fieldID);
  return std::move(res);
}

void internalLinkTypeUnknownDeepLink::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, link_); if (nextString) { env->SetObjectField(s, link_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeUnknownDeepLink::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeUnknownDeepLink");
    s.store_field("link", link_);
    s.store_class_end();
  }
}

void internalLinkTypeUnknownDeepLink::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeUnknownDeepLink").c_str());
    link_fieldID = jni::get_field_id(env, Class, "link", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeUpgradedGift::Class;
jfieldID internalLinkTypeUpgradedGift::name_fieldID;

internalLinkTypeUpgradedGift::internalLinkTypeUpgradedGift()
  : name_()
{}

internalLinkTypeUpgradedGift::internalLinkTypeUpgradedGift(string const &name_)
  : name_(name_)
{}

const std::int32_t internalLinkTypeUpgradedGift::ID;

object_ptr<InternalLinkType> internalLinkTypeUpgradedGift::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeUpgradedGift> res = make_object<internalLinkTypeUpgradedGift>();
  res->name_ = jni::fetch_string(env, p, res->name_fieldID);
  return std::move(res);
}

void internalLinkTypeUpgradedGift::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, name_); if (nextString) { env->SetObjectField(s, name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeUpgradedGift::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeUpgradedGift");
    s.store_field("name", name_);
    s.store_class_end();
  }
}

void internalLinkTypeUpgradedGift::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeUpgradedGift").c_str());
    name_fieldID = jni::get_field_id(env, Class, "name", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeUserPhoneNumber::Class;
jfieldID internalLinkTypeUserPhoneNumber::phone_number_fieldID;
jfieldID internalLinkTypeUserPhoneNumber::draft_text_fieldID;
jfieldID internalLinkTypeUserPhoneNumber::open_profile_fieldID;

internalLinkTypeUserPhoneNumber::internalLinkTypeUserPhoneNumber()
  : phone_number_()
  , draft_text_()
  , open_profile_()
{}

internalLinkTypeUserPhoneNumber::internalLinkTypeUserPhoneNumber(string const &phone_number_, string const &draft_text_, bool open_profile_)
  : phone_number_(phone_number_)
  , draft_text_(draft_text_)
  , open_profile_(open_profile_)
{}

const std::int32_t internalLinkTypeUserPhoneNumber::ID;

object_ptr<InternalLinkType> internalLinkTypeUserPhoneNumber::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeUserPhoneNumber> res = make_object<internalLinkTypeUserPhoneNumber>();
  res->phone_number_ = jni::fetch_string(env, p, res->phone_number_fieldID);
  res->draft_text_ = jni::fetch_string(env, p, res->draft_text_fieldID);
  res->open_profile_ = (env->GetBooleanField(p, res->open_profile_fieldID) != 0);
  return std::move(res);
}

void internalLinkTypeUserPhoneNumber::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, phone_number_); if (nextString) { env->SetObjectField(s, phone_number_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, draft_text_); if (nextString) { env->SetObjectField(s, draft_text_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetBooleanField(s, open_profile_fieldID, open_profile_);
}

void internalLinkTypeUserPhoneNumber::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeUserPhoneNumber");
    s.store_field("phoneNumber", phone_number_);
    s.store_field("draftText", draft_text_);
    s.store_field("openProfile", open_profile_);
    s.store_class_end();
  }
}

void internalLinkTypeUserPhoneNumber::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeUserPhoneNumber").c_str());
    phone_number_fieldID = jni::get_field_id(env, Class, "phoneNumber", "Ljava/lang/String;");
    draft_text_fieldID = jni::get_field_id(env, Class, "draftText", "Ljava/lang/String;");
    open_profile_fieldID = jni::get_field_id(env, Class, "openProfile", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeUserToken::Class;
jfieldID internalLinkTypeUserToken::token_fieldID;

internalLinkTypeUserToken::internalLinkTypeUserToken()
  : token_()
{}

internalLinkTypeUserToken::internalLinkTypeUserToken(string const &token_)
  : token_(token_)
{}

const std::int32_t internalLinkTypeUserToken::ID;

object_ptr<InternalLinkType> internalLinkTypeUserToken::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeUserToken> res = make_object<internalLinkTypeUserToken>();
  res->token_ = jni::fetch_string(env, p, res->token_fieldID);
  return std::move(res);
}

void internalLinkTypeUserToken::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, token_); if (nextString) { env->SetObjectField(s, token_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void internalLinkTypeUserToken::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeUserToken");
    s.store_field("token", token_);
    s.store_class_end();
  }
}

void internalLinkTypeUserToken::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeUserToken").c_str());
    token_fieldID = jni::get_field_id(env, Class, "token", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeVideoChat::Class;
jfieldID internalLinkTypeVideoChat::chat_username_fieldID;
jfieldID internalLinkTypeVideoChat::invite_hash_fieldID;
jfieldID internalLinkTypeVideoChat::is_live_stream_fieldID;

internalLinkTypeVideoChat::internalLinkTypeVideoChat()
  : chat_username_()
  , invite_hash_()
  , is_live_stream_()
{}

internalLinkTypeVideoChat::internalLinkTypeVideoChat(string const &chat_username_, string const &invite_hash_, bool is_live_stream_)
  : chat_username_(chat_username_)
  , invite_hash_(invite_hash_)
  , is_live_stream_(is_live_stream_)
{}

const std::int32_t internalLinkTypeVideoChat::ID;

object_ptr<InternalLinkType> internalLinkTypeVideoChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeVideoChat> res = make_object<internalLinkTypeVideoChat>();
  res->chat_username_ = jni::fetch_string(env, p, res->chat_username_fieldID);
  res->invite_hash_ = jni::fetch_string(env, p, res->invite_hash_fieldID);
  res->is_live_stream_ = (env->GetBooleanField(p, res->is_live_stream_fieldID) != 0);
  return std::move(res);
}

void internalLinkTypeVideoChat::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, chat_username_); if (nextString) { env->SetObjectField(s, chat_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, invite_hash_); if (nextString) { env->SetObjectField(s, invite_hash_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetBooleanField(s, is_live_stream_fieldID, is_live_stream_);
}

void internalLinkTypeVideoChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeVideoChat");
    s.store_field("chatUsername", chat_username_);
    s.store_field("inviteHash", invite_hash_);
    s.store_field("isLiveStream", is_live_stream_);
    s.store_class_end();
  }
}

void internalLinkTypeVideoChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeVideoChat").c_str());
    chat_username_fieldID = jni::get_field_id(env, Class, "chatUsername", "Ljava/lang/String;");
    invite_hash_fieldID = jni::get_field_id(env, Class, "inviteHash", "Ljava/lang/String;");
    is_live_stream_fieldID = jni::get_field_id(env, Class, "isLiveStream", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass internalLinkTypeWebApp::Class;
jfieldID internalLinkTypeWebApp::bot_username_fieldID;
jfieldID internalLinkTypeWebApp::web_app_short_name_fieldID;
jfieldID internalLinkTypeWebApp::start_parameter_fieldID;
jfieldID internalLinkTypeWebApp::mode_fieldID;

internalLinkTypeWebApp::internalLinkTypeWebApp()
  : bot_username_()
  , web_app_short_name_()
  , start_parameter_()
  , mode_()
{}

internalLinkTypeWebApp::internalLinkTypeWebApp(string const &bot_username_, string const &web_app_short_name_, string const &start_parameter_, object_ptr<WebAppOpenMode> &&mode_)
  : bot_username_(bot_username_)
  , web_app_short_name_(web_app_short_name_)
  , start_parameter_(start_parameter_)
  , mode_(std::move(mode_))
{}

const std::int32_t internalLinkTypeWebApp::ID;

object_ptr<InternalLinkType> internalLinkTypeWebApp::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<internalLinkTypeWebApp> res = make_object<internalLinkTypeWebApp>();
  res->bot_username_ = jni::fetch_string(env, p, res->bot_username_fieldID);
  res->web_app_short_name_ = jni::fetch_string(env, p, res->web_app_short_name_fieldID);
  res->start_parameter_ = jni::fetch_string(env, p, res->start_parameter_fieldID);
  res->mode_ = jni::fetch_tl_object<WebAppOpenMode>(env, jni::fetch_object(env, p, res->mode_fieldID));
  return std::move(res);
}

void internalLinkTypeWebApp::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, bot_username_); if (nextString) { env->SetObjectField(s, bot_username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, web_app_short_name_); if (nextString) { env->SetObjectField(s, web_app_short_name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, start_parameter_); if (nextString) { env->SetObjectField(s, start_parameter_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  if (mode_ != nullptr) { jobject next; mode_->store(env, next); if (next) { env->SetObjectField(s, mode_fieldID, next); env->DeleteLocalRef(next); } }
}

void internalLinkTypeWebApp::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "InternalLinkTypeWebApp");
    s.store_field("botUsername", bot_username_);
    s.store_field("webAppShortName", web_app_short_name_);
    s.store_field("startParameter", start_parameter_);
    s.store_object_field("mode", static_cast<const BaseObject *>(mode_.get()));
    s.store_class_end();
  }
}

void internalLinkTypeWebApp::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$InternalLinkTypeWebApp").c_str());
    bot_username_fieldID = jni::get_field_id(env, Class, "botUsername", "Ljava/lang/String;");
    web_app_short_name_fieldID = jni::get_field_id(env, Class, "webAppShortName", "Ljava/lang/String;");
    start_parameter_fieldID = jni::get_field_id(env, Class, "startParameter", "Ljava/lang/String;");
    mode_fieldID = jni::get_field_id(env, Class, "mode", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$WebAppOpenMode;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass jsonObjectMember::Class;
jfieldID jsonObjectMember::key_fieldID;
jfieldID jsonObjectMember::value_fieldID;

jsonObjectMember::jsonObjectMember()
  : key_()
  , value_()
{}

jsonObjectMember::jsonObjectMember(string const &key_, object_ptr<JsonValue> &&value_)
  : key_(key_)
  , value_(std::move(value_))
{}

const std::int32_t jsonObjectMember::ID;

object_ptr<jsonObjectMember> jsonObjectMember::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<jsonObjectMember> res = make_object<jsonObjectMember>();
  res->key_ = jni::fetch_string(env, p, res->key_fieldID);
  res->value_ = jni::fetch_tl_object<JsonValue>(env, jni::fetch_object(env, p, res->value_fieldID));
  return res;
}

void jsonObjectMember::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, key_); if (nextString) { env->SetObjectField(s, key_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  if (value_ != nullptr) { jobject next; value_->store(env, next); if (next) { env->SetObjectField(s, value_fieldID, next); env->DeleteLocalRef(next); } }
}

void jsonObjectMember::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "JsonObjectMember");
    s.store_field("key", key_);
    s.store_object_field("value", static_cast<const BaseObject *>(value_.get()));
    s.store_class_end();
  }
}

void jsonObjectMember::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$JsonObjectMember").c_str());
    key_fieldID = jni::get_field_id(env, Class, "key", "Ljava/lang/String;");
    value_fieldID = jni::get_field_id(env, Class, "value", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$JsonValue;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass keyboardButton::Class;
jfieldID keyboardButton::text_fieldID;
jfieldID keyboardButton::icon_custom_emoji_id_fieldID;
jfieldID keyboardButton::style_fieldID;
jfieldID keyboardButton::type_fieldID;

keyboardButton::keyboardButton()
  : text_()
  , icon_custom_emoji_id_()
  , style_()
  , type_()
{}

keyboardButton::keyboardButton(string const &text_, int64 icon_custom_emoji_id_, object_ptr<ButtonStyle> &&style_, object_ptr<KeyboardButtonType> &&type_)
  : text_(text_)
  , icon_custom_emoji_id_(icon_custom_emoji_id_)
  , style_(std::move(style_))
  , type_(std::move(type_))
{}

const std::int32_t keyboardButton::ID;

object_ptr<keyboardButton> keyboardButton::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<keyboardButton> res = make_object<keyboardButton>();
  res->text_ = jni::fetch_string(env, p, res->text_fieldID);
  res->icon_custom_emoji_id_ = env->GetLongField(p, res->icon_custom_emoji_id_fieldID);
  res->style_ = jni::fetch_tl_object<ButtonStyle>(env, jni::fetch_object(env, p, res->style_fieldID));
  res->type_ = jni::fetch_tl_object<KeyboardButtonType>(env, jni::fetch_object(env, p, res->type_fieldID));
  return res;
}

void keyboardButton::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, text_); if (nextString) { env->SetObjectField(s, text_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetLongField(s, icon_custom_emoji_id_fieldID, icon_custom_emoji_id_);
  if (style_ != nullptr) { jobject next; style_->store(env, next); if (next) { env->SetObjectField(s, style_fieldID, next); env->DeleteLocalRef(next); } }
  if (type_ != nullptr) { jobject next; type_->store(env, next); if (next) { env->SetObjectField(s, type_fieldID, next); env->DeleteLocalRef(next); } }
}

void keyboardButton::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "KeyboardButton");
    s.store_field("text", text_);
    s.store_field("iconCustomEmojiId", icon_custom_emoji_id_);
    s.store_object_field("style", static_cast<const BaseObject *>(style_.get()));
    s.store_object_field("type", static_cast<const BaseObject *>(type_.get()));
    s.store_class_end();
  }
}

void keyboardButton::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$KeyboardButton").c_str());
    text_fieldID = jni::get_field_id(env, Class, "text", "Ljava/lang/String;");
    icon_custom_emoji_id_fieldID = jni::get_field_id(env, Class, "iconCustomEmojiId", "J");
    style_fieldID = jni::get_field_id(env, Class, "style", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ButtonStyle;").c_str());
    type_fieldID = jni::get_field_id(env, Class, "type", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$KeyboardButtonType;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass locationAddress::Class;
jfieldID locationAddress::country_code_fieldID;
jfieldID locationAddress::state_fieldID;
jfieldID locationAddress::city_fieldID;
jfieldID locationAddress::street_fieldID;

locationAddress::locationAddress()
  : country_code_()
  , state_()
  , city_()
  , street_()
{}

locationAddress::locationAddress(string const &country_code_, string const &state_, string const &city_, string const &street_)
  : country_code_(country_code_)
  , state_(state_)
  , city_(city_)
  , street_(street_)
{}

const std::int32_t locationAddress::ID;

object_ptr<locationAddress> locationAddress::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<locationAddress> res = make_object<locationAddress>();
  res->country_code_ = jni::fetch_string(env, p, res->country_code_fieldID);
  res->state_ = jni::fetch_string(env, p, res->state_fieldID);
  res->city_ = jni::fetch_string(env, p, res->city_fieldID);
  res->street_ = jni::fetch_string(env, p, res->street_fieldID);
  return res;
}

void locationAddress::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, country_code_); if (nextString) { env->SetObjectField(s, country_code_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, state_); if (nextString) { env->SetObjectField(s, state_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, city_); if (nextString) { env->SetObjectField(s, city_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, street_); if (nextString) { env->SetObjectField(s, street_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void locationAddress::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "LocationAddress");
    s.store_field("countryCode", country_code_);
    s.store_field("state", state_);
    s.store_field("city", city_);
    s.store_field("street", street_);
    s.store_class_end();
  }
}

void locationAddress::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$LocationAddress").c_str());
    country_code_fieldID = jni::get_field_id(env, Class, "countryCode", "Ljava/lang/String;");
    state_fieldID = jni::get_field_id(env, Class, "state", "Ljava/lang/String;");
    city_fieldID = jni::get_field_id(env, Class, "city", "Ljava/lang/String;");
    street_fieldID = jni::get_field_id(env, Class, "street", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass messageCalendarDay::Class;
jfieldID messageCalendarDay::total_count_fieldID;
jfieldID messageCalendarDay::message_fieldID;

messageCalendarDay::messageCalendarDay()
  : total_count_()
  , message_()
{}

messageCalendarDay::messageCalendarDay(int32 total_count_, object_ptr<message> &&message_)
  : total_count_(total_count_)
  , message_(std::move(message_))
{}

const std::int32_t messageCalendarDay::ID;

object_ptr<messageCalendarDay> messageCalendarDay::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<messageCalendarDay> res = make_object<messageCalendarDay>();
  res->total_count_ = env->GetIntField(p, res->total_count_fieldID);
  res->message_ = jni::fetch_tl_object<message>(env, jni::fetch_object(env, p, res->message_fieldID));
  return res;
}

void messageCalendarDay::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, total_count_fieldID, total_count_);
  if (message_ != nullptr) { jobject next; message_->store(env, next); if (next) { env->SetObjectField(s, message_fieldID, next); env->DeleteLocalRef(next); } }
}

void messageCalendarDay::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "MessageCalendarDay");
    s.store_field("totalCount", total_count_);
    s.store_object_field("message", static_cast<const BaseObject *>(message_.get()));
    s.store_class_end();
  }
}

void messageCalendarDay::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$MessageCalendarDay").c_str());
    total_count_fieldID = jni::get_field_id(env, Class, "totalCount", "I");
    message_fieldID = jni::get_field_id(env, Class, "message", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Message;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass notification::Class;
jfieldID notification::id_fieldID;
jfieldID notification::date_fieldID;
jfieldID notification::is_silent_fieldID;
jfieldID notification::type_fieldID;

notification::notification()
  : id_()
  , date_()
  , is_silent_()
  , type_()
{}

notification::notification(int32 id_, int32 date_, bool is_silent_, object_ptr<NotificationType> &&type_)
  : id_(id_)
  , date_(date_)
  , is_silent_(is_silent_)
  , type_(std::move(type_))
{}

const std::int32_t notification::ID;

object_ptr<notification> notification::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<notification> res = make_object<notification>();
  res->id_ = env->GetIntField(p, res->id_fieldID);
  res->date_ = env->GetIntField(p, res->date_fieldID);
  res->is_silent_ = (env->GetBooleanField(p, res->is_silent_fieldID) != 0);
  res->type_ = jni::fetch_tl_object<NotificationType>(env, jni::fetch_object(env, p, res->type_fieldID));
  return res;
}

void notification::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, id_fieldID, id_);
  env->SetIntField(s, date_fieldID, date_);
  env->SetBooleanField(s, is_silent_fieldID, is_silent_);
  if (type_ != nullptr) { jobject next; type_->store(env, next); if (next) { env->SetObjectField(s, type_fieldID, next); env->DeleteLocalRef(next); } }
}

void notification::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "Notification");
    s.store_field("id", id_);
    s.store_field("date", date_);
    s.store_field("isSilent", is_silent_);
    s.store_object_field("type", static_cast<const BaseObject *>(type_.get()));
    s.store_class_end();
  }
}

void notification::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$Notification").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "I");
    date_fieldID = jni::get_field_id(env, Class, "date", "I");
    is_silent_fieldID = jni::get_field_id(env, Class, "isSilent", "Z");
    type_fieldID = jni::get_field_id(env, Class, "type", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$NotificationType;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass oauthLinkInfo::Class;
jfieldID oauthLinkInfo::user_id_fieldID;
jfieldID oauthLinkInfo::url_fieldID;
jfieldID oauthLinkInfo::domain_fieldID;
jfieldID oauthLinkInfo::from_app_fieldID;
jfieldID oauthLinkInfo::verified_app_name_fieldID;
jfieldID oauthLinkInfo::bot_user_id_fieldID;
jfieldID oauthLinkInfo::request_write_access_fieldID;
jfieldID oauthLinkInfo::request_phone_number_access_fieldID;
jfieldID oauthLinkInfo::browser_fieldID;
jfieldID oauthLinkInfo::platform_fieldID;
jfieldID oauthLinkInfo::ip_address_fieldID;
jfieldID oauthLinkInfo::location_fieldID;
jfieldID oauthLinkInfo::match_code_first_fieldID;
jfieldID oauthLinkInfo::match_codes_fieldID;

oauthLinkInfo::oauthLinkInfo()
  : user_id_()
  , url_()
  , domain_()
  , from_app_()
  , verified_app_name_()
  , bot_user_id_()
  , request_write_access_()
  , request_phone_number_access_()
  , browser_()
  , platform_()
  , ip_address_()
  , location_()
  , match_code_first_()
  , match_codes_()
{}

oauthLinkInfo::oauthLinkInfo(int53 user_id_, string const &url_, string const &domain_, bool from_app_, string const &verified_app_name_, int53 bot_user_id_, bool request_write_access_, bool request_phone_number_access_, string const &browser_, string const &platform_, string const &ip_address_, string const &location_, bool match_code_first_, array<string> &&match_codes_)
  : user_id_(user_id_)
  , url_(url_)
  , domain_(domain_)
  , from_app_(from_app_)
  , verified_app_name_(verified_app_name_)
  , bot_user_id_(bot_user_id_)
  , request_write_access_(request_write_access_)
  , request_phone_number_access_(request_phone_number_access_)
  , browser_(browser_)
  , platform_(platform_)
  , ip_address_(ip_address_)
  , location_(location_)
  , match_code_first_(match_code_first_)
  , match_codes_(std::move(match_codes_))
{}

const std::int32_t oauthLinkInfo::ID;

object_ptr<oauthLinkInfo> oauthLinkInfo::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<oauthLinkInfo> res = make_object<oauthLinkInfo>();
  res->user_id_ = env->GetLongField(p, res->user_id_fieldID);
  res->url_ = jni::fetch_string(env, p, res->url_fieldID);
  res->domain_ = jni::fetch_string(env, p, res->domain_fieldID);
  res->from_app_ = (env->GetBooleanField(p, res->from_app_fieldID) != 0);
  res->verified_app_name_ = jni::fetch_string(env, p, res->verified_app_name_fieldID);
  res->bot_user_id_ = env->GetLongField(p, res->bot_user_id_fieldID);
  res->request_write_access_ = (env->GetBooleanField(p, res->request_write_access_fieldID) != 0);
  res->request_phone_number_access_ = (env->GetBooleanField(p, res->request_phone_number_access_fieldID) != 0);
  res->browser_ = jni::fetch_string(env, p, res->browser_fieldID);
  res->platform_ = jni::fetch_string(env, p, res->platform_fieldID);
  res->ip_address_ = jni::fetch_string(env, p, res->ip_address_fieldID);
  res->location_ = jni::fetch_string(env, p, res->location_fieldID);
  res->match_code_first_ = (env->GetBooleanField(p, res->match_code_first_fieldID) != 0);
  res->match_codes_ = jni::FetchVector<string>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->match_codes_fieldID));
  return res;
}

void oauthLinkInfo::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, user_id_fieldID, user_id_);
  { jstring nextString = jni::to_jstring(env, url_); if (nextString) { env->SetObjectField(s, url_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, domain_); if (nextString) { env->SetObjectField(s, domain_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetBooleanField(s, from_app_fieldID, from_app_);
  { jstring nextString = jni::to_jstring(env, verified_app_name_); if (nextString) { env->SetObjectField(s, verified_app_name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetLongField(s, bot_user_id_fieldID, bot_user_id_);
  env->SetBooleanField(s, request_write_access_fieldID, request_write_access_);
  env->SetBooleanField(s, request_phone_number_access_fieldID, request_phone_number_access_);
  { jstring nextString = jni::to_jstring(env, browser_); if (nextString) { env->SetObjectField(s, browser_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, platform_); if (nextString) { env->SetObjectField(s, platform_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, ip_address_); if (nextString) { env->SetObjectField(s, ip_address_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, location_); if (nextString) { env->SetObjectField(s, location_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetBooleanField(s, match_code_first_fieldID, match_code_first_);
  { auto arr_tmp_ = jni::store_vector(env, match_codes_); if (arr_tmp_) { env->SetObjectField(s, match_codes_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void oauthLinkInfo::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "OauthLinkInfo");
    s.store_field("userId", user_id_);
    s.store_field("url", url_);
    s.store_field("domain", domain_);
    s.store_field("fromApp", from_app_);
    s.store_field("verifiedAppName", verified_app_name_);
    s.store_field("botUserId", bot_user_id_);
    s.store_field("requestWriteAccess", request_write_access_);
    s.store_field("requestPhoneNumberAccess", request_phone_number_access_);
    s.store_field("browser", browser_);
    s.store_field("platform", platform_);
    s.store_field("ipAddress", ip_address_);
    s.store_field("location", location_);
    s.store_field("matchCodeFirst", match_code_first_);
    { s.store_vector_begin("matchCodes", match_codes_.size()); for (const auto &_value : match_codes_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

void oauthLinkInfo::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$OauthLinkInfo").c_str());
    user_id_fieldID = jni::get_field_id(env, Class, "userId", "J");
    url_fieldID = jni::get_field_id(env, Class, "url", "Ljava/lang/String;");
    domain_fieldID = jni::get_field_id(env, Class, "domain", "Ljava/lang/String;");
    from_app_fieldID = jni::get_field_id(env, Class, "fromApp", "Z");
    verified_app_name_fieldID = jni::get_field_id(env, Class, "verifiedAppName", "Ljava/lang/String;");
    bot_user_id_fieldID = jni::get_field_id(env, Class, "botUserId", "J");
    request_write_access_fieldID = jni::get_field_id(env, Class, "requestWriteAccess", "Z");
    request_phone_number_access_fieldID = jni::get_field_id(env, Class, "requestPhoneNumberAccess", "Z");
    browser_fieldID = jni::get_field_id(env, Class, "browser", "Ljava/lang/String;");
    platform_fieldID = jni::get_field_id(env, Class, "platform", "Ljava/lang/String;");
    ip_address_fieldID = jni::get_field_id(env, Class, "ipAddress", "Ljava/lang/String;");
    location_fieldID = jni::get_field_id(env, Class, "location", "Ljava/lang/String;");
    match_code_first_fieldID = jni::get_field_id(env, Class, "matchCodeFirst", "Z");
    match_codes_fieldID = jni::get_field_id(env, Class, "matchCodes", "[Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass PageBlockHorizontalAlignment::Class;

object_ptr<PageBlockHorizontalAlignment> PageBlockHorizontalAlignment::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case pageBlockHorizontalAlignmentLeft::ID:
      return pageBlockHorizontalAlignmentLeft::fetch(env, p);
    case pageBlockHorizontalAlignmentCenter::ID:
      return pageBlockHorizontalAlignmentCenter::fetch(env, p);
    case pageBlockHorizontalAlignmentRight::ID:
      return pageBlockHorizontalAlignmentRight::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void PageBlockHorizontalAlignment::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PageBlockHorizontalAlignment").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass pageBlockHorizontalAlignmentLeft::Class;

pageBlockHorizontalAlignmentLeft::pageBlockHorizontalAlignmentLeft() {
}

const std::int32_t pageBlockHorizontalAlignmentLeft::ID;

object_ptr<PageBlockHorizontalAlignment> pageBlockHorizontalAlignmentLeft::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<pageBlockHorizontalAlignmentLeft>();
}

void pageBlockHorizontalAlignmentLeft::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void pageBlockHorizontalAlignmentLeft::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PageBlockHorizontalAlignmentLeft");
    s.store_class_end();
  }
}

void pageBlockHorizontalAlignmentLeft::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PageBlockHorizontalAlignmentLeft").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass pageBlockHorizontalAlignmentCenter::Class;

pageBlockHorizontalAlignmentCenter::pageBlockHorizontalAlignmentCenter() {
}

const std::int32_t pageBlockHorizontalAlignmentCenter::ID;

object_ptr<PageBlockHorizontalAlignment> pageBlockHorizontalAlignmentCenter::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<pageBlockHorizontalAlignmentCenter>();
}

void pageBlockHorizontalAlignmentCenter::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void pageBlockHorizontalAlignmentCenter::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PageBlockHorizontalAlignmentCenter");
    s.store_class_end();
  }
}

void pageBlockHorizontalAlignmentCenter::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PageBlockHorizontalAlignmentCenter").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass pageBlockHorizontalAlignmentRight::Class;

pageBlockHorizontalAlignmentRight::pageBlockHorizontalAlignmentRight() {
}

const std::int32_t pageBlockHorizontalAlignmentRight::ID;

object_ptr<PageBlockHorizontalAlignment> pageBlockHorizontalAlignmentRight::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<pageBlockHorizontalAlignmentRight>();
}

void pageBlockHorizontalAlignmentRight::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void pageBlockHorizontalAlignmentRight::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PageBlockHorizontalAlignmentRight");
    s.store_class_end();
  }
}

void pageBlockHorizontalAlignmentRight::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PageBlockHorizontalAlignmentRight").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportAuthorizationForm::Class;
jfieldID passportAuthorizationForm::id_fieldID;
jfieldID passportAuthorizationForm::required_elements_fieldID;
jfieldID passportAuthorizationForm::privacy_policy_url_fieldID;

passportAuthorizationForm::passportAuthorizationForm()
  : id_()
  , required_elements_()
  , privacy_policy_url_()
{}

passportAuthorizationForm::passportAuthorizationForm(int32 id_, array<object_ptr<passportRequiredElement>> &&required_elements_, string const &privacy_policy_url_)
  : id_(id_)
  , required_elements_(std::move(required_elements_))
  , privacy_policy_url_(privacy_policy_url_)
{}

const std::int32_t passportAuthorizationForm::ID;

object_ptr<passportAuthorizationForm> passportAuthorizationForm::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportAuthorizationForm> res = make_object<passportAuthorizationForm>();
  res->id_ = env->GetIntField(p, res->id_fieldID);
  res->required_elements_ = jni::FetchVector<passportRequiredElement>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->required_elements_fieldID));
  res->privacy_policy_url_ = jni::fetch_string(env, p, res->privacy_policy_url_fieldID);
  return res;
}

void passportAuthorizationForm::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, id_fieldID, id_);
  { auto arr_tmp_ = jni::store_vector(env, required_elements_); if (arr_tmp_) { env->SetObjectField(s, required_elements_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  { jstring nextString = jni::to_jstring(env, privacy_policy_url_); if (nextString) { env->SetObjectField(s, privacy_policy_url_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void passportAuthorizationForm::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportAuthorizationForm");
    s.store_field("id", id_);
    { s.store_vector_begin("requiredElements", required_elements_.size()); for (const auto &_value : required_elements_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_field("privacyPolicyUrl", privacy_policy_url_);
    s.store_class_end();
  }
}

void passportAuthorizationForm::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportAuthorizationForm").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "I");
    required_elements_fieldID = jni::get_field_id(env, Class, "requiredElements", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$PassportRequiredElement;").c_str());
    privacy_policy_url_fieldID = jni::get_field_id(env, Class, "privacyPolicyUrl", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass PassportElement::Class;

object_ptr<PassportElement> PassportElement::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case passportElementPersonalDetails::ID:
      return passportElementPersonalDetails::fetch(env, p);
    case passportElementPassport::ID:
      return passportElementPassport::fetch(env, p);
    case passportElementDriverLicense::ID:
      return passportElementDriverLicense::fetch(env, p);
    case passportElementIdentityCard::ID:
      return passportElementIdentityCard::fetch(env, p);
    case passportElementInternalPassport::ID:
      return passportElementInternalPassport::fetch(env, p);
    case passportElementAddress::ID:
      return passportElementAddress::fetch(env, p);
    case passportElementUtilityBill::ID:
      return passportElementUtilityBill::fetch(env, p);
    case passportElementBankStatement::ID:
      return passportElementBankStatement::fetch(env, p);
    case passportElementRentalAgreement::ID:
      return passportElementRentalAgreement::fetch(env, p);
    case passportElementPassportRegistration::ID:
      return passportElementPassportRegistration::fetch(env, p);
    case passportElementTemporaryRegistration::ID:
      return passportElementTemporaryRegistration::fetch(env, p);
    case passportElementPhoneNumber::ID:
      return passportElementPhoneNumber::fetch(env, p);
    case passportElementEmailAddress::ID:
      return passportElementEmailAddress::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void PassportElement::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElement").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportElementPersonalDetails::Class;
jfieldID passportElementPersonalDetails::personal_details_fieldID;

passportElementPersonalDetails::passportElementPersonalDetails()
  : personal_details_()
{}

passportElementPersonalDetails::passportElementPersonalDetails(object_ptr<personalDetails> &&personal_details_)
  : personal_details_(std::move(personal_details_))
{}

const std::int32_t passportElementPersonalDetails::ID;

object_ptr<PassportElement> passportElementPersonalDetails::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementPersonalDetails> res = make_object<passportElementPersonalDetails>();
  res->personal_details_ = jni::fetch_tl_object<personalDetails>(env, jni::fetch_object(env, p, res->personal_details_fieldID));
  return std::move(res);
}

void passportElementPersonalDetails::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (personal_details_ != nullptr) { jobject next; personal_details_->store(env, next); if (next) { env->SetObjectField(s, personal_details_fieldID, next); env->DeleteLocalRef(next); } }
}

void passportElementPersonalDetails::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementPersonalDetails");
    s.store_object_field("personalDetails", static_cast<const BaseObject *>(personal_details_.get()));
    s.store_class_end();
  }
}

void passportElementPersonalDetails::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementPersonalDetails").c_str());
    personal_details_fieldID = jni::get_field_id(env, Class, "personalDetails", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$PersonalDetails;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportElementPassport::Class;
jfieldID passportElementPassport::passport_fieldID;

passportElementPassport::passportElementPassport()
  : passport_()
{}

passportElementPassport::passportElementPassport(object_ptr<identityDocument> &&passport_)
  : passport_(std::move(passport_))
{}

const std::int32_t passportElementPassport::ID;

object_ptr<PassportElement> passportElementPassport::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementPassport> res = make_object<passportElementPassport>();
  res->passport_ = jni::fetch_tl_object<identityDocument>(env, jni::fetch_object(env, p, res->passport_fieldID));
  return std::move(res);
}

void passportElementPassport::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (passport_ != nullptr) { jobject next; passport_->store(env, next); if (next) { env->SetObjectField(s, passport_fieldID, next); env->DeleteLocalRef(next); } }
}

void passportElementPassport::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementPassport");
    s.store_object_field("passport", static_cast<const BaseObject *>(passport_.get()));
    s.store_class_end();
  }
}

void passportElementPassport::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementPassport").c_str());
    passport_fieldID = jni::get_field_id(env, Class, "passport", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$IdentityDocument;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportElementDriverLicense::Class;
jfieldID passportElementDriverLicense::driver_license_fieldID;

passportElementDriverLicense::passportElementDriverLicense()
  : driver_license_()
{}

passportElementDriverLicense::passportElementDriverLicense(object_ptr<identityDocument> &&driver_license_)
  : driver_license_(std::move(driver_license_))
{}

const std::int32_t passportElementDriverLicense::ID;

object_ptr<PassportElement> passportElementDriverLicense::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementDriverLicense> res = make_object<passportElementDriverLicense>();
  res->driver_license_ = jni::fetch_tl_object<identityDocument>(env, jni::fetch_object(env, p, res->driver_license_fieldID));
  return std::move(res);
}

void passportElementDriverLicense::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (driver_license_ != nullptr) { jobject next; driver_license_->store(env, next); if (next) { env->SetObjectField(s, driver_license_fieldID, next); env->DeleteLocalRef(next); } }
}

void passportElementDriverLicense::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementDriverLicense");
    s.store_object_field("driverLicense", static_cast<const BaseObject *>(driver_license_.get()));
    s.store_class_end();
  }
}

void passportElementDriverLicense::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementDriverLicense").c_str());
    driver_license_fieldID = jni::get_field_id(env, Class, "driverLicense", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$IdentityDocument;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportElementIdentityCard::Class;
jfieldID passportElementIdentityCard::identity_card_fieldID;

passportElementIdentityCard::passportElementIdentityCard()
  : identity_card_()
{}

passportElementIdentityCard::passportElementIdentityCard(object_ptr<identityDocument> &&identity_card_)
  : identity_card_(std::move(identity_card_))
{}

const std::int32_t passportElementIdentityCard::ID;

object_ptr<PassportElement> passportElementIdentityCard::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementIdentityCard> res = make_object<passportElementIdentityCard>();
  res->identity_card_ = jni::fetch_tl_object<identityDocument>(env, jni::fetch_object(env, p, res->identity_card_fieldID));
  return std::move(res);
}

void passportElementIdentityCard::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (identity_card_ != nullptr) { jobject next; identity_card_->store(env, next); if (next) { env->SetObjectField(s, identity_card_fieldID, next); env->DeleteLocalRef(next); } }
}

void passportElementIdentityCard::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementIdentityCard");
    s.store_object_field("identityCard", static_cast<const BaseObject *>(identity_card_.get()));
    s.store_class_end();
  }
}

void passportElementIdentityCard::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementIdentityCard").c_str());
    identity_card_fieldID = jni::get_field_id(env, Class, "identityCard", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$IdentityDocument;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportElementInternalPassport::Class;
jfieldID passportElementInternalPassport::internal_passport_fieldID;

passportElementInternalPassport::passportElementInternalPassport()
  : internal_passport_()
{}

passportElementInternalPassport::passportElementInternalPassport(object_ptr<identityDocument> &&internal_passport_)
  : internal_passport_(std::move(internal_passport_))
{}

const std::int32_t passportElementInternalPassport::ID;

object_ptr<PassportElement> passportElementInternalPassport::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementInternalPassport> res = make_object<passportElementInternalPassport>();
  res->internal_passport_ = jni::fetch_tl_object<identityDocument>(env, jni::fetch_object(env, p, res->internal_passport_fieldID));
  return std::move(res);
}

void passportElementInternalPassport::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (internal_passport_ != nullptr) { jobject next; internal_passport_->store(env, next); if (next) { env->SetObjectField(s, internal_passport_fieldID, next); env->DeleteLocalRef(next); } }
}

void passportElementInternalPassport::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementInternalPassport");
    s.store_object_field("internalPassport", static_cast<const BaseObject *>(internal_passport_.get()));
    s.store_class_end();
  }
}

void passportElementInternalPassport::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementInternalPassport").c_str());
    internal_passport_fieldID = jni::get_field_id(env, Class, "internalPassport", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$IdentityDocument;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportElementAddress::Class;
jfieldID passportElementAddress::address_fieldID;

passportElementAddress::passportElementAddress()
  : address_()
{}

passportElementAddress::passportElementAddress(object_ptr<address> &&address_)
  : address_(std::move(address_))
{}

const std::int32_t passportElementAddress::ID;

object_ptr<PassportElement> passportElementAddress::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementAddress> res = make_object<passportElementAddress>();
  res->address_ = jni::fetch_tl_object<address>(env, jni::fetch_object(env, p, res->address_fieldID));
  return std::move(res);
}

void passportElementAddress::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (address_ != nullptr) { jobject next; address_->store(env, next); if (next) { env->SetObjectField(s, address_fieldID, next); env->DeleteLocalRef(next); } }
}

void passportElementAddress::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementAddress");
    s.store_object_field("address", static_cast<const BaseObject *>(address_.get()));
    s.store_class_end();
  }
}

void passportElementAddress::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementAddress").c_str());
    address_fieldID = jni::get_field_id(env, Class, "address", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Address;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportElementUtilityBill::Class;
jfieldID passportElementUtilityBill::utility_bill_fieldID;

passportElementUtilityBill::passportElementUtilityBill()
  : utility_bill_()
{}

passportElementUtilityBill::passportElementUtilityBill(object_ptr<personalDocument> &&utility_bill_)
  : utility_bill_(std::move(utility_bill_))
{}

const std::int32_t passportElementUtilityBill::ID;

object_ptr<PassportElement> passportElementUtilityBill::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementUtilityBill> res = make_object<passportElementUtilityBill>();
  res->utility_bill_ = jni::fetch_tl_object<personalDocument>(env, jni::fetch_object(env, p, res->utility_bill_fieldID));
  return std::move(res);
}

void passportElementUtilityBill::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (utility_bill_ != nullptr) { jobject next; utility_bill_->store(env, next); if (next) { env->SetObjectField(s, utility_bill_fieldID, next); env->DeleteLocalRef(next); } }
}

void passportElementUtilityBill::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementUtilityBill");
    s.store_object_field("utilityBill", static_cast<const BaseObject *>(utility_bill_.get()));
    s.store_class_end();
  }
}

void passportElementUtilityBill::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementUtilityBill").c_str());
    utility_bill_fieldID = jni::get_field_id(env, Class, "utilityBill", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$PersonalDocument;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportElementBankStatement::Class;
jfieldID passportElementBankStatement::bank_statement_fieldID;

passportElementBankStatement::passportElementBankStatement()
  : bank_statement_()
{}

passportElementBankStatement::passportElementBankStatement(object_ptr<personalDocument> &&bank_statement_)
  : bank_statement_(std::move(bank_statement_))
{}

const std::int32_t passportElementBankStatement::ID;

object_ptr<PassportElement> passportElementBankStatement::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementBankStatement> res = make_object<passportElementBankStatement>();
  res->bank_statement_ = jni::fetch_tl_object<personalDocument>(env, jni::fetch_object(env, p, res->bank_statement_fieldID));
  return std::move(res);
}

void passportElementBankStatement::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (bank_statement_ != nullptr) { jobject next; bank_statement_->store(env, next); if (next) { env->SetObjectField(s, bank_statement_fieldID, next); env->DeleteLocalRef(next); } }
}

void passportElementBankStatement::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementBankStatement");
    s.store_object_field("bankStatement", static_cast<const BaseObject *>(bank_statement_.get()));
    s.store_class_end();
  }
}

void passportElementBankStatement::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementBankStatement").c_str());
    bank_statement_fieldID = jni::get_field_id(env, Class, "bankStatement", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$PersonalDocument;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportElementRentalAgreement::Class;
jfieldID passportElementRentalAgreement::rental_agreement_fieldID;

passportElementRentalAgreement::passportElementRentalAgreement()
  : rental_agreement_()
{}

passportElementRentalAgreement::passportElementRentalAgreement(object_ptr<personalDocument> &&rental_agreement_)
  : rental_agreement_(std::move(rental_agreement_))
{}

const std::int32_t passportElementRentalAgreement::ID;

object_ptr<PassportElement> passportElementRentalAgreement::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementRentalAgreement> res = make_object<passportElementRentalAgreement>();
  res->rental_agreement_ = jni::fetch_tl_object<personalDocument>(env, jni::fetch_object(env, p, res->rental_agreement_fieldID));
  return std::move(res);
}

void passportElementRentalAgreement::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (rental_agreement_ != nullptr) { jobject next; rental_agreement_->store(env, next); if (next) { env->SetObjectField(s, rental_agreement_fieldID, next); env->DeleteLocalRef(next); } }
}

void passportElementRentalAgreement::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementRentalAgreement");
    s.store_object_field("rentalAgreement", static_cast<const BaseObject *>(rental_agreement_.get()));
    s.store_class_end();
  }
}

void passportElementRentalAgreement::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementRentalAgreement").c_str());
    rental_agreement_fieldID = jni::get_field_id(env, Class, "rentalAgreement", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$PersonalDocument;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportElementPassportRegistration::Class;
jfieldID passportElementPassportRegistration::passport_registration_fieldID;

passportElementPassportRegistration::passportElementPassportRegistration()
  : passport_registration_()
{}

passportElementPassportRegistration::passportElementPassportRegistration(object_ptr<personalDocument> &&passport_registration_)
  : passport_registration_(std::move(passport_registration_))
{}

const std::int32_t passportElementPassportRegistration::ID;

object_ptr<PassportElement> passportElementPassportRegistration::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementPassportRegistration> res = make_object<passportElementPassportRegistration>();
  res->passport_registration_ = jni::fetch_tl_object<personalDocument>(env, jni::fetch_object(env, p, res->passport_registration_fieldID));
  return std::move(res);
}

void passportElementPassportRegistration::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (passport_registration_ != nullptr) { jobject next; passport_registration_->store(env, next); if (next) { env->SetObjectField(s, passport_registration_fieldID, next); env->DeleteLocalRef(next); } }
}

void passportElementPassportRegistration::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementPassportRegistration");
    s.store_object_field("passportRegistration", static_cast<const BaseObject *>(passport_registration_.get()));
    s.store_class_end();
  }
}

void passportElementPassportRegistration::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementPassportRegistration").c_str());
    passport_registration_fieldID = jni::get_field_id(env, Class, "passportRegistration", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$PersonalDocument;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportElementTemporaryRegistration::Class;
jfieldID passportElementTemporaryRegistration::temporary_registration_fieldID;

passportElementTemporaryRegistration::passportElementTemporaryRegistration()
  : temporary_registration_()
{}

passportElementTemporaryRegistration::passportElementTemporaryRegistration(object_ptr<personalDocument> &&temporary_registration_)
  : temporary_registration_(std::move(temporary_registration_))
{}

const std::int32_t passportElementTemporaryRegistration::ID;

object_ptr<PassportElement> passportElementTemporaryRegistration::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementTemporaryRegistration> res = make_object<passportElementTemporaryRegistration>();
  res->temporary_registration_ = jni::fetch_tl_object<personalDocument>(env, jni::fetch_object(env, p, res->temporary_registration_fieldID));
  return std::move(res);
}

void passportElementTemporaryRegistration::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (temporary_registration_ != nullptr) { jobject next; temporary_registration_->store(env, next); if (next) { env->SetObjectField(s, temporary_registration_fieldID, next); env->DeleteLocalRef(next); } }
}

void passportElementTemporaryRegistration::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementTemporaryRegistration");
    s.store_object_field("temporaryRegistration", static_cast<const BaseObject *>(temporary_registration_.get()));
    s.store_class_end();
  }
}

void passportElementTemporaryRegistration::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementTemporaryRegistration").c_str());
    temporary_registration_fieldID = jni::get_field_id(env, Class, "temporaryRegistration", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$PersonalDocument;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass passportElementPhoneNumber::Class;
jfieldID passportElementPhoneNumber::phone_number_fieldID;

passportElementPhoneNumber::passportElementPhoneNumber()
  : phone_number_()
{}

passportElementPhoneNumber::passportElementPhoneNumber(string const &phone_number_)
  : phone_number_(phone_number_)
{}

const std::int32_t passportElementPhoneNumber::ID;

object_ptr<PassportElement> passportElementPhoneNumber::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementPhoneNumber> res = make_object<passportElementPhoneNumber>();
  res->phone_number_ = jni::fetch_string(env, p, res->phone_number_fieldID);
  return std::move(res);
}

void passportElementPhoneNumber::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, phone_number_); if (nextString) { env->SetObjectField(s, phone_number_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void passportElementPhoneNumber::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementPhoneNumber");
    s.store_field("phoneNumber", phone_number_);
    s.store_class_end();
  }
}

void passportElementPhoneNumber::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementPhoneNumber").c_str());
    phone_number_fieldID = jni::get_field_id(env, Class, "phoneNumber", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass passportElementEmailAddress::Class;
jfieldID passportElementEmailAddress::email_address_fieldID;

passportElementEmailAddress::passportElementEmailAddress()
  : email_address_()
{}

passportElementEmailAddress::passportElementEmailAddress(string const &email_address_)
  : email_address_(email_address_)
{}

const std::int32_t passportElementEmailAddress::ID;

object_ptr<PassportElement> passportElementEmailAddress::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportElementEmailAddress> res = make_object<passportElementEmailAddress>();
  res->email_address_ = jni::fetch_string(env, p, res->email_address_fieldID);
  return std::move(res);
}

void passportElementEmailAddress::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, email_address_); if (nextString) { env->SetObjectField(s, email_address_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void passportElementEmailAddress::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportElementEmailAddress");
    s.store_field("emailAddress", email_address_);
    s.store_class_end();
  }
}

void passportElementEmailAddress::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportElementEmailAddress").c_str());
    email_address_fieldID = jni::get_field_id(env, Class, "emailAddress", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass passportSuitableElement::Class;
jfieldID passportSuitableElement::type_fieldID;
jfieldID passportSuitableElement::is_selfie_required_fieldID;
jfieldID passportSuitableElement::is_translation_required_fieldID;
jfieldID passportSuitableElement::is_native_name_required_fieldID;

passportSuitableElement::passportSuitableElement()
  : type_()
  , is_selfie_required_()
  , is_translation_required_()
  , is_native_name_required_()
{}

passportSuitableElement::passportSuitableElement(object_ptr<PassportElementType> &&type_, bool is_selfie_required_, bool is_translation_required_, bool is_native_name_required_)
  : type_(std::move(type_))
  , is_selfie_required_(is_selfie_required_)
  , is_translation_required_(is_translation_required_)
  , is_native_name_required_(is_native_name_required_)
{}

const std::int32_t passportSuitableElement::ID;

object_ptr<passportSuitableElement> passportSuitableElement::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<passportSuitableElement> res = make_object<passportSuitableElement>();
  res->type_ = jni::fetch_tl_object<PassportElementType>(env, jni::fetch_object(env, p, res->type_fieldID));
  res->is_selfie_required_ = (env->GetBooleanField(p, res->is_selfie_required_fieldID) != 0);
  res->is_translation_required_ = (env->GetBooleanField(p, res->is_translation_required_fieldID) != 0);
  res->is_native_name_required_ = (env->GetBooleanField(p, res->is_native_name_required_fieldID) != 0);
  return res;
}

void passportSuitableElement::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (type_ != nullptr) { jobject next; type_->store(env, next); if (next) { env->SetObjectField(s, type_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetBooleanField(s, is_selfie_required_fieldID, is_selfie_required_);
  env->SetBooleanField(s, is_translation_required_fieldID, is_translation_required_);
  env->SetBooleanField(s, is_native_name_required_fieldID, is_native_name_required_);
}

void passportSuitableElement::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PassportSuitableElement");
    s.store_object_field("type", static_cast<const BaseObject *>(type_.get()));
    s.store_field("isSelfieRequired", is_selfie_required_);
    s.store_field("isTranslationRequired", is_translation_required_);
    s.store_field("isNativeNameRequired", is_native_name_required_);
    s.store_class_end();
  }
}

void passportSuitableElement::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PassportSuitableElement").c_str());
    type_fieldID = jni::get_field_id(env, Class, "type", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$PassportElementType;").c_str());
    is_selfie_required_fieldID = jni::get_field_id(env, Class, "isSelfieRequired", "Z");
    is_translation_required_fieldID = jni::get_field_id(env, Class, "isTranslationRequired", "Z");
    is_native_name_required_fieldID = jni::get_field_id(env, Class, "isNativeNameRequired", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass PaymentProvider::Class;

object_ptr<PaymentProvider> PaymentProvider::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case paymentProviderSmartGlocal::ID:
      return paymentProviderSmartGlocal::fetch(env, p);
    case paymentProviderStripe::ID:
      return paymentProviderStripe::fetch(env, p);
    case paymentProviderOther::ID:
      return paymentProviderOther::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void PaymentProvider::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PaymentProvider").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass paymentProviderSmartGlocal::Class;
jfieldID paymentProviderSmartGlocal::public_token_fieldID;
jfieldID paymentProviderSmartGlocal::tokenize_url_fieldID;

paymentProviderSmartGlocal::paymentProviderSmartGlocal()
  : public_token_()
  , tokenize_url_()
{}

paymentProviderSmartGlocal::paymentProviderSmartGlocal(string const &public_token_, string const &tokenize_url_)
  : public_token_(public_token_)
  , tokenize_url_(tokenize_url_)
{}

const std::int32_t paymentProviderSmartGlocal::ID;

object_ptr<PaymentProvider> paymentProviderSmartGlocal::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<paymentProviderSmartGlocal> res = make_object<paymentProviderSmartGlocal>();
  res->public_token_ = jni::fetch_string(env, p, res->public_token_fieldID);
  res->tokenize_url_ = jni::fetch_string(env, p, res->tokenize_url_fieldID);
  return std::move(res);
}

void paymentProviderSmartGlocal::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, public_token_); if (nextString) { env->SetObjectField(s, public_token_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, tokenize_url_); if (nextString) { env->SetObjectField(s, tokenize_url_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void paymentProviderSmartGlocal::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PaymentProviderSmartGlocal");
    s.store_field("publicToken", public_token_);
    s.store_field("tokenizeUrl", tokenize_url_);
    s.store_class_end();
  }
}

void paymentProviderSmartGlocal::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PaymentProviderSmartGlocal").c_str());
    public_token_fieldID = jni::get_field_id(env, Class, "publicToken", "Ljava/lang/String;");
    tokenize_url_fieldID = jni::get_field_id(env, Class, "tokenizeUrl", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass paymentProviderStripe::Class;
jfieldID paymentProviderStripe::publishable_key_fieldID;
jfieldID paymentProviderStripe::need_country_fieldID;
jfieldID paymentProviderStripe::need_postal_code_fieldID;
jfieldID paymentProviderStripe::need_cardholder_name_fieldID;

paymentProviderStripe::paymentProviderStripe()
  : publishable_key_()
  , need_country_()
  , need_postal_code_()
  , need_cardholder_name_()
{}

paymentProviderStripe::paymentProviderStripe(string const &publishable_key_, bool need_country_, bool need_postal_code_, bool need_cardholder_name_)
  : publishable_key_(publishable_key_)
  , need_country_(need_country_)
  , need_postal_code_(need_postal_code_)
  , need_cardholder_name_(need_cardholder_name_)
{}

const std::int32_t paymentProviderStripe::ID;

object_ptr<PaymentProvider> paymentProviderStripe::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<paymentProviderStripe> res = make_object<paymentProviderStripe>();
  res->publishable_key_ = jni::fetch_string(env, p, res->publishable_key_fieldID);
  res->need_country_ = (env->GetBooleanField(p, res->need_country_fieldID) != 0);
  res->need_postal_code_ = (env->GetBooleanField(p, res->need_postal_code_fieldID) != 0);
  res->need_cardholder_name_ = (env->GetBooleanField(p, res->need_cardholder_name_fieldID) != 0);
  return std::move(res);
}

void paymentProviderStripe::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, publishable_key_); if (nextString) { env->SetObjectField(s, publishable_key_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  env->SetBooleanField(s, need_country_fieldID, need_country_);
  env->SetBooleanField(s, need_postal_code_fieldID, need_postal_code_);
  env->SetBooleanField(s, need_cardholder_name_fieldID, need_cardholder_name_);
}

void paymentProviderStripe::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PaymentProviderStripe");
    s.store_field("publishableKey", publishable_key_);
    s.store_field("needCountry", need_country_);
    s.store_field("needPostalCode", need_postal_code_);
    s.store_field("needCardholderName", need_cardholder_name_);
    s.store_class_end();
  }
}

void paymentProviderStripe::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PaymentProviderStripe").c_str());
    publishable_key_fieldID = jni::get_field_id(env, Class, "publishableKey", "Ljava/lang/String;");
    need_country_fieldID = jni::get_field_id(env, Class, "needCountry", "Z");
    need_postal_code_fieldID = jni::get_field_id(env, Class, "needPostalCode", "Z");
    need_cardholder_name_fieldID = jni::get_field_id(env, Class, "needCardholderName", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass paymentProviderOther::Class;
jfieldID paymentProviderOther::url_fieldID;

paymentProviderOther::paymentProviderOther()
  : url_()
{}

paymentProviderOther::paymentProviderOther(string const &url_)
  : url_(url_)
{}

const std::int32_t paymentProviderOther::ID;

object_ptr<PaymentProvider> paymentProviderOther::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<paymentProviderOther> res = make_object<paymentProviderOther>();
  res->url_ = jni::fetch_string(env, p, res->url_fieldID);
  return std::move(res);
}

void paymentProviderOther::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { jstring nextString = jni::to_jstring(env, url_); if (nextString) { env->SetObjectField(s, url_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void paymentProviderOther::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PaymentProviderOther");
    s.store_field("url", url_);
    s.store_class_end();
  }
}

void paymentProviderOther::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PaymentProviderOther").c_str());
    url_fieldID = jni::get_field_id(env, Class, "url", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass phoneNumberAuthenticationSettings::Class;
jfieldID phoneNumberAuthenticationSettings::allow_flash_call_fieldID;
jfieldID phoneNumberAuthenticationSettings::allow_missed_call_fieldID;
jfieldID phoneNumberAuthenticationSettings::is_current_phone_number_fieldID;
jfieldID phoneNumberAuthenticationSettings::has_unknown_phone_number_fieldID;
jfieldID phoneNumberAuthenticationSettings::allow_sms_retriever_api_fieldID;
jfieldID phoneNumberAuthenticationSettings::firebase_authentication_settings_fieldID;
jfieldID phoneNumberAuthenticationSettings::authentication_tokens_fieldID;

phoneNumberAuthenticationSettings::phoneNumberAuthenticationSettings()
  : allow_flash_call_()
  , allow_missed_call_()
  , is_current_phone_number_()
  , has_unknown_phone_number_()
  , allow_sms_retriever_api_()
  , firebase_authentication_settings_()
  , authentication_tokens_()
{}

phoneNumberAuthenticationSettings::phoneNumberAuthenticationSettings(bool allow_flash_call_, bool allow_missed_call_, bool is_current_phone_number_, bool has_unknown_phone_number_, bool allow_sms_retriever_api_, object_ptr<FirebaseAuthenticationSettings> &&firebase_authentication_settings_, array<string> &&authentication_tokens_)
  : allow_flash_call_(allow_flash_call_)
  , allow_missed_call_(allow_missed_call_)
  , is_current_phone_number_(is_current_phone_number_)
  , has_unknown_phone_number_(has_unknown_phone_number_)
  , allow_sms_retriever_api_(allow_sms_retriever_api_)
  , firebase_authentication_settings_(std::move(firebase_authentication_settings_))
  , authentication_tokens_(std::move(authentication_tokens_))
{}

const std::int32_t phoneNumberAuthenticationSettings::ID;

object_ptr<phoneNumberAuthenticationSettings> phoneNumberAuthenticationSettings::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<phoneNumberAuthenticationSettings> res = make_object<phoneNumberAuthenticationSettings>();
  res->allow_flash_call_ = (env->GetBooleanField(p, res->allow_flash_call_fieldID) != 0);
  res->allow_missed_call_ = (env->GetBooleanField(p, res->allow_missed_call_fieldID) != 0);
  res->is_current_phone_number_ = (env->GetBooleanField(p, res->is_current_phone_number_fieldID) != 0);
  res->has_unknown_phone_number_ = (env->GetBooleanField(p, res->has_unknown_phone_number_fieldID) != 0);
  res->allow_sms_retriever_api_ = (env->GetBooleanField(p, res->allow_sms_retriever_api_fieldID) != 0);
  res->firebase_authentication_settings_ = jni::fetch_tl_object<FirebaseAuthenticationSettings>(env, jni::fetch_object(env, p, res->firebase_authentication_settings_fieldID));
  res->authentication_tokens_ = jni::FetchVector<string>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->authentication_tokens_fieldID));
  return res;
}

void phoneNumberAuthenticationSettings::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PhoneNumberAuthenticationSettings");
    s.store_field("allowFlashCall", allow_flash_call_);
    s.store_field("allowMissedCall", allow_missed_call_);
    s.store_field("isCurrentPhoneNumber", is_current_phone_number_);
    s.store_field("hasUnknownPhoneNumber", has_unknown_phone_number_);
    s.store_field("allowSmsRetrieverApi", allow_sms_retriever_api_);
    s.store_object_field("firebaseAuthenticationSettings", static_cast<const BaseObject *>(firebase_authentication_settings_.get()));
    { s.store_vector_begin("authenticationTokens", authentication_tokens_.size()); for (const auto &_value : authentication_tokens_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

void phoneNumberAuthenticationSettings::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PhoneNumberAuthenticationSettings").c_str());
    allow_flash_call_fieldID = jni::get_field_id(env, Class, "allowFlashCall", "Z");
    allow_missed_call_fieldID = jni::get_field_id(env, Class, "allowMissedCall", "Z");
    is_current_phone_number_fieldID = jni::get_field_id(env, Class, "isCurrentPhoneNumber", "Z");
    has_unknown_phone_number_fieldID = jni::get_field_id(env, Class, "hasUnknownPhoneNumber", "Z");
    allow_sms_retriever_api_fieldID = jni::get_field_id(env, Class, "allowSmsRetrieverApi", "Z");
    firebase_authentication_settings_fieldID = jni::get_field_id(env, Class, "firebaseAuthenticationSettings", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$FirebaseAuthenticationSettings;").c_str());
    authentication_tokens_fieldID = jni::get_field_id(env, Class, "authenticationTokens", "[Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass pollVoter::Class;
jfieldID pollVoter::voter_id_fieldID;
jfieldID pollVoter::date_fieldID;

pollVoter::pollVoter()
  : voter_id_()
  , date_()
{}

pollVoter::pollVoter(object_ptr<MessageSender> &&voter_id_, int32 date_)
  : voter_id_(std::move(voter_id_))
  , date_(date_)
{}

const std::int32_t pollVoter::ID;

object_ptr<pollVoter> pollVoter::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<pollVoter> res = make_object<pollVoter>();
  res->voter_id_ = jni::fetch_tl_object<MessageSender>(env, jni::fetch_object(env, p, res->voter_id_fieldID));
  res->date_ = env->GetIntField(p, res->date_fieldID);
  return res;
}

void pollVoter::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (voter_id_ != nullptr) { jobject next; voter_id_->store(env, next); if (next) { env->SetObjectField(s, voter_id_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetIntField(s, date_fieldID, date_);
}

void pollVoter::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PollVoter");
    s.store_object_field("voterId", static_cast<const BaseObject *>(voter_id_.get()));
    s.store_field("date", date_);
    s.store_class_end();
  }
}

void pollVoter::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PollVoter").c_str());
    voter_id_fieldID = jni::get_field_id(env, Class, "voterId", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$MessageSender;").c_str());
    date_fieldID = jni::get_field_id(env, Class, "date", "I");
    return true;
  }();
  (void)is_inited;
}

jclass pollVoters::Class;
jfieldID pollVoters::total_count_fieldID;
jfieldID pollVoters::voters_fieldID;

pollVoters::pollVoters()
  : total_count_()
  , voters_()
{}

pollVoters::pollVoters(int32 total_count_, array<object_ptr<pollVoter>> &&voters_)
  : total_count_(total_count_)
  , voters_(std::move(voters_))
{}

const std::int32_t pollVoters::ID;

object_ptr<pollVoters> pollVoters::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<pollVoters> res = make_object<pollVoters>();
  res->total_count_ = env->GetIntField(p, res->total_count_fieldID);
  res->voters_ = jni::FetchVector<pollVoter>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->voters_fieldID));
  return res;
}

void pollVoters::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, total_count_fieldID, total_count_);
  { auto arr_tmp_ = jni::store_vector(env, voters_); if (arr_tmp_) { env->SetObjectField(s, voters_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void pollVoters::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PollVoters");
    s.store_field("totalCount", total_count_);
    { s.store_vector_begin("voters", voters_.size()); for (const auto &_value : voters_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

void pollVoters::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PollVoters").c_str());
    total_count_fieldID = jni::get_field_id(env, Class, "totalCount", "I");
    voters_fieldID = jni::get_field_id(env, Class, "voters", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$PollVoter;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass scopeNotificationSettings::Class;
jfieldID scopeNotificationSettings::mute_for_fieldID;
jfieldID scopeNotificationSettings::sound_id_fieldID;
jfieldID scopeNotificationSettings::show_preview_fieldID;
jfieldID scopeNotificationSettings::use_default_mute_stories_fieldID;
jfieldID scopeNotificationSettings::mute_stories_fieldID;
jfieldID scopeNotificationSettings::story_sound_id_fieldID;
jfieldID scopeNotificationSettings::show_story_poster_fieldID;
jfieldID scopeNotificationSettings::disable_pinned_message_notifications_fieldID;
jfieldID scopeNotificationSettings::disable_mention_notifications_fieldID;

scopeNotificationSettings::scopeNotificationSettings()
  : mute_for_()
  , sound_id_()
  , show_preview_()
  , use_default_mute_stories_()
  , mute_stories_()
  , story_sound_id_()
  , show_story_poster_()
  , disable_pinned_message_notifications_()
  , disable_mention_notifications_()
{}

scopeNotificationSettings::scopeNotificationSettings(int32 mute_for_, int64 sound_id_, bool show_preview_, bool use_default_mute_stories_, bool mute_stories_, int64 story_sound_id_, bool show_story_poster_, bool disable_pinned_message_notifications_, bool disable_mention_notifications_)
  : mute_for_(mute_for_)
  , sound_id_(sound_id_)
  , show_preview_(show_preview_)
  , use_default_mute_stories_(use_default_mute_stories_)
  , mute_stories_(mute_stories_)
  , story_sound_id_(story_sound_id_)
  , show_story_poster_(show_story_poster_)
  , disable_pinned_message_notifications_(disable_pinned_message_notifications_)
  , disable_mention_notifications_(disable_mention_notifications_)
{}

const std::int32_t scopeNotificationSettings::ID;

object_ptr<scopeNotificationSettings> scopeNotificationSettings::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<scopeNotificationSettings> res = make_object<scopeNotificationSettings>();
  res->mute_for_ = env->GetIntField(p, res->mute_for_fieldID);
  res->sound_id_ = env->GetLongField(p, res->sound_id_fieldID);
  res->show_preview_ = (env->GetBooleanField(p, res->show_preview_fieldID) != 0);
  res->use_default_mute_stories_ = (env->GetBooleanField(p, res->use_default_mute_stories_fieldID) != 0);
  res->mute_stories_ = (env->GetBooleanField(p, res->mute_stories_fieldID) != 0);
  res->story_sound_id_ = env->GetLongField(p, res->story_sound_id_fieldID);
  res->show_story_poster_ = (env->GetBooleanField(p, res->show_story_poster_fieldID) != 0);
  res->disable_pinned_message_notifications_ = (env->GetBooleanField(p, res->disable_pinned_message_notifications_fieldID) != 0);
  res->disable_mention_notifications_ = (env->GetBooleanField(p, res->disable_mention_notifications_fieldID) != 0);
  return res;
}

void scopeNotificationSettings::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, mute_for_fieldID, mute_for_);
  env->SetLongField(s, sound_id_fieldID, sound_id_);
  env->SetBooleanField(s, show_preview_fieldID, show_preview_);
  env->SetBooleanField(s, use_default_mute_stories_fieldID, use_default_mute_stories_);
  env->SetBooleanField(s, mute_stories_fieldID, mute_stories_);
  env->SetLongField(s, story_sound_id_fieldID, story_sound_id_);
  env->SetBooleanField(s, show_story_poster_fieldID, show_story_poster_);
  env->SetBooleanField(s, disable_pinned_message_notifications_fieldID, disable_pinned_message_notifications_);
  env->SetBooleanField(s, disable_mention_notifications_fieldID, disable_mention_notifications_);
}

void scopeNotificationSettings::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ScopeNotificationSettings");
    s.store_field("muteFor", mute_for_);
    s.store_field("soundId", sound_id_);
    s.store_field("showPreview", show_preview_);
    s.store_field("useDefaultMuteStories", use_default_mute_stories_);
    s.store_field("muteStories", mute_stories_);
    s.store_field("storySoundId", story_sound_id_);
    s.store_field("showStoryPoster", show_story_poster_);
    s.store_field("disablePinnedMessageNotifications", disable_pinned_message_notifications_);
    s.store_field("disableMentionNotifications", disable_mention_notifications_);
    s.store_class_end();
  }
}

void scopeNotificationSettings::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ScopeNotificationSettings").c_str());
    mute_for_fieldID = jni::get_field_id(env, Class, "muteFor", "I");
    sound_id_fieldID = jni::get_field_id(env, Class, "soundId", "J");
    show_preview_fieldID = jni::get_field_id(env, Class, "showPreview", "Z");
    use_default_mute_stories_fieldID = jni::get_field_id(env, Class, "useDefaultMuteStories", "Z");
    mute_stories_fieldID = jni::get_field_id(env, Class, "muteStories", "Z");
    story_sound_id_fieldID = jni::get_field_id(env, Class, "storySoundId", "J");
    show_story_poster_fieldID = jni::get_field_id(env, Class, "showStoryPoster", "Z");
    disable_pinned_message_notifications_fieldID = jni::get_field_id(env, Class, "disablePinnedMessageNotifications", "Z");
    disable_mention_notifications_fieldID = jni::get_field_id(env, Class, "disableMentionNotifications", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass SearchMessagesChatTypeFilter::Class;

object_ptr<SearchMessagesChatTypeFilter> SearchMessagesChatTypeFilter::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case searchMessagesChatTypeFilterPrivate::ID:
      return searchMessagesChatTypeFilterPrivate::fetch(env, p);
    case searchMessagesChatTypeFilterGroup::ID:
      return searchMessagesChatTypeFilterGroup::fetch(env, p);
    case searchMessagesChatTypeFilterChannel::ID:
      return searchMessagesChatTypeFilterChannel::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void SearchMessagesChatTypeFilter::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SearchMessagesChatTypeFilter").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass searchMessagesChatTypeFilterPrivate::Class;

searchMessagesChatTypeFilterPrivate::searchMessagesChatTypeFilterPrivate() {
}

const std::int32_t searchMessagesChatTypeFilterPrivate::ID;

object_ptr<SearchMessagesChatTypeFilter> searchMessagesChatTypeFilterPrivate::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<searchMessagesChatTypeFilterPrivate>();
}

void searchMessagesChatTypeFilterPrivate::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SearchMessagesChatTypeFilterPrivate");
    s.store_class_end();
  }
}

void searchMessagesChatTypeFilterPrivate::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SearchMessagesChatTypeFilterPrivate").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass searchMessagesChatTypeFilterGroup::Class;

searchMessagesChatTypeFilterGroup::searchMessagesChatTypeFilterGroup() {
}

const std::int32_t searchMessagesChatTypeFilterGroup::ID;

object_ptr<SearchMessagesChatTypeFilter> searchMessagesChatTypeFilterGroup::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<searchMessagesChatTypeFilterGroup>();
}

void searchMessagesChatTypeFilterGroup::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SearchMessagesChatTypeFilterGroup");
    s.store_class_end();
  }
}

void searchMessagesChatTypeFilterGroup::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SearchMessagesChatTypeFilterGroup").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass searchMessagesChatTypeFilterChannel::Class;

searchMessagesChatTypeFilterChannel::searchMessagesChatTypeFilterChannel() {
}

const std::int32_t searchMessagesChatTypeFilterChannel::ID;

object_ptr<SearchMessagesChatTypeFilter> searchMessagesChatTypeFilterChannel::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<searchMessagesChatTypeFilterChannel>();
}

void searchMessagesChatTypeFilterChannel::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SearchMessagesChatTypeFilterChannel");
    s.store_class_end();
  }
}

void searchMessagesChatTypeFilterChannel::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SearchMessagesChatTypeFilterChannel").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass sharedChat::Class;
jfieldID sharedChat::chat_id_fieldID;
jfieldID sharedChat::title_fieldID;
jfieldID sharedChat::username_fieldID;
jfieldID sharedChat::photo_fieldID;

sharedChat::sharedChat()
  : chat_id_()
  , title_()
  , username_()
  , photo_()
{}

sharedChat::sharedChat(int53 chat_id_, string const &title_, string const &username_, object_ptr<photo> &&photo_)
  : chat_id_(chat_id_)
  , title_(title_)
  , username_(username_)
  , photo_(std::move(photo_))
{}

const std::int32_t sharedChat::ID;

object_ptr<sharedChat> sharedChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<sharedChat> res = make_object<sharedChat>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->title_ = jni::fetch_string(env, p, res->title_fieldID);
  res->username_ = jni::fetch_string(env, p, res->username_fieldID);
  res->photo_ = jni::fetch_tl_object<photo>(env, jni::fetch_object(env, p, res->photo_fieldID));
  return res;
}

void sharedChat::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, chat_id_fieldID, chat_id_);
  { jstring nextString = jni::to_jstring(env, title_); if (nextString) { env->SetObjectField(s, title_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, username_); if (nextString) { env->SetObjectField(s, username_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  if (photo_ != nullptr) { jobject next; photo_->store(env, next); if (next) { env->SetObjectField(s, photo_fieldID, next); env->DeleteLocalRef(next); } }
}

void sharedChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SharedChat");
    s.store_field("chatId", chat_id_);
    s.store_field("title", title_);
    s.store_field("username", username_);
    s.store_object_field("photo", static_cast<const BaseObject *>(photo_.get()));
    s.store_class_end();
  }
}

void sharedChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SharedChat").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    title_fieldID = jni::get_field_id(env, Class, "title", "Ljava/lang/String;");
    username_fieldID = jni::get_field_id(env, Class, "username", "Ljava/lang/String;");
    photo_fieldID = jni::get_field_id(env, Class, "photo", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Photo;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass sponsoredChat::Class;
jfieldID sponsoredChat::unique_id_fieldID;
jfieldID sponsoredChat::chat_id_fieldID;
jfieldID sponsoredChat::sponsor_info_fieldID;
jfieldID sponsoredChat::additional_info_fieldID;

sponsoredChat::sponsoredChat()
  : unique_id_()
  , chat_id_()
  , sponsor_info_()
  , additional_info_()
{}

sponsoredChat::sponsoredChat(int53 unique_id_, int53 chat_id_, string const &sponsor_info_, string const &additional_info_)
  : unique_id_(unique_id_)
  , chat_id_(chat_id_)
  , sponsor_info_(sponsor_info_)
  , additional_info_(additional_info_)
{}

const std::int32_t sponsoredChat::ID;

object_ptr<sponsoredChat> sponsoredChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<sponsoredChat> res = make_object<sponsoredChat>();
  res->unique_id_ = env->GetLongField(p, res->unique_id_fieldID);
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->sponsor_info_ = jni::fetch_string(env, p, res->sponsor_info_fieldID);
  res->additional_info_ = jni::fetch_string(env, p, res->additional_info_fieldID);
  return res;
}

void sponsoredChat::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, unique_id_fieldID, unique_id_);
  env->SetLongField(s, chat_id_fieldID, chat_id_);
  { jstring nextString = jni::to_jstring(env, sponsor_info_); if (nextString) { env->SetObjectField(s, sponsor_info_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, additional_info_); if (nextString) { env->SetObjectField(s, additional_info_fieldID, nextString); env->DeleteLocalRef(nextString); } }
}

void sponsoredChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SponsoredChat");
    s.store_field("uniqueId", unique_id_);
    s.store_field("chatId", chat_id_);
    s.store_field("sponsorInfo", sponsor_info_);
    s.store_field("additionalInfo", additional_info_);
    s.store_class_end();
  }
}

void sponsoredChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SponsoredChat").c_str());
    unique_id_fieldID = jni::get_field_id(env, Class, "uniqueId", "J");
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    sponsor_info_fieldID = jni::get_field_id(env, Class, "sponsorInfo", "Ljava/lang/String;");
    additional_info_fieldID = jni::get_field_id(env, Class, "additionalInfo", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass starGiveawayWinnerOption::Class;
jfieldID starGiveawayWinnerOption::winner_count_fieldID;
jfieldID starGiveawayWinnerOption::won_star_count_fieldID;
jfieldID starGiveawayWinnerOption::is_default_fieldID;

starGiveawayWinnerOption::starGiveawayWinnerOption()
  : winner_count_()
  , won_star_count_()
  , is_default_()
{}

starGiveawayWinnerOption::starGiveawayWinnerOption(int32 winner_count_, int53 won_star_count_, bool is_default_)
  : winner_count_(winner_count_)
  , won_star_count_(won_star_count_)
  , is_default_(is_default_)
{}

const std::int32_t starGiveawayWinnerOption::ID;

object_ptr<starGiveawayWinnerOption> starGiveawayWinnerOption::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<starGiveawayWinnerOption> res = make_object<starGiveawayWinnerOption>();
  res->winner_count_ = env->GetIntField(p, res->winner_count_fieldID);
  res->won_star_count_ = env->GetLongField(p, res->won_star_count_fieldID);
  res->is_default_ = (env->GetBooleanField(p, res->is_default_fieldID) != 0);
  return res;
}

void starGiveawayWinnerOption::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, winner_count_fieldID, winner_count_);
  env->SetLongField(s, won_star_count_fieldID, won_star_count_);
  env->SetBooleanField(s, is_default_fieldID, is_default_);
}

void starGiveawayWinnerOption::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "StarGiveawayWinnerOption");
    s.store_field("winnerCount", winner_count_);
    s.store_field("wonStarCount", won_star_count_);
    s.store_field("isDefault", is_default_);
    s.store_class_end();
  }
}

void starGiveawayWinnerOption::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$StarGiveawayWinnerOption").c_str());
    winner_count_fieldID = jni::get_field_id(env, Class, "winnerCount", "I");
    won_star_count_fieldID = jni::get_field_id(env, Class, "wonStarCount", "J");
    is_default_fieldID = jni::get_field_id(env, Class, "isDefault", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass stickerSet::Class;
jfieldID stickerSet::id_fieldID;
jfieldID stickerSet::title_fieldID;
jfieldID stickerSet::name_fieldID;
jfieldID stickerSet::thumbnail_fieldID;
jfieldID stickerSet::thumbnail_outline_fieldID;
jfieldID stickerSet::is_owned_fieldID;
jfieldID stickerSet::is_installed_fieldID;
jfieldID stickerSet::is_archived_fieldID;
jfieldID stickerSet::is_official_fieldID;
jfieldID stickerSet::sticker_type_fieldID;
jfieldID stickerSet::needs_repainting_fieldID;
jfieldID stickerSet::is_allowed_as_chat_emoji_status_fieldID;
jfieldID stickerSet::is_viewed_fieldID;
jfieldID stickerSet::stickers_fieldID;
jfieldID stickerSet::emojis_fieldID;

stickerSet::stickerSet()
  : id_()
  , title_()
  , name_()
  , thumbnail_()
  , thumbnail_outline_()
  , is_owned_()
  , is_installed_()
  , is_archived_()
  , is_official_()
  , sticker_type_()
  , needs_repainting_()
  , is_allowed_as_chat_emoji_status_()
  , is_viewed_()
  , stickers_()
  , emojis_()
{}

stickerSet::stickerSet(int64 id_, string const &title_, string const &name_, object_ptr<thumbnail> &&thumbnail_, object_ptr<outline> &&thumbnail_outline_, bool is_owned_, bool is_installed_, bool is_archived_, bool is_official_, object_ptr<StickerType> &&sticker_type_, bool needs_repainting_, bool is_allowed_as_chat_emoji_status_, bool is_viewed_, array<object_ptr<sticker>> &&stickers_, array<object_ptr<emojis>> &&emojis_)
  : id_(id_)
  , title_(title_)
  , name_(name_)
  , thumbnail_(std::move(thumbnail_))
  , thumbnail_outline_(std::move(thumbnail_outline_))
  , is_owned_(is_owned_)
  , is_installed_(is_installed_)
  , is_archived_(is_archived_)
  , is_official_(is_official_)
  , sticker_type_(std::move(sticker_type_))
  , needs_repainting_(needs_repainting_)
  , is_allowed_as_chat_emoji_status_(is_allowed_as_chat_emoji_status_)
  , is_viewed_(is_viewed_)
  , stickers_(std::move(stickers_))
  , emojis_(std::move(emojis_))
{}

const std::int32_t stickerSet::ID;

object_ptr<stickerSet> stickerSet::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<stickerSet> res = make_object<stickerSet>();
  res->id_ = env->GetLongField(p, res->id_fieldID);
  res->title_ = jni::fetch_string(env, p, res->title_fieldID);
  res->name_ = jni::fetch_string(env, p, res->name_fieldID);
  res->thumbnail_ = jni::fetch_tl_object<thumbnail>(env, jni::fetch_object(env, p, res->thumbnail_fieldID));
  res->thumbnail_outline_ = jni::fetch_tl_object<outline>(env, jni::fetch_object(env, p, res->thumbnail_outline_fieldID));
  res->is_owned_ = (env->GetBooleanField(p, res->is_owned_fieldID) != 0);
  res->is_installed_ = (env->GetBooleanField(p, res->is_installed_fieldID) != 0);
  res->is_archived_ = (env->GetBooleanField(p, res->is_archived_fieldID) != 0);
  res->is_official_ = (env->GetBooleanField(p, res->is_official_fieldID) != 0);
  res->sticker_type_ = jni::fetch_tl_object<StickerType>(env, jni::fetch_object(env, p, res->sticker_type_fieldID));
  res->needs_repainting_ = (env->GetBooleanField(p, res->needs_repainting_fieldID) != 0);
  res->is_allowed_as_chat_emoji_status_ = (env->GetBooleanField(p, res->is_allowed_as_chat_emoji_status_fieldID) != 0);
  res->is_viewed_ = (env->GetBooleanField(p, res->is_viewed_fieldID) != 0);
  res->stickers_ = jni::FetchVector<sticker>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->stickers_fieldID));
  res->emojis_ = jni::FetchVector<emojis>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->emojis_fieldID));
  return res;
}

void stickerSet::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, id_fieldID, id_);
  { jstring nextString = jni::to_jstring(env, title_); if (nextString) { env->SetObjectField(s, title_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  { jstring nextString = jni::to_jstring(env, name_); if (nextString) { env->SetObjectField(s, name_fieldID, nextString); env->DeleteLocalRef(nextString); } }
  if (thumbnail_ != nullptr) { jobject next; thumbnail_->store(env, next); if (next) { env->SetObjectField(s, thumbnail_fieldID, next); env->DeleteLocalRef(next); } }
  if (thumbnail_outline_ != nullptr) { jobject next; thumbnail_outline_->store(env, next); if (next) { env->SetObjectField(s, thumbnail_outline_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetBooleanField(s, is_owned_fieldID, is_owned_);
  env->SetBooleanField(s, is_installed_fieldID, is_installed_);
  env->SetBooleanField(s, is_archived_fieldID, is_archived_);
  env->SetBooleanField(s, is_official_fieldID, is_official_);
  if (sticker_type_ != nullptr) { jobject next; sticker_type_->store(env, next); if (next) { env->SetObjectField(s, sticker_type_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetBooleanField(s, needs_repainting_fieldID, needs_repainting_);
  env->SetBooleanField(s, is_allowed_as_chat_emoji_status_fieldID, is_allowed_as_chat_emoji_status_);
  env->SetBooleanField(s, is_viewed_fieldID, is_viewed_);
  { auto arr_tmp_ = jni::store_vector(env, stickers_); if (arr_tmp_) { env->SetObjectField(s, stickers_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  { auto arr_tmp_ = jni::store_vector(env, emojis_); if (arr_tmp_) { env->SetObjectField(s, emojis_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void stickerSet::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "StickerSet");
    s.store_field("id", id_);
    s.store_field("title", title_);
    s.store_field("name", name_);
    s.store_object_field("thumbnail", static_cast<const BaseObject *>(thumbnail_.get()));
    s.store_object_field("thumbnailOutline", static_cast<const BaseObject *>(thumbnail_outline_.get()));
    s.store_field("isOwned", is_owned_);
    s.store_field("isInstalled", is_installed_);
    s.store_field("isArchived", is_archived_);
    s.store_field("isOfficial", is_official_);
    s.store_object_field("stickerType", static_cast<const BaseObject *>(sticker_type_.get()));
    s.store_field("needsRepainting", needs_repainting_);
    s.store_field("isAllowedAsChatEmojiStatus", is_allowed_as_chat_emoji_status_);
    s.store_field("isViewed", is_viewed_);
    { s.store_vector_begin("stickers", stickers_.size()); for (const auto &_value : stickers_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    { s.store_vector_begin("emojis", emojis_.size()); for (const auto &_value : emojis_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

void stickerSet::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$StickerSet").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "J");
    title_fieldID = jni::get_field_id(env, Class, "title", "Ljava/lang/String;");
    name_fieldID = jni::get_field_id(env, Class, "name", "Ljava/lang/String;");
    thumbnail_fieldID = jni::get_field_id(env, Class, "thumbnail", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Thumbnail;").c_str());
    thumbnail_outline_fieldID = jni::get_field_id(env, Class, "thumbnailOutline", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Outline;").c_str());
    is_owned_fieldID = jni::get_field_id(env, Class, "isOwned", "Z");
    is_installed_fieldID = jni::get_field_id(env, Class, "isInstalled", "Z");
    is_archived_fieldID = jni::get_field_id(env, Class, "isArchived", "Z");
    is_official_fieldID = jni::get_field_id(env, Class, "isOfficial", "Z");
    sticker_type_fieldID = jni::get_field_id(env, Class, "stickerType", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$StickerType;").c_str());
    needs_repainting_fieldID = jni::get_field_id(env, Class, "needsRepainting", "Z");
    is_allowed_as_chat_emoji_status_fieldID = jni::get_field_id(env, Class, "isAllowedAsChatEmojiStatus", "Z");
    is_viewed_fieldID = jni::get_field_id(env, Class, "isViewed", "Z");
    stickers_fieldID = jni::get_field_id(env, Class, "stickers", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$Sticker;").c_str());
    emojis_fieldID = jni::get_field_id(env, Class, "emojis", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$Emojis;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass StickerType::Class;

object_ptr<StickerType> StickerType::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case stickerTypeRegular::ID:
      return stickerTypeRegular::fetch(env, p);
    case stickerTypeMask::ID:
      return stickerTypeMask::fetch(env, p);
    case stickerTypeCustomEmoji::ID:
      return stickerTypeCustomEmoji::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void StickerType::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$StickerType").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass stickerTypeRegular::Class;

stickerTypeRegular::stickerTypeRegular() {
}

const std::int32_t stickerTypeRegular::ID;

object_ptr<StickerType> stickerTypeRegular::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<stickerTypeRegular>();
}

void stickerTypeRegular::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void stickerTypeRegular::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "StickerTypeRegular");
    s.store_class_end();
  }
}

void stickerTypeRegular::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$StickerTypeRegular").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass stickerTypeMask::Class;

stickerTypeMask::stickerTypeMask() {
}

const std::int32_t stickerTypeMask::ID;

object_ptr<StickerType> stickerTypeMask::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<stickerTypeMask>();
}

void stickerTypeMask::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void stickerTypeMask::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "StickerTypeMask");
    s.store_class_end();
  }
}

void stickerTypeMask::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$StickerTypeMask").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass stickerTypeCustomEmoji::Class;

stickerTypeCustomEmoji::stickerTypeCustomEmoji() {
}

const std::int32_t stickerTypeCustomEmoji::ID;

object_ptr<StickerType> stickerTypeCustomEmoji::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<stickerTypeCustomEmoji>();
}

void stickerTypeCustomEmoji::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void stickerTypeCustomEmoji::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "StickerTypeCustomEmoji");
    s.store_class_end();
  }
}

void stickerTypeCustomEmoji::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$StickerTypeCustomEmoji").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass stickers::Class;
jfieldID stickers::stickers_fieldID;

stickers::stickers()
  : stickers_()
{}

stickers::stickers(array<object_ptr<sticker>> &&stickers_)
  : stickers_(std::move(stickers_))
{}

const std::int32_t stickers::ID;

object_ptr<stickers> stickers::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<stickers> res = make_object<stickers>();
  res->stickers_ = jni::FetchVector<sticker>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->stickers_fieldID));
  return res;
}

void stickers::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { auto arr_tmp_ = jni::store_vector(env, stickers_); if (arr_tmp_) { env->SetObjectField(s, stickers_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void stickers::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "Stickers");
    { s.store_vector_begin("stickers", stickers_.size()); for (const auto &_value : stickers_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

void stickers::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$Stickers").c_str());
    stickers_fieldID = jni::get_field_id(env, Class, "stickers", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$Sticker;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass storageStatisticsByChat::Class;
jfieldID storageStatisticsByChat::chat_id_fieldID;
jfieldID storageStatisticsByChat::size_fieldID;
jfieldID storageStatisticsByChat::count_fieldID;
jfieldID storageStatisticsByChat::by_file_type_fieldID;

storageStatisticsByChat::storageStatisticsByChat()
  : chat_id_()
  , size_()
  , count_()
  , by_file_type_()
{}

storageStatisticsByChat::storageStatisticsByChat(int53 chat_id_, int53 size_, int32 count_, array<object_ptr<storageStatisticsByFileType>> &&by_file_type_)
  : chat_id_(chat_id_)
  , size_(size_)
  , count_(count_)
  , by_file_type_(std::move(by_file_type_))
{}

const std::int32_t storageStatisticsByChat::ID;

object_ptr<storageStatisticsByChat> storageStatisticsByChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<storageStatisticsByChat> res = make_object<storageStatisticsByChat>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->size_ = env->GetLongField(p, res->size_fieldID);
  res->count_ = env->GetIntField(p, res->count_fieldID);
  res->by_file_type_ = jni::FetchVector<storageStatisticsByFileType>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->by_file_type_fieldID));
  return res;
}

void storageStatisticsByChat::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, chat_id_fieldID, chat_id_);
  env->SetLongField(s, size_fieldID, size_);
  env->SetIntField(s, count_fieldID, count_);
  { auto arr_tmp_ = jni::store_vector(env, by_file_type_); if (arr_tmp_) { env->SetObjectField(s, by_file_type_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void storageStatisticsByChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "StorageStatisticsByChat");
    s.store_field("chatId", chat_id_);
    s.store_field("size", size_);
    s.store_field("count", count_);
    { s.store_vector_begin("byFileType", by_file_type_.size()); for (const auto &_value : by_file_type_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

void storageStatisticsByChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$StorageStatisticsByChat").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    size_fieldID = jni::get_field_id(env, Class, "size", "J");
    count_fieldID = jni::get_field_id(env, Class, "count", "I");
    by_file_type_fieldID = jni::get_field_id(env, Class, "byFileType", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$StorageStatisticsByFileType;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass storyVideo::Class;
jfieldID storyVideo::duration_fieldID;
jfieldID storyVideo::width_fieldID;
jfieldID storyVideo::height_fieldID;
jfieldID storyVideo::has_stickers_fieldID;
jfieldID storyVideo::is_animation_fieldID;
jfieldID storyVideo::minithumbnail_fieldID;
jfieldID storyVideo::thumbnail_fieldID;
jfieldID storyVideo::preload_prefix_size_fieldID;
jfieldID storyVideo::cover_frame_timestamp_fieldID;
jfieldID storyVideo::video_fieldID;

storyVideo::storyVideo()
  : duration_()
  , width_()
  , height_()
  , has_stickers_()
  , is_animation_()
  , minithumbnail_()
  , thumbnail_()
  , preload_prefix_size_()
  , cover_frame_timestamp_()
  , video_()
{}

storyVideo::storyVideo(double duration_, int32 width_, int32 height_, bool has_stickers_, bool is_animation_, object_ptr<minithumbnail> &&minithumbnail_, object_ptr<thumbnail> &&thumbnail_, int32 preload_prefix_size_, double cover_frame_timestamp_, object_ptr<file> &&video_)
  : duration_(duration_)
  , width_(width_)
  , height_(height_)
  , has_stickers_(has_stickers_)
  , is_animation_(is_animation_)
  , minithumbnail_(std::move(minithumbnail_))
  , thumbnail_(std::move(thumbnail_))
  , preload_prefix_size_(preload_prefix_size_)
  , cover_frame_timestamp_(cover_frame_timestamp_)
  , video_(std::move(video_))
{}

const std::int32_t storyVideo::ID;

object_ptr<storyVideo> storyVideo::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<storyVideo> res = make_object<storyVideo>();
  res->duration_ = env->GetDoubleField(p, res->duration_fieldID);
  res->width_ = env->GetIntField(p, res->width_fieldID);
  res->height_ = env->GetIntField(p, res->height_fieldID);
  res->has_stickers_ = (env->GetBooleanField(p, res->has_stickers_fieldID) != 0);
  res->is_animation_ = (env->GetBooleanField(p, res->is_animation_fieldID) != 0);
  res->minithumbnail_ = jni::fetch_tl_object<minithumbnail>(env, jni::fetch_object(env, p, res->minithumbnail_fieldID));
  res->thumbnail_ = jni::fetch_tl_object<thumbnail>(env, jni::fetch_object(env, p, res->thumbnail_fieldID));
  res->preload_prefix_size_ = env->GetIntField(p, res->preload_prefix_size_fieldID);
  res->cover_frame_timestamp_ = env->GetDoubleField(p, res->cover_frame_timestamp_fieldID);
  res->video_ = jni::fetch_tl_object<file>(env, jni::fetch_object(env, p, res->video_fieldID));
  return res;
}

void storyVideo::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetDoubleField(s, duration_fieldID, duration_);
  env->SetIntField(s, width_fieldID, width_);
  env->SetIntField(s, height_fieldID, height_);
  env->SetBooleanField(s, has_stickers_fieldID, has_stickers_);
  env->SetBooleanField(s, is_animation_fieldID, is_animation_);
  if (minithumbnail_ != nullptr) { jobject next; minithumbnail_->store(env, next); if (next) { env->SetObjectField(s, minithumbnail_fieldID, next); env->DeleteLocalRef(next); } }
  if (thumbnail_ != nullptr) { jobject next; thumbnail_->store(env, next); if (next) { env->SetObjectField(s, thumbnail_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetIntField(s, preload_prefix_size_fieldID, preload_prefix_size_);
  env->SetDoubleField(s, cover_frame_timestamp_fieldID, cover_frame_timestamp_);
  if (video_ != nullptr) { jobject next; video_->store(env, next); if (next) { env->SetObjectField(s, video_fieldID, next); env->DeleteLocalRef(next); } }
}

void storyVideo::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "StoryVideo");
    s.store_field("duration", duration_);
    s.store_field("width", width_);
    s.store_field("height", height_);
    s.store_field("hasStickers", has_stickers_);
    s.store_field("isAnimation", is_animation_);
    s.store_object_field("minithumbnail", static_cast<const BaseObject *>(minithumbnail_.get()));
    s.store_object_field("thumbnail", static_cast<const BaseObject *>(thumbnail_.get()));
    s.store_field("preloadPrefixSize", preload_prefix_size_);
    s.store_field("coverFrameTimestamp", cover_frame_timestamp_);
    s.store_object_field("video", static_cast<const BaseObject *>(video_.get()));
    s.store_class_end();
  }
}

void storyVideo::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$StoryVideo").c_str());
    duration_fieldID = jni::get_field_id(env, Class, "duration", "D");
    width_fieldID = jni::get_field_id(env, Class, "width", "I");
    height_fieldID = jni::get_field_id(env, Class, "height", "I");
    has_stickers_fieldID = jni::get_field_id(env, Class, "hasStickers", "Z");
    is_animation_fieldID = jni::get_field_id(env, Class, "isAnimation", "Z");
    minithumbnail_fieldID = jni::get_field_id(env, Class, "minithumbnail", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Minithumbnail;").c_str());
    thumbnail_fieldID = jni::get_field_id(env, Class, "thumbnail", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Thumbnail;").c_str());
    preload_prefix_size_fieldID = jni::get_field_id(env, Class, "preloadPrefixSize", "I");
    cover_frame_timestamp_fieldID = jni::get_field_id(env, Class, "coverFrameTimestamp", "D");
    video_fieldID = jni::get_field_id(env, Class, "video", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$File;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass supergroup::Class;
jfieldID supergroup::id_fieldID;
jfieldID supergroup::usernames_fieldID;
jfieldID supergroup::date_fieldID;
jfieldID supergroup::status_fieldID;
jfieldID supergroup::member_count_fieldID;
jfieldID supergroup::boost_level_fieldID;
jfieldID supergroup::has_automatic_translation_fieldID;
jfieldID supergroup::has_linked_chat_fieldID;
jfieldID supergroup::has_location_fieldID;
jfieldID supergroup::sign_messages_fieldID;
jfieldID supergroup::show_message_sender_fieldID;
jfieldID supergroup::join_to_send_messages_fieldID;
jfieldID supergroup::join_by_request_fieldID;
jfieldID supergroup::is_slow_mode_enabled_fieldID;
jfieldID supergroup::is_channel_fieldID;
jfieldID supergroup::is_broadcast_group_fieldID;
jfieldID supergroup::is_forum_fieldID;
jfieldID supergroup::is_direct_messages_group_fieldID;
jfieldID supergroup::is_administered_direct_messages_group_fieldID;
jfieldID supergroup::verification_status_fieldID;
jfieldID supergroup::has_direct_messages_group_fieldID;
jfieldID supergroup::has_forum_tabs_fieldID;
jfieldID supergroup::restriction_info_fieldID;
jfieldID supergroup::paid_message_star_count_fieldID;
jfieldID supergroup::active_story_state_fieldID;

supergroup::supergroup()
  : id_()
  , usernames_()
  , date_()
  , status_()
  , member_count_()
  , boost_level_()
  , has_automatic_translation_()
  , has_linked_chat_()
  , has_location_()
  , sign_messages_()
  , show_message_sender_()
  , join_to_send_messages_()
  , join_by_request_()
  , is_slow_mode_enabled_()
  , is_channel_()
  , is_broadcast_group_()
  , is_forum_()
  , is_direct_messages_group_()
  , is_administered_direct_messages_group_()
  , verification_status_()
  , has_direct_messages_group_()
  , has_forum_tabs_()
  , restriction_info_()
  , paid_message_star_count_()
  , active_story_state_()
{}

supergroup::supergroup(int53 id_, object_ptr<usernames> &&usernames_, int32 date_, object_ptr<ChatMemberStatus> &&status_, int32 member_count_, int32 boost_level_, bool has_automatic_translation_, bool has_linked_chat_, bool has_location_, bool sign_messages_, bool show_message_sender_, bool join_to_send_messages_, bool join_by_request_, bool is_slow_mode_enabled_, bool is_channel_, bool is_broadcast_group_, bool is_forum_, bool is_direct_messages_group_, bool is_administered_direct_messages_group_, object_ptr<verificationStatus> &&verification_status_, bool has_direct_messages_group_, bool has_forum_tabs_, object_ptr<restrictionInfo> &&restriction_info_, int53 paid_message_star_count_, object_ptr<ActiveStoryState> &&active_story_state_)
  : id_(id_)
  , usernames_(std::move(usernames_))
  , date_(date_)
  , status_(std::move(status_))
  , member_count_(member_count_)
  , boost_level_(boost_level_)
  , has_automatic_translation_(has_automatic_translation_)
  , has_linked_chat_(has_linked_chat_)
  , has_location_(has_location_)
  , sign_messages_(sign_messages_)
  , show_message_sender_(show_message_sender_)
  , join_to_send_messages_(join_to_send_messages_)
  , join_by_request_(join_by_request_)
  , is_slow_mode_enabled_(is_slow_mode_enabled_)
  , is_channel_(is_channel_)
  , is_broadcast_group_(is_broadcast_group_)
  , is_forum_(is_forum_)
  , is_direct_messages_group_(is_direct_messages_group_)
  , is_administered_direct_messages_group_(is_administered_direct_messages_group_)
  , verification_status_(std::move(verification_status_))
  , has_direct_messages_group_(has_direct_messages_group_)
  , has_forum_tabs_(has_forum_tabs_)
  , restriction_info_(std::move(restriction_info_))
  , paid_message_star_count_(paid_message_star_count_)
  , active_story_state_(std::move(active_story_state_))
{}

const std::int32_t supergroup::ID;

object_ptr<supergroup> supergroup::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<supergroup> res = make_object<supergroup>();
  res->id_ = env->GetLongField(p, res->id_fieldID);
  res->usernames_ = jni::fetch_tl_object<usernames>(env, jni::fetch_object(env, p, res->usernames_fieldID));
  res->date_ = env->GetIntField(p, res->date_fieldID);
  res->status_ = jni::fetch_tl_object<ChatMemberStatus>(env, jni::fetch_object(env, p, res->status_fieldID));
  res->member_count_ = env->GetIntField(p, res->member_count_fieldID);
  res->boost_level_ = env->GetIntField(p, res->boost_level_fieldID);
  res->has_automatic_translation_ = (env->GetBooleanField(p, res->has_automatic_translation_fieldID) != 0);
  res->has_linked_chat_ = (env->GetBooleanField(p, res->has_linked_chat_fieldID) != 0);
  res->has_location_ = (env->GetBooleanField(p, res->has_location_fieldID) != 0);
  res->sign_messages_ = (env->GetBooleanField(p, res->sign_messages_fieldID) != 0);
  res->show_message_sender_ = (env->GetBooleanField(p, res->show_message_sender_fieldID) != 0);
  res->join_to_send_messages_ = (env->GetBooleanField(p, res->join_to_send_messages_fieldID) != 0);
  res->join_by_request_ = (env->GetBooleanField(p, res->join_by_request_fieldID) != 0);
  res->is_slow_mode_enabled_ = (env->GetBooleanField(p, res->is_slow_mode_enabled_fieldID) != 0);
  res->is_channel_ = (env->GetBooleanField(p, res->is_channel_fieldID) != 0);
  res->is_broadcast_group_ = (env->GetBooleanField(p, res->is_broadcast_group_fieldID) != 0);
  res->is_forum_ = (env->GetBooleanField(p, res->is_forum_fieldID) != 0);
  res->is_direct_messages_group_ = (env->GetBooleanField(p, res->is_direct_messages_group_fieldID) != 0);
  res->is_administered_direct_messages_group_ = (env->GetBooleanField(p, res->is_administered_direct_messages_group_fieldID) != 0);
  res->verification_status_ = jni::fetch_tl_object<verificationStatus>(env, jni::fetch_object(env, p, res->verification_status_fieldID));
  res->has_direct_messages_group_ = (env->GetBooleanField(p, res->has_direct_messages_group_fieldID) != 0);
  res->has_forum_tabs_ = (env->GetBooleanField(p, res->has_forum_tabs_fieldID) != 0);
  res->restriction_info_ = jni::fetch_tl_object<restrictionInfo>(env, jni::fetch_object(env, p, res->restriction_info_fieldID));
  res->paid_message_star_count_ = env->GetLongField(p, res->paid_message_star_count_fieldID);
  res->active_story_state_ = jni::fetch_tl_object<ActiveStoryState>(env, jni::fetch_object(env, p, res->active_story_state_fieldID));
  return res;
}

void supergroup::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetLongField(s, id_fieldID, id_);
  if (usernames_ != nullptr) { jobject next; usernames_->store(env, next); if (next) { env->SetObjectField(s, usernames_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetIntField(s, date_fieldID, date_);
  if (status_ != nullptr) { jobject next; status_->store(env, next); if (next) { env->SetObjectField(s, status_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetIntField(s, member_count_fieldID, member_count_);
  env->SetIntField(s, boost_level_fieldID, boost_level_);
  env->SetBooleanField(s, has_automatic_translation_fieldID, has_automatic_translation_);
  env->SetBooleanField(s, has_linked_chat_fieldID, has_linked_chat_);
  env->SetBooleanField(s, has_location_fieldID, has_location_);
  env->SetBooleanField(s, sign_messages_fieldID, sign_messages_);
  env->SetBooleanField(s, show_message_sender_fieldID, show_message_sender_);
  env->SetBooleanField(s, join_to_send_messages_fieldID, join_to_send_messages_);
  env->SetBooleanField(s, join_by_request_fieldID, join_by_request_);
  env->SetBooleanField(s, is_slow_mode_enabled_fieldID, is_slow_mode_enabled_);
  env->SetBooleanField(s, is_channel_fieldID, is_channel_);
  env->SetBooleanField(s, is_broadcast_group_fieldID, is_broadcast_group_);
  env->SetBooleanField(s, is_forum_fieldID, is_forum_);
  env->SetBooleanField(s, is_direct_messages_group_fieldID, is_direct_messages_group_);
  env->SetBooleanField(s, is_administered_direct_messages_group_fieldID, is_administered_direct_messages_group_);
  if (verification_status_ != nullptr) { jobject next; verification_status_->store(env, next); if (next) { env->SetObjectField(s, verification_status_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetBooleanField(s, has_direct_messages_group_fieldID, has_direct_messages_group_);
  env->SetBooleanField(s, has_forum_tabs_fieldID, has_forum_tabs_);
  if (restriction_info_ != nullptr) { jobject next; restriction_info_->store(env, next); if (next) { env->SetObjectField(s, restriction_info_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetLongField(s, paid_message_star_count_fieldID, paid_message_star_count_);
  if (active_story_state_ != nullptr) { jobject next; active_story_state_->store(env, next); if (next) { env->SetObjectField(s, active_story_state_fieldID, next); env->DeleteLocalRef(next); } }
}

void supergroup::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "Supergroup");
    s.store_field("id", id_);
    s.store_object_field("usernames", static_cast<const BaseObject *>(usernames_.get()));
    s.store_field("date", date_);
    s.store_object_field("status", static_cast<const BaseObject *>(status_.get()));
    s.store_field("memberCount", member_count_);
    s.store_field("boostLevel", boost_level_);
    s.store_field("hasAutomaticTranslation", has_automatic_translation_);
    s.store_field("hasLinkedChat", has_linked_chat_);
    s.store_field("hasLocation", has_location_);
    s.store_field("signMessages", sign_messages_);
    s.store_field("showMessageSender", show_message_sender_);
    s.store_field("joinToSendMessages", join_to_send_messages_);
    s.store_field("joinByRequest", join_by_request_);
    s.store_field("isSlowModeEnabled", is_slow_mode_enabled_);
    s.store_field("isChannel", is_channel_);
    s.store_field("isBroadcastGroup", is_broadcast_group_);
    s.store_field("isForum", is_forum_);
    s.store_field("isDirectMessagesGroup", is_direct_messages_group_);
    s.store_field("isAdministeredDirectMessagesGroup", is_administered_direct_messages_group_);
    s.store_object_field("verificationStatus", static_cast<const BaseObject *>(verification_status_.get()));
    s.store_field("hasDirectMessagesGroup", has_direct_messages_group_);
    s.store_field("hasForumTabs", has_forum_tabs_);
    s.store_object_field("restrictionInfo", static_cast<const BaseObject *>(restriction_info_.get()));
    s.store_field("paidMessageStarCount", paid_message_star_count_);
    s.store_object_field("activeStoryState", static_cast<const BaseObject *>(active_story_state_.get()));
    s.store_class_end();
  }
}

void supergroup::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$Supergroup").c_str());
    id_fieldID = jni::get_field_id(env, Class, "id", "J");
    usernames_fieldID = jni::get_field_id(env, Class, "usernames", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Usernames;").c_str());
    date_fieldID = jni::get_field_id(env, Class, "date", "I");
    status_fieldID = jni::get_field_id(env, Class, "status", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ChatMemberStatus;").c_str());
    member_count_fieldID = jni::get_field_id(env, Class, "memberCount", "I");
    boost_level_fieldID = jni::get_field_id(env, Class, "boostLevel", "I");
    has_automatic_translation_fieldID = jni::get_field_id(env, Class, "hasAutomaticTranslation", "Z");
    has_linked_chat_fieldID = jni::get_field_id(env, Class, "hasLinkedChat", "Z");
    has_location_fieldID = jni::get_field_id(env, Class, "hasLocation", "Z");
    sign_messages_fieldID = jni::get_field_id(env, Class, "signMessages", "Z");
    show_message_sender_fieldID = jni::get_field_id(env, Class, "showMessageSender", "Z");
    join_to_send_messages_fieldID = jni::get_field_id(env, Class, "joinToSendMessages", "Z");
    join_by_request_fieldID = jni::get_field_id(env, Class, "joinByRequest", "Z");
    is_slow_mode_enabled_fieldID = jni::get_field_id(env, Class, "isSlowModeEnabled", "Z");
    is_channel_fieldID = jni::get_field_id(env, Class, "isChannel", "Z");
    is_broadcast_group_fieldID = jni::get_field_id(env, Class, "isBroadcastGroup", "Z");
    is_forum_fieldID = jni::get_field_id(env, Class, "isForum", "Z");
    is_direct_messages_group_fieldID = jni::get_field_id(env, Class, "isDirectMessagesGroup", "Z");
    is_administered_direct_messages_group_fieldID = jni::get_field_id(env, Class, "isAdministeredDirectMessagesGroup", "Z");
    verification_status_fieldID = jni::get_field_id(env, Class, "verificationStatus", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$VerificationStatus;").c_str());
    has_direct_messages_group_fieldID = jni::get_field_id(env, Class, "hasDirectMessagesGroup", "Z");
    has_forum_tabs_fieldID = jni::get_field_id(env, Class, "hasForumTabs", "Z");
    restriction_info_fieldID = jni::get_field_id(env, Class, "restrictionInfo", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$RestrictionInfo;").c_str());
    paid_message_star_count_fieldID = jni::get_field_id(env, Class, "paidMessageStarCount", "J");
    active_story_state_fieldID = jni::get_field_id(env, Class, "activeStoryState", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ActiveStoryState;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass testInt::Class;
jfieldID testInt::value_fieldID;

testInt::testInt()
  : value_()
{}

testInt::testInt(int32 value_)
  : value_(value_)
{}

const std::int32_t testInt::ID;

object_ptr<testInt> testInt::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<testInt> res = make_object<testInt>();
  res->value_ = env->GetIntField(p, res->value_fieldID);
  return res;
}

void testInt::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  env->SetIntField(s, value_fieldID, value_);
}

void testInt::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "TestInt");
    s.store_field("value", value_);
    s.store_class_end();
  }
}

void testInt::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$TestInt").c_str());
    value_fieldID = jni::get_field_id(env, Class, "value", "I");
    return true;
  }();
  (void)is_inited;
}

jclass testVectorInt::Class;
jfieldID testVectorInt::value_fieldID;

testVectorInt::testVectorInt()
  : value_()
{}

testVectorInt::testVectorInt(array<int32> &&value_)
  : value_(std::move(value_))
{}

const std::int32_t testVectorInt::ID;

object_ptr<testVectorInt> testVectorInt::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<testVectorInt> res = make_object<testVectorInt>();
  res->value_ = jni::fetch_vector(env, (jintArray)jni::fetch_object(env, p, res->value_fieldID));
  return res;
}

void testVectorInt::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { auto arr_tmp_ = jni::store_vector(env, value_); if (arr_tmp_) { env->SetObjectField(s, value_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
}

void testVectorInt::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "TestVectorInt");
    { s.store_vector_begin("value", value_.size()); for (const auto &_value : value_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

void testVectorInt::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$TestVectorInt").c_str());
    value_fieldID = jni::get_field_id(env, Class, "value", "[I");
    return true;
  }();
  (void)is_inited;
}

jclass unreadReaction::Class;
jfieldID unreadReaction::type_fieldID;
jfieldID unreadReaction::sender_id_fieldID;
jfieldID unreadReaction::is_big_fieldID;

unreadReaction::unreadReaction()
  : type_()
  , sender_id_()
  , is_big_()
{}

unreadReaction::unreadReaction(object_ptr<ReactionType> &&type_, object_ptr<MessageSender> &&sender_id_, bool is_big_)
  : type_(std::move(type_))
  , sender_id_(std::move(sender_id_))
  , is_big_(is_big_)
{}

const std::int32_t unreadReaction::ID;

object_ptr<unreadReaction> unreadReaction::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<unreadReaction> res = make_object<unreadReaction>();
  res->type_ = jni::fetch_tl_object<ReactionType>(env, jni::fetch_object(env, p, res->type_fieldID));
  res->sender_id_ = jni::fetch_tl_object<MessageSender>(env, jni::fetch_object(env, p, res->sender_id_fieldID));
  res->is_big_ = (env->GetBooleanField(p, res->is_big_fieldID) != 0);
  return res;
}

void unreadReaction::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  if (type_ != nullptr) { jobject next; type_->store(env, next); if (next) { env->SetObjectField(s, type_fieldID, next); env->DeleteLocalRef(next); } }
  if (sender_id_ != nullptr) { jobject next; sender_id_->store(env, next); if (next) { env->SetObjectField(s, sender_id_fieldID, next); env->DeleteLocalRef(next); } }
  env->SetBooleanField(s, is_big_fieldID, is_big_);
}

void unreadReaction::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "UnreadReaction");
    s.store_object_field("type", static_cast<const BaseObject *>(type_.get()));
    s.store_object_field("senderId", static_cast<const BaseObject *>(sender_id_.get()));
    s.store_field("isBig", is_big_);
    s.store_class_end();
  }
}

void unreadReaction::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$UnreadReaction").c_str());
    type_fieldID = jni::get_field_id(env, Class, "type", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReactionType;").c_str());
    sender_id_fieldID = jni::get_field_id(env, Class, "senderId", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$MessageSender;").c_str());
    is_big_fieldID = jni::get_field_id(env, Class, "isBig", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass videoMessageAdvertisements::Class;
jfieldID videoMessageAdvertisements::advertisements_fieldID;
jfieldID videoMessageAdvertisements::start_delay_fieldID;
jfieldID videoMessageAdvertisements::between_delay_fieldID;

videoMessageAdvertisements::videoMessageAdvertisements()
  : advertisements_()
  , start_delay_()
  , between_delay_()
{}

videoMessageAdvertisements::videoMessageAdvertisements(array<object_ptr<videoMessageAdvertisement>> &&advertisements_, int32 start_delay_, int32 between_delay_)
  : advertisements_(std::move(advertisements_))
  , start_delay_(start_delay_)
  , between_delay_(between_delay_)
{}

const std::int32_t videoMessageAdvertisements::ID;

object_ptr<videoMessageAdvertisements> videoMessageAdvertisements::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<videoMessageAdvertisements> res = make_object<videoMessageAdvertisements>();
  res->advertisements_ = jni::FetchVector<videoMessageAdvertisement>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->advertisements_fieldID));
  res->start_delay_ = env->GetIntField(p, res->start_delay_fieldID);
  res->between_delay_ = env->GetIntField(p, res->between_delay_fieldID);
  return res;
}

void videoMessageAdvertisements::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
  { auto arr_tmp_ = jni::store_vector(env, advertisements_); if (arr_tmp_) { env->SetObjectField(s, advertisements_fieldID, arr_tmp_); env->DeleteLocalRef(arr_tmp_); } }
  env->SetIntField(s, start_delay_fieldID, start_delay_);
  env->SetIntField(s, between_delay_fieldID, between_delay_);
}

void videoMessageAdvertisements::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "VideoMessageAdvertisements");
    { s.store_vector_begin("advertisements", advertisements_.size()); for (const auto &_value : advertisements_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_field("startDelay", start_delay_);
    s.store_field("betweenDelay", between_delay_);
    s.store_class_end();
  }
}

void videoMessageAdvertisements::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$VideoMessageAdvertisements").c_str());
    advertisements_fieldID = jni::get_field_id(env, Class, "advertisements", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$VideoMessageAdvertisement;").c_str());
    start_delay_fieldID = jni::get_field_id(env, Class, "startDelay", "I");
    between_delay_fieldID = jni::get_field_id(env, Class, "betweenDelay", "I");
    return true;
  }();
  (void)is_inited;
}

jclass WebAppOpenMode::Class;

object_ptr<WebAppOpenMode> WebAppOpenMode::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case webAppOpenModeCompact::ID:
      return webAppOpenModeCompact::fetch(env, p);
    case webAppOpenModeFullSize::ID:
      return webAppOpenModeFullSize::fetch(env, p);
    case webAppOpenModeFullScreen::ID:
      return webAppOpenModeFullScreen::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void WebAppOpenMode::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$WebAppOpenMode").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass webAppOpenModeCompact::Class;

webAppOpenModeCompact::webAppOpenModeCompact() {
}

const std::int32_t webAppOpenModeCompact::ID;

object_ptr<WebAppOpenMode> webAppOpenModeCompact::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<webAppOpenModeCompact>();
}

void webAppOpenModeCompact::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void webAppOpenModeCompact::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "WebAppOpenModeCompact");
    s.store_class_end();
  }
}

void webAppOpenModeCompact::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$WebAppOpenModeCompact").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass webAppOpenModeFullSize::Class;

webAppOpenModeFullSize::webAppOpenModeFullSize() {
}

const std::int32_t webAppOpenModeFullSize::ID;

object_ptr<WebAppOpenMode> webAppOpenModeFullSize::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<webAppOpenModeFullSize>();
}

void webAppOpenModeFullSize::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void webAppOpenModeFullSize::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "WebAppOpenModeFullSize");
    s.store_class_end();
  }
}

void webAppOpenModeFullSize::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$WebAppOpenModeFullSize").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass webAppOpenModeFullScreen::Class;

webAppOpenModeFullScreen::webAppOpenModeFullScreen() {
}

const std::int32_t webAppOpenModeFullScreen::ID;

object_ptr<WebAppOpenMode> webAppOpenModeFullScreen::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<webAppOpenModeFullScreen>();
}

void webAppOpenModeFullScreen::store(JNIEnv *env, jobject &s) const {
  init_jni_vars(env);
  s = env->AllocObject(Class);
  if (!s) { return; }
}

void webAppOpenModeFullScreen::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "WebAppOpenModeFullScreen");
    s.store_class_end();
  }
}

void webAppOpenModeFullScreen::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$WebAppOpenModeFullScreen").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass addChatMember::Class;
jfieldID addChatMember::chat_id_fieldID;
jfieldID addChatMember::user_id_fieldID;
jfieldID addChatMember::forward_limit_fieldID;

addChatMember::addChatMember()
  : chat_id_()
  , user_id_()
  , forward_limit_()
{}

addChatMember::addChatMember(int53 chat_id_, int53 user_id_, int32 forward_limit_)
  : chat_id_(chat_id_)
  , user_id_(user_id_)
  , forward_limit_(forward_limit_)
{}

const std::int32_t addChatMember::ID;

object_ptr<addChatMember> addChatMember::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<addChatMember> res = make_object<addChatMember>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->user_id_ = env->GetLongField(p, res->user_id_fieldID);
  res->forward_limit_ = env->GetIntField(p, res->forward_limit_fieldID);
  return res;
}

void addChatMember::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AddChatMember");
    s.store_field("chatId", chat_id_);
    s.store_field("userId", user_id_);
    s.store_field("forwardLimit", forward_limit_);
    s.store_class_end();
  }
}

addChatMember::ReturnType addChatMember::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return failedToAddMembers::fetch(env, p);
}

void addChatMember::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AddChatMember").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    user_id_fieldID = jni::get_field_id(env, Class, "userId", "J");
    forward_limit_fieldID = jni::get_field_id(env, Class, "forwardLimit", "I");
    return true;
  }();
  (void)is_inited;
}

jclass addMessageReaction::Class;
jfieldID addMessageReaction::chat_id_fieldID;
jfieldID addMessageReaction::message_id_fieldID;
jfieldID addMessageReaction::reaction_type_fieldID;
jfieldID addMessageReaction::is_big_fieldID;
jfieldID addMessageReaction::update_recent_reactions_fieldID;

addMessageReaction::addMessageReaction()
  : chat_id_()
  , message_id_()
  , reaction_type_()
  , is_big_()
  , update_recent_reactions_()
{}

addMessageReaction::addMessageReaction(int53 chat_id_, int53 message_id_, object_ptr<ReactionType> &&reaction_type_, bool is_big_, bool update_recent_reactions_)
  : chat_id_(chat_id_)
  , message_id_(message_id_)
  , reaction_type_(std::move(reaction_type_))
  , is_big_(is_big_)
  , update_recent_reactions_(update_recent_reactions_)
{}

const std::int32_t addMessageReaction::ID;

object_ptr<addMessageReaction> addMessageReaction::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<addMessageReaction> res = make_object<addMessageReaction>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  res->reaction_type_ = jni::fetch_tl_object<ReactionType>(env, jni::fetch_object(env, p, res->reaction_type_fieldID));
  res->is_big_ = (env->GetBooleanField(p, res->is_big_fieldID) != 0);
  res->update_recent_reactions_ = (env->GetBooleanField(p, res->update_recent_reactions_fieldID) != 0);
  return res;
}

void addMessageReaction::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AddMessageReaction");
    s.store_field("chatId", chat_id_);
    s.store_field("messageId", message_id_);
    s.store_object_field("reactionType", static_cast<const BaseObject *>(reaction_type_.get()));
    s.store_field("isBig", is_big_);
    s.store_field("updateRecentReactions", update_recent_reactions_);
    s.store_class_end();
  }
}

addMessageReaction::ReturnType addMessageReaction::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void addMessageReaction::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AddMessageReaction").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    reaction_type_fieldID = jni::get_field_id(env, Class, "reactionType", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReactionType;").c_str());
    is_big_fieldID = jni::get_field_id(env, Class, "isBig", "Z");
    update_recent_reactions_fieldID = jni::get_field_id(env, Class, "updateRecentReactions", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass addNetworkStatistics::Class;
jfieldID addNetworkStatistics::entry_fieldID;

addNetworkStatistics::addNetworkStatistics()
  : entry_()
{}

addNetworkStatistics::addNetworkStatistics(object_ptr<NetworkStatisticsEntry> &&entry_)
  : entry_(std::move(entry_))
{}

const std::int32_t addNetworkStatistics::ID;

object_ptr<addNetworkStatistics> addNetworkStatistics::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<addNetworkStatistics> res = make_object<addNetworkStatistics>();
  res->entry_ = jni::fetch_tl_object<NetworkStatisticsEntry>(env, jni::fetch_object(env, p, res->entry_fieldID));
  return res;
}

void addNetworkStatistics::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AddNetworkStatistics");
    s.store_object_field("entry", static_cast<const BaseObject *>(entry_.get()));
    s.store_class_end();
  }
}

addNetworkStatistics::ReturnType addNetworkStatistics::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void addNetworkStatistics::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AddNetworkStatistics").c_str());
    entry_fieldID = jni::get_field_id(env, Class, "entry", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$NetworkStatisticsEntry;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass answerGuestQuery::Class;
jfieldID answerGuestQuery::guest_query_id_fieldID;
jfieldID answerGuestQuery::result_fieldID;

answerGuestQuery::answerGuestQuery()
  : guest_query_id_()
  , result_()
{}

answerGuestQuery::answerGuestQuery(int64 guest_query_id_, object_ptr<InputInlineQueryResult> &&result_)
  : guest_query_id_(guest_query_id_)
  , result_(std::move(result_))
{}

const std::int32_t answerGuestQuery::ID;

object_ptr<answerGuestQuery> answerGuestQuery::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<answerGuestQuery> res = make_object<answerGuestQuery>();
  res->guest_query_id_ = env->GetLongField(p, res->guest_query_id_fieldID);
  res->result_ = jni::fetch_tl_object<InputInlineQueryResult>(env, jni::fetch_object(env, p, res->result_fieldID));
  return res;
}

void answerGuestQuery::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "AnswerGuestQuery");
    s.store_field("guestQueryId", guest_query_id_);
    s.store_object_field("result", static_cast<const BaseObject *>(result_.get()));
    s.store_class_end();
  }
}

answerGuestQuery::ReturnType answerGuestQuery::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return inlineMessageId::fetch(env, p);
}

void answerGuestQuery::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$AnswerGuestQuery").c_str());
    guest_query_id_fieldID = jni::get_field_id(env, Class, "guestQueryId", "J");
    result_fieldID = jni::get_field_id(env, Class, "result", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputInlineQueryResult;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass applyPremiumGiftCode::Class;
jfieldID applyPremiumGiftCode::code_fieldID;

applyPremiumGiftCode::applyPremiumGiftCode()
  : code_()
{}

applyPremiumGiftCode::applyPremiumGiftCode(string const &code_)
  : code_(code_)
{}

const std::int32_t applyPremiumGiftCode::ID;

object_ptr<applyPremiumGiftCode> applyPremiumGiftCode::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<applyPremiumGiftCode> res = make_object<applyPremiumGiftCode>();
  res->code_ = jni::fetch_string(env, p, res->code_fieldID);
  return res;
}

void applyPremiumGiftCode::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ApplyPremiumGiftCode");
    s.store_field("code", code_);
    s.store_class_end();
  }
}

applyPremiumGiftCode::ReturnType applyPremiumGiftCode::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void applyPremiumGiftCode::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ApplyPremiumGiftCode").c_str());
    code_fieldID = jni::get_field_id(env, Class, "code", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass canPostStory::Class;
jfieldID canPostStory::chat_id_fieldID;

canPostStory::canPostStory()
  : chat_id_()
{}

canPostStory::canPostStory(int53 chat_id_)
  : chat_id_(chat_id_)
{}

const std::int32_t canPostStory::ID;

object_ptr<canPostStory> canPostStory::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<canPostStory> res = make_object<canPostStory>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  return res;
}

void canPostStory::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CanPostStory");
    s.store_field("chatId", chat_id_);
    s.store_class_end();
  }
}

canPostStory::ReturnType canPostStory::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return CanPostStoryResult::fetch(env, p);
}

void canPostStory::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CanPostStory").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass changeImportedContacts::Class;
jfieldID changeImportedContacts::contacts_fieldID;

changeImportedContacts::changeImportedContacts()
  : contacts_()
{}

changeImportedContacts::changeImportedContacts(array<object_ptr<importedContact>> &&contacts_)
  : contacts_(std::move(contacts_))
{}

const std::int32_t changeImportedContacts::ID;

object_ptr<changeImportedContacts> changeImportedContacts::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<changeImportedContacts> res = make_object<changeImportedContacts>();
  res->contacts_ = jni::FetchVector<importedContact>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->contacts_fieldID));
  return res;
}

void changeImportedContacts::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ChangeImportedContacts");
    { s.store_vector_begin("contacts", contacts_.size()); for (const auto &_value : contacts_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

changeImportedContacts::ReturnType changeImportedContacts::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return importedContacts::fetch(env, p);
}

void changeImportedContacts::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ChangeImportedContacts").c_str());
    contacts_fieldID = jni::get_field_id(env, Class, "contacts", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$ImportedContact;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass checkAuthenticationPasswordRecoveryCode::Class;
jfieldID checkAuthenticationPasswordRecoveryCode::recovery_code_fieldID;

checkAuthenticationPasswordRecoveryCode::checkAuthenticationPasswordRecoveryCode()
  : recovery_code_()
{}

checkAuthenticationPasswordRecoveryCode::checkAuthenticationPasswordRecoveryCode(string const &recovery_code_)
  : recovery_code_(recovery_code_)
{}

const std::int32_t checkAuthenticationPasswordRecoveryCode::ID;

object_ptr<checkAuthenticationPasswordRecoveryCode> checkAuthenticationPasswordRecoveryCode::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<checkAuthenticationPasswordRecoveryCode> res = make_object<checkAuthenticationPasswordRecoveryCode>();
  res->recovery_code_ = jni::fetch_string(env, p, res->recovery_code_fieldID);
  return res;
}

void checkAuthenticationPasswordRecoveryCode::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CheckAuthenticationPasswordRecoveryCode");
    s.store_field("recoveryCode", recovery_code_);
    s.store_class_end();
  }
}

checkAuthenticationPasswordRecoveryCode::ReturnType checkAuthenticationPasswordRecoveryCode::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void checkAuthenticationPasswordRecoveryCode::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CheckAuthenticationPasswordRecoveryCode").c_str());
    recovery_code_fieldID = jni::get_field_id(env, Class, "recoveryCode", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass checkLoginEmailAddressCode::Class;
jfieldID checkLoginEmailAddressCode::code_fieldID;

checkLoginEmailAddressCode::checkLoginEmailAddressCode()
  : code_()
{}

checkLoginEmailAddressCode::checkLoginEmailAddressCode(object_ptr<EmailAddressAuthentication> &&code_)
  : code_(std::move(code_))
{}

const std::int32_t checkLoginEmailAddressCode::ID;

object_ptr<checkLoginEmailAddressCode> checkLoginEmailAddressCode::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<checkLoginEmailAddressCode> res = make_object<checkLoginEmailAddressCode>();
  res->code_ = jni::fetch_tl_object<EmailAddressAuthentication>(env, jni::fetch_object(env, p, res->code_fieldID));
  return res;
}

void checkLoginEmailAddressCode::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CheckLoginEmailAddressCode");
    s.store_object_field("code", static_cast<const BaseObject *>(code_.get()));
    s.store_class_end();
  }
}

checkLoginEmailAddressCode::ReturnType checkLoginEmailAddressCode::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void checkLoginEmailAddressCode::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CheckLoginEmailAddressCode").c_str());
    code_fieldID = jni::get_field_id(env, Class, "code", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$EmailAddressAuthentication;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass checkPasswordRecoveryCode::Class;
jfieldID checkPasswordRecoveryCode::recovery_code_fieldID;

checkPasswordRecoveryCode::checkPasswordRecoveryCode()
  : recovery_code_()
{}

checkPasswordRecoveryCode::checkPasswordRecoveryCode(string const &recovery_code_)
  : recovery_code_(recovery_code_)
{}

const std::int32_t checkPasswordRecoveryCode::ID;

object_ptr<checkPasswordRecoveryCode> checkPasswordRecoveryCode::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<checkPasswordRecoveryCode> res = make_object<checkPasswordRecoveryCode>();
  res->recovery_code_ = jni::fetch_string(env, p, res->recovery_code_fieldID);
  return res;
}

void checkPasswordRecoveryCode::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CheckPasswordRecoveryCode");
    s.store_field("recoveryCode", recovery_code_);
    s.store_class_end();
  }
}

checkPasswordRecoveryCode::ReturnType checkPasswordRecoveryCode::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void checkPasswordRecoveryCode::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CheckPasswordRecoveryCode").c_str());
    recovery_code_fieldID = jni::get_field_id(env, Class, "recoveryCode", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass closeChat::Class;
jfieldID closeChat::chat_id_fieldID;

closeChat::closeChat()
  : chat_id_()
{}

closeChat::closeChat(int53 chat_id_)
  : chat_id_(chat_id_)
{}

const std::int32_t closeChat::ID;

object_ptr<closeChat> closeChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<closeChat> res = make_object<closeChat>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  return res;
}

void closeChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CloseChat");
    s.store_field("chatId", chat_id_);
    s.store_class_end();
  }
}

closeChat::ReturnType closeChat::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void closeChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CloseChat").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass craftGift::Class;
jfieldID craftGift::received_gift_ids_fieldID;

craftGift::craftGift()
  : received_gift_ids_()
{}

craftGift::craftGift(array<string> &&received_gift_ids_)
  : received_gift_ids_(std::move(received_gift_ids_))
{}

const std::int32_t craftGift::ID;

object_ptr<craftGift> craftGift::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<craftGift> res = make_object<craftGift>();
  res->received_gift_ids_ = jni::FetchVector<string>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->received_gift_ids_fieldID));
  return res;
}

void craftGift::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CraftGift");
    { s.store_vector_begin("receivedGiftIds", received_gift_ids_.size()); for (const auto &_value : received_gift_ids_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

craftGift::ReturnType craftGift::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return CraftGiftResult::fetch(env, p);
}

void craftGift::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CraftGift").c_str());
    received_gift_ids_fieldID = jni::get_field_id(env, Class, "receivedGiftIds", "[Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass createBusinessChatLink::Class;
jfieldID createBusinessChatLink::link_info_fieldID;

createBusinessChatLink::createBusinessChatLink()
  : link_info_()
{}

createBusinessChatLink::createBusinessChatLink(object_ptr<inputBusinessChatLink> &&link_info_)
  : link_info_(std::move(link_info_))
{}

const std::int32_t createBusinessChatLink::ID;

object_ptr<createBusinessChatLink> createBusinessChatLink::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<createBusinessChatLink> res = make_object<createBusinessChatLink>();
  res->link_info_ = jni::fetch_tl_object<inputBusinessChatLink>(env, jni::fetch_object(env, p, res->link_info_fieldID));
  return res;
}

void createBusinessChatLink::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "CreateBusinessChatLink");
    s.store_object_field("linkInfo", static_cast<const BaseObject *>(link_info_.get()));
    s.store_class_end();
  }
}

createBusinessChatLink::ReturnType createBusinessChatLink::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return businessChatLink::fetch(env, p);
}

void createBusinessChatLink::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$CreateBusinessChatLink").c_str());
    link_info_fieldID = jni::get_field_id(env, Class, "linkInfo", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputBusinessChatLink;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass deleteChatHistory::Class;
jfieldID deleteChatHistory::chat_id_fieldID;
jfieldID deleteChatHistory::remove_from_chat_list_fieldID;
jfieldID deleteChatHistory::revoke_fieldID;

deleteChatHistory::deleteChatHistory()
  : chat_id_()
  , remove_from_chat_list_()
  , revoke_()
{}

deleteChatHistory::deleteChatHistory(int53 chat_id_, bool remove_from_chat_list_, bool revoke_)
  : chat_id_(chat_id_)
  , remove_from_chat_list_(remove_from_chat_list_)
  , revoke_(revoke_)
{}

const std::int32_t deleteChatHistory::ID;

object_ptr<deleteChatHistory> deleteChatHistory::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<deleteChatHistory> res = make_object<deleteChatHistory>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->remove_from_chat_list_ = (env->GetBooleanField(p, res->remove_from_chat_list_fieldID) != 0);
  res->revoke_ = (env->GetBooleanField(p, res->revoke_fieldID) != 0);
  return res;
}

void deleteChatHistory::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "DeleteChatHistory");
    s.store_field("chatId", chat_id_);
    s.store_field("removeFromChatList", remove_from_chat_list_);
    s.store_field("revoke", revoke_);
    s.store_class_end();
  }
}

deleteChatHistory::ReturnType deleteChatHistory::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void deleteChatHistory::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$DeleteChatHistory").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    remove_from_chat_list_fieldID = jni::get_field_id(env, Class, "removeFromChatList", "Z");
    revoke_fieldID = jni::get_field_id(env, Class, "revoke", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass deleteMessageReactionsFromSender::Class;
jfieldID deleteMessageReactionsFromSender::chat_id_fieldID;
jfieldID deleteMessageReactionsFromSender::message_id_fieldID;
jfieldID deleteMessageReactionsFromSender::sender_id_fieldID;

deleteMessageReactionsFromSender::deleteMessageReactionsFromSender()
  : chat_id_()
  , message_id_()
  , sender_id_()
{}

deleteMessageReactionsFromSender::deleteMessageReactionsFromSender(int53 chat_id_, int53 message_id_, object_ptr<MessageSender> &&sender_id_)
  : chat_id_(chat_id_)
  , message_id_(message_id_)
  , sender_id_(std::move(sender_id_))
{}

const std::int32_t deleteMessageReactionsFromSender::ID;

object_ptr<deleteMessageReactionsFromSender> deleteMessageReactionsFromSender::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<deleteMessageReactionsFromSender> res = make_object<deleteMessageReactionsFromSender>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  res->sender_id_ = jni::fetch_tl_object<MessageSender>(env, jni::fetch_object(env, p, res->sender_id_fieldID));
  return res;
}

void deleteMessageReactionsFromSender::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "DeleteMessageReactionsFromSender");
    s.store_field("chatId", chat_id_);
    s.store_field("messageId", message_id_);
    s.store_object_field("senderId", static_cast<const BaseObject *>(sender_id_.get()));
    s.store_class_end();
  }
}

deleteMessageReactionsFromSender::ReturnType deleteMessageReactionsFromSender::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void deleteMessageReactionsFromSender::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$DeleteMessageReactionsFromSender").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    sender_id_fieldID = jni::get_field_id(env, Class, "senderId", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$MessageSender;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass deleteProfilePhoto::Class;
jfieldID deleteProfilePhoto::profile_photo_id_fieldID;

deleteProfilePhoto::deleteProfilePhoto()
  : profile_photo_id_()
{}

deleteProfilePhoto::deleteProfilePhoto(int64 profile_photo_id_)
  : profile_photo_id_(profile_photo_id_)
{}

const std::int32_t deleteProfilePhoto::ID;

object_ptr<deleteProfilePhoto> deleteProfilePhoto::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<deleteProfilePhoto> res = make_object<deleteProfilePhoto>();
  res->profile_photo_id_ = env->GetLongField(p, res->profile_photo_id_fieldID);
  return res;
}

void deleteProfilePhoto::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "DeleteProfilePhoto");
    s.store_field("profilePhotoId", profile_photo_id_);
    s.store_class_end();
  }
}

deleteProfilePhoto::ReturnType deleteProfilePhoto::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void deleteProfilePhoto::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$DeleteProfilePhoto").c_str());
    profile_photo_id_fieldID = jni::get_field_id(env, Class, "profilePhotoId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass deleteSavedMessagesTopicMessagesByDate::Class;
jfieldID deleteSavedMessagesTopicMessagesByDate::saved_messages_topic_id_fieldID;
jfieldID deleteSavedMessagesTopicMessagesByDate::min_date_fieldID;
jfieldID deleteSavedMessagesTopicMessagesByDate::max_date_fieldID;

deleteSavedMessagesTopicMessagesByDate::deleteSavedMessagesTopicMessagesByDate()
  : saved_messages_topic_id_()
  , min_date_()
  , max_date_()
{}

deleteSavedMessagesTopicMessagesByDate::deleteSavedMessagesTopicMessagesByDate(int53 saved_messages_topic_id_, int32 min_date_, int32 max_date_)
  : saved_messages_topic_id_(saved_messages_topic_id_)
  , min_date_(min_date_)
  , max_date_(max_date_)
{}

const std::int32_t deleteSavedMessagesTopicMessagesByDate::ID;

object_ptr<deleteSavedMessagesTopicMessagesByDate> deleteSavedMessagesTopicMessagesByDate::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<deleteSavedMessagesTopicMessagesByDate> res = make_object<deleteSavedMessagesTopicMessagesByDate>();
  res->saved_messages_topic_id_ = env->GetLongField(p, res->saved_messages_topic_id_fieldID);
  res->min_date_ = env->GetIntField(p, res->min_date_fieldID);
  res->max_date_ = env->GetIntField(p, res->max_date_fieldID);
  return res;
}

void deleteSavedMessagesTopicMessagesByDate::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "DeleteSavedMessagesTopicMessagesByDate");
    s.store_field("savedMessagesTopicId", saved_messages_topic_id_);
    s.store_field("minDate", min_date_);
    s.store_field("maxDate", max_date_);
    s.store_class_end();
  }
}

deleteSavedMessagesTopicMessagesByDate::ReturnType deleteSavedMessagesTopicMessagesByDate::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void deleteSavedMessagesTopicMessagesByDate::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$DeleteSavedMessagesTopicMessagesByDate").c_str());
    saved_messages_topic_id_fieldID = jni::get_field_id(env, Class, "savedMessagesTopicId", "J");
    min_date_fieldID = jni::get_field_id(env, Class, "minDate", "I");
    max_date_fieldID = jni::get_field_id(env, Class, "maxDate", "I");
    return true;
  }();
  (void)is_inited;
}

jclass deleteStory::Class;
jfieldID deleteStory::story_poster_chat_id_fieldID;
jfieldID deleteStory::story_id_fieldID;

deleteStory::deleteStory()
  : story_poster_chat_id_()
  , story_id_()
{}

deleteStory::deleteStory(int53 story_poster_chat_id_, int32 story_id_)
  : story_poster_chat_id_(story_poster_chat_id_)
  , story_id_(story_id_)
{}

const std::int32_t deleteStory::ID;

object_ptr<deleteStory> deleteStory::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<deleteStory> res = make_object<deleteStory>();
  res->story_poster_chat_id_ = env->GetLongField(p, res->story_poster_chat_id_fieldID);
  res->story_id_ = env->GetIntField(p, res->story_id_fieldID);
  return res;
}

void deleteStory::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "DeleteStory");
    s.store_field("storyPosterChatId", story_poster_chat_id_);
    s.store_field("storyId", story_id_);
    s.store_class_end();
  }
}

deleteStory::ReturnType deleteStory::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void deleteStory::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$DeleteStory").c_str());
    story_poster_chat_id_fieldID = jni::get_field_id(env, Class, "storyPosterChatId", "J");
    story_id_fieldID = jni::get_field_id(env, Class, "storyId", "I");
    return true;
  }();
  (void)is_inited;
}

jclass deleteStoryAlbum::Class;
jfieldID deleteStoryAlbum::chat_id_fieldID;
jfieldID deleteStoryAlbum::story_album_id_fieldID;

deleteStoryAlbum::deleteStoryAlbum()
  : chat_id_()
  , story_album_id_()
{}

deleteStoryAlbum::deleteStoryAlbum(int53 chat_id_, int32 story_album_id_)
  : chat_id_(chat_id_)
  , story_album_id_(story_album_id_)
{}

const std::int32_t deleteStoryAlbum::ID;

object_ptr<deleteStoryAlbum> deleteStoryAlbum::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<deleteStoryAlbum> res = make_object<deleteStoryAlbum>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->story_album_id_ = env->GetIntField(p, res->story_album_id_fieldID);
  return res;
}

void deleteStoryAlbum::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "DeleteStoryAlbum");
    s.store_field("chatId", chat_id_);
    s.store_field("storyAlbumId", story_album_id_);
    s.store_class_end();
  }
}

deleteStoryAlbum::ReturnType deleteStoryAlbum::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void deleteStoryAlbum::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$DeleteStoryAlbum").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    story_album_id_fieldID = jni::get_field_id(env, Class, "storyAlbumId", "I");
    return true;
  }();
  (void)is_inited;
}

jclass editChatSubscriptionInviteLink::Class;
jfieldID editChatSubscriptionInviteLink::chat_id_fieldID;
jfieldID editChatSubscriptionInviteLink::invite_link_fieldID;
jfieldID editChatSubscriptionInviteLink::name_fieldID;

editChatSubscriptionInviteLink::editChatSubscriptionInviteLink()
  : chat_id_()
  , invite_link_()
  , name_()
{}

editChatSubscriptionInviteLink::editChatSubscriptionInviteLink(int53 chat_id_, string const &invite_link_, string const &name_)
  : chat_id_(chat_id_)
  , invite_link_(invite_link_)
  , name_(name_)
{}

const std::int32_t editChatSubscriptionInviteLink::ID;

object_ptr<editChatSubscriptionInviteLink> editChatSubscriptionInviteLink::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<editChatSubscriptionInviteLink> res = make_object<editChatSubscriptionInviteLink>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->invite_link_ = jni::fetch_string(env, p, res->invite_link_fieldID);
  res->name_ = jni::fetch_string(env, p, res->name_fieldID);
  return res;
}

void editChatSubscriptionInviteLink::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "EditChatSubscriptionInviteLink");
    s.store_field("chatId", chat_id_);
    s.store_field("inviteLink", invite_link_);
    s.store_field("name", name_);
    s.store_class_end();
  }
}

editChatSubscriptionInviteLink::ReturnType editChatSubscriptionInviteLink::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return chatInviteLink::fetch(env, p);
}

void editChatSubscriptionInviteLink::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$EditChatSubscriptionInviteLink").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    invite_link_fieldID = jni::get_field_id(env, Class, "inviteLink", "Ljava/lang/String;");
    name_fieldID = jni::get_field_id(env, Class, "name", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass editMessageLiveLocation::Class;
jfieldID editMessageLiveLocation::chat_id_fieldID;
jfieldID editMessageLiveLocation::message_id_fieldID;
jfieldID editMessageLiveLocation::reply_markup_fieldID;
jfieldID editMessageLiveLocation::location_fieldID;
jfieldID editMessageLiveLocation::live_period_fieldID;
jfieldID editMessageLiveLocation::heading_fieldID;
jfieldID editMessageLiveLocation::proximity_alert_radius_fieldID;

editMessageLiveLocation::editMessageLiveLocation()
  : chat_id_()
  , message_id_()
  , reply_markup_()
  , location_()
  , live_period_()
  , heading_()
  , proximity_alert_radius_()
{}

editMessageLiveLocation::editMessageLiveLocation(int53 chat_id_, int53 message_id_, object_ptr<ReplyMarkup> &&reply_markup_, object_ptr<location> &&location_, int32 live_period_, int32 heading_, int32 proximity_alert_radius_)
  : chat_id_(chat_id_)
  , message_id_(message_id_)
  , reply_markup_(std::move(reply_markup_))
  , location_(std::move(location_))
  , live_period_(live_period_)
  , heading_(heading_)
  , proximity_alert_radius_(proximity_alert_radius_)
{}

const std::int32_t editMessageLiveLocation::ID;

object_ptr<editMessageLiveLocation> editMessageLiveLocation::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<editMessageLiveLocation> res = make_object<editMessageLiveLocation>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  res->reply_markup_ = jni::fetch_tl_object<ReplyMarkup>(env, jni::fetch_object(env, p, res->reply_markup_fieldID));
  res->location_ = jni::fetch_tl_object<location>(env, jni::fetch_object(env, p, res->location_fieldID));
  res->live_period_ = env->GetIntField(p, res->live_period_fieldID);
  res->heading_ = env->GetIntField(p, res->heading_fieldID);
  res->proximity_alert_radius_ = env->GetIntField(p, res->proximity_alert_radius_fieldID);
  return res;
}

void editMessageLiveLocation::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "EditMessageLiveLocation");
    s.store_field("chatId", chat_id_);
    s.store_field("messageId", message_id_);
    s.store_object_field("replyMarkup", static_cast<const BaseObject *>(reply_markup_.get()));
    s.store_object_field("location", static_cast<const BaseObject *>(location_.get()));
    s.store_field("livePeriod", live_period_);
    s.store_field("heading", heading_);
    s.store_field("proximityAlertRadius", proximity_alert_radius_);
    s.store_class_end();
  }
}

editMessageLiveLocation::ReturnType editMessageLiveLocation::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return message::fetch(env, p);
}

void editMessageLiveLocation::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$EditMessageLiveLocation").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    reply_markup_fieldID = jni::get_field_id(env, Class, "replyMarkup", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReplyMarkup;").c_str());
    location_fieldID = jni::get_field_id(env, Class, "location", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Location;").c_str());
    live_period_fieldID = jni::get_field_id(env, Class, "livePeriod", "I");
    heading_fieldID = jni::get_field_id(env, Class, "heading", "I");
    proximity_alert_radius_fieldID = jni::get_field_id(env, Class, "proximityAlertRadius", "I");
    return true;
  }();
  (void)is_inited;
}

jclass editProxy::Class;
jfieldID editProxy::proxy_id_fieldID;
jfieldID editProxy::proxy_fieldID;
jfieldID editProxy::enable_fieldID;
jfieldID editProxy::comment_fieldID;

editProxy::editProxy()
  : proxy_id_()
  , proxy_()
  , enable_()
  , comment_()
{}

editProxy::editProxy(int32 proxy_id_, object_ptr<proxy> &&proxy_, bool enable_, string const &comment_)
  : proxy_id_(proxy_id_)
  , proxy_(std::move(proxy_))
  , enable_(enable_)
  , comment_(comment_)
{}

const std::int32_t editProxy::ID;

object_ptr<editProxy> editProxy::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<editProxy> res = make_object<editProxy>();
  res->proxy_id_ = env->GetIntField(p, res->proxy_id_fieldID);
  res->proxy_ = jni::fetch_tl_object<proxy>(env, jni::fetch_object(env, p, res->proxy_fieldID));
  res->enable_ = (env->GetBooleanField(p, res->enable_fieldID) != 0);
  res->comment_ = jni::fetch_string(env, p, res->comment_fieldID);
  return res;
}

void editProxy::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "EditProxy");
    s.store_field("proxyId", proxy_id_);
    s.store_object_field("proxy", static_cast<const BaseObject *>(proxy_.get()));
    s.store_field("enable", enable_);
    s.store_field("comment", comment_);
    s.store_class_end();
  }
}

editProxy::ReturnType editProxy::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return addedProxy::fetch(env, p);
}

void editProxy::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$EditProxy").c_str());
    proxy_id_fieldID = jni::get_field_id(env, Class, "proxyId", "I");
    proxy_fieldID = jni::get_field_id(env, Class, "proxy", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Proxy;").c_str());
    enable_fieldID = jni::get_field_id(env, Class, "enable", "Z");
    comment_fieldID = jni::get_field_id(env, Class, "comment", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass editStoryCover::Class;
jfieldID editStoryCover::story_poster_chat_id_fieldID;
jfieldID editStoryCover::story_id_fieldID;
jfieldID editStoryCover::cover_frame_timestamp_fieldID;

editStoryCover::editStoryCover()
  : story_poster_chat_id_()
  , story_id_()
  , cover_frame_timestamp_()
{}

editStoryCover::editStoryCover(int53 story_poster_chat_id_, int32 story_id_, double cover_frame_timestamp_)
  : story_poster_chat_id_(story_poster_chat_id_)
  , story_id_(story_id_)
  , cover_frame_timestamp_(cover_frame_timestamp_)
{}

const std::int32_t editStoryCover::ID;

object_ptr<editStoryCover> editStoryCover::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<editStoryCover> res = make_object<editStoryCover>();
  res->story_poster_chat_id_ = env->GetLongField(p, res->story_poster_chat_id_fieldID);
  res->story_id_ = env->GetIntField(p, res->story_id_fieldID);
  res->cover_frame_timestamp_ = env->GetDoubleField(p, res->cover_frame_timestamp_fieldID);
  return res;
}

void editStoryCover::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "EditStoryCover");
    s.store_field("storyPosterChatId", story_poster_chat_id_);
    s.store_field("storyId", story_id_);
    s.store_field("coverFrameTimestamp", cover_frame_timestamp_);
    s.store_class_end();
  }
}

editStoryCover::ReturnType editStoryCover::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void editStoryCover::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$EditStoryCover").c_str());
    story_poster_chat_id_fieldID = jni::get_field_id(env, Class, "storyPosterChatId", "J");
    story_id_fieldID = jni::get_field_id(env, Class, "storyId", "I");
    cover_frame_timestamp_fieldID = jni::get_field_id(env, Class, "coverFrameTimestamp", "D");
    return true;
  }();
  (void)is_inited;
}

jclass enableProxy::Class;
jfieldID enableProxy::proxy_id_fieldID;

enableProxy::enableProxy()
  : proxy_id_()
{}

enableProxy::enableProxy(int32 proxy_id_)
  : proxy_id_(proxy_id_)
{}

const std::int32_t enableProxy::ID;

object_ptr<enableProxy> enableProxy::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<enableProxy> res = make_object<enableProxy>();
  res->proxy_id_ = env->GetIntField(p, res->proxy_id_fieldID);
  return res;
}

void enableProxy::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "EnableProxy");
    s.store_field("proxyId", proxy_id_);
    s.store_class_end();
  }
}

enableProxy::ReturnType enableProxy::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void enableProxy::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$EnableProxy").c_str());
    proxy_id_fieldID = jni::get_field_id(env, Class, "proxyId", "I");
    return true;
  }();
  (void)is_inited;
}

jclass encryptGroupCallData::Class;
jfieldID encryptGroupCallData::group_call_id_fieldID;
jfieldID encryptGroupCallData::data_channel_fieldID;
jfieldID encryptGroupCallData::data_fieldID;
jfieldID encryptGroupCallData::unencrypted_prefix_size_fieldID;

encryptGroupCallData::encryptGroupCallData()
  : group_call_id_()
  , data_channel_()
  , data_()
  , unencrypted_prefix_size_()
{}

encryptGroupCallData::encryptGroupCallData(int32 group_call_id_, object_ptr<GroupCallDataChannel> &&data_channel_, bytes const &data_, int32 unencrypted_prefix_size_)
  : group_call_id_(group_call_id_)
  , data_channel_(std::move(data_channel_))
  , data_(std::move(data_))
  , unencrypted_prefix_size_(unencrypted_prefix_size_)
{}

const std::int32_t encryptGroupCallData::ID;

object_ptr<encryptGroupCallData> encryptGroupCallData::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<encryptGroupCallData> res = make_object<encryptGroupCallData>();
  res->group_call_id_ = env->GetIntField(p, res->group_call_id_fieldID);
  res->data_channel_ = jni::fetch_tl_object<GroupCallDataChannel>(env, jni::fetch_object(env, p, res->data_channel_fieldID));
  res->data_ = jni::from_bytes(env, (jbyteArray)jni::fetch_object(env, p, res->data_fieldID));
  res->unencrypted_prefix_size_ = env->GetIntField(p, res->unencrypted_prefix_size_fieldID);
  return res;
}

void encryptGroupCallData::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "EncryptGroupCallData");
    s.store_field("groupCallId", group_call_id_);
    s.store_object_field("dataChannel", static_cast<const BaseObject *>(data_channel_.get()));
    s.store_bytes_field("data", data_);
    s.store_field("unencryptedPrefixSize", unencrypted_prefix_size_);
    s.store_class_end();
  }
}

encryptGroupCallData::ReturnType encryptGroupCallData::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return data::fetch(env, p);
}

void encryptGroupCallData::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$EncryptGroupCallData").c_str());
    group_call_id_fieldID = jni::get_field_id(env, Class, "groupCallId", "I");
    data_channel_fieldID = jni::get_field_id(env, Class, "dataChannel", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$GroupCallDataChannel;").c_str());
    data_fieldID = jni::get_field_id(env, Class, "data", "[B");
    unencrypted_prefix_size_fieldID = jni::get_field_id(env, Class, "unencryptedPrefixSize", "I");
    return true;
  }();
  (void)is_inited;
}

jclass getAccountTtl::Class;

getAccountTtl::getAccountTtl() {
}

const std::int32_t getAccountTtl::ID;

object_ptr<getAccountTtl> getAccountTtl::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<getAccountTtl>();
}

void getAccountTtl::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetAccountTtl");
    s.store_class_end();
  }
}

getAccountTtl::ReturnType getAccountTtl::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return accountTtl::fetch(env, p);
}

void getAccountTtl::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetAccountTtl").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getApplicationConfig::Class;

getApplicationConfig::getApplicationConfig() {
}

const std::int32_t getApplicationConfig::ID;

object_ptr<getApplicationConfig> getApplicationConfig::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<getApplicationConfig>();
}

void getApplicationConfig::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetApplicationConfig");
    s.store_class_end();
  }
}

getApplicationConfig::ReturnType getApplicationConfig::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return JsonValue::fetch(env, p);
}

void getApplicationConfig::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetApplicationConfig").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getAutosaveSettings::Class;

getAutosaveSettings::getAutosaveSettings() {
}

const std::int32_t getAutosaveSettings::ID;

object_ptr<getAutosaveSettings> getAutosaveSettings::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<getAutosaveSettings>();
}

void getAutosaveSettings::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetAutosaveSettings");
    s.store_class_end();
  }
}

getAutosaveSettings::ReturnType getAutosaveSettings::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return autosaveSettings::fetch(env, p);
}

void getAutosaveSettings::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetAutosaveSettings").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getCallbackQueryMessage::Class;
jfieldID getCallbackQueryMessage::chat_id_fieldID;
jfieldID getCallbackQueryMessage::message_id_fieldID;
jfieldID getCallbackQueryMessage::callback_query_id_fieldID;

getCallbackQueryMessage::getCallbackQueryMessage()
  : chat_id_()
  , message_id_()
  , callback_query_id_()
{}

getCallbackQueryMessage::getCallbackQueryMessage(int53 chat_id_, int53 message_id_, int64 callback_query_id_)
  : chat_id_(chat_id_)
  , message_id_(message_id_)
  , callback_query_id_(callback_query_id_)
{}

const std::int32_t getCallbackQueryMessage::ID;

object_ptr<getCallbackQueryMessage> getCallbackQueryMessage::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getCallbackQueryMessage> res = make_object<getCallbackQueryMessage>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  res->callback_query_id_ = env->GetLongField(p, res->callback_query_id_fieldID);
  return res;
}

void getCallbackQueryMessage::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetCallbackQueryMessage");
    s.store_field("chatId", chat_id_);
    s.store_field("messageId", message_id_);
    s.store_field("callbackQueryId", callback_query_id_);
    s.store_class_end();
  }
}

getCallbackQueryMessage::ReturnType getCallbackQueryMessage::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return message::fetch(env, p);
}

void getCallbackQueryMessage::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetCallbackQueryMessage").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    callback_query_id_fieldID = jni::get_field_id(env, Class, "callbackQueryId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass getChatAvailableMessageSenders::Class;
jfieldID getChatAvailableMessageSenders::chat_id_fieldID;

getChatAvailableMessageSenders::getChatAvailableMessageSenders()
  : chat_id_()
{}

getChatAvailableMessageSenders::getChatAvailableMessageSenders(int53 chat_id_)
  : chat_id_(chat_id_)
{}

const std::int32_t getChatAvailableMessageSenders::ID;

object_ptr<getChatAvailableMessageSenders> getChatAvailableMessageSenders::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getChatAvailableMessageSenders> res = make_object<getChatAvailableMessageSenders>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  return res;
}

void getChatAvailableMessageSenders::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetChatAvailableMessageSenders");
    s.store_field("chatId", chat_id_);
    s.store_class_end();
  }
}

getChatAvailableMessageSenders::ReturnType getChatAvailableMessageSenders::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return chatMessageSenders::fetch(env, p);
}

void getChatAvailableMessageSenders::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetChatAvailableMessageSenders").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass getChatInviteLink::Class;
jfieldID getChatInviteLink::chat_id_fieldID;
jfieldID getChatInviteLink::invite_link_fieldID;

getChatInviteLink::getChatInviteLink()
  : chat_id_()
  , invite_link_()
{}

getChatInviteLink::getChatInviteLink(int53 chat_id_, string const &invite_link_)
  : chat_id_(chat_id_)
  , invite_link_(invite_link_)
{}

const std::int32_t getChatInviteLink::ID;

object_ptr<getChatInviteLink> getChatInviteLink::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getChatInviteLink> res = make_object<getChatInviteLink>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->invite_link_ = jni::fetch_string(env, p, res->invite_link_fieldID);
  return res;
}

void getChatInviteLink::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetChatInviteLink");
    s.store_field("chatId", chat_id_);
    s.store_field("inviteLink", invite_link_);
    s.store_class_end();
  }
}

getChatInviteLink::ReturnType getChatInviteLink::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return chatInviteLink::fetch(env, p);
}

void getChatInviteLink::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetChatInviteLink").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    invite_link_fieldID = jni::get_field_id(env, Class, "inviteLink", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass getChatInviteLinkMembers::Class;
jfieldID getChatInviteLinkMembers::chat_id_fieldID;
jfieldID getChatInviteLinkMembers::invite_link_fieldID;
jfieldID getChatInviteLinkMembers::only_with_expired_subscription_fieldID;
jfieldID getChatInviteLinkMembers::offset_member_fieldID;
jfieldID getChatInviteLinkMembers::limit_fieldID;

getChatInviteLinkMembers::getChatInviteLinkMembers()
  : chat_id_()
  , invite_link_()
  , only_with_expired_subscription_()
  , offset_member_()
  , limit_()
{}

getChatInviteLinkMembers::getChatInviteLinkMembers(int53 chat_id_, string const &invite_link_, bool only_with_expired_subscription_, object_ptr<chatInviteLinkMember> &&offset_member_, int32 limit_)
  : chat_id_(chat_id_)
  , invite_link_(invite_link_)
  , only_with_expired_subscription_(only_with_expired_subscription_)
  , offset_member_(std::move(offset_member_))
  , limit_(limit_)
{}

const std::int32_t getChatInviteLinkMembers::ID;

object_ptr<getChatInviteLinkMembers> getChatInviteLinkMembers::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getChatInviteLinkMembers> res = make_object<getChatInviteLinkMembers>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->invite_link_ = jni::fetch_string(env, p, res->invite_link_fieldID);
  res->only_with_expired_subscription_ = (env->GetBooleanField(p, res->only_with_expired_subscription_fieldID) != 0);
  res->offset_member_ = jni::fetch_tl_object<chatInviteLinkMember>(env, jni::fetch_object(env, p, res->offset_member_fieldID));
  res->limit_ = env->GetIntField(p, res->limit_fieldID);
  return res;
}

void getChatInviteLinkMembers::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetChatInviteLinkMembers");
    s.store_field("chatId", chat_id_);
    s.store_field("inviteLink", invite_link_);
    s.store_field("onlyWithExpiredSubscription", only_with_expired_subscription_);
    s.store_object_field("offsetMember", static_cast<const BaseObject *>(offset_member_.get()));
    s.store_field("limit", limit_);
    s.store_class_end();
  }
}

getChatInviteLinkMembers::ReturnType getChatInviteLinkMembers::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return chatInviteLinkMembers::fetch(env, p);
}

void getChatInviteLinkMembers::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetChatInviteLinkMembers").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    invite_link_fieldID = jni::get_field_id(env, Class, "inviteLink", "Ljava/lang/String;");
    only_with_expired_subscription_fieldID = jni::get_field_id(env, Class, "onlyWithExpiredSubscription", "Z");
    offset_member_fieldID = jni::get_field_id(env, Class, "offsetMember", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ChatInviteLinkMember;").c_str());
    limit_fieldID = jni::get_field_id(env, Class, "limit", "I");
    return true;
  }();
  (void)is_inited;
}

jclass getChatMember::Class;
jfieldID getChatMember::chat_id_fieldID;
jfieldID getChatMember::member_id_fieldID;

getChatMember::getChatMember()
  : chat_id_()
  , member_id_()
{}

getChatMember::getChatMember(int53 chat_id_, object_ptr<MessageSender> &&member_id_)
  : chat_id_(chat_id_)
  , member_id_(std::move(member_id_))
{}

const std::int32_t getChatMember::ID;

object_ptr<getChatMember> getChatMember::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getChatMember> res = make_object<getChatMember>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->member_id_ = jni::fetch_tl_object<MessageSender>(env, jni::fetch_object(env, p, res->member_id_fieldID));
  return res;
}

void getChatMember::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetChatMember");
    s.store_field("chatId", chat_id_);
    s.store_object_field("memberId", static_cast<const BaseObject *>(member_id_.get()));
    s.store_class_end();
  }
}

getChatMember::ReturnType getChatMember::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return chatMember::fetch(env, p);
}

void getChatMember::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetChatMember").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    member_id_fieldID = jni::get_field_id(env, Class, "memberId", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$MessageSender;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getChatSponsoredMessages::Class;
jfieldID getChatSponsoredMessages::chat_id_fieldID;

getChatSponsoredMessages::getChatSponsoredMessages()
  : chat_id_()
{}

getChatSponsoredMessages::getChatSponsoredMessages(int53 chat_id_)
  : chat_id_(chat_id_)
{}

const std::int32_t getChatSponsoredMessages::ID;

object_ptr<getChatSponsoredMessages> getChatSponsoredMessages::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getChatSponsoredMessages> res = make_object<getChatSponsoredMessages>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  return res;
}

void getChatSponsoredMessages::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetChatSponsoredMessages");
    s.store_field("chatId", chat_id_);
    s.store_class_end();
  }
}

getChatSponsoredMessages::ReturnType getChatSponsoredMessages::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return sponsoredMessages::fetch(env, p);
}

void getChatSponsoredMessages::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetChatSponsoredMessages").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass getConnectedAffiliateProgram::Class;
jfieldID getConnectedAffiliateProgram::affiliate_fieldID;
jfieldID getConnectedAffiliateProgram::bot_user_id_fieldID;

getConnectedAffiliateProgram::getConnectedAffiliateProgram()
  : affiliate_()
  , bot_user_id_()
{}

getConnectedAffiliateProgram::getConnectedAffiliateProgram(object_ptr<AffiliateType> &&affiliate_, int53 bot_user_id_)
  : affiliate_(std::move(affiliate_))
  , bot_user_id_(bot_user_id_)
{}

const std::int32_t getConnectedAffiliateProgram::ID;

object_ptr<getConnectedAffiliateProgram> getConnectedAffiliateProgram::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getConnectedAffiliateProgram> res = make_object<getConnectedAffiliateProgram>();
  res->affiliate_ = jni::fetch_tl_object<AffiliateType>(env, jni::fetch_object(env, p, res->affiliate_fieldID));
  res->bot_user_id_ = env->GetLongField(p, res->bot_user_id_fieldID);
  return res;
}

void getConnectedAffiliateProgram::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetConnectedAffiliateProgram");
    s.store_object_field("affiliate", static_cast<const BaseObject *>(affiliate_.get()));
    s.store_field("botUserId", bot_user_id_);
    s.store_class_end();
  }
}

getConnectedAffiliateProgram::ReturnType getConnectedAffiliateProgram::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return connectedAffiliateProgram::fetch(env, p);
}

void getConnectedAffiliateProgram::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetConnectedAffiliateProgram").c_str());
    affiliate_fieldID = jni::get_field_id(env, Class, "affiliate", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$AffiliateType;").c_str());
    bot_user_id_fieldID = jni::get_field_id(env, Class, "botUserId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass getCurrentWeather::Class;
jfieldID getCurrentWeather::location_fieldID;

getCurrentWeather::getCurrentWeather()
  : location_()
{}

getCurrentWeather::getCurrentWeather(object_ptr<location> &&location_)
  : location_(std::move(location_))
{}

const std::int32_t getCurrentWeather::ID;

object_ptr<getCurrentWeather> getCurrentWeather::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getCurrentWeather> res = make_object<getCurrentWeather>();
  res->location_ = jni::fetch_tl_object<location>(env, jni::fetch_object(env, p, res->location_fieldID));
  return res;
}

void getCurrentWeather::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetCurrentWeather");
    s.store_object_field("location", static_cast<const BaseObject *>(location_.get()));
    s.store_class_end();
  }
}

getCurrentWeather::ReturnType getCurrentWeather::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return currentWeather::fetch(env, p);
}

void getCurrentWeather::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetCurrentWeather").c_str());
    location_fieldID = jni::get_field_id(env, Class, "location", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Location;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getDeepLinkInfo::Class;
jfieldID getDeepLinkInfo::link_fieldID;

getDeepLinkInfo::getDeepLinkInfo()
  : link_()
{}

getDeepLinkInfo::getDeepLinkInfo(string const &link_)
  : link_(link_)
{}

const std::int32_t getDeepLinkInfo::ID;

object_ptr<getDeepLinkInfo> getDeepLinkInfo::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getDeepLinkInfo> res = make_object<getDeepLinkInfo>();
  res->link_ = jni::fetch_string(env, p, res->link_fieldID);
  return res;
}

void getDeepLinkInfo::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetDeepLinkInfo");
    s.store_field("link", link_);
    s.store_class_end();
  }
}

getDeepLinkInfo::ReturnType getDeepLinkInfo::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return deepLinkInfo::fetch(env, p);
}

void getDeepLinkInfo::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetDeepLinkInfo").c_str());
    link_fieldID = jni::get_field_id(env, Class, "link", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass getDefaultChatPhotoCustomEmojiStickers::Class;

getDefaultChatPhotoCustomEmojiStickers::getDefaultChatPhotoCustomEmojiStickers() {
}

const std::int32_t getDefaultChatPhotoCustomEmojiStickers::ID;

object_ptr<getDefaultChatPhotoCustomEmojiStickers> getDefaultChatPhotoCustomEmojiStickers::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<getDefaultChatPhotoCustomEmojiStickers>();
}

void getDefaultChatPhotoCustomEmojiStickers::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetDefaultChatPhotoCustomEmojiStickers");
    s.store_class_end();
  }
}

getDefaultChatPhotoCustomEmojiStickers::ReturnType getDefaultChatPhotoCustomEmojiStickers::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return stickers::fetch(env, p);
}

void getDefaultChatPhotoCustomEmojiStickers::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetDefaultChatPhotoCustomEmojiStickers").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getDefaultMessageAutoDeleteTime::Class;

getDefaultMessageAutoDeleteTime::getDefaultMessageAutoDeleteTime() {
}

const std::int32_t getDefaultMessageAutoDeleteTime::ID;

object_ptr<getDefaultMessageAutoDeleteTime> getDefaultMessageAutoDeleteTime::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<getDefaultMessageAutoDeleteTime>();
}

void getDefaultMessageAutoDeleteTime::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetDefaultMessageAutoDeleteTime");
    s.store_class_end();
  }
}

getDefaultMessageAutoDeleteTime::ReturnType getDefaultMessageAutoDeleteTime::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return messageAutoDeleteTime::fetch(env, p);
}

void getDefaultMessageAutoDeleteTime::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetDefaultMessageAutoDeleteTime").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getDefaultProfilePhotoCustomEmojiStickers::Class;

getDefaultProfilePhotoCustomEmojiStickers::getDefaultProfilePhotoCustomEmojiStickers() {
}

const std::int32_t getDefaultProfilePhotoCustomEmojiStickers::ID;

object_ptr<getDefaultProfilePhotoCustomEmojiStickers> getDefaultProfilePhotoCustomEmojiStickers::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<getDefaultProfilePhotoCustomEmojiStickers>();
}

void getDefaultProfilePhotoCustomEmojiStickers::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetDefaultProfilePhotoCustomEmojiStickers");
    s.store_class_end();
  }
}

getDefaultProfilePhotoCustomEmojiStickers::ReturnType getDefaultProfilePhotoCustomEmojiStickers::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return stickers::fetch(env, p);
}

void getDefaultProfilePhotoCustomEmojiStickers::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetDefaultProfilePhotoCustomEmojiStickers").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getGameHighScores::Class;
jfieldID getGameHighScores::chat_id_fieldID;
jfieldID getGameHighScores::message_id_fieldID;
jfieldID getGameHighScores::user_id_fieldID;

getGameHighScores::getGameHighScores()
  : chat_id_()
  , message_id_()
  , user_id_()
{}

getGameHighScores::getGameHighScores(int53 chat_id_, int53 message_id_, int53 user_id_)
  : chat_id_(chat_id_)
  , message_id_(message_id_)
  , user_id_(user_id_)
{}

const std::int32_t getGameHighScores::ID;

object_ptr<getGameHighScores> getGameHighScores::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getGameHighScores> res = make_object<getGameHighScores>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  res->user_id_ = env->GetLongField(p, res->user_id_fieldID);
  return res;
}

void getGameHighScores::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetGameHighScores");
    s.store_field("chatId", chat_id_);
    s.store_field("messageId", message_id_);
    s.store_field("userId", user_id_);
    s.store_class_end();
  }
}

getGameHighScores::ReturnType getGameHighScores::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return gameHighScores::fetch(env, p);
}

void getGameHighScores::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetGameHighScores").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    user_id_fieldID = jni::get_field_id(env, Class, "userId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass getGiftCollections::Class;
jfieldID getGiftCollections::owner_id_fieldID;

getGiftCollections::getGiftCollections()
  : owner_id_()
{}

getGiftCollections::getGiftCollections(object_ptr<MessageSender> &&owner_id_)
  : owner_id_(std::move(owner_id_))
{}

const std::int32_t getGiftCollections::ID;

object_ptr<getGiftCollections> getGiftCollections::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getGiftCollections> res = make_object<getGiftCollections>();
  res->owner_id_ = jni::fetch_tl_object<MessageSender>(env, jni::fetch_object(env, p, res->owner_id_fieldID));
  return res;
}

void getGiftCollections::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetGiftCollections");
    s.store_object_field("ownerId", static_cast<const BaseObject *>(owner_id_.get()));
    s.store_class_end();
  }
}

getGiftCollections::ReturnType getGiftCollections::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return giftCollections::fetch(env, p);
}

void getGiftCollections::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetGiftCollections").c_str());
    owner_id_fieldID = jni::get_field_id(env, Class, "ownerId", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$MessageSender;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getGiftsForCrafting::Class;
jfieldID getGiftsForCrafting::regular_gift_id_fieldID;
jfieldID getGiftsForCrafting::offset_fieldID;
jfieldID getGiftsForCrafting::limit_fieldID;

getGiftsForCrafting::getGiftsForCrafting()
  : regular_gift_id_()
  , offset_()
  , limit_()
{}

getGiftsForCrafting::getGiftsForCrafting(int64 regular_gift_id_, string const &offset_, int32 limit_)
  : regular_gift_id_(regular_gift_id_)
  , offset_(offset_)
  , limit_(limit_)
{}

const std::int32_t getGiftsForCrafting::ID;

object_ptr<getGiftsForCrafting> getGiftsForCrafting::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getGiftsForCrafting> res = make_object<getGiftsForCrafting>();
  res->regular_gift_id_ = env->GetLongField(p, res->regular_gift_id_fieldID);
  res->offset_ = jni::fetch_string(env, p, res->offset_fieldID);
  res->limit_ = env->GetIntField(p, res->limit_fieldID);
  return res;
}

void getGiftsForCrafting::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetGiftsForCrafting");
    s.store_field("regularGiftId", regular_gift_id_);
    s.store_field("offset", offset_);
    s.store_field("limit", limit_);
    s.store_class_end();
  }
}

getGiftsForCrafting::ReturnType getGiftsForCrafting::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return giftsForCrafting::fetch(env, p);
}

void getGiftsForCrafting::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetGiftsForCrafting").c_str());
    regular_gift_id_fieldID = jni::get_field_id(env, Class, "regularGiftId", "J");
    offset_fieldID = jni::get_field_id(env, Class, "offset", "Ljava/lang/String;");
    limit_fieldID = jni::get_field_id(env, Class, "limit", "I");
    return true;
  }();
  (void)is_inited;
}

jclass getKeywordEmojis::Class;
jfieldID getKeywordEmojis::text_fieldID;
jfieldID getKeywordEmojis::input_language_codes_fieldID;

getKeywordEmojis::getKeywordEmojis()
  : text_()
  , input_language_codes_()
{}

getKeywordEmojis::getKeywordEmojis(string const &text_, array<string> &&input_language_codes_)
  : text_(text_)
  , input_language_codes_(std::move(input_language_codes_))
{}

const std::int32_t getKeywordEmojis::ID;

object_ptr<getKeywordEmojis> getKeywordEmojis::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getKeywordEmojis> res = make_object<getKeywordEmojis>();
  res->text_ = jni::fetch_string(env, p, res->text_fieldID);
  res->input_language_codes_ = jni::FetchVector<string>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->input_language_codes_fieldID));
  return res;
}

void getKeywordEmojis::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetKeywordEmojis");
    s.store_field("text", text_);
    { s.store_vector_begin("inputLanguageCodes", input_language_codes_.size()); for (const auto &_value : input_language_codes_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

getKeywordEmojis::ReturnType getKeywordEmojis::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return emojis::fetch(env, p);
}

void getKeywordEmojis::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetKeywordEmojis").c_str());
    text_fieldID = jni::get_field_id(env, Class, "text", "Ljava/lang/String;");
    input_language_codes_fieldID = jni::get_field_id(env, Class, "inputLanguageCodes", "[Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass getLanguagePackInfo::Class;
jfieldID getLanguagePackInfo::language_pack_id_fieldID;

getLanguagePackInfo::getLanguagePackInfo()
  : language_pack_id_()
{}

getLanguagePackInfo::getLanguagePackInfo(string const &language_pack_id_)
  : language_pack_id_(language_pack_id_)
{}

const std::int32_t getLanguagePackInfo::ID;

object_ptr<getLanguagePackInfo> getLanguagePackInfo::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getLanguagePackInfo> res = make_object<getLanguagePackInfo>();
  res->language_pack_id_ = jni::fetch_string(env, p, res->language_pack_id_fieldID);
  return res;
}

void getLanguagePackInfo::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetLanguagePackInfo");
    s.store_field("languagePackId", language_pack_id_);
    s.store_class_end();
  }
}

getLanguagePackInfo::ReturnType getLanguagePackInfo::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return languagePackInfo::fetch(env, p);
}

void getLanguagePackInfo::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetLanguagePackInfo").c_str());
    language_pack_id_fieldID = jni::get_field_id(env, Class, "languagePackId", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass getLanguagePackString::Class;
jfieldID getLanguagePackString::language_pack_database_path_fieldID;
jfieldID getLanguagePackString::localization_target_fieldID;
jfieldID getLanguagePackString::language_pack_id_fieldID;
jfieldID getLanguagePackString::key_fieldID;

getLanguagePackString::getLanguagePackString()
  : language_pack_database_path_()
  , localization_target_()
  , language_pack_id_()
  , key_()
{}

getLanguagePackString::getLanguagePackString(string const &language_pack_database_path_, string const &localization_target_, string const &language_pack_id_, string const &key_)
  : language_pack_database_path_(language_pack_database_path_)
  , localization_target_(localization_target_)
  , language_pack_id_(language_pack_id_)
  , key_(key_)
{}

const std::int32_t getLanguagePackString::ID;

object_ptr<getLanguagePackString> getLanguagePackString::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getLanguagePackString> res = make_object<getLanguagePackString>();
  res->language_pack_database_path_ = jni::fetch_string(env, p, res->language_pack_database_path_fieldID);
  res->localization_target_ = jni::fetch_string(env, p, res->localization_target_fieldID);
  res->language_pack_id_ = jni::fetch_string(env, p, res->language_pack_id_fieldID);
  res->key_ = jni::fetch_string(env, p, res->key_fieldID);
  return res;
}

void getLanguagePackString::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetLanguagePackString");
    s.store_field("languagePackDatabasePath", language_pack_database_path_);
    s.store_field("localizationTarget", localization_target_);
    s.store_field("languagePackId", language_pack_id_);
    s.store_field("key", key_);
    s.store_class_end();
  }
}

getLanguagePackString::ReturnType getLanguagePackString::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return LanguagePackStringValue::fetch(env, p);
}

void getLanguagePackString::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetLanguagePackString").c_str());
    language_pack_database_path_fieldID = jni::get_field_id(env, Class, "languagePackDatabasePath", "Ljava/lang/String;");
    localization_target_fieldID = jni::get_field_id(env, Class, "localizationTarget", "Ljava/lang/String;");
    language_pack_id_fieldID = jni::get_field_id(env, Class, "languagePackId", "Ljava/lang/String;");
    key_fieldID = jni::get_field_id(env, Class, "key", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass getLiveStoryRtmpUrl::Class;
jfieldID getLiveStoryRtmpUrl::chat_id_fieldID;

getLiveStoryRtmpUrl::getLiveStoryRtmpUrl()
  : chat_id_()
{}

getLiveStoryRtmpUrl::getLiveStoryRtmpUrl(int53 chat_id_)
  : chat_id_(chat_id_)
{}

const std::int32_t getLiveStoryRtmpUrl::ID;

object_ptr<getLiveStoryRtmpUrl> getLiveStoryRtmpUrl::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getLiveStoryRtmpUrl> res = make_object<getLiveStoryRtmpUrl>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  return res;
}

void getLiveStoryRtmpUrl::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetLiveStoryRtmpUrl");
    s.store_field("chatId", chat_id_);
    s.store_class_end();
  }
}

getLiveStoryRtmpUrl::ReturnType getLiveStoryRtmpUrl::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return rtmpUrl::fetch(env, p);
}

void getLiveStoryRtmpUrl::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetLiveStoryRtmpUrl").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass getLiveStoryStreamer::Class;
jfieldID getLiveStoryStreamer::group_call_id_fieldID;

getLiveStoryStreamer::getLiveStoryStreamer()
  : group_call_id_()
{}

getLiveStoryStreamer::getLiveStoryStreamer(int32 group_call_id_)
  : group_call_id_(group_call_id_)
{}

const std::int32_t getLiveStoryStreamer::ID;

object_ptr<getLiveStoryStreamer> getLiveStoryStreamer::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getLiveStoryStreamer> res = make_object<getLiveStoryStreamer>();
  res->group_call_id_ = env->GetIntField(p, res->group_call_id_fieldID);
  return res;
}

void getLiveStoryStreamer::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetLiveStoryStreamer");
    s.store_field("groupCallId", group_call_id_);
    s.store_class_end();
  }
}

getLiveStoryStreamer::ReturnType getLiveStoryStreamer::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return groupCallParticipant::fetch(env, p);
}

void getLiveStoryStreamer::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetLiveStoryStreamer").c_str());
    group_call_id_fieldID = jni::get_field_id(env, Class, "groupCallId", "I");
    return true;
  }();
  (void)is_inited;
}

jclass getManagedBotToken::Class;
jfieldID getManagedBotToken::bot_user_id_fieldID;
jfieldID getManagedBotToken::revoke_fieldID;

getManagedBotToken::getManagedBotToken()
  : bot_user_id_()
  , revoke_()
{}

getManagedBotToken::getManagedBotToken(int53 bot_user_id_, bool revoke_)
  : bot_user_id_(bot_user_id_)
  , revoke_(revoke_)
{}

const std::int32_t getManagedBotToken::ID;

object_ptr<getManagedBotToken> getManagedBotToken::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getManagedBotToken> res = make_object<getManagedBotToken>();
  res->bot_user_id_ = env->GetLongField(p, res->bot_user_id_fieldID);
  res->revoke_ = (env->GetBooleanField(p, res->revoke_fieldID) != 0);
  return res;
}

void getManagedBotToken::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetManagedBotToken");
    s.store_field("botUserId", bot_user_id_);
    s.store_field("revoke", revoke_);
    s.store_class_end();
  }
}

getManagedBotToken::ReturnType getManagedBotToken::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return text::fetch(env, p);
}

void getManagedBotToken::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetManagedBotToken").c_str());
    bot_user_id_fieldID = jni::get_field_id(env, Class, "botUserId", "J");
    revoke_fieldID = jni::get_field_id(env, Class, "revoke", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass getMapThumbnailFile::Class;
jfieldID getMapThumbnailFile::location_fieldID;
jfieldID getMapThumbnailFile::zoom_fieldID;
jfieldID getMapThumbnailFile::width_fieldID;
jfieldID getMapThumbnailFile::height_fieldID;
jfieldID getMapThumbnailFile::scale_fieldID;
jfieldID getMapThumbnailFile::chat_id_fieldID;

getMapThumbnailFile::getMapThumbnailFile()
  : location_()
  , zoom_()
  , width_()
  , height_()
  , scale_()
  , chat_id_()
{}

getMapThumbnailFile::getMapThumbnailFile(object_ptr<location> &&location_, int32 zoom_, int32 width_, int32 height_, int32 scale_, int53 chat_id_)
  : location_(std::move(location_))
  , zoom_(zoom_)
  , width_(width_)
  , height_(height_)
  , scale_(scale_)
  , chat_id_(chat_id_)
{}

const std::int32_t getMapThumbnailFile::ID;

object_ptr<getMapThumbnailFile> getMapThumbnailFile::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getMapThumbnailFile> res = make_object<getMapThumbnailFile>();
  res->location_ = jni::fetch_tl_object<location>(env, jni::fetch_object(env, p, res->location_fieldID));
  res->zoom_ = env->GetIntField(p, res->zoom_fieldID);
  res->width_ = env->GetIntField(p, res->width_fieldID);
  res->height_ = env->GetIntField(p, res->height_fieldID);
  res->scale_ = env->GetIntField(p, res->scale_fieldID);
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  return res;
}

void getMapThumbnailFile::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetMapThumbnailFile");
    s.store_object_field("location", static_cast<const BaseObject *>(location_.get()));
    s.store_field("zoom", zoom_);
    s.store_field("width", width_);
    s.store_field("height", height_);
    s.store_field("scale", scale_);
    s.store_field("chatId", chat_id_);
    s.store_class_end();
  }
}

getMapThumbnailFile::ReturnType getMapThumbnailFile::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return file::fetch(env, p);
}

void getMapThumbnailFile::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetMapThumbnailFile").c_str());
    location_fieldID = jni::get_field_id(env, Class, "location", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$Location;").c_str());
    zoom_fieldID = jni::get_field_id(env, Class, "zoom", "I");
    width_fieldID = jni::get_field_id(env, Class, "width", "I");
    height_fieldID = jni::get_field_id(env, Class, "height", "I");
    scale_fieldID = jni::get_field_id(env, Class, "scale", "I");
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass getMessageAddedReactions::Class;
jfieldID getMessageAddedReactions::chat_id_fieldID;
jfieldID getMessageAddedReactions::message_id_fieldID;
jfieldID getMessageAddedReactions::reaction_type_fieldID;
jfieldID getMessageAddedReactions::offset_fieldID;
jfieldID getMessageAddedReactions::limit_fieldID;

getMessageAddedReactions::getMessageAddedReactions()
  : chat_id_()
  , message_id_()
  , reaction_type_()
  , offset_()
  , limit_()
{}

getMessageAddedReactions::getMessageAddedReactions(int53 chat_id_, int53 message_id_, object_ptr<ReactionType> &&reaction_type_, string const &offset_, int32 limit_)
  : chat_id_(chat_id_)
  , message_id_(message_id_)
  , reaction_type_(std::move(reaction_type_))
  , offset_(offset_)
  , limit_(limit_)
{}

const std::int32_t getMessageAddedReactions::ID;

object_ptr<getMessageAddedReactions> getMessageAddedReactions::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getMessageAddedReactions> res = make_object<getMessageAddedReactions>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  res->reaction_type_ = jni::fetch_tl_object<ReactionType>(env, jni::fetch_object(env, p, res->reaction_type_fieldID));
  res->offset_ = jni::fetch_string(env, p, res->offset_fieldID);
  res->limit_ = env->GetIntField(p, res->limit_fieldID);
  return res;
}

void getMessageAddedReactions::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetMessageAddedReactions");
    s.store_field("chatId", chat_id_);
    s.store_field("messageId", message_id_);
    s.store_object_field("reactionType", static_cast<const BaseObject *>(reaction_type_.get()));
    s.store_field("offset", offset_);
    s.store_field("limit", limit_);
    s.store_class_end();
  }
}

getMessageAddedReactions::ReturnType getMessageAddedReactions::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return addedReactions::fetch(env, p);
}

void getMessageAddedReactions::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetMessageAddedReactions").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    reaction_type_fieldID = jni::get_field_id(env, Class, "reactionType", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReactionType;").c_str());
    offset_fieldID = jni::get_field_id(env, Class, "offset", "Ljava/lang/String;");
    limit_fieldID = jni::get_field_id(env, Class, "limit", "I");
    return true;
  }();
  (void)is_inited;
}

jclass getMessageEmbeddingCode::Class;
jfieldID getMessageEmbeddingCode::chat_id_fieldID;
jfieldID getMessageEmbeddingCode::message_id_fieldID;
jfieldID getMessageEmbeddingCode::for_album_fieldID;

getMessageEmbeddingCode::getMessageEmbeddingCode()
  : chat_id_()
  , message_id_()
  , for_album_()
{}

getMessageEmbeddingCode::getMessageEmbeddingCode(int53 chat_id_, int53 message_id_, bool for_album_)
  : chat_id_(chat_id_)
  , message_id_(message_id_)
  , for_album_(for_album_)
{}

const std::int32_t getMessageEmbeddingCode::ID;

object_ptr<getMessageEmbeddingCode> getMessageEmbeddingCode::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getMessageEmbeddingCode> res = make_object<getMessageEmbeddingCode>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  res->for_album_ = (env->GetBooleanField(p, res->for_album_fieldID) != 0);
  return res;
}

void getMessageEmbeddingCode::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetMessageEmbeddingCode");
    s.store_field("chatId", chat_id_);
    s.store_field("messageId", message_id_);
    s.store_field("forAlbum", for_album_);
    s.store_class_end();
  }
}

getMessageEmbeddingCode::ReturnType getMessageEmbeddingCode::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return text::fetch(env, p);
}

void getMessageEmbeddingCode::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetMessageEmbeddingCode").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    for_album_fieldID = jni::get_field_id(env, Class, "forAlbum", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass getMessageReadDate::Class;
jfieldID getMessageReadDate::chat_id_fieldID;
jfieldID getMessageReadDate::message_id_fieldID;

getMessageReadDate::getMessageReadDate()
  : chat_id_()
  , message_id_()
{}

getMessageReadDate::getMessageReadDate(int53 chat_id_, int53 message_id_)
  : chat_id_(chat_id_)
  , message_id_(message_id_)
{}

const std::int32_t getMessageReadDate::ID;

object_ptr<getMessageReadDate> getMessageReadDate::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getMessageReadDate> res = make_object<getMessageReadDate>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  return res;
}

void getMessageReadDate::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetMessageReadDate");
    s.store_field("chatId", chat_id_);
    s.store_field("messageId", message_id_);
    s.store_class_end();
  }
}

getMessageReadDate::ReturnType getMessageReadDate::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return MessageReadDate::fetch(env, p);
}

void getMessageReadDate::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetMessageReadDate").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass getNewChatPrivacySettings::Class;

getNewChatPrivacySettings::getNewChatPrivacySettings() {
}

const std::int32_t getNewChatPrivacySettings::ID;

object_ptr<getNewChatPrivacySettings> getNewChatPrivacySettings::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<getNewChatPrivacySettings>();
}

void getNewChatPrivacySettings::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetNewChatPrivacySettings");
    s.store_class_end();
  }
}

getNewChatPrivacySettings::ReturnType getNewChatPrivacySettings::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return newChatPrivacySettings::fetch(env, p);
}

void getNewChatPrivacySettings::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetNewChatPrivacySettings").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getPassportAuthorizationForm::Class;
jfieldID getPassportAuthorizationForm::bot_user_id_fieldID;
jfieldID getPassportAuthorizationForm::scope_fieldID;
jfieldID getPassportAuthorizationForm::public_key_fieldID;
jfieldID getPassportAuthorizationForm::nonce_fieldID;

getPassportAuthorizationForm::getPassportAuthorizationForm()
  : bot_user_id_()
  , scope_()
  , public_key_()
  , nonce_()
{}

getPassportAuthorizationForm::getPassportAuthorizationForm(int53 bot_user_id_, string const &scope_, string const &public_key_, string const &nonce_)
  : bot_user_id_(bot_user_id_)
  , scope_(scope_)
  , public_key_(public_key_)
  , nonce_(nonce_)
{}

const std::int32_t getPassportAuthorizationForm::ID;

object_ptr<getPassportAuthorizationForm> getPassportAuthorizationForm::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getPassportAuthorizationForm> res = make_object<getPassportAuthorizationForm>();
  res->bot_user_id_ = env->GetLongField(p, res->bot_user_id_fieldID);
  res->scope_ = jni::fetch_string(env, p, res->scope_fieldID);
  res->public_key_ = jni::fetch_string(env, p, res->public_key_fieldID);
  res->nonce_ = jni::fetch_string(env, p, res->nonce_fieldID);
  return res;
}

void getPassportAuthorizationForm::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetPassportAuthorizationForm");
    s.store_field("botUserId", bot_user_id_);
    s.store_field("scope", scope_);
    s.store_field("publicKey", public_key_);
    s.store_field("nonce", nonce_);
    s.store_class_end();
  }
}

getPassportAuthorizationForm::ReturnType getPassportAuthorizationForm::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return passportAuthorizationForm::fetch(env, p);
}

void getPassportAuthorizationForm::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetPassportAuthorizationForm").c_str());
    bot_user_id_fieldID = jni::get_field_id(env, Class, "botUserId", "J");
    scope_fieldID = jni::get_field_id(env, Class, "scope", "Ljava/lang/String;");
    public_key_fieldID = jni::get_field_id(env, Class, "publicKey", "Ljava/lang/String;");
    nonce_fieldID = jni::get_field_id(env, Class, "nonce", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass getPaymentReceipt::Class;
jfieldID getPaymentReceipt::chat_id_fieldID;
jfieldID getPaymentReceipt::message_id_fieldID;

getPaymentReceipt::getPaymentReceipt()
  : chat_id_()
  , message_id_()
{}

getPaymentReceipt::getPaymentReceipt(int53 chat_id_, int53 message_id_)
  : chat_id_(chat_id_)
  , message_id_(message_id_)
{}

const std::int32_t getPaymentReceipt::ID;

object_ptr<getPaymentReceipt> getPaymentReceipt::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getPaymentReceipt> res = make_object<getPaymentReceipt>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  return res;
}

void getPaymentReceipt::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetPaymentReceipt");
    s.store_field("chatId", chat_id_);
    s.store_field("messageId", message_id_);
    s.store_class_end();
  }
}

getPaymentReceipt::ReturnType getPaymentReceipt::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return paymentReceipt::fetch(env, p);
}

void getPaymentReceipt::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetPaymentReceipt").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass getRecentlyVisitedTMeUrls::Class;
jfieldID getRecentlyVisitedTMeUrls::referrer_fieldID;

getRecentlyVisitedTMeUrls::getRecentlyVisitedTMeUrls()
  : referrer_()
{}

getRecentlyVisitedTMeUrls::getRecentlyVisitedTMeUrls(string const &referrer_)
  : referrer_(referrer_)
{}

const std::int32_t getRecentlyVisitedTMeUrls::ID;

object_ptr<getRecentlyVisitedTMeUrls> getRecentlyVisitedTMeUrls::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getRecentlyVisitedTMeUrls> res = make_object<getRecentlyVisitedTMeUrls>();
  res->referrer_ = jni::fetch_string(env, p, res->referrer_fieldID);
  return res;
}

void getRecentlyVisitedTMeUrls::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetRecentlyVisitedTMeUrls");
    s.store_field("referrer", referrer_);
    s.store_class_end();
  }
}

getRecentlyVisitedTMeUrls::ReturnType getRecentlyVisitedTMeUrls::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return tMeUrls::fetch(env, p);
}

void getRecentlyVisitedTMeUrls::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetRecentlyVisitedTMeUrls").c_str());
    referrer_fieldID = jni::get_field_id(env, Class, "referrer", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass getRecoveryEmailAddress::Class;
jfieldID getRecoveryEmailAddress::password_fieldID;

getRecoveryEmailAddress::getRecoveryEmailAddress()
  : password_()
{}

getRecoveryEmailAddress::getRecoveryEmailAddress(string const &password_)
  : password_(password_)
{}

const std::int32_t getRecoveryEmailAddress::ID;

object_ptr<getRecoveryEmailAddress> getRecoveryEmailAddress::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getRecoveryEmailAddress> res = make_object<getRecoveryEmailAddress>();
  res->password_ = jni::fetch_string(env, p, res->password_fieldID);
  return res;
}

void getRecoveryEmailAddress::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetRecoveryEmailAddress");
    s.store_field("password", password_);
    s.store_class_end();
  }
}

getRecoveryEmailAddress::ReturnType getRecoveryEmailAddress::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return recoveryEmailAddress::fetch(env, p);
}

void getRecoveryEmailAddress::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetRecoveryEmailAddress").c_str());
    password_fieldID = jni::get_field_id(env, Class, "password", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass getRemoteFile::Class;
jfieldID getRemoteFile::remote_file_id_fieldID;
jfieldID getRemoteFile::file_type_fieldID;

getRemoteFile::getRemoteFile()
  : remote_file_id_()
  , file_type_()
{}

getRemoteFile::getRemoteFile(string const &remote_file_id_, object_ptr<FileType> &&file_type_)
  : remote_file_id_(remote_file_id_)
  , file_type_(std::move(file_type_))
{}

const std::int32_t getRemoteFile::ID;

object_ptr<getRemoteFile> getRemoteFile::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getRemoteFile> res = make_object<getRemoteFile>();
  res->remote_file_id_ = jni::fetch_string(env, p, res->remote_file_id_fieldID);
  res->file_type_ = jni::fetch_tl_object<FileType>(env, jni::fetch_object(env, p, res->file_type_fieldID));
  return res;
}

void getRemoteFile::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetRemoteFile");
    s.store_field("remoteFileId", remote_file_id_);
    s.store_object_field("fileType", static_cast<const BaseObject *>(file_type_.get()));
    s.store_class_end();
  }
}

getRemoteFile::ReturnType getRemoteFile::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return file::fetch(env, p);
}

void getRemoteFile::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetRemoteFile").c_str());
    remote_file_id_fieldID = jni::get_field_id(env, Class, "remoteFileId", "Ljava/lang/String;");
    file_type_fieldID = jni::get_field_id(env, Class, "fileType", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$FileType;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getSavedNotificationSounds::Class;

getSavedNotificationSounds::getSavedNotificationSounds() {
}

const std::int32_t getSavedNotificationSounds::ID;

object_ptr<getSavedNotificationSounds> getSavedNotificationSounds::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<getSavedNotificationSounds>();
}

void getSavedNotificationSounds::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetSavedNotificationSounds");
    s.store_class_end();
  }
}

getSavedNotificationSounds::ReturnType getSavedNotificationSounds::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return notificationSounds::fetch(env, p);
}

void getSavedNotificationSounds::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetSavedNotificationSounds").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getStoryAvailableReactions::Class;
jfieldID getStoryAvailableReactions::row_size_fieldID;

getStoryAvailableReactions::getStoryAvailableReactions()
  : row_size_()
{}

getStoryAvailableReactions::getStoryAvailableReactions(int32 row_size_)
  : row_size_(row_size_)
{}

const std::int32_t getStoryAvailableReactions::ID;

object_ptr<getStoryAvailableReactions> getStoryAvailableReactions::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getStoryAvailableReactions> res = make_object<getStoryAvailableReactions>();
  res->row_size_ = env->GetIntField(p, res->row_size_fieldID);
  return res;
}

void getStoryAvailableReactions::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetStoryAvailableReactions");
    s.store_field("rowSize", row_size_);
    s.store_class_end();
  }
}

getStoryAvailableReactions::ReturnType getStoryAvailableReactions::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return availableReactions::fetch(env, p);
}

void getStoryAvailableReactions::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetStoryAvailableReactions").c_str());
    row_size_fieldID = jni::get_field_id(env, Class, "rowSize", "I");
    return true;
  }();
  (void)is_inited;
}

jclass getStoryNotificationSettingsExceptions::Class;

getStoryNotificationSettingsExceptions::getStoryNotificationSettingsExceptions() {
}

const std::int32_t getStoryNotificationSettingsExceptions::ID;

object_ptr<getStoryNotificationSettingsExceptions> getStoryNotificationSettingsExceptions::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<getStoryNotificationSettingsExceptions>();
}

void getStoryNotificationSettingsExceptions::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetStoryNotificationSettingsExceptions");
    s.store_class_end();
  }
}

getStoryNotificationSettingsExceptions::ReturnType getStoryNotificationSettingsExceptions::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return chats::fetch(env, p);
}

void getStoryNotificationSettingsExceptions::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetStoryNotificationSettingsExceptions").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getSuggestedFileName::Class;
jfieldID getSuggestedFileName::file_id_fieldID;
jfieldID getSuggestedFileName::directory_fieldID;

getSuggestedFileName::getSuggestedFileName()
  : file_id_()
  , directory_()
{}

getSuggestedFileName::getSuggestedFileName(int32 file_id_, string const &directory_)
  : file_id_(file_id_)
  , directory_(directory_)
{}

const std::int32_t getSuggestedFileName::ID;

object_ptr<getSuggestedFileName> getSuggestedFileName::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getSuggestedFileName> res = make_object<getSuggestedFileName>();
  res->file_id_ = env->GetIntField(p, res->file_id_fieldID);
  res->directory_ = jni::fetch_string(env, p, res->directory_fieldID);
  return res;
}

void getSuggestedFileName::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetSuggestedFileName");
    s.store_field("fileId", file_id_);
    s.store_field("directory", directory_);
    s.store_class_end();
  }
}

getSuggestedFileName::ReturnType getSuggestedFileName::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return text::fetch(env, p);
}

void getSuggestedFileName::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetSuggestedFileName").c_str());
    file_id_fieldID = jni::get_field_id(env, Class, "fileId", "I");
    directory_fieldID = jni::get_field_id(env, Class, "directory", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass getSupportUser::Class;

getSupportUser::getSupportUser() {
}

const std::int32_t getSupportUser::ID;

object_ptr<getSupportUser> getSupportUser::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<getSupportUser>();
}

void getSupportUser::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetSupportUser");
    s.store_class_end();
  }
}

getSupportUser::ReturnType getSupportUser::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return user::fetch(env, p);
}

void getSupportUser::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetSupportUser").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass getUpgradedGift::Class;
jfieldID getUpgradedGift::name_fieldID;

getUpgradedGift::getUpgradedGift()
  : name_()
{}

getUpgradedGift::getUpgradedGift(string const &name_)
  : name_(name_)
{}

const std::int32_t getUpgradedGift::ID;

object_ptr<getUpgradedGift> getUpgradedGift::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getUpgradedGift> res = make_object<getUpgradedGift>();
  res->name_ = jni::fetch_string(env, p, res->name_fieldID);
  return res;
}

void getUpgradedGift::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetUpgradedGift");
    s.store_field("name", name_);
    s.store_class_end();
  }
}

getUpgradedGift::ReturnType getUpgradedGift::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return upgradedGift::fetch(env, p);
}

void getUpgradedGift::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetUpgradedGift").c_str());
    name_fieldID = jni::get_field_id(env, Class, "name", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass getUserChatBoosts::Class;
jfieldID getUserChatBoosts::chat_id_fieldID;
jfieldID getUserChatBoosts::user_id_fieldID;

getUserChatBoosts::getUserChatBoosts()
  : chat_id_()
  , user_id_()
{}

getUserChatBoosts::getUserChatBoosts(int53 chat_id_, int53 user_id_)
  : chat_id_(chat_id_)
  , user_id_(user_id_)
{}

const std::int32_t getUserChatBoosts::ID;

object_ptr<getUserChatBoosts> getUserChatBoosts::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getUserChatBoosts> res = make_object<getUserChatBoosts>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->user_id_ = env->GetLongField(p, res->user_id_fieldID);
  return res;
}

void getUserChatBoosts::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetUserChatBoosts");
    s.store_field("chatId", chat_id_);
    s.store_field("userId", user_id_);
    s.store_class_end();
  }
}

getUserChatBoosts::ReturnType getUserChatBoosts::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return foundChatBoosts::fetch(env, p);
}

void getUserChatBoosts::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetUserChatBoosts").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    user_id_fieldID = jni::get_field_id(env, Class, "userId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass getVideoChatAvailableParticipants::Class;
jfieldID getVideoChatAvailableParticipants::chat_id_fieldID;

getVideoChatAvailableParticipants::getVideoChatAvailableParticipants()
  : chat_id_()
{}

getVideoChatAvailableParticipants::getVideoChatAvailableParticipants(int53 chat_id_)
  : chat_id_(chat_id_)
{}

const std::int32_t getVideoChatAvailableParticipants::ID;

object_ptr<getVideoChatAvailableParticipants> getVideoChatAvailableParticipants::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getVideoChatAvailableParticipants> res = make_object<getVideoChatAvailableParticipants>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  return res;
}

void getVideoChatAvailableParticipants::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetVideoChatAvailableParticipants");
    s.store_field("chatId", chat_id_);
    s.store_class_end();
  }
}

getVideoChatAvailableParticipants::ReturnType getVideoChatAvailableParticipants::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return messageSenders::fetch(env, p);
}

void getVideoChatAvailableParticipants::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetVideoChatAvailableParticipants").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass getWebAppUrl::Class;
jfieldID getWebAppUrl::bot_user_id_fieldID;
jfieldID getWebAppUrl::url_fieldID;
jfieldID getWebAppUrl::parameters_fieldID;

getWebAppUrl::getWebAppUrl()
  : bot_user_id_()
  , url_()
  , parameters_()
{}

getWebAppUrl::getWebAppUrl(int53 bot_user_id_, string const &url_, object_ptr<webAppOpenParameters> &&parameters_)
  : bot_user_id_(bot_user_id_)
  , url_(url_)
  , parameters_(std::move(parameters_))
{}

const std::int32_t getWebAppUrl::ID;

object_ptr<getWebAppUrl> getWebAppUrl::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<getWebAppUrl> res = make_object<getWebAppUrl>();
  res->bot_user_id_ = env->GetLongField(p, res->bot_user_id_fieldID);
  res->url_ = jni::fetch_string(env, p, res->url_fieldID);
  res->parameters_ = jni::fetch_tl_object<webAppOpenParameters>(env, jni::fetch_object(env, p, res->parameters_fieldID));
  return res;
}

void getWebAppUrl::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "GetWebAppUrl");
    s.store_field("botUserId", bot_user_id_);
    s.store_field("url", url_);
    s.store_object_field("parameters", static_cast<const BaseObject *>(parameters_.get()));
    s.store_class_end();
  }
}

getWebAppUrl::ReturnType getWebAppUrl::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return httpUrl::fetch(env, p);
}

void getWebAppUrl::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$GetWebAppUrl").c_str());
    bot_user_id_fieldID = jni::get_field_id(env, Class, "botUserId", "J");
    url_fieldID = jni::get_field_id(env, Class, "url", "Ljava/lang/String;");
    parameters_fieldID = jni::get_field_id(env, Class, "parameters", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$WebAppOpenParameters;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass importContacts::Class;
jfieldID importContacts::contacts_fieldID;

importContacts::importContacts()
  : contacts_()
{}

importContacts::importContacts(array<object_ptr<importedContact>> &&contacts_)
  : contacts_(std::move(contacts_))
{}

const std::int32_t importContacts::ID;

object_ptr<importContacts> importContacts::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<importContacts> res = make_object<importContacts>();
  res->contacts_ = jni::FetchVector<importedContact>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->contacts_fieldID));
  return res;
}

void importContacts::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ImportContacts");
    { s.store_vector_begin("contacts", contacts_.size()); for (const auto &_value : contacts_) { s.store_object_field("", static_cast<const BaseObject *>(_value.get())); } s.store_class_end(); }
    s.store_class_end();
  }
}

importContacts::ReturnType importContacts::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return importedContacts::fetch(env, p);
}

void importContacts::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ImportContacts").c_str());
    contacts_fieldID = jni::get_field_id(env, Class, "contacts", (PSLICE() << "[L" << get_package_name_ref() << "/TdApi$ImportedContact;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass increaseGiftAuctionBid::Class;
jfieldID increaseGiftAuctionBid::gift_id_fieldID;
jfieldID increaseGiftAuctionBid::star_count_fieldID;

increaseGiftAuctionBid::increaseGiftAuctionBid()
  : gift_id_()
  , star_count_()
{}

increaseGiftAuctionBid::increaseGiftAuctionBid(int64 gift_id_, int53 star_count_)
  : gift_id_(gift_id_)
  , star_count_(star_count_)
{}

const std::int32_t increaseGiftAuctionBid::ID;

object_ptr<increaseGiftAuctionBid> increaseGiftAuctionBid::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<increaseGiftAuctionBid> res = make_object<increaseGiftAuctionBid>();
  res->gift_id_ = env->GetLongField(p, res->gift_id_fieldID);
  res->star_count_ = env->GetLongField(p, res->star_count_fieldID);
  return res;
}

void increaseGiftAuctionBid::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "IncreaseGiftAuctionBid");
    s.store_field("giftId", gift_id_);
    s.store_field("starCount", star_count_);
    s.store_class_end();
  }
}

increaseGiftAuctionBid::ReturnType increaseGiftAuctionBid::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void increaseGiftAuctionBid::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$IncreaseGiftAuctionBid").c_str());
    gift_id_fieldID = jni::get_field_id(env, Class, "giftId", "J");
    star_count_fieldID = jni::get_field_id(env, Class, "starCount", "J");
    return true;
  }();
  (void)is_inited;
}

jclass joinGroupCall::Class;
jfieldID joinGroupCall::input_group_call_fieldID;
jfieldID joinGroupCall::join_parameters_fieldID;

joinGroupCall::joinGroupCall()
  : input_group_call_()
  , join_parameters_()
{}

joinGroupCall::joinGroupCall(object_ptr<InputGroupCall> &&input_group_call_, object_ptr<groupCallJoinParameters> &&join_parameters_)
  : input_group_call_(std::move(input_group_call_))
  , join_parameters_(std::move(join_parameters_))
{}

const std::int32_t joinGroupCall::ID;

object_ptr<joinGroupCall> joinGroupCall::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<joinGroupCall> res = make_object<joinGroupCall>();
  res->input_group_call_ = jni::fetch_tl_object<InputGroupCall>(env, jni::fetch_object(env, p, res->input_group_call_fieldID));
  res->join_parameters_ = jni::fetch_tl_object<groupCallJoinParameters>(env, jni::fetch_object(env, p, res->join_parameters_fieldID));
  return res;
}

void joinGroupCall::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "JoinGroupCall");
    s.store_object_field("inputGroupCall", static_cast<const BaseObject *>(input_group_call_.get()));
    s.store_object_field("joinParameters", static_cast<const BaseObject *>(join_parameters_.get()));
    s.store_class_end();
  }
}

joinGroupCall::ReturnType joinGroupCall::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return groupCallInfo::fetch(env, p);
}

void joinGroupCall::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$JoinGroupCall").c_str());
    input_group_call_fieldID = jni::get_field_id(env, Class, "inputGroupCall", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputGroupCall;").c_str());
    join_parameters_fieldID = jni::get_field_id(env, Class, "joinParameters", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$GroupCallJoinParameters;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass openChatSimilarChat::Class;
jfieldID openChatSimilarChat::chat_id_fieldID;
jfieldID openChatSimilarChat::opened_chat_id_fieldID;

openChatSimilarChat::openChatSimilarChat()
  : chat_id_()
  , opened_chat_id_()
{}

openChatSimilarChat::openChatSimilarChat(int53 chat_id_, int53 opened_chat_id_)
  : chat_id_(chat_id_)
  , opened_chat_id_(opened_chat_id_)
{}

const std::int32_t openChatSimilarChat::ID;

object_ptr<openChatSimilarChat> openChatSimilarChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<openChatSimilarChat> res = make_object<openChatSimilarChat>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->opened_chat_id_ = env->GetLongField(p, res->opened_chat_id_fieldID);
  return res;
}

void openChatSimilarChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "OpenChatSimilarChat");
    s.store_field("chatId", chat_id_);
    s.store_field("openedChatId", opened_chat_id_);
    s.store_class_end();
  }
}

openChatSimilarChat::ReturnType openChatSimilarChat::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void openChatSimilarChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$OpenChatSimilarChat").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    opened_chat_id_fieldID = jni::get_field_id(env, Class, "openedChatId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass placeGiftAuctionBid::Class;
jfieldID placeGiftAuctionBid::gift_id_fieldID;
jfieldID placeGiftAuctionBid::star_count_fieldID;
jfieldID placeGiftAuctionBid::user_id_fieldID;
jfieldID placeGiftAuctionBid::text_fieldID;
jfieldID placeGiftAuctionBid::is_private_fieldID;

placeGiftAuctionBid::placeGiftAuctionBid()
  : gift_id_()
  , star_count_()
  , user_id_()
  , text_()
  , is_private_()
{}

placeGiftAuctionBid::placeGiftAuctionBid(int64 gift_id_, int53 star_count_, int53 user_id_, object_ptr<formattedText> &&text_, bool is_private_)
  : gift_id_(gift_id_)
  , star_count_(star_count_)
  , user_id_(user_id_)
  , text_(std::move(text_))
  , is_private_(is_private_)
{}

const std::int32_t placeGiftAuctionBid::ID;

object_ptr<placeGiftAuctionBid> placeGiftAuctionBid::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<placeGiftAuctionBid> res = make_object<placeGiftAuctionBid>();
  res->gift_id_ = env->GetLongField(p, res->gift_id_fieldID);
  res->star_count_ = env->GetLongField(p, res->star_count_fieldID);
  res->user_id_ = env->GetLongField(p, res->user_id_fieldID);
  res->text_ = jni::fetch_tl_object<formattedText>(env, jni::fetch_object(env, p, res->text_fieldID));
  res->is_private_ = (env->GetBooleanField(p, res->is_private_fieldID) != 0);
  return res;
}

void placeGiftAuctionBid::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "PlaceGiftAuctionBid");
    s.store_field("giftId", gift_id_);
    s.store_field("starCount", star_count_);
    s.store_field("userId", user_id_);
    s.store_object_field("text", static_cast<const BaseObject *>(text_.get()));
    s.store_field("isPrivate", is_private_);
    s.store_class_end();
  }
}

placeGiftAuctionBid::ReturnType placeGiftAuctionBid::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void placeGiftAuctionBid::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$PlaceGiftAuctionBid").c_str());
    gift_id_fieldID = jni::get_field_id(env, Class, "giftId", "J");
    star_count_fieldID = jni::get_field_id(env, Class, "starCount", "J");
    user_id_fieldID = jni::get_field_id(env, Class, "userId", "J");
    text_fieldID = jni::get_field_id(env, Class, "text", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$FormattedText;").c_str());
    is_private_fieldID = jni::get_field_id(env, Class, "isPrivate", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass processChatHasProtectedContentDisableRequest::Class;
jfieldID processChatHasProtectedContentDisableRequest::chat_id_fieldID;
jfieldID processChatHasProtectedContentDisableRequest::request_message_id_fieldID;
jfieldID processChatHasProtectedContentDisableRequest::approve_fieldID;

processChatHasProtectedContentDisableRequest::processChatHasProtectedContentDisableRequest()
  : chat_id_()
  , request_message_id_()
  , approve_()
{}

processChatHasProtectedContentDisableRequest::processChatHasProtectedContentDisableRequest(int53 chat_id_, int53 request_message_id_, bool approve_)
  : chat_id_(chat_id_)
  , request_message_id_(request_message_id_)
  , approve_(approve_)
{}

const std::int32_t processChatHasProtectedContentDisableRequest::ID;

object_ptr<processChatHasProtectedContentDisableRequest> processChatHasProtectedContentDisableRequest::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<processChatHasProtectedContentDisableRequest> res = make_object<processChatHasProtectedContentDisableRequest>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->request_message_id_ = env->GetLongField(p, res->request_message_id_fieldID);
  res->approve_ = (env->GetBooleanField(p, res->approve_fieldID) != 0);
  return res;
}

void processChatHasProtectedContentDisableRequest::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ProcessChatHasProtectedContentDisableRequest");
    s.store_field("chatId", chat_id_);
    s.store_field("requestMessageId", request_message_id_);
    s.store_field("approve", approve_);
    s.store_class_end();
  }
}

processChatHasProtectedContentDisableRequest::ReturnType processChatHasProtectedContentDisableRequest::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void processChatHasProtectedContentDisableRequest::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ProcessChatHasProtectedContentDisableRequest").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    request_message_id_fieldID = jni::get_field_id(env, Class, "requestMessageId", "J");
    approve_fieldID = jni::get_field_id(env, Class, "approve", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass readAllDirectMessagesChatTopicReactions::Class;
jfieldID readAllDirectMessagesChatTopicReactions::chat_id_fieldID;
jfieldID readAllDirectMessagesChatTopicReactions::topic_id_fieldID;

readAllDirectMessagesChatTopicReactions::readAllDirectMessagesChatTopicReactions()
  : chat_id_()
  , topic_id_()
{}

readAllDirectMessagesChatTopicReactions::readAllDirectMessagesChatTopicReactions(int53 chat_id_, int53 topic_id_)
  : chat_id_(chat_id_)
  , topic_id_(topic_id_)
{}

const std::int32_t readAllDirectMessagesChatTopicReactions::ID;

object_ptr<readAllDirectMessagesChatTopicReactions> readAllDirectMessagesChatTopicReactions::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<readAllDirectMessagesChatTopicReactions> res = make_object<readAllDirectMessagesChatTopicReactions>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->topic_id_ = env->GetLongField(p, res->topic_id_fieldID);
  return res;
}

void readAllDirectMessagesChatTopicReactions::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ReadAllDirectMessagesChatTopicReactions");
    s.store_field("chatId", chat_id_);
    s.store_field("topicId", topic_id_);
    s.store_class_end();
  }
}

readAllDirectMessagesChatTopicReactions::ReturnType readAllDirectMessagesChatTopicReactions::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void readAllDirectMessagesChatTopicReactions::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ReadAllDirectMessagesChatTopicReactions").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    topic_id_fieldID = jni::get_field_id(env, Class, "topicId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass registerDevice::Class;
jfieldID registerDevice::device_token_fieldID;
jfieldID registerDevice::other_user_ids_fieldID;

registerDevice::registerDevice()
  : device_token_()
  , other_user_ids_()
{}

registerDevice::registerDevice(object_ptr<DeviceToken> &&device_token_, array<int53> &&other_user_ids_)
  : device_token_(std::move(device_token_))
  , other_user_ids_(std::move(other_user_ids_))
{}

const std::int32_t registerDevice::ID;

object_ptr<registerDevice> registerDevice::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<registerDevice> res = make_object<registerDevice>();
  res->device_token_ = jni::fetch_tl_object<DeviceToken>(env, jni::fetch_object(env, p, res->device_token_fieldID));
  res->other_user_ids_ = jni::fetch_vector(env, (jlongArray)jni::fetch_object(env, p, res->other_user_ids_fieldID));
  return res;
}

void registerDevice::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "RegisterDevice");
    s.store_object_field("deviceToken", static_cast<const BaseObject *>(device_token_.get()));
    { s.store_vector_begin("otherUserIds", other_user_ids_.size()); for (const auto &_value : other_user_ids_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

registerDevice::ReturnType registerDevice::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return pushReceiverId::fetch(env, p);
}

void registerDevice::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$RegisterDevice").c_str());
    device_token_fieldID = jni::get_field_id(env, Class, "deviceToken", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$DeviceToken;").c_str());
    other_user_ids_fieldID = jni::get_field_id(env, Class, "otherUserIds", "[J");
    return true;
  }();
  (void)is_inited;
}

jclass removeAllFilesFromDownloads::Class;
jfieldID removeAllFilesFromDownloads::only_active_fieldID;
jfieldID removeAllFilesFromDownloads::only_completed_fieldID;
jfieldID removeAllFilesFromDownloads::delete_from_cache_fieldID;

removeAllFilesFromDownloads::removeAllFilesFromDownloads()
  : only_active_()
  , only_completed_()
  , delete_from_cache_()
{}

removeAllFilesFromDownloads::removeAllFilesFromDownloads(bool only_active_, bool only_completed_, bool delete_from_cache_)
  : only_active_(only_active_)
  , only_completed_(only_completed_)
  , delete_from_cache_(delete_from_cache_)
{}

const std::int32_t removeAllFilesFromDownloads::ID;

object_ptr<removeAllFilesFromDownloads> removeAllFilesFromDownloads::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<removeAllFilesFromDownloads> res = make_object<removeAllFilesFromDownloads>();
  res->only_active_ = (env->GetBooleanField(p, res->only_active_fieldID) != 0);
  res->only_completed_ = (env->GetBooleanField(p, res->only_completed_fieldID) != 0);
  res->delete_from_cache_ = (env->GetBooleanField(p, res->delete_from_cache_fieldID) != 0);
  return res;
}

void removeAllFilesFromDownloads::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "RemoveAllFilesFromDownloads");
    s.store_field("onlyActive", only_active_);
    s.store_field("onlyCompleted", only_completed_);
    s.store_field("deleteFromCache", delete_from_cache_);
    s.store_class_end();
  }
}

removeAllFilesFromDownloads::ReturnType removeAllFilesFromDownloads::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void removeAllFilesFromDownloads::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$RemoveAllFilesFromDownloads").c_str());
    only_active_fieldID = jni::get_field_id(env, Class, "onlyActive", "Z");
    only_completed_fieldID = jni::get_field_id(env, Class, "onlyCompleted", "Z");
    delete_from_cache_fieldID = jni::get_field_id(env, Class, "deleteFromCache", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass removeBusinessConnectedBotFromChat::Class;
jfieldID removeBusinessConnectedBotFromChat::chat_id_fieldID;

removeBusinessConnectedBotFromChat::removeBusinessConnectedBotFromChat()
  : chat_id_()
{}

removeBusinessConnectedBotFromChat::removeBusinessConnectedBotFromChat(int53 chat_id_)
  : chat_id_(chat_id_)
{}

const std::int32_t removeBusinessConnectedBotFromChat::ID;

object_ptr<removeBusinessConnectedBotFromChat> removeBusinessConnectedBotFromChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<removeBusinessConnectedBotFromChat> res = make_object<removeBusinessConnectedBotFromChat>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  return res;
}

void removeBusinessConnectedBotFromChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "RemoveBusinessConnectedBotFromChat");
    s.store_field("chatId", chat_id_);
    s.store_class_end();
  }
}

removeBusinessConnectedBotFromChat::ReturnType removeBusinessConnectedBotFromChat::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void removeBusinessConnectedBotFromChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$RemoveBusinessConnectedBotFromChat").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass removePendingPaidMessageReactions::Class;
jfieldID removePendingPaidMessageReactions::chat_id_fieldID;
jfieldID removePendingPaidMessageReactions::message_id_fieldID;

removePendingPaidMessageReactions::removePendingPaidMessageReactions()
  : chat_id_()
  , message_id_()
{}

removePendingPaidMessageReactions::removePendingPaidMessageReactions(int53 chat_id_, int53 message_id_)
  : chat_id_(chat_id_)
  , message_id_(message_id_)
{}

const std::int32_t removePendingPaidMessageReactions::ID;

object_ptr<removePendingPaidMessageReactions> removePendingPaidMessageReactions::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<removePendingPaidMessageReactions> res = make_object<removePendingPaidMessageReactions>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_id_ = env->GetLongField(p, res->message_id_fieldID);
  return res;
}

void removePendingPaidMessageReactions::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "RemovePendingPaidMessageReactions");
    s.store_field("chatId", chat_id_);
    s.store_field("messageId", message_id_);
    s.store_class_end();
  }
}

removePendingPaidMessageReactions::ReturnType removePendingPaidMessageReactions::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void removePendingPaidMessageReactions::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$RemovePendingPaidMessageReactions").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_id_fieldID = jni::get_field_id(env, Class, "messageId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass removeRecentlyFoundChat::Class;
jfieldID removeRecentlyFoundChat::chat_id_fieldID;

removeRecentlyFoundChat::removeRecentlyFoundChat()
  : chat_id_()
{}

removeRecentlyFoundChat::removeRecentlyFoundChat(int53 chat_id_)
  : chat_id_(chat_id_)
{}

const std::int32_t removeRecentlyFoundChat::ID;

object_ptr<removeRecentlyFoundChat> removeRecentlyFoundChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<removeRecentlyFoundChat> res = make_object<removeRecentlyFoundChat>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  return res;
}

void removeRecentlyFoundChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "RemoveRecentlyFoundChat");
    s.store_field("chatId", chat_id_);
    s.store_class_end();
  }
}

removeRecentlyFoundChat::ReturnType removeRecentlyFoundChat::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void removeRecentlyFoundChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$RemoveRecentlyFoundChat").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass removeTopChat::Class;
jfieldID removeTopChat::category_fieldID;
jfieldID removeTopChat::chat_id_fieldID;

removeTopChat::removeTopChat()
  : category_()
  , chat_id_()
{}

removeTopChat::removeTopChat(object_ptr<TopChatCategory> &&category_, int53 chat_id_)
  : category_(std::move(category_))
  , chat_id_(chat_id_)
{}

const std::int32_t removeTopChat::ID;

object_ptr<removeTopChat> removeTopChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<removeTopChat> res = make_object<removeTopChat>();
  res->category_ = jni::fetch_tl_object<TopChatCategory>(env, jni::fetch_object(env, p, res->category_fieldID));
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  return res;
}

void removeTopChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "RemoveTopChat");
    s.store_object_field("category", static_cast<const BaseObject *>(category_.get()));
    s.store_field("chatId", chat_id_);
    s.store_class_end();
  }
}

removeTopChat::ReturnType removeTopChat::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void removeTopChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$RemoveTopChat").c_str());
    category_fieldID = jni::get_field_id(env, Class, "category", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$TopChatCategory;").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass reorderGiftCollections::Class;
jfieldID reorderGiftCollections::owner_id_fieldID;
jfieldID reorderGiftCollections::collection_ids_fieldID;

reorderGiftCollections::reorderGiftCollections()
  : owner_id_()
  , collection_ids_()
{}

reorderGiftCollections::reorderGiftCollections(object_ptr<MessageSender> &&owner_id_, array<int32> &&collection_ids_)
  : owner_id_(std::move(owner_id_))
  , collection_ids_(std::move(collection_ids_))
{}

const std::int32_t reorderGiftCollections::ID;

object_ptr<reorderGiftCollections> reorderGiftCollections::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<reorderGiftCollections> res = make_object<reorderGiftCollections>();
  res->owner_id_ = jni::fetch_tl_object<MessageSender>(env, jni::fetch_object(env, p, res->owner_id_fieldID));
  res->collection_ids_ = jni::fetch_vector(env, (jintArray)jni::fetch_object(env, p, res->collection_ids_fieldID));
  return res;
}

void reorderGiftCollections::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ReorderGiftCollections");
    s.store_object_field("ownerId", static_cast<const BaseObject *>(owner_id_.get()));
    { s.store_vector_begin("collectionIds", collection_ids_.size()); for (const auto &_value : collection_ids_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

reorderGiftCollections::ReturnType reorderGiftCollections::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void reorderGiftCollections::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ReorderGiftCollections").c_str());
    owner_id_fieldID = jni::get_field_id(env, Class, "ownerId", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$MessageSender;").c_str());
    collection_ids_fieldID = jni::get_field_id(env, Class, "collectionIds", "[I");
    return true;
  }();
  (void)is_inited;
}

jclass reportAuthenticationCodeMissing::Class;
jfieldID reportAuthenticationCodeMissing::mobile_network_code_fieldID;

reportAuthenticationCodeMissing::reportAuthenticationCodeMissing()
  : mobile_network_code_()
{}

reportAuthenticationCodeMissing::reportAuthenticationCodeMissing(string const &mobile_network_code_)
  : mobile_network_code_(mobile_network_code_)
{}

const std::int32_t reportAuthenticationCodeMissing::ID;

object_ptr<reportAuthenticationCodeMissing> reportAuthenticationCodeMissing::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<reportAuthenticationCodeMissing> res = make_object<reportAuthenticationCodeMissing>();
  res->mobile_network_code_ = jni::fetch_string(env, p, res->mobile_network_code_fieldID);
  return res;
}

void reportAuthenticationCodeMissing::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ReportAuthenticationCodeMissing");
    s.store_field("mobileNetworkCode", mobile_network_code_);
    s.store_class_end();
  }
}

reportAuthenticationCodeMissing::ReturnType reportAuthenticationCodeMissing::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void reportAuthenticationCodeMissing::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ReportAuthenticationCodeMissing").c_str());
    mobile_network_code_fieldID = jni::get_field_id(env, Class, "mobileNetworkCode", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass reportSponsoredChat::Class;
jfieldID reportSponsoredChat::sponsored_chat_unique_id_fieldID;
jfieldID reportSponsoredChat::option_id_fieldID;

reportSponsoredChat::reportSponsoredChat()
  : sponsored_chat_unique_id_()
  , option_id_()
{}

reportSponsoredChat::reportSponsoredChat(int53 sponsored_chat_unique_id_, bytes const &option_id_)
  : sponsored_chat_unique_id_(sponsored_chat_unique_id_)
  , option_id_(std::move(option_id_))
{}

const std::int32_t reportSponsoredChat::ID;

object_ptr<reportSponsoredChat> reportSponsoredChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<reportSponsoredChat> res = make_object<reportSponsoredChat>();
  res->sponsored_chat_unique_id_ = env->GetLongField(p, res->sponsored_chat_unique_id_fieldID);
  res->option_id_ = jni::from_bytes(env, (jbyteArray)jni::fetch_object(env, p, res->option_id_fieldID));
  return res;
}

void reportSponsoredChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ReportSponsoredChat");
    s.store_field("sponsoredChatUniqueId", sponsored_chat_unique_id_);
    s.store_bytes_field("optionId", option_id_);
    s.store_class_end();
  }
}

reportSponsoredChat::ReturnType reportSponsoredChat::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ReportSponsoredResult::fetch(env, p);
}

void reportSponsoredChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ReportSponsoredChat").c_str());
    sponsored_chat_unique_id_fieldID = jni::get_field_id(env, Class, "sponsoredChatUniqueId", "J");
    option_id_fieldID = jni::get_field_id(env, Class, "optionId", "[B");
    return true;
  }();
  (void)is_inited;
}

jclass resendPhoneNumberCode::Class;
jfieldID resendPhoneNumberCode::reason_fieldID;

resendPhoneNumberCode::resendPhoneNumberCode()
  : reason_()
{}

resendPhoneNumberCode::resendPhoneNumberCode(object_ptr<ResendCodeReason> &&reason_)
  : reason_(std::move(reason_))
{}

const std::int32_t resendPhoneNumberCode::ID;

object_ptr<resendPhoneNumberCode> resendPhoneNumberCode::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<resendPhoneNumberCode> res = make_object<resendPhoneNumberCode>();
  res->reason_ = jni::fetch_tl_object<ResendCodeReason>(env, jni::fetch_object(env, p, res->reason_fieldID));
  return res;
}

void resendPhoneNumberCode::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ResendPhoneNumberCode");
    s.store_object_field("reason", static_cast<const BaseObject *>(reason_.get()));
    s.store_class_end();
  }
}

resendPhoneNumberCode::ReturnType resendPhoneNumberCode::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return authenticationCodeInfo::fetch(env, p);
}

void resendPhoneNumberCode::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ResendPhoneNumberCode").c_str());
    reason_fieldID = jni::get_field_id(env, Class, "reason", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ResendCodeReason;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass resetAuthenticationEmailAddress::Class;

resetAuthenticationEmailAddress::resetAuthenticationEmailAddress() {
}

const std::int32_t resetAuthenticationEmailAddress::ID;

object_ptr<resetAuthenticationEmailAddress> resetAuthenticationEmailAddress::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<resetAuthenticationEmailAddress>();
}

void resetAuthenticationEmailAddress::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ResetAuthenticationEmailAddress");
    s.store_class_end();
  }
}

resetAuthenticationEmailAddress::ReturnType resetAuthenticationEmailAddress::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void resetAuthenticationEmailAddress::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ResetAuthenticationEmailAddress").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass revokeGroupCallInviteLink::Class;
jfieldID revokeGroupCallInviteLink::group_call_id_fieldID;

revokeGroupCallInviteLink::revokeGroupCallInviteLink()
  : group_call_id_()
{}

revokeGroupCallInviteLink::revokeGroupCallInviteLink(int32 group_call_id_)
  : group_call_id_(group_call_id_)
{}

const std::int32_t revokeGroupCallInviteLink::ID;

object_ptr<revokeGroupCallInviteLink> revokeGroupCallInviteLink::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<revokeGroupCallInviteLink> res = make_object<revokeGroupCallInviteLink>();
  res->group_call_id_ = env->GetIntField(p, res->group_call_id_fieldID);
  return res;
}

void revokeGroupCallInviteLink::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "RevokeGroupCallInviteLink");
    s.store_field("groupCallId", group_call_id_);
    s.store_class_end();
  }
}

revokeGroupCallInviteLink::ReturnType revokeGroupCallInviteLink::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void revokeGroupCallInviteLink::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$RevokeGroupCallInviteLink").c_str());
    group_call_id_fieldID = jni::get_field_id(env, Class, "groupCallId", "I");
    return true;
  }();
  (void)is_inited;
}

jclass saveApplicationLogEvent::Class;
jfieldID saveApplicationLogEvent::type_fieldID;
jfieldID saveApplicationLogEvent::chat_id_fieldID;
jfieldID saveApplicationLogEvent::data_fieldID;

saveApplicationLogEvent::saveApplicationLogEvent()
  : type_()
  , chat_id_()
  , data_()
{}

saveApplicationLogEvent::saveApplicationLogEvent(string const &type_, int53 chat_id_, object_ptr<JsonValue> &&data_)
  : type_(type_)
  , chat_id_(chat_id_)
  , data_(std::move(data_))
{}

const std::int32_t saveApplicationLogEvent::ID;

object_ptr<saveApplicationLogEvent> saveApplicationLogEvent::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<saveApplicationLogEvent> res = make_object<saveApplicationLogEvent>();
  res->type_ = jni::fetch_string(env, p, res->type_fieldID);
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->data_ = jni::fetch_tl_object<JsonValue>(env, jni::fetch_object(env, p, res->data_fieldID));
  return res;
}

void saveApplicationLogEvent::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SaveApplicationLogEvent");
    s.store_field("type", type_);
    s.store_field("chatId", chat_id_);
    s.store_object_field("data", static_cast<const BaseObject *>(data_.get()));
    s.store_class_end();
  }
}

saveApplicationLogEvent::ReturnType saveApplicationLogEvent::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void saveApplicationLogEvent::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SaveApplicationLogEvent").c_str());
    type_fieldID = jni::get_field_id(env, Class, "type", "Ljava/lang/String;");
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    data_fieldID = jni::get_field_id(env, Class, "data", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$JsonValue;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass searchHashtags::Class;
jfieldID searchHashtags::prefix_fieldID;
jfieldID searchHashtags::limit_fieldID;

searchHashtags::searchHashtags()
  : prefix_()
  , limit_()
{}

searchHashtags::searchHashtags(string const &prefix_, int32 limit_)
  : prefix_(prefix_)
  , limit_(limit_)
{}

const std::int32_t searchHashtags::ID;

object_ptr<searchHashtags> searchHashtags::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<searchHashtags> res = make_object<searchHashtags>();
  res->prefix_ = jni::fetch_string(env, p, res->prefix_fieldID);
  res->limit_ = env->GetIntField(p, res->limit_fieldID);
  return res;
}

void searchHashtags::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SearchHashtags");
    s.store_field("prefix", prefix_);
    s.store_field("limit", limit_);
    s.store_class_end();
  }
}

searchHashtags::ReturnType searchHashtags::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return hashtags::fetch(env, p);
}

void searchHashtags::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SearchHashtags").c_str());
    prefix_fieldID = jni::get_field_id(env, Class, "prefix", "Ljava/lang/String;");
    limit_fieldID = jni::get_field_id(env, Class, "limit", "I");
    return true;
  }();
  (void)is_inited;
}

jclass searchPublicChat::Class;
jfieldID searchPublicChat::username_fieldID;

searchPublicChat::searchPublicChat()
  : username_()
{}

searchPublicChat::searchPublicChat(string const &username_)
  : username_(username_)
{}

const std::int32_t searchPublicChat::ID;

object_ptr<searchPublicChat> searchPublicChat::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<searchPublicChat> res = make_object<searchPublicChat>();
  res->username_ = jni::fetch_string(env, p, res->username_fieldID);
  return res;
}

void searchPublicChat::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SearchPublicChat");
    s.store_field("username", username_);
    s.store_class_end();
  }
}

searchPublicChat::ReturnType searchPublicChat::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return chat::fetch(env, p);
}

void searchPublicChat::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SearchPublicChat").c_str());
    username_fieldID = jni::get_field_id(env, Class, "username", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass searchUserByPhoneNumber::Class;
jfieldID searchUserByPhoneNumber::phone_number_fieldID;
jfieldID searchUserByPhoneNumber::only_local_fieldID;

searchUserByPhoneNumber::searchUserByPhoneNumber()
  : phone_number_()
  , only_local_()
{}

searchUserByPhoneNumber::searchUserByPhoneNumber(string const &phone_number_, bool only_local_)
  : phone_number_(phone_number_)
  , only_local_(only_local_)
{}

const std::int32_t searchUserByPhoneNumber::ID;

object_ptr<searchUserByPhoneNumber> searchUserByPhoneNumber::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<searchUserByPhoneNumber> res = make_object<searchUserByPhoneNumber>();
  res->phone_number_ = jni::fetch_string(env, p, res->phone_number_fieldID);
  res->only_local_ = (env->GetBooleanField(p, res->only_local_fieldID) != 0);
  return res;
}

void searchUserByPhoneNumber::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SearchUserByPhoneNumber");
    s.store_field("phoneNumber", phone_number_);
    s.store_field("onlyLocal", only_local_);
    s.store_class_end();
  }
}

searchUserByPhoneNumber::ReturnType searchUserByPhoneNumber::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return user::fetch(env, p);
}

void searchUserByPhoneNumber::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SearchUserByPhoneNumber").c_str());
    phone_number_fieldID = jni::get_field_id(env, Class, "phoneNumber", "Ljava/lang/String;");
    only_local_fieldID = jni::get_field_id(env, Class, "onlyLocal", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass sellGift::Class;
jfieldID sellGift::business_connection_id_fieldID;
jfieldID sellGift::received_gift_id_fieldID;

sellGift::sellGift()
  : business_connection_id_()
  , received_gift_id_()
{}

sellGift::sellGift(string const &business_connection_id_, string const &received_gift_id_)
  : business_connection_id_(business_connection_id_)
  , received_gift_id_(received_gift_id_)
{}

const std::int32_t sellGift::ID;

object_ptr<sellGift> sellGift::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<sellGift> res = make_object<sellGift>();
  res->business_connection_id_ = jni::fetch_string(env, p, res->business_connection_id_fieldID);
  res->received_gift_id_ = jni::fetch_string(env, p, res->received_gift_id_fieldID);
  return res;
}

void sellGift::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SellGift");
    s.store_field("businessConnectionId", business_connection_id_);
    s.store_field("receivedGiftId", received_gift_id_);
    s.store_class_end();
  }
}

sellGift::ReturnType sellGift::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void sellGift::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SellGift").c_str());
    business_connection_id_fieldID = jni::get_field_id(env, Class, "businessConnectionId", "Ljava/lang/String;");
    received_gift_id_fieldID = jni::get_field_id(env, Class, "receivedGiftId", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass setAccountTtl::Class;
jfieldID setAccountTtl::ttl_fieldID;

setAccountTtl::setAccountTtl()
  : ttl_()
{}

setAccountTtl::setAccountTtl(object_ptr<accountTtl> &&ttl_)
  : ttl_(std::move(ttl_))
{}

const std::int32_t setAccountTtl::ID;

object_ptr<setAccountTtl> setAccountTtl::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<setAccountTtl> res = make_object<setAccountTtl>();
  res->ttl_ = jni::fetch_tl_object<accountTtl>(env, jni::fetch_object(env, p, res->ttl_fieldID));
  return res;
}

void setAccountTtl::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SetAccountTtl");
    s.store_object_field("ttl", static_cast<const BaseObject *>(ttl_.get()));
    s.store_class_end();
  }
}

setAccountTtl::ReturnType setAccountTtl::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void setAccountTtl::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SetAccountTtl").c_str());
    ttl_fieldID = jni::get_field_id(env, Class, "ttl", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$AccountTtl;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass setChatSlowModeDelay::Class;
jfieldID setChatSlowModeDelay::chat_id_fieldID;
jfieldID setChatSlowModeDelay::slow_mode_delay_fieldID;

setChatSlowModeDelay::setChatSlowModeDelay()
  : chat_id_()
  , slow_mode_delay_()
{}

setChatSlowModeDelay::setChatSlowModeDelay(int53 chat_id_, int32 slow_mode_delay_)
  : chat_id_(chat_id_)
  , slow_mode_delay_(slow_mode_delay_)
{}

const std::int32_t setChatSlowModeDelay::ID;

object_ptr<setChatSlowModeDelay> setChatSlowModeDelay::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<setChatSlowModeDelay> res = make_object<setChatSlowModeDelay>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->slow_mode_delay_ = env->GetIntField(p, res->slow_mode_delay_fieldID);
  return res;
}

void setChatSlowModeDelay::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SetChatSlowModeDelay");
    s.store_field("chatId", chat_id_);
    s.store_field("slowModeDelay", slow_mode_delay_);
    s.store_class_end();
  }
}

setChatSlowModeDelay::ReturnType setChatSlowModeDelay::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void setChatSlowModeDelay::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SetChatSlowModeDelay").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    slow_mode_delay_fieldID = jni::get_field_id(env, Class, "slowModeDelay", "I");
    return true;
  }();
  (void)is_inited;
}

jclass setCloseFriends::Class;
jfieldID setCloseFriends::user_ids_fieldID;

setCloseFriends::setCloseFriends()
  : user_ids_()
{}

setCloseFriends::setCloseFriends(array<int53> &&user_ids_)
  : user_ids_(std::move(user_ids_))
{}

const std::int32_t setCloseFriends::ID;

object_ptr<setCloseFriends> setCloseFriends::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<setCloseFriends> res = make_object<setCloseFriends>();
  res->user_ids_ = jni::fetch_vector(env, (jlongArray)jni::fetch_object(env, p, res->user_ids_fieldID));
  return res;
}

void setCloseFriends::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SetCloseFriends");
    { s.store_vector_begin("userIds", user_ids_.size()); for (const auto &_value : user_ids_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

setCloseFriends::ReturnType setCloseFriends::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void setCloseFriends::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SetCloseFriends").c_str());
    user_ids_fieldID = jni::get_field_id(env, Class, "userIds", "[J");
    return true;
  }();
  (void)is_inited;
}

jclass setGroupCallParticipantIsSpeaking::Class;
jfieldID setGroupCallParticipantIsSpeaking::group_call_id_fieldID;
jfieldID setGroupCallParticipantIsSpeaking::audio_source_fieldID;
jfieldID setGroupCallParticipantIsSpeaking::is_speaking_fieldID;

setGroupCallParticipantIsSpeaking::setGroupCallParticipantIsSpeaking()
  : group_call_id_()
  , audio_source_()
  , is_speaking_()
{}

setGroupCallParticipantIsSpeaking::setGroupCallParticipantIsSpeaking(int32 group_call_id_, int32 audio_source_, bool is_speaking_)
  : group_call_id_(group_call_id_)
  , audio_source_(audio_source_)
  , is_speaking_(is_speaking_)
{}

const std::int32_t setGroupCallParticipantIsSpeaking::ID;

object_ptr<setGroupCallParticipantIsSpeaking> setGroupCallParticipantIsSpeaking::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<setGroupCallParticipantIsSpeaking> res = make_object<setGroupCallParticipantIsSpeaking>();
  res->group_call_id_ = env->GetIntField(p, res->group_call_id_fieldID);
  res->audio_source_ = env->GetIntField(p, res->audio_source_fieldID);
  res->is_speaking_ = (env->GetBooleanField(p, res->is_speaking_fieldID) != 0);
  return res;
}

void setGroupCallParticipantIsSpeaking::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SetGroupCallParticipantIsSpeaking");
    s.store_field("groupCallId", group_call_id_);
    s.store_field("audioSource", audio_source_);
    s.store_field("isSpeaking", is_speaking_);
    s.store_class_end();
  }
}

setGroupCallParticipantIsSpeaking::ReturnType setGroupCallParticipantIsSpeaking::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return MessageSender::fetch(env, p);
}

void setGroupCallParticipantIsSpeaking::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SetGroupCallParticipantIsSpeaking").c_str());
    group_call_id_fieldID = jni::get_field_id(env, Class, "groupCallId", "I");
    audio_source_fieldID = jni::get_field_id(env, Class, "audioSource", "I");
    is_speaking_fieldID = jni::get_field_id(env, Class, "isSpeaking", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass setNetworkType::Class;
jfieldID setNetworkType::type_fieldID;

setNetworkType::setNetworkType()
  : type_()
{}

setNetworkType::setNetworkType(object_ptr<NetworkType> &&type_)
  : type_(std::move(type_))
{}

const std::int32_t setNetworkType::ID;

object_ptr<setNetworkType> setNetworkType::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<setNetworkType> res = make_object<setNetworkType>();
  res->type_ = jni::fetch_tl_object<NetworkType>(env, jni::fetch_object(env, p, res->type_fieldID));
  return res;
}

void setNetworkType::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SetNetworkType");
    s.store_object_field("type", static_cast<const BaseObject *>(type_.get()));
    s.store_class_end();
  }
}

setNetworkType::ReturnType setNetworkType::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void setNetworkType::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SetNetworkType").c_str());
    type_fieldID = jni::get_field_id(env, Class, "type", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$NetworkType;").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass setPinnedGifts::Class;
jfieldID setPinnedGifts::owner_id_fieldID;
jfieldID setPinnedGifts::received_gift_ids_fieldID;

setPinnedGifts::setPinnedGifts()
  : owner_id_()
  , received_gift_ids_()
{}

setPinnedGifts::setPinnedGifts(object_ptr<MessageSender> &&owner_id_, array<string> &&received_gift_ids_)
  : owner_id_(std::move(owner_id_))
  , received_gift_ids_(std::move(received_gift_ids_))
{}

const std::int32_t setPinnedGifts::ID;

object_ptr<setPinnedGifts> setPinnedGifts::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<setPinnedGifts> res = make_object<setPinnedGifts>();
  res->owner_id_ = jni::fetch_tl_object<MessageSender>(env, jni::fetch_object(env, p, res->owner_id_fieldID));
  res->received_gift_ids_ = jni::FetchVector<string>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->received_gift_ids_fieldID));
  return res;
}

void setPinnedGifts::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SetPinnedGifts");
    s.store_object_field("ownerId", static_cast<const BaseObject *>(owner_id_.get()));
    { s.store_vector_begin("receivedGiftIds", received_gift_ids_.size()); for (const auto &_value : received_gift_ids_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

setPinnedGifts::ReturnType setPinnedGifts::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void setPinnedGifts::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SetPinnedGifts").c_str());
    owner_id_fieldID = jni::get_field_id(env, Class, "ownerId", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$MessageSender;").c_str());
    received_gift_ids_fieldID = jni::get_field_id(env, Class, "receivedGiftIds", "[Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass setStickerKeywords::Class;
jfieldID setStickerKeywords::sticker_fieldID;
jfieldID setStickerKeywords::keywords_fieldID;

setStickerKeywords::setStickerKeywords()
  : sticker_()
  , keywords_()
{}

setStickerKeywords::setStickerKeywords(object_ptr<InputFile> &&sticker_, array<string> &&keywords_)
  : sticker_(std::move(sticker_))
  , keywords_(std::move(keywords_))
{}

const std::int32_t setStickerKeywords::ID;

object_ptr<setStickerKeywords> setStickerKeywords::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<setStickerKeywords> res = make_object<setStickerKeywords>();
  res->sticker_ = jni::fetch_tl_object<InputFile>(env, jni::fetch_object(env, p, res->sticker_fieldID));
  res->keywords_ = jni::FetchVector<string>::fetch(env, (jobjectArray)jni::fetch_object(env, p, res->keywords_fieldID));
  return res;
}

void setStickerKeywords::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SetStickerKeywords");
    s.store_object_field("sticker", static_cast<const BaseObject *>(sticker_.get()));
    { s.store_vector_begin("keywords", keywords_.size()); for (const auto &_value : keywords_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_class_end();
  }
}

setStickerKeywords::ReturnType setStickerKeywords::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void setStickerKeywords::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SetStickerKeywords").c_str());
    sticker_fieldID = jni::get_field_id(env, Class, "sticker", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$InputFile;").c_str());
    keywords_fieldID = jni::get_field_id(env, Class, "keywords", "[Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass setStoryReaction::Class;
jfieldID setStoryReaction::story_poster_chat_id_fieldID;
jfieldID setStoryReaction::story_id_fieldID;
jfieldID setStoryReaction::reaction_type_fieldID;
jfieldID setStoryReaction::update_recent_reactions_fieldID;

setStoryReaction::setStoryReaction()
  : story_poster_chat_id_()
  , story_id_()
  , reaction_type_()
  , update_recent_reactions_()
{}

setStoryReaction::setStoryReaction(int53 story_poster_chat_id_, int32 story_id_, object_ptr<ReactionType> &&reaction_type_, bool update_recent_reactions_)
  : story_poster_chat_id_(story_poster_chat_id_)
  , story_id_(story_id_)
  , reaction_type_(std::move(reaction_type_))
  , update_recent_reactions_(update_recent_reactions_)
{}

const std::int32_t setStoryReaction::ID;

object_ptr<setStoryReaction> setStoryReaction::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<setStoryReaction> res = make_object<setStoryReaction>();
  res->story_poster_chat_id_ = env->GetLongField(p, res->story_poster_chat_id_fieldID);
  res->story_id_ = env->GetIntField(p, res->story_id_fieldID);
  res->reaction_type_ = jni::fetch_tl_object<ReactionType>(env, jni::fetch_object(env, p, res->reaction_type_fieldID));
  res->update_recent_reactions_ = (env->GetBooleanField(p, res->update_recent_reactions_fieldID) != 0);
  return res;
}

void setStoryReaction::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SetStoryReaction");
    s.store_field("storyPosterChatId", story_poster_chat_id_);
    s.store_field("storyId", story_id_);
    s.store_object_field("reactionType", static_cast<const BaseObject *>(reaction_type_.get()));
    s.store_field("updateRecentReactions", update_recent_reactions_);
    s.store_class_end();
  }
}

setStoryReaction::ReturnType setStoryReaction::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void setStoryReaction::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SetStoryReaction").c_str());
    story_poster_chat_id_fieldID = jni::get_field_id(env, Class, "storyPosterChatId", "J");
    story_id_fieldID = jni::get_field_id(env, Class, "storyId", "I");
    reaction_type_fieldID = jni::get_field_id(env, Class, "reactionType", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$ReactionType;").c_str());
    update_recent_reactions_fieldID = jni::get_field_id(env, Class, "updateRecentReactions", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass setSupergroupUsername::Class;
jfieldID setSupergroupUsername::supergroup_id_fieldID;
jfieldID setSupergroupUsername::username_fieldID;

setSupergroupUsername::setSupergroupUsername()
  : supergroup_id_()
  , username_()
{}

setSupergroupUsername::setSupergroupUsername(int53 supergroup_id_, string const &username_)
  : supergroup_id_(supergroup_id_)
  , username_(username_)
{}

const std::int32_t setSupergroupUsername::ID;

object_ptr<setSupergroupUsername> setSupergroupUsername::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<setSupergroupUsername> res = make_object<setSupergroupUsername>();
  res->supergroup_id_ = env->GetLongField(p, res->supergroup_id_fieldID);
  res->username_ = jni::fetch_string(env, p, res->username_fieldID);
  return res;
}

void setSupergroupUsername::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SetSupergroupUsername");
    s.store_field("supergroupId", supergroup_id_);
    s.store_field("username", username_);
    s.store_class_end();
  }
}

setSupergroupUsername::ReturnType setSupergroupUsername::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void setSupergroupUsername::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SetSupergroupUsername").c_str());
    supergroup_id_fieldID = jni::get_field_id(env, Class, "supergroupId", "J");
    username_fieldID = jni::get_field_id(env, Class, "username", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass setTdlibParameters::Class;
jfieldID setTdlibParameters::use_test_dc_fieldID;
jfieldID setTdlibParameters::database_directory_fieldID;
jfieldID setTdlibParameters::files_directory_fieldID;
jfieldID setTdlibParameters::database_encryption_key_fieldID;
jfieldID setTdlibParameters::use_file_database_fieldID;
jfieldID setTdlibParameters::use_chat_info_database_fieldID;
jfieldID setTdlibParameters::use_message_database_fieldID;
jfieldID setTdlibParameters::use_secret_chats_fieldID;
jfieldID setTdlibParameters::api_id_fieldID;
jfieldID setTdlibParameters::api_hash_fieldID;
jfieldID setTdlibParameters::system_language_code_fieldID;
jfieldID setTdlibParameters::device_model_fieldID;
jfieldID setTdlibParameters::system_version_fieldID;
jfieldID setTdlibParameters::application_version_fieldID;

setTdlibParameters::setTdlibParameters()
  : use_test_dc_()
  , database_directory_()
  , files_directory_()
  , database_encryption_key_()
  , use_file_database_()
  , use_chat_info_database_()
  , use_message_database_()
  , use_secret_chats_()
  , api_id_()
  , api_hash_()
  , system_language_code_()
  , device_model_()
  , system_version_()
  , application_version_()
{}

setTdlibParameters::setTdlibParameters(bool use_test_dc_, string const &database_directory_, string const &files_directory_, bytes const &database_encryption_key_, bool use_file_database_, bool use_chat_info_database_, bool use_message_database_, bool use_secret_chats_, int32 api_id_, string const &api_hash_, string const &system_language_code_, string const &device_model_, string const &system_version_, string const &application_version_)
  : use_test_dc_(use_test_dc_)
  , database_directory_(database_directory_)
  , files_directory_(files_directory_)
  , database_encryption_key_(std::move(database_encryption_key_))
  , use_file_database_(use_file_database_)
  , use_chat_info_database_(use_chat_info_database_)
  , use_message_database_(use_message_database_)
  , use_secret_chats_(use_secret_chats_)
  , api_id_(api_id_)
  , api_hash_(api_hash_)
  , system_language_code_(system_language_code_)
  , device_model_(device_model_)
  , system_version_(system_version_)
  , application_version_(application_version_)
{}

const std::int32_t setTdlibParameters::ID;

object_ptr<setTdlibParameters> setTdlibParameters::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<setTdlibParameters> res = make_object<setTdlibParameters>();
  res->use_test_dc_ = (env->GetBooleanField(p, res->use_test_dc_fieldID) != 0);
  res->database_directory_ = jni::fetch_string(env, p, res->database_directory_fieldID);
  res->files_directory_ = jni::fetch_string(env, p, res->files_directory_fieldID);
  res->database_encryption_key_ = jni::from_bytes(env, (jbyteArray)jni::fetch_object(env, p, res->database_encryption_key_fieldID));
  res->use_file_database_ = (env->GetBooleanField(p, res->use_file_database_fieldID) != 0);
  res->use_chat_info_database_ = (env->GetBooleanField(p, res->use_chat_info_database_fieldID) != 0);
  res->use_message_database_ = (env->GetBooleanField(p, res->use_message_database_fieldID) != 0);
  res->use_secret_chats_ = (env->GetBooleanField(p, res->use_secret_chats_fieldID) != 0);
  res->api_id_ = env->GetIntField(p, res->api_id_fieldID);
  res->api_hash_ = jni::fetch_string(env, p, res->api_hash_fieldID);
  res->system_language_code_ = jni::fetch_string(env, p, res->system_language_code_fieldID);
  res->device_model_ = jni::fetch_string(env, p, res->device_model_fieldID);
  res->system_version_ = jni::fetch_string(env, p, res->system_version_fieldID);
  res->application_version_ = jni::fetch_string(env, p, res->application_version_fieldID);
  return res;
}

void setTdlibParameters::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "SetTdlibParameters");
    s.store_field("useTestDc", use_test_dc_);
    s.store_field("databaseDirectory", database_directory_);
    s.store_field("filesDirectory", files_directory_);
    s.store_bytes_field("databaseEncryptionKey", database_encryption_key_);
    s.store_field("useFileDatabase", use_file_database_);
    s.store_field("useChatInfoDatabase", use_chat_info_database_);
    s.store_field("useMessageDatabase", use_message_database_);
    s.store_field("useSecretChats", use_secret_chats_);
    s.store_field("apiId", api_id_);
    s.store_field("apiHash", api_hash_);
    s.store_field("systemLanguageCode", system_language_code_);
    s.store_field("deviceModel", device_model_);
    s.store_field("systemVersion", system_version_);
    s.store_field("applicationVersion", application_version_);
    s.store_class_end();
  }
}

setTdlibParameters::ReturnType setTdlibParameters::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void setTdlibParameters::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$SetTdlibParameters").c_str());
    use_test_dc_fieldID = jni::get_field_id(env, Class, "useTestDc", "Z");
    database_directory_fieldID = jni::get_field_id(env, Class, "databaseDirectory", "Ljava/lang/String;");
    files_directory_fieldID = jni::get_field_id(env, Class, "filesDirectory", "Ljava/lang/String;");
    database_encryption_key_fieldID = jni::get_field_id(env, Class, "databaseEncryptionKey", "[B");
    use_file_database_fieldID = jni::get_field_id(env, Class, "useFileDatabase", "Z");
    use_chat_info_database_fieldID = jni::get_field_id(env, Class, "useChatInfoDatabase", "Z");
    use_message_database_fieldID = jni::get_field_id(env, Class, "useMessageDatabase", "Z");
    use_secret_chats_fieldID = jni::get_field_id(env, Class, "useSecretChats", "Z");
    api_id_fieldID = jni::get_field_id(env, Class, "apiId", "I");
    api_hash_fieldID = jni::get_field_id(env, Class, "apiHash", "Ljava/lang/String;");
    system_language_code_fieldID = jni::get_field_id(env, Class, "systemLanguageCode", "Ljava/lang/String;");
    device_model_fieldID = jni::get_field_id(env, Class, "deviceModel", "Ljava/lang/String;");
    system_version_fieldID = jni::get_field_id(env, Class, "systemVersion", "Ljava/lang/String;");
    application_version_fieldID = jni::get_field_id(env, Class, "applicationVersion", "Ljava/lang/String;");
    return true;
  }();
  (void)is_inited;
}

jclass terminateSession::Class;
jfieldID terminateSession::session_id_fieldID;

terminateSession::terminateSession()
  : session_id_()
{}

terminateSession::terminateSession(int64 session_id_)
  : session_id_(session_id_)
{}

const std::int32_t terminateSession::ID;

object_ptr<terminateSession> terminateSession::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<terminateSession> res = make_object<terminateSession>();
  res->session_id_ = env->GetLongField(p, res->session_id_fieldID);
  return res;
}

void terminateSession::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "TerminateSession");
    s.store_field("sessionId", session_id_);
    s.store_class_end();
  }
}

terminateSession::ReturnType terminateSession::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void terminateSession::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$TerminateSession").c_str());
    session_id_fieldID = jni::get_field_id(env, Class, "sessionId", "J");
    return true;
  }();
  (void)is_inited;
}

jclass testNetwork::Class;

testNetwork::testNetwork() {
}

const std::int32_t testNetwork::ID;

object_ptr<testNetwork> testNetwork::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  return make_object<testNetwork>();
}

void testNetwork::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "TestNetwork");
    s.store_class_end();
  }
}

testNetwork::ReturnType testNetwork::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void testNetwork::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$TestNetwork").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass toggleForumTopicIsPinned::Class;
jfieldID toggleForumTopicIsPinned::chat_id_fieldID;
jfieldID toggleForumTopicIsPinned::forum_topic_id_fieldID;
jfieldID toggleForumTopicIsPinned::is_pinned_fieldID;

toggleForumTopicIsPinned::toggleForumTopicIsPinned()
  : chat_id_()
  , forum_topic_id_()
  , is_pinned_()
{}

toggleForumTopicIsPinned::toggleForumTopicIsPinned(int53 chat_id_, int32 forum_topic_id_, bool is_pinned_)
  : chat_id_(chat_id_)
  , forum_topic_id_(forum_topic_id_)
  , is_pinned_(is_pinned_)
{}

const std::int32_t toggleForumTopicIsPinned::ID;

object_ptr<toggleForumTopicIsPinned> toggleForumTopicIsPinned::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<toggleForumTopicIsPinned> res = make_object<toggleForumTopicIsPinned>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->forum_topic_id_ = env->GetIntField(p, res->forum_topic_id_fieldID);
  res->is_pinned_ = (env->GetBooleanField(p, res->is_pinned_fieldID) != 0);
  return res;
}

void toggleForumTopicIsPinned::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ToggleForumTopicIsPinned");
    s.store_field("chatId", chat_id_);
    s.store_field("forumTopicId", forum_topic_id_);
    s.store_field("isPinned", is_pinned_);
    s.store_class_end();
  }
}

toggleForumTopicIsPinned::ReturnType toggleForumTopicIsPinned::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void toggleForumTopicIsPinned::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ToggleForumTopicIsPinned").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    forum_topic_id_fieldID = jni::get_field_id(env, Class, "forumTopicId", "I");
    is_pinned_fieldID = jni::get_field_id(env, Class, "isPinned", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass viewMessages::Class;
jfieldID viewMessages::chat_id_fieldID;
jfieldID viewMessages::message_ids_fieldID;
jfieldID viewMessages::source_fieldID;
jfieldID viewMessages::force_read_fieldID;

viewMessages::viewMessages()
  : chat_id_()
  , message_ids_()
  , source_()
  , force_read_()
{}

viewMessages::viewMessages(int53 chat_id_, array<int53> &&message_ids_, object_ptr<MessageSource> &&source_, bool force_read_)
  : chat_id_(chat_id_)
  , message_ids_(std::move(message_ids_))
  , source_(std::move(source_))
  , force_read_(force_read_)
{}

const std::int32_t viewMessages::ID;

object_ptr<viewMessages> viewMessages::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) return nullptr;
  init_jni_vars(env);
  object_ptr<viewMessages> res = make_object<viewMessages>();
  res->chat_id_ = env->GetLongField(p, res->chat_id_fieldID);
  res->message_ids_ = jni::fetch_vector(env, (jlongArray)jni::fetch_object(env, p, res->message_ids_fieldID));
  res->source_ = jni::fetch_tl_object<MessageSource>(env, jni::fetch_object(env, p, res->source_fieldID));
  res->force_read_ = (env->GetBooleanField(p, res->force_read_fieldID) != 0);
  return res;
}

void viewMessages::store(TlStorerToString &s, const char *field_name) const {
  if (!LOG_IS_STRIPPED(ERROR)) {
    s.store_class_begin(field_name, "ViewMessages");
    s.store_field("chatId", chat_id_);
    { s.store_vector_begin("messageIds", message_ids_.size()); for (const auto &_value : message_ids_) { s.store_field("", _value); } s.store_class_end(); }
    s.store_object_field("source", static_cast<const BaseObject *>(source_.get()));
    s.store_field("forceRead", force_read_);
    s.store_class_end();
  }
}

viewMessages::ReturnType viewMessages::fetch_result(JNIEnv *env, jobject &p) {
  if (p == nullptr) return ReturnType();
  return ok::fetch(env, p);
}

void viewMessages::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$ViewMessages").c_str());
    chat_id_fieldID = jni::get_field_id(env, Class, "chatId", "J");
    message_ids_fieldID = jni::get_field_id(env, Class, "messageIds", "[J");
    source_fieldID = jni::get_field_id(env, Class, "source", (PSLICE() << "L" << get_package_name_ref() << "/TdApi$MessageSource;").c_str());
    force_read_fieldID = jni::get_field_id(env, Class, "forceRead", "Z");
    return true;
  }();
  (void)is_inited;
}

jclass Object::Class;

object_ptr<Object> Object::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case accentColor::ID:
      return accentColor::fetch(env, p);
    case acceptedGiftTypes::ID:
      return acceptedGiftTypes::fetch(env, p);
    case accountInfo::ID:
      return accountInfo::fetch(env, p);
    case accountTtl::ID:
      return accountTtl::fetch(env, p);
    case activeStoryStateLive::ID:
      return activeStoryStateLive::fetch(env, p);
    case activeStoryStateUnread::ID:
      return activeStoryStateUnread::fetch(env, p);
    case activeStoryStateRead::ID:
      return activeStoryStateRead::fetch(env, p);
    case addedProxies::ID:
      return addedProxies::fetch(env, p);
    case addedProxy::ID:
      return addedProxy::fetch(env, p);
    case addedReaction::ID:
      return addedReaction::fetch(env, p);
    case addedReactions::ID:
      return addedReactions::fetch(env, p);
    case address::ID:
      return address::fetch(env, p);
    case advertisementSponsor::ID:
      return advertisementSponsor::fetch(env, p);
    case affiliateInfo::ID:
      return affiliateInfo::fetch(env, p);
    case affiliateProgramInfo::ID:
      return affiliateProgramInfo::fetch(env, p);
    case affiliateProgramParameters::ID:
      return affiliateProgramParameters::fetch(env, p);
    case affiliateProgramSortOrderProfitability::ID:
      return affiliateProgramSortOrderProfitability::fetch(env, p);
    case affiliateProgramSortOrderCreationDate::ID:
      return affiliateProgramSortOrderCreationDate::fetch(env, p);
    case affiliateProgramSortOrderRevenue::ID:
      return affiliateProgramSortOrderRevenue::fetch(env, p);
    case affiliateTypeCurrentUser::ID:
      return affiliateTypeCurrentUser::fetch(env, p);
    case affiliateTypeBot::ID:
      return affiliateTypeBot::fetch(env, p);
    case affiliateTypeChannel::ID:
      return affiliateTypeChannel::fetch(env, p);
    case ageVerificationParameters::ID:
      return ageVerificationParameters::fetch(env, p);
    case alternativeVideo::ID:
      return alternativeVideo::fetch(env, p);
    case animatedChatPhoto::ID:
      return animatedChatPhoto::fetch(env, p);
    case animatedEmoji::ID:
      return animatedEmoji::fetch(env, p);
    case animation::ID:
      return animation::fetch(env, p);
    case animations::ID:
      return animations::fetch(env, p);
    case archiveChatListSettings::ID:
      return archiveChatListSettings::fetch(env, p);
    case attachmentMenuBot::ID:
      return attachmentMenuBot::fetch(env, p);
    case attachmentMenuBotColor::ID:
      return attachmentMenuBotColor::fetch(env, p);
    case attributeCraftPersistenceProbability::ID:
      return attributeCraftPersistenceProbability::fetch(env, p);
    case auctionBid::ID:
      return auctionBid::fetch(env, p);
    case auctionRound::ID:
      return auctionRound::fetch(env, p);
    case auctionStateActive::ID:
      return auctionStateActive::fetch(env, p);
    case auctionStateFinished::ID:
      return auctionStateFinished::fetch(env, p);
    case audio::ID:
      return audio::fetch(env, p);
    case audios::ID:
      return audios::fetch(env, p);
    case authenticationCodeInfo::ID:
      return authenticationCodeInfo::fetch(env, p);
    case authenticationCodeTypeTelegramMessage::ID:
      return authenticationCodeTypeTelegramMessage::fetch(env, p);
    case authenticationCodeTypeSms::ID:
      return authenticationCodeTypeSms::fetch(env, p);
    case authenticationCodeTypeSmsWord::ID:
      return authenticationCodeTypeSmsWord::fetch(env, p);
    case authenticationCodeTypeSmsPhrase::ID:
      return authenticationCodeTypeSmsPhrase::fetch(env, p);
    case authenticationCodeTypeCall::ID:
      return authenticationCodeTypeCall::fetch(env, p);
    case authenticationCodeTypeFlashCall::ID:
      return authenticationCodeTypeFlashCall::fetch(env, p);
    case authenticationCodeTypeMissedCall::ID:
      return authenticationCodeTypeMissedCall::fetch(env, p);
    case authenticationCodeTypeFragment::ID:
      return authenticationCodeTypeFragment::fetch(env, p);
    case authenticationCodeTypeFirebaseAndroid::ID:
      return authenticationCodeTypeFirebaseAndroid::fetch(env, p);
    case authenticationCodeTypeFirebaseIos::ID:
      return authenticationCodeTypeFirebaseIos::fetch(env, p);
    case authorizationStateWaitTdlibParameters::ID:
      return authorizationStateWaitTdlibParameters::fetch(env, p);
    case authorizationStateWaitPhoneNumber::ID:
      return authorizationStateWaitPhoneNumber::fetch(env, p);
    case authorizationStateWaitPremiumPurchase::ID:
      return authorizationStateWaitPremiumPurchase::fetch(env, p);
    case authorizationStateWaitEmailAddress::ID:
      return authorizationStateWaitEmailAddress::fetch(env, p);
    case authorizationStateWaitEmailCode::ID:
      return authorizationStateWaitEmailCode::fetch(env, p);
    case authorizationStateWaitCode::ID:
      return authorizationStateWaitCode::fetch(env, p);
    case authorizationStateWaitOtherDeviceConfirmation::ID:
      return authorizationStateWaitOtherDeviceConfirmation::fetch(env, p);
    case authorizationStateWaitRegistration::ID:
      return authorizationStateWaitRegistration::fetch(env, p);
    case authorizationStateWaitPassword::ID:
      return authorizationStateWaitPassword::fetch(env, p);
    case authorizationStateReady::ID:
      return authorizationStateReady::fetch(env, p);
    case authorizationStateLoggingOut::ID:
      return authorizationStateLoggingOut::fetch(env, p);
    case authorizationStateClosing::ID:
      return authorizationStateClosing::fetch(env, p);
    case authorizationStateClosed::ID:
      return authorizationStateClosed::fetch(env, p);
    case autoDownloadSettings::ID:
      return autoDownloadSettings::fetch(env, p);
    case autoDownloadSettingsPresets::ID:
      return autoDownloadSettingsPresets::fetch(env, p);
    case autosaveSettings::ID:
      return autosaveSettings::fetch(env, p);
    case autosaveSettingsException::ID:
      return autosaveSettingsException::fetch(env, p);
    case autosaveSettingsScopePrivateChats::ID:
      return autosaveSettingsScopePrivateChats::fetch(env, p);
    case autosaveSettingsScopeGroupChats::ID:
      return autosaveSettingsScopeGroupChats::fetch(env, p);
    case autosaveSettingsScopeChannelChats::ID:
      return autosaveSettingsScopeChannelChats::fetch(env, p);
    case autosaveSettingsScopeChat::ID:
      return autosaveSettingsScopeChat::fetch(env, p);
    case availableGift::ID:
      return availableGift::fetch(env, p);
    case availableGifts::ID:
      return availableGifts::fetch(env, p);
    case availableReaction::ID:
      return availableReaction::fetch(env, p);
    case availableReactions::ID:
      return availableReactions::fetch(env, p);
    case background::ID:
      return background::fetch(env, p);
    case backgroundFillSolid::ID:
      return backgroundFillSolid::fetch(env, p);
    case backgroundFillGradient::ID:
      return backgroundFillGradient::fetch(env, p);
    case backgroundFillFreeformGradient::ID:
      return backgroundFillFreeformGradient::fetch(env, p);
    case backgroundTypeWallpaper::ID:
      return backgroundTypeWallpaper::fetch(env, p);
    case backgroundTypePattern::ID:
      return backgroundTypePattern::fetch(env, p);
    case backgroundTypeFill::ID:
      return backgroundTypeFill::fetch(env, p);
    case backgroundTypeChatTheme::ID:
      return backgroundTypeChatTheme::fetch(env, p);
    case backgrounds::ID:
      return backgrounds::fetch(env, p);
    case bankCardActionOpenUrl::ID:
      return bankCardActionOpenUrl::fetch(env, p);
    case bankCardInfo::ID:
      return bankCardInfo::fetch(env, p);
    case basicGroup::ID:
      return basicGroup::fetch(env, p);
    case basicGroupFullInfo::ID:
      return basicGroupFullInfo::fetch(env, p);
    case birthdate::ID:
      return birthdate::fetch(env, p);
    case blockListMain::ID:
      return blockListMain::fetch(env, p);
    case blockListStories::ID:
      return blockListStories::fetch(env, p);
    case botAccessSettings::ID:
      return botAccessSettings::fetch(env, p);
    case botCommand::ID:
      return botCommand::fetch(env, p);
    case botCommandScopeDefault::ID:
      return botCommandScopeDefault::fetch(env, p);
    case botCommandScopeAllPrivateChats::ID:
      return botCommandScopeAllPrivateChats::fetch(env, p);
    case botCommandScopeAllGroupChats::ID:
      return botCommandScopeAllGroupChats::fetch(env, p);
    case botCommandScopeAllChatAdministrators::ID:
      return botCommandScopeAllChatAdministrators::fetch(env, p);
    case botCommandScopeChat::ID:
      return botCommandScopeChat::fetch(env, p);
    case botCommandScopeChatAdministrators::ID:
      return botCommandScopeChatAdministrators::fetch(env, p);
    case botCommandScopeChatMember::ID:
      return botCommandScopeChatMember::fetch(env, p);
    case botCommands::ID:
      return botCommands::fetch(env, p);
    case botInfo::ID:
      return botInfo::fetch(env, p);
    case botMediaPreview::ID:
      return botMediaPreview::fetch(env, p);
    case botMediaPreviewInfo::ID:
      return botMediaPreviewInfo::fetch(env, p);
    case botMediaPreviews::ID:
      return botMediaPreviews::fetch(env, p);
    case botMenuButton::ID:
      return botMenuButton::fetch(env, p);
    case botVerification::ID:
      return botVerification::fetch(env, p);
    case botVerificationParameters::ID:
      return botVerificationParameters::fetch(env, p);
    case botWriteAccessAllowReasonConnectedWebsite::ID:
      return botWriteAccessAllowReasonConnectedWebsite::fetch(env, p);
    case botWriteAccessAllowReasonAddedToAttachmentMenu::ID:
      return botWriteAccessAllowReasonAddedToAttachmentMenu::fetch(env, p);
    case botWriteAccessAllowReasonLaunchedWebApp::ID:
      return botWriteAccessAllowReasonLaunchedWebApp::fetch(env, p);
    case botWriteAccessAllowReasonAcceptedRequest::ID:
      return botWriteAccessAllowReasonAcceptedRequest::fetch(env, p);
    case builtInThemeClassic::ID:
      return builtInThemeClassic::fetch(env, p);
    case builtInThemeDay::ID:
      return builtInThemeDay::fetch(env, p);
    case builtInThemeNight::ID:
      return builtInThemeNight::fetch(env, p);
    case builtInThemeTinted::ID:
      return builtInThemeTinted::fetch(env, p);
    case builtInThemeArctic::ID:
      return builtInThemeArctic::fetch(env, p);
    case businessAwayMessageScheduleAlways::ID:
      return businessAwayMessageScheduleAlways::fetch(env, p);
    case businessAwayMessageScheduleOutsideOfOpeningHours::ID:
      return businessAwayMessageScheduleOutsideOfOpeningHours::fetch(env, p);
    case businessAwayMessageScheduleCustom::ID:
      return businessAwayMessageScheduleCustom::fetch(env, p);
    case businessAwayMessageSettings::ID:
      return businessAwayMessageSettings::fetch(env, p);
    case businessBotManageBar::ID:
      return businessBotManageBar::fetch(env, p);
    case businessBotRights::ID:
      return businessBotRights::fetch(env, p);
    case businessChatLink::ID:
      return businessChatLink::fetch(env, p);
    case businessChatLinkInfo::ID:
      return businessChatLinkInfo::fetch(env, p);
    case businessChatLinks::ID:
      return businessChatLinks::fetch(env, p);
    case businessConnectedBot::ID:
      return businessConnectedBot::fetch(env, p);
    case businessConnection::ID:
      return businessConnection::fetch(env, p);
    case businessFeatureLocation::ID:
      return businessFeatureLocation::fetch(env, p);
    case businessFeatureOpeningHours::ID:
      return businessFeatureOpeningHours::fetch(env, p);
    case businessFeatureQuickReplies::ID:
      return businessFeatureQuickReplies::fetch(env, p);
    case businessFeatureGreetingMessage::ID:
      return businessFeatureGreetingMessage::fetch(env, p);
    case businessFeatureAwayMessage::ID:
      return businessFeatureAwayMessage::fetch(env, p);
    case businessFeatureAccountLinks::ID:
      return businessFeatureAccountLinks::fetch(env, p);
    case businessFeatureStartPage::ID:
      return businessFeatureStartPage::fetch(env, p);
    case businessFeatureBots::ID:
      return businessFeatureBots::fetch(env, p);
    case businessFeatureEmojiStatus::ID:
      return businessFeatureEmojiStatus::fetch(env, p);
    case businessFeatureChatFolderTags::ID:
      return businessFeatureChatFolderTags::fetch(env, p);
    case businessFeatureUpgradedStories::ID:
      return businessFeatureUpgradedStories::fetch(env, p);
    case businessFeaturePromotionAnimation::ID:
      return businessFeaturePromotionAnimation::fetch(env, p);
    case businessFeatures::ID:
      return businessFeatures::fetch(env, p);
    case businessGreetingMessageSettings::ID:
      return businessGreetingMessageSettings::fetch(env, p);
    case businessInfo::ID:
      return businessInfo::fetch(env, p);
    case businessLocation::ID:
      return businessLocation::fetch(env, p);
    case businessMessage::ID:
      return businessMessage::fetch(env, p);
    case businessMessages::ID:
      return businessMessages::fetch(env, p);
    case businessOpeningHours::ID:
      return businessOpeningHours::fetch(env, p);
    case businessOpeningHoursInterval::ID:
      return businessOpeningHoursInterval::fetch(env, p);
    case businessRecipients::ID:
      return businessRecipients::fetch(env, p);
    case businessStartPage::ID:
      return businessStartPage::fetch(env, p);
    case buttonStyleDefault::ID:
      return buttonStyleDefault::fetch(env, p);
    case buttonStylePrimary::ID:
      return buttonStylePrimary::fetch(env, p);
    case buttonStyleDanger::ID:
      return buttonStyleDanger::fetch(env, p);
    case buttonStyleSuccess::ID:
      return buttonStyleSuccess::fetch(env, p);
    case call::ID:
      return call::fetch(env, p);
    case callDiscardReasonEmpty::ID:
      return callDiscardReasonEmpty::fetch(env, p);
    case callDiscardReasonMissed::ID:
      return callDiscardReasonMissed::fetch(env, p);
    case callDiscardReasonDeclined::ID:
      return callDiscardReasonDeclined::fetch(env, p);
    case callDiscardReasonDisconnected::ID:
      return callDiscardReasonDisconnected::fetch(env, p);
    case callDiscardReasonHungUp::ID:
      return callDiscardReasonHungUp::fetch(env, p);
    case callDiscardReasonUpgradeToGroupCall::ID:
      return callDiscardReasonUpgradeToGroupCall::fetch(env, p);
    case callId::ID:
      return callId::fetch(env, p);
    case callProblemEcho::ID:
      return callProblemEcho::fetch(env, p);
    case callProblemNoise::ID:
      return callProblemNoise::fetch(env, p);
    case callProblemInterruptions::ID:
      return callProblemInterruptions::fetch(env, p);
    case callProblemDistortedSpeech::ID:
      return callProblemDistortedSpeech::fetch(env, p);
    case callProblemSilentLocal::ID:
      return callProblemSilentLocal::fetch(env, p);
    case callProblemSilentRemote::ID:
      return callProblemSilentRemote::fetch(env, p);
    case callProblemDropped::ID:
      return callProblemDropped::fetch(env, p);
    case callProblemDistortedVideo::ID:
      return callProblemDistortedVideo::fetch(env, p);
    case callProblemPixelatedVideo::ID:
      return callProblemPixelatedVideo::fetch(env, p);
    case callProtocol::ID:
      return callProtocol::fetch(env, p);
    case callServer::ID:
      return callServer::fetch(env, p);
    case callServerTypeTelegramReflector::ID:
      return callServerTypeTelegramReflector::fetch(env, p);
    case callServerTypeWebrtc::ID:
      return callServerTypeWebrtc::fetch(env, p);
    case callStatePending::ID:
      return callStatePending::fetch(env, p);
    case callStateExchangingKeys::ID:
      return callStateExchangingKeys::fetch(env, p);
    case callStateReady::ID:
      return callStateReady::fetch(env, p);
    case callStateHangingUp::ID:
      return callStateHangingUp::fetch(env, p);
    case callStateDiscarded::ID:
      return callStateDiscarded::fetch(env, p);
    case callStateError::ID:
      return callStateError::fetch(env, p);
    case callbackQueryAnswer::ID:
      return callbackQueryAnswer::fetch(env, p);
    case callbackQueryPayloadData::ID:
      return callbackQueryPayloadData::fetch(env, p);
    case callbackQueryPayloadDataWithPassword::ID:
      return callbackQueryPayloadDataWithPassword::fetch(env, p);
    case callbackQueryPayloadGame::ID:
      return callbackQueryPayloadGame::fetch(env, p);
    case canPostStoryResultOk::ID:
      return canPostStoryResultOk::fetch(env, p);
    case canPostStoryResultPremiumNeeded::ID:
      return canPostStoryResultPremiumNeeded::fetch(env, p);
    case canPostStoryResultBoostNeeded::ID:
      return canPostStoryResultBoostNeeded::fetch(env, p);
    case canPostStoryResultActiveStoryLimitExceeded::ID:
      return canPostStoryResultActiveStoryLimitExceeded::fetch(env, p);
    case canPostStoryResultWeeklyLimitExceeded::ID:
      return canPostStoryResultWeeklyLimitExceeded::fetch(env, p);
    case canPostStoryResultMonthlyLimitExceeded::ID:
      return canPostStoryResultMonthlyLimitExceeded::fetch(env, p);
    case canPostStoryResultLiveStoryIsActive::ID:
      return canPostStoryResultLiveStoryIsActive::fetch(env, p);
    case canSendGiftResultOk::ID:
      return canSendGiftResultOk::fetch(env, p);
    case canSendGiftResultFail::ID:
      return canSendGiftResultFail::fetch(env, p);
    case canSendMessageToUserResultOk::ID:
      return canSendMessageToUserResultOk::fetch(env, p);
    case canSendMessageToUserResultUserHasPaidMessages::ID:
      return canSendMessageToUserResultUserHasPaidMessages::fetch(env, p);
    case canSendMessageToUserResultUserIsDeleted::ID:
      return canSendMessageToUserResultUserIsDeleted::fetch(env, p);
    case canSendMessageToUserResultUserRestrictsNewChats::ID:
      return canSendMessageToUserResultUserRestrictsNewChats::fetch(env, p);
    case canTransferOwnershipResultOk::ID:
      return canTransferOwnershipResultOk::fetch(env, p);
    case canTransferOwnershipResultPasswordNeeded::ID:
      return canTransferOwnershipResultPasswordNeeded::fetch(env, p);
    case canTransferOwnershipResultPasswordTooFresh::ID:
      return canTransferOwnershipResultPasswordTooFresh::fetch(env, p);
    case canTransferOwnershipResultSessionTooFresh::ID:
      return canTransferOwnershipResultSessionTooFresh::fetch(env, p);
    case chat::ID:
      return chat::fetch(env, p);
    case chatActionTyping::ID:
      return chatActionTyping::fetch(env, p);
    case chatActionRecordingVideo::ID:
      return chatActionRecordingVideo::fetch(env, p);
    case chatActionUploadingVideo::ID:
      return chatActionUploadingVideo::fetch(env, p);
    case chatActionRecordingVoiceNote::ID:
      return chatActionRecordingVoiceNote::fetch(env, p);
    case chatActionUploadingVoiceNote::ID:
      return chatActionUploadingVoiceNote::fetch(env, p);
    case chatActionUploadingPhoto::ID:
      return chatActionUploadingPhoto::fetch(env, p);
    case chatActionUploadingDocument::ID:
      return chatActionUploadingDocument::fetch(env, p);
    case chatActionChoosingSticker::ID:
      return chatActionChoosingSticker::fetch(env, p);
    case chatActionChoosingLocation::ID:
      return chatActionChoosingLocation::fetch(env, p);
    case chatActionChoosingContact::ID:
      return chatActionChoosingContact::fetch(env, p);
    case chatActionStartPlayingGame::ID:
      return chatActionStartPlayingGame::fetch(env, p);
    case chatActionRecordingVideoNote::ID:
      return chatActionRecordingVideoNote::fetch(env, p);
    case chatActionUploadingVideoNote::ID:
      return chatActionUploadingVideoNote::fetch(env, p);
    case chatActionWatchingAnimations::ID:
      return chatActionWatchingAnimations::fetch(env, p);
    case chatActionCancel::ID:
      return chatActionCancel::fetch(env, p);
    case chatActionBarReportSpam::ID:
      return chatActionBarReportSpam::fetch(env, p);
    case chatActionBarInviteMembers::ID:
      return chatActionBarInviteMembers::fetch(env, p);
    case chatActionBarReportAddBlock::ID:
      return chatActionBarReportAddBlock::fetch(env, p);
    case chatActionBarAddContact::ID:
      return chatActionBarAddContact::fetch(env, p);
    case chatActionBarSharePhoneNumber::ID:
      return chatActionBarSharePhoneNumber::fetch(env, p);
    case chatActionBarJoinRequest::ID:
      return chatActionBarJoinRequest::fetch(env, p);
    case chatActiveStories::ID:
      return chatActiveStories::fetch(env, p);
    case chatAdministrator::ID:
      return chatAdministrator::fetch(env, p);
    case chatAdministratorRights::ID:
      return chatAdministratorRights::fetch(env, p);
    case chatAdministrators::ID:
      return chatAdministrators::fetch(env, p);
    case chatAvailableReactionsAll::ID:
      return chatAvailableReactionsAll::fetch(env, p);
    case chatAvailableReactionsSome::ID:
      return chatAvailableReactionsSome::fetch(env, p);
    case chatBackground::ID:
      return chatBackground::fetch(env, p);
    case chatBoost::ID:
      return chatBoost::fetch(env, p);
    case chatBoostFeatures::ID:
      return chatBoostFeatures::fetch(env, p);
    case chatBoostLevelFeatures::ID:
      return chatBoostLevelFeatures::fetch(env, p);
    case chatBoostLink::ID:
      return chatBoostLink::fetch(env, p);
    case chatBoostLinkInfo::ID:
      return chatBoostLinkInfo::fetch(env, p);
    case chatBoostSlot::ID:
      return chatBoostSlot::fetch(env, p);
    case chatBoostSlots::ID:
      return chatBoostSlots::fetch(env, p);
    case chatBoostSourceGiftCode::ID:
      return chatBoostSourceGiftCode::fetch(env, p);
    case chatBoostSourceGiveaway::ID:
      return chatBoostSourceGiveaway::fetch(env, p);
    case chatBoostSourcePremium::ID:
      return chatBoostSourcePremium::fetch(env, p);
    case chatBoostStatus::ID:
      return chatBoostStatus::fetch(env, p);
    case chatEvent::ID:
      return chatEvent::fetch(env, p);
    case chatEventMessageEdited::ID:
      return chatEventMessageEdited::fetch(env, p);
    case chatEventMessageDeleted::ID:
      return chatEventMessageDeleted::fetch(env, p);
    case chatEventMessagePinned::ID:
      return chatEventMessagePinned::fetch(env, p);
    case chatEventMessageUnpinned::ID:
      return chatEventMessageUnpinned::fetch(env, p);
    case chatEventPollStopped::ID:
      return chatEventPollStopped::fetch(env, p);
    case chatEventMemberJoined::ID:
      return chatEventMemberJoined::fetch(env, p);
    case chatEventMemberJoinedByInviteLink::ID:
      return chatEventMemberJoinedByInviteLink::fetch(env, p);
    case chatEventMemberJoinedByRequest::ID:
      return chatEventMemberJoinedByRequest::fetch(env, p);
    case chatEventMemberInvited::ID:
      return chatEventMemberInvited::fetch(env, p);
    case chatEventMemberLeft::ID:
      return chatEventMemberLeft::fetch(env, p);
    case chatEventMemberPromoted::ID:
      return chatEventMemberPromoted::fetch(env, p);
    case chatEventMemberRestricted::ID:
      return chatEventMemberRestricted::fetch(env, p);
    case chatEventMemberTagChanged::ID:
      return chatEventMemberTagChanged::fetch(env, p);
    case chatEventMemberSubscriptionExtended::ID:
      return chatEventMemberSubscriptionExtended::fetch(env, p);
    case chatEventAvailableReactionsChanged::ID:
      return chatEventAvailableReactionsChanged::fetch(env, p);
    case chatEventBackgroundChanged::ID:
      return chatEventBackgroundChanged::fetch(env, p);
    case chatEventDescriptionChanged::ID:
      return chatEventDescriptionChanged::fetch(env, p);
    case chatEventEmojiStatusChanged::ID:
      return chatEventEmojiStatusChanged::fetch(env, p);
    case chatEventLinkedChatChanged::ID:
      return chatEventLinkedChatChanged::fetch(env, p);
    case chatEventLocationChanged::ID:
      return chatEventLocationChanged::fetch(env, p);
    case chatEventMessageAutoDeleteTimeChanged::ID:
      return chatEventMessageAutoDeleteTimeChanged::fetch(env, p);
    case chatEventPermissionsChanged::ID:
      return chatEventPermissionsChanged::fetch(env, p);
    case chatEventPhotoChanged::ID:
      return chatEventPhotoChanged::fetch(env, p);
    case chatEventSlowModeDelayChanged::ID:
      return chatEventSlowModeDelayChanged::fetch(env, p);
    case chatEventStickerSetChanged::ID:
      return chatEventStickerSetChanged::fetch(env, p);
    case chatEventCustomEmojiStickerSetChanged::ID:
      return chatEventCustomEmojiStickerSetChanged::fetch(env, p);
    case chatEventTitleChanged::ID:
      return chatEventTitleChanged::fetch(env, p);
    case chatEventUsernameChanged::ID:
      return chatEventUsernameChanged::fetch(env, p);
    case chatEventActiveUsernamesChanged::ID:
      return chatEventActiveUsernamesChanged::fetch(env, p);
    case chatEventAccentColorChanged::ID:
      return chatEventAccentColorChanged::fetch(env, p);
    case chatEventProfileAccentColorChanged::ID:
      return chatEventProfileAccentColorChanged::fetch(env, p);
    case chatEventHasProtectedContentToggled::ID:
      return chatEventHasProtectedContentToggled::fetch(env, p);
    case chatEventInvitesToggled::ID:
      return chatEventInvitesToggled::fetch(env, p);
    case chatEventIsAllHistoryAvailableToggled::ID:
      return chatEventIsAllHistoryAvailableToggled::fetch(env, p);
    case chatEventHasAggressiveAntiSpamEnabledToggled::ID:
      return chatEventHasAggressiveAntiSpamEnabledToggled::fetch(env, p);
    case chatEventSignMessagesToggled::ID:
      return chatEventSignMessagesToggled::fetch(env, p);
    case chatEventShowMessageSenderToggled::ID:
      return chatEventShowMessageSenderToggled::fetch(env, p);
    case chatEventAutomaticTranslationToggled::ID:
      return chatEventAutomaticTranslationToggled::fetch(env, p);
    case chatEventInviteLinkEdited::ID:
      return chatEventInviteLinkEdited::fetch(env, p);
    case chatEventInviteLinkRevoked::ID:
      return chatEventInviteLinkRevoked::fetch(env, p);
    case chatEventInviteLinkDeleted::ID:
      return chatEventInviteLinkDeleted::fetch(env, p);
    case chatEventVideoChatCreated::ID:
      return chatEventVideoChatCreated::fetch(env, p);
    case chatEventVideoChatEnded::ID:
      return chatEventVideoChatEnded::fetch(env, p);
    case chatEventVideoChatMuteNewParticipantsToggled::ID:
      return chatEventVideoChatMuteNewParticipantsToggled::fetch(env, p);
    case chatEventVideoChatParticipantIsMutedToggled::ID:
      return chatEventVideoChatParticipantIsMutedToggled::fetch(env, p);
    case chatEventVideoChatParticipantVolumeLevelChanged::ID:
      return chatEventVideoChatParticipantVolumeLevelChanged::fetch(env, p);
    case chatEventIsForumToggled::ID:
      return chatEventIsForumToggled::fetch(env, p);
    case chatEventForumTopicCreated::ID:
      return chatEventForumTopicCreated::fetch(env, p);
    case chatEventForumTopicEdited::ID:
      return chatEventForumTopicEdited::fetch(env, p);
    case chatEventForumTopicToggleIsClosed::ID:
      return chatEventForumTopicToggleIsClosed::fetch(env, p);
    case chatEventForumTopicToggleIsHidden::ID:
      return chatEventForumTopicToggleIsHidden::fetch(env, p);
    case chatEventForumTopicDeleted::ID:
      return chatEventForumTopicDeleted::fetch(env, p);
    case chatEventForumTopicPinned::ID:
      return chatEventForumTopicPinned::fetch(env, p);
    case chatEventLogFilters::ID:
      return chatEventLogFilters::fetch(env, p);
    case chatEvents::ID:
      return chatEvents::fetch(env, p);
    case chatFolder::ID:
      return chatFolder::fetch(env, p);
    case chatFolderIcon::ID:
      return chatFolderIcon::fetch(env, p);
    case chatFolderInfo::ID:
      return chatFolderInfo::fetch(env, p);
    case chatFolderInviteLink::ID:
      return chatFolderInviteLink::fetch(env, p);
    case chatFolderInviteLinkInfo::ID:
      return chatFolderInviteLinkInfo::fetch(env, p);
    case chatFolderInviteLinks::ID:
      return chatFolderInviteLinks::fetch(env, p);
    case chatFolderName::ID:
      return chatFolderName::fetch(env, p);
    case chatInviteLink::ID:
      return chatInviteLink::fetch(env, p);
    case chatInviteLinkCount::ID:
      return chatInviteLinkCount::fetch(env, p);
    case chatInviteLinkCounts::ID:
      return chatInviteLinkCounts::fetch(env, p);
    case chatInviteLinkInfo::ID:
      return chatInviteLinkInfo::fetch(env, p);
    case chatInviteLinkMember::ID:
      return chatInviteLinkMember::fetch(env, p);
    case chatInviteLinkMembers::ID:
      return chatInviteLinkMembers::fetch(env, p);
    case chatInviteLinkSubscriptionInfo::ID:
      return chatInviteLinkSubscriptionInfo::fetch(env, p);
    case chatInviteLinks::ID:
      return chatInviteLinks::fetch(env, p);
    case chatJoinRequest::ID:
      return chatJoinRequest::fetch(env, p);
    case chatJoinRequests::ID:
      return chatJoinRequests::fetch(env, p);
    case chatJoinRequestsInfo::ID:
      return chatJoinRequestsInfo::fetch(env, p);
    case chatListMain::ID:
      return chatListMain::fetch(env, p);
    case chatListArchive::ID:
      return chatListArchive::fetch(env, p);
    case chatListFolder::ID:
      return chatListFolder::fetch(env, p);
    case chatLists::ID:
      return chatLists::fetch(env, p);
    case chatLocation::ID:
      return chatLocation::fetch(env, p);
    case chatMember::ID:
      return chatMember::fetch(env, p);
    case chatMemberStatusCreator::ID:
      return chatMemberStatusCreator::fetch(env, p);
    case chatMemberStatusAdministrator::ID:
      return chatMemberStatusAdministrator::fetch(env, p);
    case chatMemberStatusMember::ID:
      return chatMemberStatusMember::fetch(env, p);
    case chatMemberStatusRestricted::ID:
      return chatMemberStatusRestricted::fetch(env, p);
    case chatMemberStatusLeft::ID:
      return chatMemberStatusLeft::fetch(env, p);
    case chatMemberStatusBanned::ID:
      return chatMemberStatusBanned::fetch(env, p);
    case chatMembers::ID:
      return chatMembers::fetch(env, p);
    case chatMembersFilterContacts::ID:
      return chatMembersFilterContacts::fetch(env, p);
    case chatMembersFilterAdministrators::ID:
      return chatMembersFilterAdministrators::fetch(env, p);
    case chatMembersFilterMembers::ID:
      return chatMembersFilterMembers::fetch(env, p);
    case chatMembersFilterMention::ID:
      return chatMembersFilterMention::fetch(env, p);
    case chatMembersFilterRestricted::ID:
      return chatMembersFilterRestricted::fetch(env, p);
    case chatMembersFilterBanned::ID:
      return chatMembersFilterBanned::fetch(env, p);
    case chatMembersFilterBots::ID:
      return chatMembersFilterBots::fetch(env, p);
    case chatMessageSender::ID:
      return chatMessageSender::fetch(env, p);
    case chatMessageSenders::ID:
      return chatMessageSenders::fetch(env, p);
    case chatNotificationSettings::ID:
      return chatNotificationSettings::fetch(env, p);
    case chatPermissions::ID:
      return chatPermissions::fetch(env, p);
    case chatPhoto::ID:
      return chatPhoto::fetch(env, p);
    case chatPhotoInfo::ID:
      return chatPhotoInfo::fetch(env, p);
    case chatPhotoSticker::ID:
      return chatPhotoSticker::fetch(env, p);
    case chatPhotoStickerTypeRegularOrMask::ID:
      return chatPhotoStickerTypeRegularOrMask::fetch(env, p);
    case chatPhotoStickerTypeCustomEmoji::ID:
      return chatPhotoStickerTypeCustomEmoji::fetch(env, p);
    case chatPhotos::ID:
      return chatPhotos::fetch(env, p);
    case chatPosition::ID:
      return chatPosition::fetch(env, p);
    case chatRevenueAmount::ID:
      return chatRevenueAmount::fetch(env, p);
    case chatRevenueStatistics::ID:
      return chatRevenueStatistics::fetch(env, p);
    case chatRevenueTransaction::ID:
      return chatRevenueTransaction::fetch(env, p);
    case chatRevenueTransactionTypeUnsupported::ID:
      return chatRevenueTransactionTypeUnsupported::fetch(env, p);
    case chatRevenueTransactionTypeSponsoredMessageEarnings::ID:
      return chatRevenueTransactionTypeSponsoredMessageEarnings::fetch(env, p);
    case chatRevenueTransactionTypeSuggestedPostEarnings::ID:
      return chatRevenueTransactionTypeSuggestedPostEarnings::fetch(env, p);
    case chatRevenueTransactionTypeFragmentWithdrawal::ID:
      return chatRevenueTransactionTypeFragmentWithdrawal::fetch(env, p);
    case chatRevenueTransactionTypeFragmentRefund::ID:
      return chatRevenueTransactionTypeFragmentRefund::fetch(env, p);
    case chatRevenueTransactions::ID:
      return chatRevenueTransactions::fetch(env, p);
    case chatSourceMtprotoProxy::ID:
      return chatSourceMtprotoProxy::fetch(env, p);
    case chatSourcePublicServiceAnnouncement::ID:
      return chatSourcePublicServiceAnnouncement::fetch(env, p);
    case chatStatisticsSupergroup::ID:
      return chatStatisticsSupergroup::fetch(env, p);
    case chatStatisticsChannel::ID:
      return chatStatisticsChannel::fetch(env, p);
    case chatStatisticsAdministratorActionsInfo::ID:
      return chatStatisticsAdministratorActionsInfo::fetch(env, p);
    case chatStatisticsInteractionInfo::ID:
      return chatStatisticsInteractionInfo::fetch(env, p);
    case chatStatisticsInviterInfo::ID:
      return chatStatisticsInviterInfo::fetch(env, p);
    case chatStatisticsMessageSenderInfo::ID:
      return chatStatisticsMessageSenderInfo::fetch(env, p);
    case chatStatisticsObjectTypeMessage::ID:
      return chatStatisticsObjectTypeMessage::fetch(env, p);
    case chatStatisticsObjectTypeStory::ID:
      return chatStatisticsObjectTypeStory::fetch(env, p);
    case chatThemeEmoji::ID:
      return chatThemeEmoji::fetch(env, p);
    case chatThemeGift::ID:
      return chatThemeGift::fetch(env, p);
    case chatTypePrivate::ID:
      return chatTypePrivate::fetch(env, p);
    case chatTypeBasicGroup::ID:
      return chatTypeBasicGroup::fetch(env, p);
    case chatTypeSupergroup::ID:
      return chatTypeSupergroup::fetch(env, p);
    case chatTypeSecret::ID:
      return chatTypeSecret::fetch(env, p);
    case chats::ID:
      return chats::fetch(env, p);
    case checkChatUsernameResultOk::ID:
      return checkChatUsernameResultOk::fetch(env, p);
    case checkChatUsernameResultUsernameInvalid::ID:
      return checkChatUsernameResultUsernameInvalid::fetch(env, p);
    case checkChatUsernameResultUsernameOccupied::ID:
      return checkChatUsernameResultUsernameOccupied::fetch(env, p);
    case checkChatUsernameResultUsernamePurchasable::ID:
      return checkChatUsernameResultUsernamePurchasable::fetch(env, p);
    case checkChatUsernameResultPublicChatsTooMany::ID:
      return checkChatUsernameResultPublicChatsTooMany::fetch(env, p);
    case checkChatUsernameResultPublicGroupsUnavailable::ID:
      return checkChatUsernameResultPublicGroupsUnavailable::fetch(env, p);
    case checkStickerSetNameResultOk::ID:
      return checkStickerSetNameResultOk::fetch(env, p);
    case checkStickerSetNameResultNameInvalid::ID:
      return checkStickerSetNameResultNameInvalid::fetch(env, p);
    case checkStickerSetNameResultNameOccupied::ID:
      return checkStickerSetNameResultNameOccupied::fetch(env, p);
    case checklist::ID:
      return checklist::fetch(env, p);
    case checklistTask::ID:
      return checklistTask::fetch(env, p);
    case closeBirthdayUser::ID:
      return closeBirthdayUser::fetch(env, p);
    case closedVectorPath::ID:
      return closedVectorPath::fetch(env, p);
    case collectibleItemInfo::ID:
      return collectibleItemInfo::fetch(env, p);
    case collectibleItemTypeUsername::ID:
      return collectibleItemTypeUsername::fetch(env, p);
    case collectibleItemTypePhoneNumber::ID:
      return collectibleItemTypePhoneNumber::fetch(env, p);
    case connectedAffiliateProgram::ID:
      return connectedAffiliateProgram::fetch(env, p);
    case connectedAffiliatePrograms::ID:
      return connectedAffiliatePrograms::fetch(env, p);
    case connectedWebsite::ID:
      return connectedWebsite::fetch(env, p);
    case connectedWebsites::ID:
      return connectedWebsites::fetch(env, p);
    case connectionStateWaitingForNetwork::ID:
      return connectionStateWaitingForNetwork::fetch(env, p);
    case connectionStateConnectingToProxy::ID:
      return connectionStateConnectingToProxy::fetch(env, p);
    case connectionStateConnecting::ID:
      return connectionStateConnecting::fetch(env, p);
    case connectionStateUpdating::ID:
      return connectionStateUpdating::fetch(env, p);
    case connectionStateReady::ID:
      return connectionStateReady::fetch(env, p);
    case contact::ID:
      return contact::fetch(env, p);
    case count::ID:
      return count::fetch(env, p);
    case countries::ID:
      return countries::fetch(env, p);
    case countryInfo::ID:
      return countryInfo::fetch(env, p);
    case craftGiftResultSuccess::ID:
      return craftGiftResultSuccess::fetch(env, p);
    case craftGiftResultTooEarly::ID:
      return craftGiftResultTooEarly::fetch(env, p);
    case craftGiftResultInvalidGift::ID:
      return craftGiftResultInvalidGift::fetch(env, p);
    case craftGiftResultFail::ID:
      return craftGiftResultFail::fetch(env, p);
    case createdBasicGroupChat::ID:
      return createdBasicGroupChat::fetch(env, p);
    case currentWeather::ID:
      return currentWeather::fetch(env, p);
    case customRequestResult::ID:
      return customRequestResult::fetch(env, p);
    case data::ID:
      return data::fetch(env, p);
    case databaseStatistics::ID:
      return databaseStatistics::fetch(env, p);
    case date::ID:
      return date::fetch(env, p);
    case dateRange::ID:
      return dateRange::fetch(env, p);
    case dateTimeFormattingTypeRelative::ID:
      return dateTimeFormattingTypeRelative::fetch(env, p);
    case dateTimeFormattingTypeAbsolute::ID:
      return dateTimeFormattingTypeAbsolute::fetch(env, p);
    case dateTimePartPrecisionNone::ID:
      return dateTimePartPrecisionNone::fetch(env, p);
    case dateTimePartPrecisionShort::ID:
      return dateTimePartPrecisionShort::fetch(env, p);
    case dateTimePartPrecisionLong::ID:
      return dateTimePartPrecisionLong::fetch(env, p);
    case datedFile::ID:
      return datedFile::fetch(env, p);
    case deepLinkInfo::ID:
      return deepLinkInfo::fetch(env, p);
    case deviceTokenFirebaseCloudMessaging::ID:
      return deviceTokenFirebaseCloudMessaging::fetch(env, p);
    case deviceTokenApplePush::ID:
      return deviceTokenApplePush::fetch(env, p);
    case deviceTokenApplePushVoIP::ID:
      return deviceTokenApplePushVoIP::fetch(env, p);
    case deviceTokenWindowsPush::ID:
      return deviceTokenWindowsPush::fetch(env, p);
    case deviceTokenMicrosoftPush::ID:
      return deviceTokenMicrosoftPush::fetch(env, p);
    case deviceTokenMicrosoftPushVoIP::ID:
      return deviceTokenMicrosoftPushVoIP::fetch(env, p);
    case deviceTokenWebPush::ID:
      return deviceTokenWebPush::fetch(env, p);
    case deviceTokenSimplePush::ID:
      return deviceTokenSimplePush::fetch(env, p);
    case deviceTokenUbuntuPush::ID:
      return deviceTokenUbuntuPush::fetch(env, p);
    case deviceTokenBlackBerryPush::ID:
      return deviceTokenBlackBerryPush::fetch(env, p);
    case deviceTokenTizenPush::ID:
      return deviceTokenTizenPush::fetch(env, p);
    case deviceTokenHuaweiPush::ID:
      return deviceTokenHuaweiPush::fetch(env, p);
    case diceStickersRegular::ID:
      return diceStickersRegular::fetch(env, p);
    case diceStickersSlotMachine::ID:
      return diceStickersSlotMachine::fetch(env, p);
    case diffEntity::ID:
      return diffEntity::fetch(env, p);
    case diffEntityTypeInsert::ID:
      return diffEntityTypeInsert::fetch(env, p);
    case diffEntityTypeReplace::ID:
      return diffEntityTypeReplace::fetch(env, p);
    case diffEntityTypeDelete::ID:
      return diffEntityTypeDelete::fetch(env, p);
    case diffText::ID:
      return diffText::fetch(env, p);
    case directMessagesChatTopic::ID:
      return directMessagesChatTopic::fetch(env, p);
    case document::ID:
      return document::fetch(env, p);
    case downloadedFileCounts::ID:
      return downloadedFileCounts::fetch(env, p);
    case draftMessage::ID:
      return draftMessage::fetch(env, p);
    case emailAddressAuthenticationCode::ID:
      return emailAddressAuthenticationCode::fetch(env, p);
    case emailAddressAuthenticationAppleId::ID:
      return emailAddressAuthenticationAppleId::fetch(env, p);
    case emailAddressAuthenticationGoogleId::ID:
      return emailAddressAuthenticationGoogleId::fetch(env, p);
    case emailAddressAuthenticationCodeInfo::ID:
      return emailAddressAuthenticationCodeInfo::fetch(env, p);
    case emailAddressResetStateAvailable::ID:
      return emailAddressResetStateAvailable::fetch(env, p);
    case emailAddressResetStatePending::ID:
      return emailAddressResetStatePending::fetch(env, p);
    case emojiCategories::ID:
      return emojiCategories::fetch(env, p);
    case emojiCategory::ID:
      return emojiCategory::fetch(env, p);
    case emojiCategorySourceSearch::ID:
      return emojiCategorySourceSearch::fetch(env, p);
    case emojiCategorySourcePremium::ID:
      return emojiCategorySourcePremium::fetch(env, p);
    case emojiCategoryTypeDefault::ID:
      return emojiCategoryTypeDefault::fetch(env, p);
    case emojiCategoryTypeRegularStickers::ID:
      return emojiCategoryTypeRegularStickers::fetch(env, p);
    case emojiCategoryTypeEmojiStatus::ID:
      return emojiCategoryTypeEmojiStatus::fetch(env, p);
    case emojiCategoryTypeChatPhoto::ID:
      return emojiCategoryTypeChatPhoto::fetch(env, p);
    case emojiChatTheme::ID:
      return emojiChatTheme::fetch(env, p);
    case emojiKeyword::ID:
      return emojiKeyword::fetch(env, p);
    case emojiKeywords::ID:
      return emojiKeywords::fetch(env, p);
    case emojiReaction::ID:
      return emojiReaction::fetch(env, p);
    case emojiStatus::ID:
      return emojiStatus::fetch(env, p);
    case emojiStatusCustomEmojis::ID:
      return emojiStatusCustomEmojis::fetch(env, p);
    case emojiStatusTypeCustomEmoji::ID:
      return emojiStatusTypeCustomEmoji::fetch(env, p);
    case emojiStatusTypeUpgradedGift::ID:
      return emojiStatusTypeUpgradedGift::fetch(env, p);
    case emojiStatuses::ID:
      return emojiStatuses::fetch(env, p);
    case emojis::ID:
      return emojis::fetch(env, p);
    case encryptedCredentials::ID:
      return encryptedCredentials::fetch(env, p);
    case encryptedPassportElement::ID:
      return encryptedPassportElement::fetch(env, p);
    case error::ID:
      return error::fetch(env, p);
    case factCheck::ID:
      return factCheck::fetch(env, p);
    case failedToAddMember::ID:
      return failedToAddMember::fetch(env, p);
    case failedToAddMembers::ID:
      return failedToAddMembers::fetch(env, p);
    case file::ID:
      return file::fetch(env, p);
    case fileDownload::ID:
      return fileDownload::fetch(env, p);
    case fileDownloadedPrefixSize::ID:
      return fileDownloadedPrefixSize::fetch(env, p);
    case fileTypeNone::ID:
      return fileTypeNone::fetch(env, p);
    case fileTypeAnimation::ID:
      return fileTypeAnimation::fetch(env, p);
    case fileTypeAudio::ID:
      return fileTypeAudio::fetch(env, p);
    case fileTypeDocument::ID:
      return fileTypeDocument::fetch(env, p);
    case fileTypeLivePhotoVideo::ID:
      return fileTypeLivePhotoVideo::fetch(env, p);
    case fileTypeNotificationSound::ID:
      return fileTypeNotificationSound::fetch(env, p);
    case fileTypePhoto::ID:
      return fileTypePhoto::fetch(env, p);
    case fileTypePhotoStory::ID:
      return fileTypePhotoStory::fetch(env, p);
    case fileTypeProfilePhoto::ID:
      return fileTypeProfilePhoto::fetch(env, p);
    case fileTypeSecret::ID:
      return fileTypeSecret::fetch(env, p);
    case fileTypeSecretThumbnail::ID:
      return fileTypeSecretThumbnail::fetch(env, p);
    case fileTypeSecure::ID:
      return fileTypeSecure::fetch(env, p);
    case fileTypeSelfDestructingLivePhotoVideo::ID:
      return fileTypeSelfDestructingLivePhotoVideo::fetch(env, p);
    case fileTypeSelfDestructingPhoto::ID:
      return fileTypeSelfDestructingPhoto::fetch(env, p);
    case fileTypeSelfDestructingVideo::ID:
      return fileTypeSelfDestructingVideo::fetch(env, p);
    case fileTypeSelfDestructingVideoNote::ID:
      return fileTypeSelfDestructingVideoNote::fetch(env, p);
    case fileTypeSelfDestructingVoiceNote::ID:
      return fileTypeSelfDestructingVoiceNote::fetch(env, p);
    case fileTypeSticker::ID:
      return fileTypeSticker::fetch(env, p);
    case fileTypeThumbnail::ID:
      return fileTypeThumbnail::fetch(env, p);
    case fileTypeUnknown::ID:
      return fileTypeUnknown::fetch(env, p);
    case fileTypeVideo::ID:
      return fileTypeVideo::fetch(env, p);
    case fileTypeVideoNote::ID:
      return fileTypeVideoNote::fetch(env, p);
    case fileTypeVideoStory::ID:
      return fileTypeVideoStory::fetch(env, p);
    case fileTypeVoiceNote::ID:
      return fileTypeVoiceNote::fetch(env, p);
    case fileTypeWallpaper::ID:
      return fileTypeWallpaper::fetch(env, p);
    case firebaseAuthenticationSettingsAndroid::ID:
      return firebaseAuthenticationSettingsAndroid::fetch(env, p);
    case firebaseAuthenticationSettingsIos::ID:
      return firebaseAuthenticationSettingsIos::fetch(env, p);
    case firebaseDeviceVerificationParametersSafetyNet::ID:
      return firebaseDeviceVerificationParametersSafetyNet::fetch(env, p);
    case firebaseDeviceVerificationParametersPlayIntegrity::ID:
      return firebaseDeviceVerificationParametersPlayIntegrity::fetch(env, p);
    case fixedText::ID:
      return fixedText::fetch(env, p);
    case formattedText::ID:
      return formattedText::fetch(env, p);
    case forumTopic::ID:
      return forumTopic::fetch(env, p);
    case forumTopicIcon::ID:
      return forumTopicIcon::fetch(env, p);
    case forumTopicInfo::ID:
      return forumTopicInfo::fetch(env, p);
    case forumTopics::ID:
      return forumTopics::fetch(env, p);
    case forwardSource::ID:
      return forwardSource::fetch(env, p);
    case foundAffiliateProgram::ID:
      return foundAffiliateProgram::fetch(env, p);
    case foundAffiliatePrograms::ID:
      return foundAffiliatePrograms::fetch(env, p);
    case foundChatBoosts::ID:
      return foundChatBoosts::fetch(env, p);
    case foundChatMessages::ID:
      return foundChatMessages::fetch(env, p);
    case foundFileDownloads::ID:
      return foundFileDownloads::fetch(env, p);
    case foundMessages::ID:
      return foundMessages::fetch(env, p);
    case foundPosition::ID:
      return foundPosition::fetch(env, p);
    case foundPositions::ID:
      return foundPositions::fetch(env, p);
    case foundPublicPosts::ID:
      return foundPublicPosts::fetch(env, p);
    case foundStories::ID:
      return foundStories::fetch(env, p);
    case foundUsers::ID:
      return foundUsers::fetch(env, p);
    case foundWebApp::ID:
      return foundWebApp::fetch(env, p);
    case game::ID:
      return game::fetch(env, p);
    case gameHighScore::ID:
      return gameHighScore::fetch(env, p);
    case gameHighScores::ID:
      return gameHighScores::fetch(env, p);
    case gift::ID:
      return gift::fetch(env, p);
    case giftAuction::ID:
      return giftAuction::fetch(env, p);
    case giftAuctionAcquiredGift::ID:
      return giftAuctionAcquiredGift::fetch(env, p);
    case giftAuctionAcquiredGifts::ID:
      return giftAuctionAcquiredGifts::fetch(env, p);
    case giftAuctionState::ID:
      return giftAuctionState::fetch(env, p);
    case giftBackground::ID:
      return giftBackground::fetch(env, p);
    case giftChatTheme::ID:
      return giftChatTheme::fetch(env, p);
    case giftChatThemes::ID:
      return giftChatThemes::fetch(env, p);
    case giftCollection::ID:
      return giftCollection::fetch(env, p);
    case giftCollections::ID:
      return giftCollections::fetch(env, p);
    case giftForResale::ID:
      return giftForResale::fetch(env, p);
    case giftForResaleOrderPrice::ID:
      return giftForResaleOrderPrice::fetch(env, p);
    case giftForResaleOrderPriceChangeDate::ID:
      return giftForResaleOrderPriceChangeDate::fetch(env, p);
    case giftForResaleOrderNumber::ID:
      return giftForResaleOrderNumber::fetch(env, p);
    case giftPurchaseLimits::ID:
      return giftPurchaseLimits::fetch(env, p);
    case giftPurchaseOfferStatePending::ID:
      return giftPurchaseOfferStatePending::fetch(env, p);
    case giftPurchaseOfferStateAccepted::ID:
      return giftPurchaseOfferStateAccepted::fetch(env, p);
    case giftPurchaseOfferStateRejected::ID:
      return giftPurchaseOfferStateRejected::fetch(env, p);
    case giftResaleParameters::ID:
      return giftResaleParameters::fetch(env, p);
    case giftResalePriceStar::ID:
      return giftResalePriceStar::fetch(env, p);
    case giftResalePriceTon::ID:
      return giftResalePriceTon::fetch(env, p);
    case giftResaleResultOk::ID:
      return giftResaleResultOk::fetch(env, p);
    case giftResaleResultPriceIncreased::ID:
      return giftResaleResultPriceIncreased::fetch(env, p);
    case giftSettings::ID:
      return giftSettings::fetch(env, p);
    case giftUpgradePreview::ID:
      return giftUpgradePreview::fetch(env, p);
    case giftUpgradePrice::ID:
      return giftUpgradePrice::fetch(env, p);
    case giftUpgradeVariants::ID:
      return giftUpgradeVariants::fetch(env, p);
    case giftsForCrafting::ID:
      return giftsForCrafting::fetch(env, p);
    case giftsForResale::ID:
      return giftsForResale::fetch(env, p);
    case giveawayInfoOngoing::ID:
      return giveawayInfoOngoing::fetch(env, p);
    case giveawayInfoCompleted::ID:
      return giveawayInfoCompleted::fetch(env, p);
    case giveawayParameters::ID:
      return giveawayParameters::fetch(env, p);
    case giveawayParticipantStatusEligible::ID:
      return giveawayParticipantStatusEligible::fetch(env, p);
    case giveawayParticipantStatusParticipating::ID:
      return giveawayParticipantStatusParticipating::fetch(env, p);
    case giveawayParticipantStatusAlreadyWasMember::ID:
      return giveawayParticipantStatusAlreadyWasMember::fetch(env, p);
    case giveawayParticipantStatusAdministrator::ID:
      return giveawayParticipantStatusAdministrator::fetch(env, p);
    case giveawayParticipantStatusDisallowedCountry::ID:
      return giveawayParticipantStatusDisallowedCountry::fetch(env, p);
    case giveawayPrizePremium::ID:
      return giveawayPrizePremium::fetch(env, p);
    case giveawayPrizeStars::ID:
      return giveawayPrizeStars::fetch(env, p);
    case groupCall::ID:
      return groupCall::fetch(env, p);
    case groupCallDataChannelMain::ID:
      return groupCallDataChannelMain::fetch(env, p);
    case groupCallDataChannelScreenSharing::ID:
      return groupCallDataChannelScreenSharing::fetch(env, p);
    case groupCallId::ID:
      return groupCallId::fetch(env, p);
    case groupCallInfo::ID:
      return groupCallInfo::fetch(env, p);
    case groupCallJoinParameters::ID:
      return groupCallJoinParameters::fetch(env, p);
    case groupCallMessage::ID:
      return groupCallMessage::fetch(env, p);
    case groupCallMessageLevel::ID:
      return groupCallMessageLevel::fetch(env, p);
    case groupCallParticipant::ID:
      return groupCallParticipant::fetch(env, p);
    case groupCallParticipantVideoInfo::ID:
      return groupCallParticipantVideoInfo::fetch(env, p);
    case groupCallParticipants::ID:
      return groupCallParticipants::fetch(env, p);
    case groupCallRecentSpeaker::ID:
      return groupCallRecentSpeaker::fetch(env, p);
    case groupCallStream::ID:
      return groupCallStream::fetch(env, p);
    case groupCallStreams::ID:
      return groupCallStreams::fetch(env, p);
    case groupCallVideoQualityThumbnail::ID:
      return groupCallVideoQualityThumbnail::fetch(env, p);
    case groupCallVideoQualityMedium::ID:
      return groupCallVideoQualityMedium::fetch(env, p);
    case groupCallVideoQualityFull::ID:
      return groupCallVideoQualityFull::fetch(env, p);
    case groupCallVideoSourceGroup::ID:
      return groupCallVideoSourceGroup::fetch(env, p);
    case hashtags::ID:
      return hashtags::fetch(env, p);
    case httpUrl::ID:
      return httpUrl::fetch(env, p);
    case identityDocument::ID:
      return identityDocument::fetch(env, p);
    case importedContact::ID:
      return importedContact::fetch(env, p);
    case importedContacts::ID:
      return importedContacts::fetch(env, p);
    case inlineKeyboardButton::ID:
      return inlineKeyboardButton::fetch(env, p);
    case inlineKeyboardButtonTypeUrl::ID:
      return inlineKeyboardButtonTypeUrl::fetch(env, p);
    case inlineKeyboardButtonTypeLoginUrl::ID:
      return inlineKeyboardButtonTypeLoginUrl::fetch(env, p);
    case inlineKeyboardButtonTypeWebApp::ID:
      return inlineKeyboardButtonTypeWebApp::fetch(env, p);
    case inlineKeyboardButtonTypeCallback::ID:
      return inlineKeyboardButtonTypeCallback::fetch(env, p);
    case inlineKeyboardButtonTypeCallbackWithPassword::ID:
      return inlineKeyboardButtonTypeCallbackWithPassword::fetch(env, p);
    case inlineKeyboardButtonTypeCallbackGame::ID:
      return inlineKeyboardButtonTypeCallbackGame::fetch(env, p);
    case inlineKeyboardButtonTypeSwitchInline::ID:
      return inlineKeyboardButtonTypeSwitchInline::fetch(env, p);
    case inlineKeyboardButtonTypeBuy::ID:
      return inlineKeyboardButtonTypeBuy::fetch(env, p);
    case inlineKeyboardButtonTypeUser::ID:
      return inlineKeyboardButtonTypeUser::fetch(env, p);
    case inlineKeyboardButtonTypeCopyText::ID:
      return inlineKeyboardButtonTypeCopyText::fetch(env, p);
    case inlineMessageId::ID:
      return inlineMessageId::fetch(env, p);
    case inlineQueryResultArticle::ID:
      return inlineQueryResultArticle::fetch(env, p);
    case inlineQueryResultContact::ID:
      return inlineQueryResultContact::fetch(env, p);
    case inlineQueryResultLocation::ID:
      return inlineQueryResultLocation::fetch(env, p);
    case inlineQueryResultVenue::ID:
      return inlineQueryResultVenue::fetch(env, p);
    case inlineQueryResultGame::ID:
      return inlineQueryResultGame::fetch(env, p);
    case inlineQueryResultAnimation::ID:
      return inlineQueryResultAnimation::fetch(env, p);
    case inlineQueryResultAudio::ID:
      return inlineQueryResultAudio::fetch(env, p);
    case inlineQueryResultDocument::ID:
      return inlineQueryResultDocument::fetch(env, p);
    case inlineQueryResultPhoto::ID:
      return inlineQueryResultPhoto::fetch(env, p);
    case inlineQueryResultSticker::ID:
      return inlineQueryResultSticker::fetch(env, p);
    case inlineQueryResultVideo::ID:
      return inlineQueryResultVideo::fetch(env, p);
    case inlineQueryResultVoiceNote::ID:
      return inlineQueryResultVoiceNote::fetch(env, p);
    case inlineQueryResults::ID:
      return inlineQueryResults::fetch(env, p);
    case inlineQueryResultsButton::ID:
      return inlineQueryResultsButton::fetch(env, p);
    case inlineQueryResultsButtonTypeStartBot::ID:
      return inlineQueryResultsButtonTypeStartBot::fetch(env, p);
    case inlineQueryResultsButtonTypeWebApp::ID:
      return inlineQueryResultsButtonTypeWebApp::fetch(env, p);
    case inputBackgroundLocal::ID:
      return inputBackgroundLocal::fetch(env, p);
    case inputBackgroundRemote::ID:
      return inputBackgroundRemote::fetch(env, p);
    case inputBackgroundPrevious::ID:
      return inputBackgroundPrevious::fetch(env, p);
    case inputBusinessChatLink::ID:
      return inputBusinessChatLink::fetch(env, p);
    case inputBusinessStartPage::ID:
      return inputBusinessStartPage::fetch(env, p);
    case inputCallDiscarded::ID:
      return inputCallDiscarded::fetch(env, p);
    case inputCallFromMessage::ID:
      return inputCallFromMessage::fetch(env, p);
    case inputChatPhotoPrevious::ID:
      return inputChatPhotoPrevious::fetch(env, p);
    case inputChatPhotoStatic::ID:
      return inputChatPhotoStatic::fetch(env, p);
    case inputChatPhotoAnimation::ID:
      return inputChatPhotoAnimation::fetch(env, p);
    case inputChatPhotoSticker::ID:
      return inputChatPhotoSticker::fetch(env, p);
    case inputChatThemeEmoji::ID:
      return inputChatThemeEmoji::fetch(env, p);
    case inputChatThemeGift::ID:
      return inputChatThemeGift::fetch(env, p);
    case inputChecklist::ID:
      return inputChecklist::fetch(env, p);
    case inputChecklistTask::ID:
      return inputChecklistTask::fetch(env, p);
    case inputCredentialsSaved::ID:
      return inputCredentialsSaved::fetch(env, p);
    case inputCredentialsNew::ID:
      return inputCredentialsNew::fetch(env, p);
    case inputCredentialsApplePay::ID:
      return inputCredentialsApplePay::fetch(env, p);
    case inputCredentialsGooglePay::ID:
      return inputCredentialsGooglePay::fetch(env, p);
    case inputFileId::ID:
      return inputFileId::fetch(env, p);
    case inputFileRemote::ID:
      return inputFileRemote::fetch(env, p);
    case inputFileLocal::ID:
      return inputFileLocal::fetch(env, p);
    case inputFileGenerated::ID:
      return inputFileGenerated::fetch(env, p);
    case inputGroupCallLink::ID:
      return inputGroupCallLink::fetch(env, p);
    case inputGroupCallMessage::ID:
      return inputGroupCallMessage::fetch(env, p);
    case inputIdentityDocument::ID:
      return inputIdentityDocument::fetch(env, p);
    case inputInlineQueryResultAnimation::ID:
      return inputInlineQueryResultAnimation::fetch(env, p);
    case inputInlineQueryResultArticle::ID:
      return inputInlineQueryResultArticle::fetch(env, p);
    case inputInlineQueryResultAudio::ID:
      return inputInlineQueryResultAudio::fetch(env, p);
    case inputInlineQueryResultContact::ID:
      return inputInlineQueryResultContact::fetch(env, p);
    case inputInlineQueryResultDocument::ID:
      return inputInlineQueryResultDocument::fetch(env, p);
    case inputInlineQueryResultGame::ID:
      return inputInlineQueryResultGame::fetch(env, p);
    case inputInlineQueryResultLocation::ID:
      return inputInlineQueryResultLocation::fetch(env, p);
    case inputInlineQueryResultPhoto::ID:
      return inputInlineQueryResultPhoto::fetch(env, p);
    case inputInlineQueryResultSticker::ID:
      return inputInlineQueryResultSticker::fetch(env, p);
    case inputInlineQueryResultVenue::ID:
      return inputInlineQueryResultVenue::fetch(env, p);
    case inputInlineQueryResultVideo::ID:
      return inputInlineQueryResultVideo::fetch(env, p);
    case inputInlineQueryResultVoiceNote::ID:
      return inputInlineQueryResultVoiceNote::fetch(env, p);
    case inputInvoiceMessage::ID:
      return inputInvoiceMessage::fetch(env, p);
    case inputInvoiceName::ID:
      return inputInvoiceName::fetch(env, p);
    case inputInvoiceTelegram::ID:
      return inputInvoiceTelegram::fetch(env, p);
    case inputMessageText::ID:
      return inputMessageText::fetch(env, p);
    case inputMessageAnimation::ID:
      return inputMessageAnimation::fetch(env, p);
    case inputMessageAudio::ID:
      return inputMessageAudio::fetch(env, p);
    case inputMessageDocument::ID:
      return inputMessageDocument::fetch(env, p);
    case inputMessagePaidMedia::ID:
      return inputMessagePaidMedia::fetch(env, p);
    case inputMessagePhoto::ID:
      return inputMessagePhoto::fetch(env, p);
    case inputMessageSticker::ID:
      return inputMessageSticker::fetch(env, p);
    case inputMessageVideo::ID:
      return inputMessageVideo::fetch(env, p);
    case inputMessageVideoNote::ID:
      return inputMessageVideoNote::fetch(env, p);
    case inputMessageVoiceNote::ID:
      return inputMessageVoiceNote::fetch(env, p);
    case inputMessageLocation::ID:
      return inputMessageLocation::fetch(env, p);
    case inputMessageVenue::ID:
      return inputMessageVenue::fetch(env, p);
    case inputMessageContact::ID:
      return inputMessageContact::fetch(env, p);
    case inputMessageDice::ID:
      return inputMessageDice::fetch(env, p);
    case inputMessageGame::ID:
      return inputMessageGame::fetch(env, p);
    case inputMessageInvoice::ID:
      return inputMessageInvoice::fetch(env, p);
    case inputMessagePoll::ID:
      return inputMessagePoll::fetch(env, p);
    case inputMessageStakeDice::ID:
      return inputMessageStakeDice::fetch(env, p);
    case inputMessageStory::ID:
      return inputMessageStory::fetch(env, p);
    case inputMessageChecklist::ID:
      return inputMessageChecklist::fetch(env, p);
    case inputMessageForwarded::ID:
      return inputMessageForwarded::fetch(env, p);
    case inputMessageReplyToMessage::ID:
      return inputMessageReplyToMessage::fetch(env, p);
    case inputMessageReplyToExternalMessage::ID:
      return inputMessageReplyToExternalMessage::fetch(env, p);
    case inputMessageReplyToStory::ID:
      return inputMessageReplyToStory::fetch(env, p);
    case inputPaidMedia::ID:
      return inputPaidMedia::fetch(env, p);
    case inputPaidMediaTypePhoto::ID:
      return inputPaidMediaTypePhoto::fetch(env, p);
    case inputPaidMediaTypeVideo::ID:
      return inputPaidMediaTypeVideo::fetch(env, p);
    case inputPassportElementPersonalDetails::ID:
      return inputPassportElementPersonalDetails::fetch(env, p);
    case inputPassportElementPassport::ID:
      return inputPassportElementPassport::fetch(env, p);
    case inputPassportElementDriverLicense::ID:
      return inputPassportElementDriverLicense::fetch(env, p);
    case inputPassportElementIdentityCard::ID:
      return inputPassportElementIdentityCard::fetch(env, p);
    case inputPassportElementInternalPassport::ID:
      return inputPassportElementInternalPassport::fetch(env, p);
    case inputPassportElementAddress::ID:
      return inputPassportElementAddress::fetch(env, p);
    case inputPassportElementUtilityBill::ID:
      return inputPassportElementUtilityBill::fetch(env, p);
    case inputPassportElementBankStatement::ID:
      return inputPassportElementBankStatement::fetch(env, p);
    case inputPassportElementRentalAgreement::ID:
      return inputPassportElementRentalAgreement::fetch(env, p);
    case inputPassportElementPassportRegistration::ID:
      return inputPassportElementPassportRegistration::fetch(env, p);
    case inputPassportElementTemporaryRegistration::ID:
      return inputPassportElementTemporaryRegistration::fetch(env, p);
    case inputPassportElementPhoneNumber::ID:
      return inputPassportElementPhoneNumber::fetch(env, p);
    case inputPassportElementEmailAddress::ID:
      return inputPassportElementEmailAddress::fetch(env, p);
    case inputPassportElementError::ID:
      return inputPassportElementError::fetch(env, p);
    case inputPassportElementErrorSourceUnspecified::ID:
      return inputPassportElementErrorSourceUnspecified::fetch(env, p);
    case inputPassportElementErrorSourceDataField::ID:
      return inputPassportElementErrorSourceDataField::fetch(env, p);
    case inputPassportElementErrorSourceFrontSide::ID:
      return inputPassportElementErrorSourceFrontSide::fetch(env, p);
    case inputPassportElementErrorSourceReverseSide::ID:
      return inputPassportElementErrorSourceReverseSide::fetch(env, p);
    case inputPassportElementErrorSourceSelfie::ID:
      return inputPassportElementErrorSourceSelfie::fetch(env, p);
    case inputPassportElementErrorSourceTranslationFile::ID:
      return inputPassportElementErrorSourceTranslationFile::fetch(env, p);
    case inputPassportElementErrorSourceTranslationFiles::ID:
      return inputPassportElementErrorSourceTranslationFiles::fetch(env, p);
    case inputPassportElementErrorSourceFile::ID:
      return inputPassportElementErrorSourceFile::fetch(env, p);
    case inputPassportElementErrorSourceFiles::ID:
      return inputPassportElementErrorSourceFiles::fetch(env, p);
    case inputPersonalDocument::ID:
      return inputPersonalDocument::fetch(env, p);
    case inputPollOption::ID:
      return inputPollOption::fetch(env, p);
    case inputPollTypeRegular::ID:
      return inputPollTypeRegular::fetch(env, p);
    case inputPollTypeQuiz::ID:
      return inputPollTypeQuiz::fetch(env, p);
    case inputSticker::ID:
      return inputSticker::fetch(env, p);
    case inputStoryArea::ID:
      return inputStoryArea::fetch(env, p);
    case inputStoryAreaTypeLocation::ID:
      return inputStoryAreaTypeLocation::fetch(env, p);
    case inputStoryAreaTypeFoundVenue::ID:
      return inputStoryAreaTypeFoundVenue::fetch(env, p);
    case inputStoryAreaTypePreviousVenue::ID:
      return inputStoryAreaTypePreviousVenue::fetch(env, p);
    case inputStoryAreaTypeSuggestedReaction::ID:
      return inputStoryAreaTypeSuggestedReaction::fetch(env, p);
    case inputStoryAreaTypeMessage::ID:
      return inputStoryAreaTypeMessage::fetch(env, p);
    case inputStoryAreaTypeLink::ID:
      return inputStoryAreaTypeLink::fetch(env, p);
    case inputStoryAreaTypeWeather::ID:
      return inputStoryAreaTypeWeather::fetch(env, p);
    case inputStoryAreaTypeUpgradedGift::ID:
      return inputStoryAreaTypeUpgradedGift::fetch(env, p);
    case inputStoryAreas::ID:
      return inputStoryAreas::fetch(env, p);
    case inputStoryContentPhoto::ID:
      return inputStoryContentPhoto::fetch(env, p);
    case inputStoryContentVideo::ID:
      return inputStoryContentVideo::fetch(env, p);
    case inputSuggestedPostInfo::ID:
      return inputSuggestedPostInfo::fetch(env, p);
    case inputTextQuote::ID:
      return inputTextQuote::fetch(env, p);
    case inputThumbnail::ID:
      return inputThumbnail::fetch(env, p);
    case internalLinkTypeAttachmentMenuBot::ID:
      return internalLinkTypeAttachmentMenuBot::fetch(env, p);
    case internalLinkTypeAuthenticationCode::ID:
      return internalLinkTypeAuthenticationCode::fetch(env, p);
    case internalLinkTypeBackground::ID:
      return internalLinkTypeBackground::fetch(env, p);
    case internalLinkTypeBotAddToChannel::ID:
      return internalLinkTypeBotAddToChannel::fetch(env, p);
    case internalLinkTypeBotStart::ID:
      return internalLinkTypeBotStart::fetch(env, p);
    case internalLinkTypeBotStartInGroup::ID:
      return internalLinkTypeBotStartInGroup::fetch(env, p);
    case internalLinkTypeBusinessChat::ID:
      return internalLinkTypeBusinessChat::fetch(env, p);
    case internalLinkTypeCallsPage::ID:
      return internalLinkTypeCallsPage::fetch(env, p);
    case internalLinkTypeChatAffiliateProgram::ID:
      return internalLinkTypeChatAffiliateProgram::fetch(env, p);
    case internalLinkTypeChatBoost::ID:
      return internalLinkTypeChatBoost::fetch(env, p);
    case internalLinkTypeChatFolderInvite::ID:
      return internalLinkTypeChatFolderInvite::fetch(env, p);
    case internalLinkTypeChatInvite::ID:
      return internalLinkTypeChatInvite::fetch(env, p);
    case internalLinkTypeChatSelection::ID:
      return internalLinkTypeChatSelection::fetch(env, p);
    case internalLinkTypeContactsPage::ID:
      return internalLinkTypeContactsPage::fetch(env, p);
    case internalLinkTypeDirectMessagesChat::ID:
      return internalLinkTypeDirectMessagesChat::fetch(env, p);
    case internalLinkTypeGame::ID:
      return internalLinkTypeGame::fetch(env, p);
    case internalLinkTypeGiftAuction::ID:
      return internalLinkTypeGiftAuction::fetch(env, p);
    case internalLinkTypeGiftCollection::ID:
      return internalLinkTypeGiftCollection::fetch(env, p);
    case internalLinkTypeGroupCall::ID:
      return internalLinkTypeGroupCall::fetch(env, p);
    case internalLinkTypeInstantView::ID:
      return internalLinkTypeInstantView::fetch(env, p);
    case internalLinkTypeInvoice::ID:
      return internalLinkTypeInvoice::fetch(env, p);
    case internalLinkTypeLanguagePack::ID:
      return internalLinkTypeLanguagePack::fetch(env, p);
    case internalLinkTypeLiveStory::ID:
      return internalLinkTypeLiveStory::fetch(env, p);
    case internalLinkTypeMainWebApp::ID:
      return internalLinkTypeMainWebApp::fetch(env, p);
    case internalLinkTypeMessage::ID:
      return internalLinkTypeMessage::fetch(env, p);
    case internalLinkTypeMessageDraft::ID:
      return internalLinkTypeMessageDraft::fetch(env, p);
    case internalLinkTypeMyProfilePage::ID:
      return internalLinkTypeMyProfilePage::fetch(env, p);
    case internalLinkTypeNewChannelChat::ID:
      return internalLinkTypeNewChannelChat::fetch(env, p);
    case internalLinkTypeNewGroupChat::ID:
      return internalLinkTypeNewGroupChat::fetch(env, p);
    case internalLinkTypeNewPrivateChat::ID:
      return internalLinkTypeNewPrivateChat::fetch(env, p);
    case internalLinkTypeNewStory::ID:
      return internalLinkTypeNewStory::fetch(env, p);
    case internalLinkTypeOauth::ID:
      return internalLinkTypeOauth::fetch(env, p);
    case internalLinkTypePassportDataRequest::ID:
      return internalLinkTypePassportDataRequest::fetch(env, p);
    case internalLinkTypePhoneNumberConfirmation::ID:
      return internalLinkTypePhoneNumberConfirmation::fetch(env, p);
    case internalLinkTypePremiumFeaturesPage::ID:
      return internalLinkTypePremiumFeaturesPage::fetch(env, p);
    case internalLinkTypePremiumGiftCode::ID:
      return internalLinkTypePremiumGiftCode::fetch(env, p);
    case internalLinkTypePremiumGiftPurchase::ID:
      return internalLinkTypePremiumGiftPurchase::fetch(env, p);
    case internalLinkTypeProxy::ID:
      return internalLinkTypeProxy::fetch(env, p);
    case internalLinkTypePublicChat::ID:
      return internalLinkTypePublicChat::fetch(env, p);
    case internalLinkTypeQrCodeAuthentication::ID:
      return internalLinkTypeQrCodeAuthentication::fetch(env, p);
    case internalLinkTypeRequestManagedBot::ID:
      return internalLinkTypeRequestManagedBot::fetch(env, p);
    case internalLinkTypeRestorePurchases::ID:
      return internalLinkTypeRestorePurchases::fetch(env, p);
    case internalLinkTypeSavedMessages::ID:
      return internalLinkTypeSavedMessages::fetch(env, p);
    case internalLinkTypeSearch::ID:
      return internalLinkTypeSearch::fetch(env, p);
    case internalLinkTypeSettings::ID:
      return internalLinkTypeSettings::fetch(env, p);
    case internalLinkTypeStarPurchase::ID:
      return internalLinkTypeStarPurchase::fetch(env, p);
    case internalLinkTypeStickerSet::ID:
      return internalLinkTypeStickerSet::fetch(env, p);
    case internalLinkTypeStory::ID:
      return internalLinkTypeStory::fetch(env, p);
    case internalLinkTypeStoryAlbum::ID:
      return internalLinkTypeStoryAlbum::fetch(env, p);
    case internalLinkTypeTextCompositionStyle::ID:
      return internalLinkTypeTextCompositionStyle::fetch(env, p);
    case internalLinkTypeTheme::ID:
      return internalLinkTypeTheme::fetch(env, p);
    case internalLinkTypeUnknownDeepLink::ID:
      return internalLinkTypeUnknownDeepLink::fetch(env, p);
    case internalLinkTypeUpgradedGift::ID:
      return internalLinkTypeUpgradedGift::fetch(env, p);
    case internalLinkTypeUserPhoneNumber::ID:
      return internalLinkTypeUserPhoneNumber::fetch(env, p);
    case internalLinkTypeUserToken::ID:
      return internalLinkTypeUserToken::fetch(env, p);
    case internalLinkTypeVideoChat::ID:
      return internalLinkTypeVideoChat::fetch(env, p);
    case internalLinkTypeWebApp::ID:
      return internalLinkTypeWebApp::fetch(env, p);
    case inviteGroupCallParticipantResultUserPrivacyRestricted::ID:
      return inviteGroupCallParticipantResultUserPrivacyRestricted::fetch(env, p);
    case inviteGroupCallParticipantResultUserAlreadyParticipant::ID:
      return inviteGroupCallParticipantResultUserAlreadyParticipant::fetch(env, p);
    case inviteGroupCallParticipantResultUserWasBanned::ID:
      return inviteGroupCallParticipantResultUserWasBanned::fetch(env, p);
    case inviteGroupCallParticipantResultSuccess::ID:
      return inviteGroupCallParticipantResultSuccess::fetch(env, p);
    case inviteLinkChatTypeBasicGroup::ID:
      return inviteLinkChatTypeBasicGroup::fetch(env, p);
    case inviteLinkChatTypeSupergroup::ID:
      return inviteLinkChatTypeSupergroup::fetch(env, p);
    case inviteLinkChatTypeChannel::ID:
      return inviteLinkChatTypeChannel::fetch(env, p);
    case invoice::ID:
      return invoice::fetch(env, p);
    case jsonObjectMember::ID:
      return jsonObjectMember::fetch(env, p);
    case jsonValueNull::ID:
      return jsonValueNull::fetch(env, p);
    case jsonValueBoolean::ID:
      return jsonValueBoolean::fetch(env, p);
    case jsonValueNumber::ID:
      return jsonValueNumber::fetch(env, p);
    case jsonValueString::ID:
      return jsonValueString::fetch(env, p);
    case jsonValueArray::ID:
      return jsonValueArray::fetch(env, p);
    case jsonValueObject::ID:
      return jsonValueObject::fetch(env, p);
    case keyboardButton::ID:
      return keyboardButton::fetch(env, p);
    case keyboardButtonSourceMessage::ID:
      return keyboardButtonSourceMessage::fetch(env, p);
    case keyboardButtonSourceWebApp::ID:
      return keyboardButtonSourceWebApp::fetch(env, p);
    case keyboardButtonTypeText::ID:
      return keyboardButtonTypeText::fetch(env, p);
    case keyboardButtonTypeRequestPhoneNumber::ID:
      return keyboardButtonTypeRequestPhoneNumber::fetch(env, p);
    case keyboardButtonTypeRequestLocation::ID:
      return keyboardButtonTypeRequestLocation::fetch(env, p);
    case keyboardButtonTypeRequestPoll::ID:
      return keyboardButtonTypeRequestPoll::fetch(env, p);
    case keyboardButtonTypeRequestUsers::ID:
      return keyboardButtonTypeRequestUsers::fetch(env, p);
    case keyboardButtonTypeRequestChat::ID:
      return keyboardButtonTypeRequestChat::fetch(env, p);
    case keyboardButtonTypeRequestManagedBot::ID:
      return keyboardButtonTypeRequestManagedBot::fetch(env, p);
    case keyboardButtonTypeWebApp::ID:
      return keyboardButtonTypeWebApp::fetch(env, p);
    case labeledPricePart::ID:
      return labeledPricePart::fetch(env, p);
    case languagePackInfo::ID:
      return languagePackInfo::fetch(env, p);
    case languagePackString::ID:
      return languagePackString::fetch(env, p);
    case languagePackStringValueOrdinary::ID:
      return languagePackStringValueOrdinary::fetch(env, p);
    case languagePackStringValuePluralized::ID:
      return languagePackStringValuePluralized::fetch(env, p);
    case languagePackStringValueDeleted::ID:
      return languagePackStringValueDeleted::fetch(env, p);
    case languagePackStrings::ID:
      return languagePackStrings::fetch(env, p);
    case linkPreview::ID:
      return linkPreview::fetch(env, p);
    case linkPreviewAlbumMediaPhoto::ID:
      return linkPreviewAlbumMediaPhoto::fetch(env, p);
    case linkPreviewAlbumMediaVideo::ID:
      return linkPreviewAlbumMediaVideo::fetch(env, p);
    case linkPreviewOptions::ID:
      return linkPreviewOptions::fetch(env, p);
    case linkPreviewTypeAlbum::ID:
      return linkPreviewTypeAlbum::fetch(env, p);
    case linkPreviewTypeAnimation::ID:
      return linkPreviewTypeAnimation::fetch(env, p);
    case linkPreviewTypeApp::ID:
      return linkPreviewTypeApp::fetch(env, p);
    case linkPreviewTypeArticle::ID:
      return linkPreviewTypeArticle::fetch(env, p);
    case linkPreviewTypeAudio::ID:
      return linkPreviewTypeAudio::fetch(env, p);
    case linkPreviewTypeBackground::ID:
      return linkPreviewTypeBackground::fetch(env, p);
    case linkPreviewTypeChannelBoost::ID:
      return linkPreviewTypeChannelBoost::fetch(env, p);
    case linkPreviewTypeChat::ID:
      return linkPreviewTypeChat::fetch(env, p);
    case linkPreviewTypeDirectMessagesChat::ID:
      return linkPreviewTypeDirectMessagesChat::fetch(env, p);
    case linkPreviewTypeDocument::ID:
      return linkPreviewTypeDocument::fetch(env, p);
    case linkPreviewTypeEmbeddedAnimationPlayer::ID:
      return linkPreviewTypeEmbeddedAnimationPlayer::fetch(env, p);
    case linkPreviewTypeEmbeddedAudioPlayer::ID:
      return linkPreviewTypeEmbeddedAudioPlayer::fetch(env, p);
    case linkPreviewTypeEmbeddedVideoPlayer::ID:
      return linkPreviewTypeEmbeddedVideoPlayer::fetch(env, p);
    case linkPreviewTypeExternalAudio::ID:
      return linkPreviewTypeExternalAudio::fetch(env, p);
    case linkPreviewTypeExternalVideo::ID:
      return linkPreviewTypeExternalVideo::fetch(env, p);
    case linkPreviewTypeGiftAuction::ID:
      return linkPreviewTypeGiftAuction::fetch(env, p);
    case linkPreviewTypeGiftCollection::ID:
      return linkPreviewTypeGiftCollection::fetch(env, p);
    case linkPreviewTypeGroupCall::ID:
      return linkPreviewTypeGroupCall::fetch(env, p);
    case linkPreviewTypeInvoice::ID:
      return linkPreviewTypeInvoice::fetch(env, p);
    case linkPreviewTypeLiveStory::ID:
      return linkPreviewTypeLiveStory::fetch(env, p);
    case linkPreviewTypeMessage::ID:
      return linkPreviewTypeMessage::fetch(env, p);
    case linkPreviewTypePhoto::ID:
      return linkPreviewTypePhoto::fetch(env, p);
    case linkPreviewTypePremiumGiftCode::ID:
      return linkPreviewTypePremiumGiftCode::fetch(env, p);
    case linkPreviewTypeRequestManagedBot::ID:
      return linkPreviewTypeRequestManagedBot::fetch(env, p);
    case linkPreviewTypeShareableChatFolder::ID:
      return linkPreviewTypeShareableChatFolder::fetch(env, p);
    case linkPreviewTypeSticker::ID:
      return linkPreviewTypeSticker::fetch(env, p);
    case linkPreviewTypeStickerSet::ID:
      return linkPreviewTypeStickerSet::fetch(env, p);
    case linkPreviewTypeStory::ID:
      return linkPreviewTypeStory::fetch(env, p);
    case linkPreviewTypeStoryAlbum::ID:
      return linkPreviewTypeStoryAlbum::fetch(env, p);
    case linkPreviewTypeSupergroupBoost::ID:
      return linkPreviewTypeSupergroupBoost::fetch(env, p);
    case linkPreviewTypeTextCompositionStyle::ID:
      return linkPreviewTypeTextCompositionStyle::fetch(env, p);
    case linkPreviewTypeTheme::ID:
      return linkPreviewTypeTheme::fetch(env, p);
    case linkPreviewTypeUnsupported::ID:
      return linkPreviewTypeUnsupported::fetch(env, p);
    case linkPreviewTypeUpgradedGift::ID:
      return linkPreviewTypeUpgradedGift::fetch(env, p);
    case linkPreviewTypeUser::ID:
      return linkPreviewTypeUser::fetch(env, p);
    case linkPreviewTypeVideo::ID:
      return linkPreviewTypeVideo::fetch(env, p);
    case linkPreviewTypeVideoChat::ID:
      return linkPreviewTypeVideoChat::fetch(env, p);
    case linkPreviewTypeVideoNote::ID:
      return linkPreviewTypeVideoNote::fetch(env, p);
    case linkPreviewTypeVoiceNote::ID:
      return linkPreviewTypeVoiceNote::fetch(env, p);
    case linkPreviewTypeWebApp::ID:
      return linkPreviewTypeWebApp::fetch(env, p);
    case liveStoryDonors::ID:
      return liveStoryDonors::fetch(env, p);
    case localFile::ID:
      return localFile::fetch(env, p);
    case localizationTargetInfo::ID:
      return localizationTargetInfo::fetch(env, p);
    case location::ID:
      return location::fetch(env, p);
    case locationAddress::ID:
      return locationAddress::fetch(env, p);
    case logStreamDefault::ID:
      return logStreamDefault::fetch(env, p);
    case logStreamFile::ID:
      return logStreamFile::fetch(env, p);
    case logStreamEmpty::ID:
      return logStreamEmpty::fetch(env, p);
    case logTags::ID:
      return logTags::fetch(env, p);
    case logVerbosityLevel::ID:
      return logVerbosityLevel::fetch(env, p);
    case loginUrlInfoOpen::ID:
      return loginUrlInfoOpen::fetch(env, p);
    case loginUrlInfoRequestConfirmation::ID:
      return loginUrlInfoRequestConfirmation::fetch(env, p);
    case mainWebApp::ID:
      return mainWebApp::fetch(env, p);
    case maskPointForehead::ID:
      return maskPointForehead::fetch(env, p);
    case maskPointEyes::ID:
      return maskPointEyes::fetch(env, p);
    case maskPointMouth::ID:
      return maskPointMouth::fetch(env, p);
    case maskPointChin::ID:
      return maskPointChin::fetch(env, p);
    case maskPosition::ID:
      return maskPosition::fetch(env, p);
    case message::ID:
      return message::fetch(env, p);
    case messageAutoDeleteTime::ID:
      return messageAutoDeleteTime::fetch(env, p);
    case messageCalendar::ID:
      return messageCalendar::fetch(env, p);
    case messageCalendarDay::ID:
      return messageCalendarDay::fetch(env, p);
    case messageText::ID:
      return messageText::fetch(env, p);
    case messageAnimation::ID:
      return messageAnimation::fetch(env, p);
    case messageAudio::ID:
      return messageAudio::fetch(env, p);
    case messageDocument::ID:
      return messageDocument::fetch(env, p);
    case messagePaidMedia::ID:
      return messagePaidMedia::fetch(env, p);
    case messagePhoto::ID:
      return messagePhoto::fetch(env, p);
    case messageSticker::ID:
      return messageSticker::fetch(env, p);
    case messageVideo::ID:
      return messageVideo::fetch(env, p);
    case messageVideoNote::ID:
      return messageVideoNote::fetch(env, p);
    case messageVoiceNote::ID:
      return messageVoiceNote::fetch(env, p);
    case messageExpiredPhoto::ID:
      return messageExpiredPhoto::fetch(env, p);
    case messageExpiredVideo::ID:
      return messageExpiredVideo::fetch(env, p);
    case messageExpiredVideoNote::ID:
      return messageExpiredVideoNote::fetch(env, p);
    case messageExpiredVoiceNote::ID:
      return messageExpiredVoiceNote::fetch(env, p);
    case messageLocation::ID:
      return messageLocation::fetch(env, p);
    case messageVenue::ID:
      return messageVenue::fetch(env, p);
    case messageContact::ID:
      return messageContact::fetch(env, p);
    case messageAnimatedEmoji::ID:
      return messageAnimatedEmoji::fetch(env, p);
    case messageDice::ID:
      return messageDice::fetch(env, p);
    case messageGame::ID:
      return messageGame::fetch(env, p);
    case messagePoll::ID:
      return messagePoll::fetch(env, p);
    case messageStakeDice::ID:
      return messageStakeDice::fetch(env, p);
    case messageStory::ID:
      return messageStory::fetch(env, p);
    case messageChecklist::ID:
      return messageChecklist::fetch(env, p);
    case messageInvoice::ID:
      return messageInvoice::fetch(env, p);
    case messageCall::ID:
      return messageCall::fetch(env, p);
    case messageGroupCall::ID:
      return messageGroupCall::fetch(env, p);
    case messageVideoChatScheduled::ID:
      return messageVideoChatScheduled::fetch(env, p);
    case messageVideoChatStarted::ID:
      return messageVideoChatStarted::fetch(env, p);
    case messageVideoChatEnded::ID:
      return messageVideoChatEnded::fetch(env, p);
    case messageInviteVideoChatParticipants::ID:
      return messageInviteVideoChatParticipants::fetch(env, p);
    case messagePollOptionAdded::ID:
      return messagePollOptionAdded::fetch(env, p);
    case messagePollOptionDeleted::ID:
      return messagePollOptionDeleted::fetch(env, p);
    case messageBasicGroupChatCreate::ID:
      return messageBasicGroupChatCreate::fetch(env, p);
    case messageSupergroupChatCreate::ID:
      return messageSupergroupChatCreate::fetch(env, p);
    case messageChatChangeTitle::ID:
      return messageChatChangeTitle::fetch(env, p);
    case messageChatChangePhoto::ID:
      return messageChatChangePhoto::fetch(env, p);
    case messageChatDeletePhoto::ID:
      return messageChatDeletePhoto::fetch(env, p);
    case messageChatOwnerLeft::ID:
      return messageChatOwnerLeft::fetch(env, p);
    case messageChatOwnerChanged::ID:
      return messageChatOwnerChanged::fetch(env, p);
    case messageChatHasProtectedContentToggled::ID:
      return messageChatHasProtectedContentToggled::fetch(env, p);
    case messageChatHasProtectedContentDisableRequested::ID:
      return messageChatHasProtectedContentDisableRequested::fetch(env, p);
    case messageChatAddMembers::ID:
      return messageChatAddMembers::fetch(env, p);
    case messageChatJoinByLink::ID:
      return messageChatJoinByLink::fetch(env, p);
    case messageChatJoinByRequest::ID:
      return messageChatJoinByRequest::fetch(env, p);
    case messageChatDeleteMember::ID:
      return messageChatDeleteMember::fetch(env, p);
    case messageChatUpgradeTo::ID:
      return messageChatUpgradeTo::fetch(env, p);
    case messageChatUpgradeFrom::ID:
      return messageChatUpgradeFrom::fetch(env, p);
    case messagePinMessage::ID:
      return messagePinMessage::fetch(env, p);
    case messageScreenshotTaken::ID:
      return messageScreenshotTaken::fetch(env, p);
    case messageChatSetBackground::ID:
      return messageChatSetBackground::fetch(env, p);
    case messageChatSetTheme::ID:
      return messageChatSetTheme::fetch(env, p);
    case messageChatSetMessageAutoDeleteTime::ID:
      return messageChatSetMessageAutoDeleteTime::fetch(env, p);
    case messageChatBoost::ID:
      return messageChatBoost::fetch(env, p);
    case messageForumTopicCreated::ID:
      return messageForumTopicCreated::fetch(env, p);
    case messageForumTopicEdited::ID:
      return messageForumTopicEdited::fetch(env, p);
    case messageForumTopicIsClosedToggled::ID:
      return messageForumTopicIsClosedToggled::fetch(env, p);
    case messageForumTopicIsHiddenToggled::ID:
      return messageForumTopicIsHiddenToggled::fetch(env, p);
    case messageSuggestProfilePhoto::ID:
      return messageSuggestProfilePhoto::fetch(env, p);
    case messageSuggestBirthdate::ID:
      return messageSuggestBirthdate::fetch(env, p);
    case messageCustomServiceAction::ID:
      return messageCustomServiceAction::fetch(env, p);
    case messageGameScore::ID:
      return messageGameScore::fetch(env, p);
    case messageManagedBotCreated::ID:
      return messageManagedBotCreated::fetch(env, p);
    case messagePaymentSuccessful::ID:
      return messagePaymentSuccessful::fetch(env, p);
    case messagePaymentSuccessfulBot::ID:
      return messagePaymentSuccessfulBot::fetch(env, p);
    case messagePaymentRefunded::ID:
      return messagePaymentRefunded::fetch(env, p);
    case messageGiftedPremium::ID:
      return messageGiftedPremium::fetch(env, p);
    case messagePremiumGiftCode::ID:
      return messagePremiumGiftCode::fetch(env, p);
    case messageGiveawayCreated::ID:
      return messageGiveawayCreated::fetch(env, p);
    case messageGiveaway::ID:
      return messageGiveaway::fetch(env, p);
    case messageGiveawayCompleted::ID:
      return messageGiveawayCompleted::fetch(env, p);
    case messageGiveawayWinners::ID:
      return messageGiveawayWinners::fetch(env, p);
    case messageGiftedStars::ID:
      return messageGiftedStars::fetch(env, p);
    case messageGiftedTon::ID:
      return messageGiftedTon::fetch(env, p);
    case messageGiveawayPrizeStars::ID:
      return messageGiveawayPrizeStars::fetch(env, p);
    case messageGift::ID:
      return messageGift::fetch(env, p);
    case messageUpgradedGift::ID:
      return messageUpgradedGift::fetch(env, p);
    case messageRefundedUpgradedGift::ID:
      return messageRefundedUpgradedGift::fetch(env, p);
    case messageUpgradedGiftPurchaseOffer::ID:
      return messageUpgradedGiftPurchaseOffer::fetch(env, p);
    case messageUpgradedGiftPurchaseOfferRejected::ID:
      return messageUpgradedGiftPurchaseOfferRejected::fetch(env, p);
    case messagePaidMessagesRefunded::ID:
      return messagePaidMessagesRefunded::fetch(env, p);
    case messagePaidMessagePriceChanged::ID:
      return messagePaidMessagePriceChanged::fetch(env, p);
    case messageDirectMessagePriceChanged::ID:
      return messageDirectMessagePriceChanged::fetch(env, p);
    case messageChecklistTasksDone::ID:
      return messageChecklistTasksDone::fetch(env, p);
    case messageChecklistTasksAdded::ID:
      return messageChecklistTasksAdded::fetch(env, p);
    case messageSuggestedPostApprovalFailed::ID:
      return messageSuggestedPostApprovalFailed::fetch(env, p);
    case messageSuggestedPostApproved::ID:
      return messageSuggestedPostApproved::fetch(env, p);
    case messageSuggestedPostDeclined::ID:
      return messageSuggestedPostDeclined::fetch(env, p);
    case messageSuggestedPostPaid::ID:
      return messageSuggestedPostPaid::fetch(env, p);
    case messageSuggestedPostRefunded::ID:
      return messageSuggestedPostRefunded::fetch(env, p);
    case messageContactRegistered::ID:
      return messageContactRegistered::fetch(env, p);
    case messageUsersShared::ID:
      return messageUsersShared::fetch(env, p);
    case messageChatShared::ID:
      return messageChatShared::fetch(env, p);
    case messageBotWriteAccessAllowed::ID:
      return messageBotWriteAccessAllowed::fetch(env, p);
    case messageWebAppDataSent::ID:
      return messageWebAppDataSent::fetch(env, p);
    case messageWebAppDataReceived::ID:
      return messageWebAppDataReceived::fetch(env, p);
    case messagePassportDataSent::ID:
      return messagePassportDataSent::fetch(env, p);
    case messagePassportDataReceived::ID:
      return messagePassportDataReceived::fetch(env, p);
    case messageProximityAlertTriggered::ID:
      return messageProximityAlertTriggered::fetch(env, p);
    case messageUnsupported::ID:
      return messageUnsupported::fetch(env, p);
    case messageCopyOptions::ID:
      return messageCopyOptions::fetch(env, p);
    case messageEffect::ID:
      return messageEffect::fetch(env, p);
    case messageEffectTypeEmojiReaction::ID:
      return messageEffectTypeEmojiReaction::fetch(env, p);
    case messageEffectTypePremiumSticker::ID:
      return messageEffectTypePremiumSticker::fetch(env, p);
    case messageFileTypePrivate::ID:
      return messageFileTypePrivate::fetch(env, p);
    case messageFileTypeGroup::ID:
      return messageFileTypeGroup::fetch(env, p);
    case messageFileTypeUnknown::ID:
      return messageFileTypeUnknown::fetch(env, p);
    case messageForwardInfo::ID:
      return messageForwardInfo::fetch(env, p);
    case messageImportInfo::ID:
      return messageImportInfo::fetch(env, p);
    case messageInteractionInfo::ID:
      return messageInteractionInfo::fetch(env, p);
    case messageLink::ID:
      return messageLink::fetch(env, p);
    case messageLinkInfo::ID:
      return messageLinkInfo::fetch(env, p);
    case messageOriginUser::ID:
      return messageOriginUser::fetch(env, p);
    case messageOriginHiddenUser::ID:
      return messageOriginHiddenUser::fetch(env, p);
    case messageOriginChat::ID:
      return messageOriginChat::fetch(env, p);
    case messageOriginChannel::ID:
      return messageOriginChannel::fetch(env, p);
    case messagePosition::ID:
      return messagePosition::fetch(env, p);
    case messagePositions::ID:
      return messagePositions::fetch(env, p);
    case messageProperties::ID:
      return messageProperties::fetch(env, p);
    case messageReaction::ID:
      return messageReaction::fetch(env, p);
    case messageReactions::ID:
      return messageReactions::fetch(env, p);
    case messageReadDateRead::ID:
      return messageReadDateRead::fetch(env, p);
    case messageReadDateUnread::ID:
      return messageReadDateUnread::fetch(env, p);
    case messageReadDateTooOld::ID:
      return messageReadDateTooOld::fetch(env, p);
    case messageReadDateUserPrivacyRestricted::ID:
      return messageReadDateUserPrivacyRestricted::fetch(env, p);
    case messageReadDateMyPrivacyRestricted::ID:
      return messageReadDateMyPrivacyRestricted::fetch(env, p);
    case messageReplyInfo::ID:
      return messageReplyInfo::fetch(env, p);
    case messageReplyToMessage::ID:
      return messageReplyToMessage::fetch(env, p);
    case messageReplyToStory::ID:
      return messageReplyToStory::fetch(env, p);
    case messageSchedulingStateSendAtDate::ID:
      return messageSchedulingStateSendAtDate::fetch(env, p);
    case messageSchedulingStateSendWhenOnline::ID:
      return messageSchedulingStateSendWhenOnline::fetch(env, p);
    case messageSchedulingStateSendWhenVideoProcessed::ID:
      return messageSchedulingStateSendWhenVideoProcessed::fetch(env, p);
    case messageSelfDestructTypeTimer::ID:
      return messageSelfDestructTypeTimer::fetch(env, p);
    case messageSelfDestructTypeImmediately::ID:
      return messageSelfDestructTypeImmediately::fetch(env, p);
    case messageSendOptions::ID:
      return messageSendOptions::fetch(env, p);
    case messageSenderUser::ID:
      return messageSenderUser::fetch(env, p);
    case messageSenderChat::ID:
      return messageSenderChat::fetch(env, p);
    case messageSenders::ID:
      return messageSenders::fetch(env, p);
    case messageSendingStatePending::ID:
      return messageSendingStatePending::fetch(env, p);
    case messageSendingStateFailed::ID:
      return messageSendingStateFailed::fetch(env, p);
    case messageSourceChatHistory::ID:
      return messageSourceChatHistory::fetch(env, p);
    case messageSourceMessageThreadHistory::ID:
      return messageSourceMessageThreadHistory::fetch(env, p);
    case messageSourceForumTopicHistory::ID:
      return messageSourceForumTopicHistory::fetch(env, p);
    case messageSourceDirectMessagesChatTopicHistory::ID:
      return messageSourceDirectMessagesChatTopicHistory::fetch(env, p);
    case messageSourceHistoryPreview::ID:
      return messageSourceHistoryPreview::fetch(env, p);
    case messageSourceChatList::ID:
      return messageSourceChatList::fetch(env, p);
    case messageSourceSearch::ID:
      return messageSourceSearch::fetch(env, p);
    case messageSourceChatEventLog::ID:
      return messageSourceChatEventLog::fetch(env, p);
    case messageSourceNotification::ID:
      return messageSourceNotification::fetch(env, p);
    case messageSourceScreenshot::ID:
      return messageSourceScreenshot::fetch(env, p);
    case messageSourceOther::ID:
      return messageSourceOther::fetch(env, p);
    case messageStatistics::ID:
      return messageStatistics::fetch(env, p);
    case messageThreadInfo::ID:
      return messageThreadInfo::fetch(env, p);
    case messageTopicThread::ID:
      return messageTopicThread::fetch(env, p);
    case messageTopicForum::ID:
      return messageTopicForum::fetch(env, p);
    case messageTopicDirectMessages::ID:
      return messageTopicDirectMessages::fetch(env, p);
    case messageTopicSavedMessages::ID:
      return messageTopicSavedMessages::fetch(env, p);
    case messageViewer::ID:
      return messageViewer::fetch(env, p);
    case messageViewers::ID:
      return messageViewers::fetch(env, p);
    case messages::ID:
      return messages::fetch(env, p);
    case minithumbnail::ID:
      return minithumbnail::fetch(env, p);
    case networkStatistics::ID:
      return networkStatistics::fetch(env, p);
    case networkStatisticsEntryFile::ID:
      return networkStatisticsEntryFile::fetch(env, p);
    case networkStatisticsEntryCall::ID:
      return networkStatisticsEntryCall::fetch(env, p);
    case networkTypeNone::ID:
      return networkTypeNone::fetch(env, p);
    case networkTypeMobile::ID:
      return networkTypeMobile::fetch(env, p);
    case networkTypeMobileRoaming::ID:
      return networkTypeMobileRoaming::fetch(env, p);
    case networkTypeWiFi::ID:
      return networkTypeWiFi::fetch(env, p);
    case networkTypeOther::ID:
      return networkTypeOther::fetch(env, p);
    case newChatPrivacySettings::ID:
      return newChatPrivacySettings::fetch(env, p);
    case notification::ID:
      return notification::fetch(env, p);
    case notificationGroup::ID:
      return notificationGroup::fetch(env, p);
    case notificationGroupTypeMessages::ID:
      return notificationGroupTypeMessages::fetch(env, p);
    case notificationGroupTypeMentions::ID:
      return notificationGroupTypeMentions::fetch(env, p);
    case notificationGroupTypeSecretChat::ID:
      return notificationGroupTypeSecretChat::fetch(env, p);
    case notificationGroupTypeCalls::ID:
      return notificationGroupTypeCalls::fetch(env, p);
    case notificationSettingsScopePrivateChats::ID:
      return notificationSettingsScopePrivateChats::fetch(env, p);
    case notificationSettingsScopeGroupChats::ID:
      return notificationSettingsScopeGroupChats::fetch(env, p);
    case notificationSettingsScopeChannelChats::ID:
      return notificationSettingsScopeChannelChats::fetch(env, p);
    case notificationSound::ID:
      return notificationSound::fetch(env, p);
    case notificationSounds::ID:
      return notificationSounds::fetch(env, p);
    case notificationTypeNewMessage::ID:
      return notificationTypeNewMessage::fetch(env, p);
    case notificationTypeNewSecretChat::ID:
      return notificationTypeNewSecretChat::fetch(env, p);
    case notificationTypeNewCall::ID:
      return notificationTypeNewCall::fetch(env, p);
    case notificationTypeNewPushMessage::ID:
      return notificationTypeNewPushMessage::fetch(env, p);
    case oauthLinkInfo::ID:
      return oauthLinkInfo::fetch(env, p);
    case ok::ID:
      return ok::fetch(env, p);
    case optionValueBoolean::ID:
      return optionValueBoolean::fetch(env, p);
    case optionValueEmpty::ID:
      return optionValueEmpty::fetch(env, p);
    case optionValueInteger::ID:
      return optionValueInteger::fetch(env, p);
    case optionValueString::ID:
      return optionValueString::fetch(env, p);
    case orderInfo::ID:
      return orderInfo::fetch(env, p);
    case outline::ID:
      return outline::fetch(env, p);
    case pageBlockTitle::ID:
      return pageBlockTitle::fetch(env, p);
    case pageBlockSubtitle::ID:
      return pageBlockSubtitle::fetch(env, p);
    case pageBlockAuthorDate::ID:
      return pageBlockAuthorDate::fetch(env, p);
    case pageBlockHeader::ID:
      return pageBlockHeader::fetch(env, p);
    case pageBlockSubheader::ID:
      return pageBlockSubheader::fetch(env, p);
    case pageBlockKicker::ID:
      return pageBlockKicker::fetch(env, p);
    case pageBlockParagraph::ID:
      return pageBlockParagraph::fetch(env, p);
    case pageBlockPreformatted::ID:
      return pageBlockPreformatted::fetch(env, p);
    case pageBlockFooter::ID:
      return pageBlockFooter::fetch(env, p);
    case pageBlockDivider::ID:
      return pageBlockDivider::fetch(env, p);
    case pageBlockAnchor::ID:
      return pageBlockAnchor::fetch(env, p);
    case pageBlockList::ID:
      return pageBlockList::fetch(env, p);
    case pageBlockBlockQuote::ID:
      return pageBlockBlockQuote::fetch(env, p);
    case pageBlockPullQuote::ID:
      return pageBlockPullQuote::fetch(env, p);
    case pageBlockAnimation::ID:
      return pageBlockAnimation::fetch(env, p);
    case pageBlockAudio::ID:
      return pageBlockAudio::fetch(env, p);
    case pageBlockPhoto::ID:
      return pageBlockPhoto::fetch(env, p);
    case pageBlockVideo::ID:
      return pageBlockVideo::fetch(env, p);
    case pageBlockVoiceNote::ID:
      return pageBlockVoiceNote::fetch(env, p);
    case pageBlockCover::ID:
      return pageBlockCover::fetch(env, p);
    case pageBlockEmbedded::ID:
      return pageBlockEmbedded::fetch(env, p);
    case pageBlockEmbeddedPost::ID:
      return pageBlockEmbeddedPost::fetch(env, p);
    case pageBlockCollage::ID:
      return pageBlockCollage::fetch(env, p);
    case pageBlockSlideshow::ID:
      return pageBlockSlideshow::fetch(env, p);
    case pageBlockChatLink::ID:
      return pageBlockChatLink::fetch(env, p);
    case pageBlockTable::ID:
      return pageBlockTable::fetch(env, p);
    case pageBlockDetails::ID:
      return pageBlockDetails::fetch(env, p);
    case pageBlockRelatedArticles::ID:
      return pageBlockRelatedArticles::fetch(env, p);
    case pageBlockMap::ID:
      return pageBlockMap::fetch(env, p);
    case pageBlockCaption::ID:
      return pageBlockCaption::fetch(env, p);
    case pageBlockHorizontalAlignmentLeft::ID:
      return pageBlockHorizontalAlignmentLeft::fetch(env, p);
    case pageBlockHorizontalAlignmentCenter::ID:
      return pageBlockHorizontalAlignmentCenter::fetch(env, p);
    case pageBlockHorizontalAlignmentRight::ID:
      return pageBlockHorizontalAlignmentRight::fetch(env, p);
    case pageBlockListItem::ID:
      return pageBlockListItem::fetch(env, p);
    case pageBlockRelatedArticle::ID:
      return pageBlockRelatedArticle::fetch(env, p);
    case pageBlockTableCell::ID:
      return pageBlockTableCell::fetch(env, p);
    case pageBlockVerticalAlignmentTop::ID:
      return pageBlockVerticalAlignmentTop::fetch(env, p);
    case pageBlockVerticalAlignmentMiddle::ID:
      return pageBlockVerticalAlignmentMiddle::fetch(env, p);
    case pageBlockVerticalAlignmentBottom::ID:
      return pageBlockVerticalAlignmentBottom::fetch(env, p);
    case paidMediaPreview::ID:
      return paidMediaPreview::fetch(env, p);
    case paidMediaPhoto::ID:
      return paidMediaPhoto::fetch(env, p);
    case paidMediaVideo::ID:
      return paidMediaVideo::fetch(env, p);
    case paidMediaUnsupported::ID:
      return paidMediaUnsupported::fetch(env, p);
    case paidReactionTypeRegular::ID:
      return paidReactionTypeRegular::fetch(env, p);
    case paidReactionTypeAnonymous::ID:
      return paidReactionTypeAnonymous::fetch(env, p);
    case paidReactionTypeChat::ID:
      return paidReactionTypeChat::fetch(env, p);
    case paidReactor::ID:
      return paidReactor::fetch(env, p);
    case passkey::ID:
      return passkey::fetch(env, p);
    case passkeys::ID:
      return passkeys::fetch(env, p);
    case passportAuthorizationForm::ID:
      return passportAuthorizationForm::fetch(env, p);
    case passportElementPersonalDetails::ID:
      return passportElementPersonalDetails::fetch(env, p);
    case passportElementPassport::ID:
      return passportElementPassport::fetch(env, p);
    case passportElementDriverLicense::ID:
      return passportElementDriverLicense::fetch(env, p);
    case passportElementIdentityCard::ID:
      return passportElementIdentityCard::fetch(env, p);
    case passportElementInternalPassport::ID:
      return passportElementInternalPassport::fetch(env, p);
    case passportElementAddress::ID:
      return passportElementAddress::fetch(env, p);
    case passportElementUtilityBill::ID:
      return passportElementUtilityBill::fetch(env, p);
    case passportElementBankStatement::ID:
      return passportElementBankStatement::fetch(env, p);
    case passportElementRentalAgreement::ID:
      return passportElementRentalAgreement::fetch(env, p);
    case passportElementPassportRegistration::ID:
      return passportElementPassportRegistration::fetch(env, p);
    case passportElementTemporaryRegistration::ID:
      return passportElementTemporaryRegistration::fetch(env, p);
    case passportElementPhoneNumber::ID:
      return passportElementPhoneNumber::fetch(env, p);
    case passportElementEmailAddress::ID:
      return passportElementEmailAddress::fetch(env, p);
    case passportElementError::ID:
      return passportElementError::fetch(env, p);
    case passportElementErrorSourceUnspecified::ID:
      return passportElementErrorSourceUnspecified::fetch(env, p);
    case passportElementErrorSourceDataField::ID:
      return passportElementErrorSourceDataField::fetch(env, p);
    case passportElementErrorSourceFrontSide::ID:
      return passportElementErrorSourceFrontSide::fetch(env, p);
    case passportElementErrorSourceReverseSide::ID:
      return passportElementErrorSourceReverseSide::fetch(env, p);
    case passportElementErrorSourceSelfie::ID:
      return passportElementErrorSourceSelfie::fetch(env, p);
    case passportElementErrorSourceTranslationFile::ID:
      return passportElementErrorSourceTranslationFile::fetch(env, p);
    case passportElementErrorSourceTranslationFiles::ID:
      return passportElementErrorSourceTranslationFiles::fetch(env, p);
    case passportElementErrorSourceFile::ID:
      return passportElementErrorSourceFile::fetch(env, p);
    case passportElementErrorSourceFiles::ID:
      return passportElementErrorSourceFiles::fetch(env, p);
    case passportElementTypePersonalDetails::ID:
      return passportElementTypePersonalDetails::fetch(env, p);
    case passportElementTypePassport::ID:
      return passportElementTypePassport::fetch(env, p);
    case passportElementTypeDriverLicense::ID:
      return passportElementTypeDriverLicense::fetch(env, p);
    case passportElementTypeIdentityCard::ID:
      return passportElementTypeIdentityCard::fetch(env, p);
    case passportElementTypeInternalPassport::ID:
      return passportElementTypeInternalPassport::fetch(env, p);
    case passportElementTypeAddress::ID:
      return passportElementTypeAddress::fetch(env, p);
    case passportElementTypeUtilityBill::ID:
      return passportElementTypeUtilityBill::fetch(env, p);
    case passportElementTypeBankStatement::ID:
      return passportElementTypeBankStatement::fetch(env, p);
    case passportElementTypeRentalAgreement::ID:
      return passportElementTypeRentalAgreement::fetch(env, p);
    case passportElementTypePassportRegistration::ID:
      return passportElementTypePassportRegistration::fetch(env, p);
    case passportElementTypeTemporaryRegistration::ID:
      return passportElementTypeTemporaryRegistration::fetch(env, p);
    case passportElementTypePhoneNumber::ID:
      return passportElementTypePhoneNumber::fetch(env, p);
    case passportElementTypeEmailAddress::ID:
      return passportElementTypeEmailAddress::fetch(env, p);
    case passportElements::ID:
      return passportElements::fetch(env, p);
    case passportElementsWithErrors::ID:
      return passportElementsWithErrors::fetch(env, p);
    case passportRequiredElement::ID:
      return passportRequiredElement::fetch(env, p);
    case passportSuitableElement::ID:
      return passportSuitableElement::fetch(env, p);
    case passwordState::ID:
      return passwordState::fetch(env, p);
    case paymentForm::ID:
      return paymentForm::fetch(env, p);
    case paymentFormTypeRegular::ID:
      return paymentFormTypeRegular::fetch(env, p);
    case paymentFormTypeStars::ID:
      return paymentFormTypeStars::fetch(env, p);
    case paymentFormTypeStarSubscription::ID:
      return paymentFormTypeStarSubscription::fetch(env, p);
    case paymentOption::ID:
      return paymentOption::fetch(env, p);
    case paymentProviderSmartGlocal::ID:
      return paymentProviderSmartGlocal::fetch(env, p);
    case paymentProviderStripe::ID:
      return paymentProviderStripe::fetch(env, p);
    case paymentProviderOther::ID:
      return paymentProviderOther::fetch(env, p);
    case paymentReceipt::ID:
      return paymentReceipt::fetch(env, p);
    case paymentReceiptTypeRegular::ID:
      return paymentReceiptTypeRegular::fetch(env, p);
    case paymentReceiptTypeStars::ID:
      return paymentReceiptTypeStars::fetch(env, p);
    case paymentResult::ID:
      return paymentResult::fetch(env, p);
    case personalDetails::ID:
      return personalDetails::fetch(env, p);
    case personalDocument::ID:
      return personalDocument::fetch(env, p);
    case phoneNumberAuthenticationSettings::ID:
      return phoneNumberAuthenticationSettings::fetch(env, p);
    case phoneNumberCodeTypeChange::ID:
      return phoneNumberCodeTypeChange::fetch(env, p);
    case phoneNumberCodeTypeVerify::ID:
      return phoneNumberCodeTypeVerify::fetch(env, p);
    case phoneNumberCodeTypeConfirmOwnership::ID:
      return phoneNumberCodeTypeConfirmOwnership::fetch(env, p);
    case phoneNumberInfo::ID:
      return phoneNumberInfo::fetch(env, p);
    case photo::ID:
      return photo::fetch(env, p);
    case photoSize::ID:
      return photoSize::fetch(env, p);
    case point::ID:
      return point::fetch(env, p);
    case poll::ID:
      return poll::fetch(env, p);
    case pollOption::ID:
      return pollOption::fetch(env, p);
    case pollOptionProperties::ID:
      return pollOptionProperties::fetch(env, p);
    case pollTypeRegular::ID:
      return pollTypeRegular::fetch(env, p);
    case pollTypeQuiz::ID:
      return pollTypeQuiz::fetch(env, p);
    case pollVoteRestrictionReasonClosed::ID:
      return pollVoteRestrictionReasonClosed::fetch(env, p);
    case pollVoteRestrictionReasonYetUnsent::ID:
      return pollVoteRestrictionReasonYetUnsent::fetch(env, p);
    case pollVoteRestrictionReasonScheduled::ID:
      return pollVoteRestrictionReasonScheduled::fetch(env, p);
    case pollVoteRestrictionReasonCountryRestricted::ID:
      return pollVoteRestrictionReasonCountryRestricted::fetch(env, p);
    case pollVoteRestrictionReasonMembershipRequired::ID:
      return pollVoteRestrictionReasonMembershipRequired::fetch(env, p);
    case pollVoteRestrictionReasonOther::ID:
      return pollVoteRestrictionReasonOther::fetch(env, p);
    case pollVoteStatistics::ID:
      return pollVoteStatistics::fetch(env, p);
    case pollVoter::ID:
      return pollVoter::fetch(env, p);
    case pollVoters::ID:
      return pollVoters::fetch(env, p);
    case premiumFeatureIncreasedLimits::ID:
      return premiumFeatureIncreasedLimits::fetch(env, p);
    case premiumFeatureIncreasedUploadFileSize::ID:
      return premiumFeatureIncreasedUploadFileSize::fetch(env, p);
    case premiumFeatureImprovedDownloadSpeed::ID:
      return premiumFeatureImprovedDownloadSpeed::fetch(env, p);
    case premiumFeatureVoiceRecognition::ID:
      return premiumFeatureVoiceRecognition::fetch(env, p);
    case premiumFeatureDisabledAds::ID:
      return premiumFeatureDisabledAds::fetch(env, p);
    case premiumFeatureUniqueReactions::ID:
      return premiumFeatureUniqueReactions::fetch(env, p);
    case premiumFeatureUniqueStickers::ID:
      return premiumFeatureUniqueStickers::fetch(env, p);
    case premiumFeatureCustomEmoji::ID:
      return premiumFeatureCustomEmoji::fetch(env, p);
    case premiumFeatureAdvancedChatManagement::ID:
      return premiumFeatureAdvancedChatManagement::fetch(env, p);
    case premiumFeatureProfileBadge::ID:
      return premiumFeatureProfileBadge::fetch(env, p);
    case premiumFeatureEmojiStatus::ID:
      return premiumFeatureEmojiStatus::fetch(env, p);
    case premiumFeatureAnimatedProfilePhoto::ID:
      return premiumFeatureAnimatedProfilePhoto::fetch(env, p);
    case premiumFeatureForumTopicIcon::ID:
      return premiumFeatureForumTopicIcon::fetch(env, p);
    case premiumFeatureAppIcons::ID:
      return premiumFeatureAppIcons::fetch(env, p);
    case premiumFeatureRealTimeChatTranslation::ID:
      return premiumFeatureRealTimeChatTranslation::fetch(env, p);
    case premiumFeatureUpgradedStories::ID:
      return premiumFeatureUpgradedStories::fetch(env, p);
    case premiumFeatureChatBoost::ID:
      return premiumFeatureChatBoost::fetch(env, p);
    case premiumFeatureAccentColor::ID:
      return premiumFeatureAccentColor::fetch(env, p);
    case premiumFeatureBackgroundForBoth::ID:
      return premiumFeatureBackgroundForBoth::fetch(env, p);
    case premiumFeatureSavedMessagesTags::ID:
      return premiumFeatureSavedMessagesTags::fetch(env, p);
    case premiumFeatureMessagePrivacy::ID:
      return premiumFeatureMessagePrivacy::fetch(env, p);
    case premiumFeatureLastSeenTimes::ID:
      return premiumFeatureLastSeenTimes::fetch(env, p);
    case premiumFeatureBusiness::ID:
      return premiumFeatureBusiness::fetch(env, p);
    case premiumFeatureMessageEffects::ID:
      return premiumFeatureMessageEffects::fetch(env, p);
    case premiumFeatureChecklists::ID:
      return premiumFeatureChecklists::fetch(env, p);
    case premiumFeaturePaidMessages::ID:
      return premiumFeaturePaidMessages::fetch(env, p);
    case premiumFeatureProtectPrivateChatContent::ID:
      return premiumFeatureProtectPrivateChatContent::fetch(env, p);
    case premiumFeatureTextComposition::ID:
      return premiumFeatureTextComposition::fetch(env, p);
    case premiumFeaturePromotionAnimation::ID:
      return premiumFeaturePromotionAnimation::fetch(env, p);
    case premiumFeatures::ID:
      return premiumFeatures::fetch(env, p);
    case premiumGiftCodeInfo::ID:
      return premiumGiftCodeInfo::fetch(env, p);
    case premiumGiftPaymentOption::ID:
      return premiumGiftPaymentOption::fetch(env, p);
    case premiumGiftPaymentOptions::ID:
      return premiumGiftPaymentOptions::fetch(env, p);
    case premiumGiveawayPaymentOption::ID:
      return premiumGiveawayPaymentOption::fetch(env, p);
    case premiumGiveawayPaymentOptions::ID:
      return premiumGiveawayPaymentOptions::fetch(env, p);
    case premiumLimit::ID:
      return premiumLimit::fetch(env, p);
    case premiumLimitTypeSupergroupCount::ID:
      return premiumLimitTypeSupergroupCount::fetch(env, p);
    case premiumLimitTypePinnedChatCount::ID:
      return premiumLimitTypePinnedChatCount::fetch(env, p);
    case premiumLimitTypeCreatedPublicChatCount::ID:
      return premiumLimitTypeCreatedPublicChatCount::fetch(env, p);
    case premiumLimitTypeSavedAnimationCount::ID:
      return premiumLimitTypeSavedAnimationCount::fetch(env, p);
    case premiumLimitTypeFavoriteStickerCount::ID:
      return premiumLimitTypeFavoriteStickerCount::fetch(env, p);
    case premiumLimitTypeChatFolderCount::ID:
      return premiumLimitTypeChatFolderCount::fetch(env, p);
    case premiumLimitTypeChatFolderChosenChatCount::ID:
      return premiumLimitTypeChatFolderChosenChatCount::fetch(env, p);
    case premiumLimitTypePinnedArchivedChatCount::ID:
      return premiumLimitTypePinnedArchivedChatCount::fetch(env, p);
    case premiumLimitTypePinnedSavedMessagesTopicCount::ID:
      return premiumLimitTypePinnedSavedMessagesTopicCount::fetch(env, p);
    case premiumLimitTypeCaptionLength::ID:
      return premiumLimitTypeCaptionLength::fetch(env, p);
    case premiumLimitTypeBioLength::ID:
      return premiumLimitTypeBioLength::fetch(env, p);
    case premiumLimitTypeChatFolderInviteLinkCount::ID:
      return premiumLimitTypeChatFolderInviteLinkCount::fetch(env, p);
    case premiumLimitTypeShareableChatFolderCount::ID:
      return premiumLimitTypeShareableChatFolderCount::fetch(env, p);
    case premiumLimitTypeActiveStoryCount::ID:
      return premiumLimitTypeActiveStoryCount::fetch(env, p);
    case premiumLimitTypeWeeklyPostedStoryCount::ID:
      return premiumLimitTypeWeeklyPostedStoryCount::fetch(env, p);
    case premiumLimitTypeMonthlyPostedStoryCount::ID:
      return premiumLimitTypeMonthlyPostedStoryCount::fetch(env, p);
    case premiumLimitTypeStoryCaptionLength::ID:
      return premiumLimitTypeStoryCaptionLength::fetch(env, p);
    case premiumLimitTypeStorySuggestedReactionAreaCount::ID:
      return premiumLimitTypeStorySuggestedReactionAreaCount::fetch(env, p);
    case premiumLimitTypeSimilarChatCount::ID:
      return premiumLimitTypeSimilarChatCount::fetch(env, p);
    case premiumLimitTypeOwnedBotCount::ID:
      return premiumLimitTypeOwnedBotCount::fetch(env, p);
    case premiumLimitTypeCustomTextCompositionStyleCount::ID:
      return premiumLimitTypeCustomTextCompositionStyleCount::fetch(env, p);
    case premiumPaymentOption::ID:
      return premiumPaymentOption::fetch(env, p);
    case premiumSourceLimitExceeded::ID:
      return premiumSourceLimitExceeded::fetch(env, p);
    case premiumSourceFeature::ID:
      return premiumSourceFeature::fetch(env, p);
    case premiumSourceBusinessFeature::ID:
      return premiumSourceBusinessFeature::fetch(env, p);
    case premiumSourceStoryFeature::ID:
      return premiumSourceStoryFeature::fetch(env, p);
    case premiumSourceLink::ID:
      return premiumSourceLink::fetch(env, p);
    case premiumSourceSettings::ID:
      return premiumSourceSettings::fetch(env, p);
    case premiumState::ID:
      return premiumState::fetch(env, p);
    case premiumStatePaymentOption::ID:
      return premiumStatePaymentOption::fetch(env, p);
    case premiumStoryFeaturePriorityOrder::ID:
      return premiumStoryFeaturePriorityOrder::fetch(env, p);
    case premiumStoryFeatureStealthMode::ID:
      return premiumStoryFeatureStealthMode::fetch(env, p);
    case premiumStoryFeaturePermanentViewsHistory::ID:
      return premiumStoryFeaturePermanentViewsHistory::fetch(env, p);
    case premiumStoryFeatureCustomExpirationDuration::ID:
      return premiumStoryFeatureCustomExpirationDuration::fetch(env, p);
    case premiumStoryFeatureSaveStories::ID:
      return premiumStoryFeatureSaveStories::fetch(env, p);
    case premiumStoryFeatureLinksAndFormatting::ID:
      return premiumStoryFeatureLinksAndFormatting::fetch(env, p);
    case premiumStoryFeatureVideoQuality::ID:
      return premiumStoryFeatureVideoQuality::fetch(env, p);
    case prepaidGiveaway::ID:
      return prepaidGiveaway::fetch(env, p);
    case preparedInlineMessage::ID:
      return preparedInlineMessage::fetch(env, p);
    case preparedInlineMessageId::ID:
      return preparedInlineMessageId::fetch(env, p);
    case productInfo::ID:
      return productInfo::fetch(env, p);
    case profileAccentColor::ID:
      return profileAccentColor::fetch(env, p);
    case profileAccentColors::ID:
      return profileAccentColors::fetch(env, p);
    case profilePhoto::ID:
      return profilePhoto::fetch(env, p);
    case profileTabPosts::ID:
      return profileTabPosts::fetch(env, p);
    case profileTabGifts::ID:
      return profileTabGifts::fetch(env, p);
    case profileTabMedia::ID:
      return profileTabMedia::fetch(env, p);
    case profileTabFiles::ID:
      return profileTabFiles::fetch(env, p);
    case profileTabLinks::ID:
      return profileTabLinks::fetch(env, p);
    case profileTabMusic::ID:
      return profileTabMusic::fetch(env, p);
    case profileTabVoice::ID:
      return profileTabVoice::fetch(env, p);
    case profileTabGifs::ID:
      return profileTabGifs::fetch(env, p);
    case proxy::ID:
      return proxy::fetch(env, p);
    case proxyTypeSocks5::ID:
      return proxyTypeSocks5::fetch(env, p);
    case proxyTypeHttp::ID:
      return proxyTypeHttp::fetch(env, p);
    case proxyTypeMtproto::ID:
      return proxyTypeMtproto::fetch(env, p);
    case publicChatTypeHasUsername::ID:
      return publicChatTypeHasUsername::fetch(env, p);
    case publicChatTypeIsLocationBased::ID:
      return publicChatTypeIsLocationBased::fetch(env, p);
    case publicForwardMessage::ID:
      return publicForwardMessage::fetch(env, p);
    case publicForwardStory::ID:
      return publicForwardStory::fetch(env, p);
    case publicForwards::ID:
      return publicForwards::fetch(env, p);
    case publicPostSearchLimits::ID:
      return publicPostSearchLimits::fetch(env, p);
    case pushMessageContentHidden::ID:
      return pushMessageContentHidden::fetch(env, p);
    case pushMessageContentAnimation::ID:
      return pushMessageContentAnimation::fetch(env, p);
    case pushMessageContentAudio::ID:
      return pushMessageContentAudio::fetch(env, p);
    case pushMessageContentContact::ID:
      return pushMessageContentContact::fetch(env, p);
    case pushMessageContentContactRegistered::ID:
      return pushMessageContentContactRegistered::fetch(env, p);
    case pushMessageContentDocument::ID:
      return pushMessageContentDocument::fetch(env, p);
    case pushMessageContentGame::ID:
      return pushMessageContentGame::fetch(env, p);
    case pushMessageContentGameScore::ID:
      return pushMessageContentGameScore::fetch(env, p);
    case pushMessageContentInvoice::ID:
      return pushMessageContentInvoice::fetch(env, p);
    case pushMessageContentLocation::ID:
      return pushMessageContentLocation::fetch(env, p);
    case pushMessageContentPaidMedia::ID:
      return pushMessageContentPaidMedia::fetch(env, p);
    case pushMessageContentPhoto::ID:
      return pushMessageContentPhoto::fetch(env, p);
    case pushMessageContentPoll::ID:
      return pushMessageContentPoll::fetch(env, p);
    case pushMessageContentPremiumGiftCode::ID:
      return pushMessageContentPremiumGiftCode::fetch(env, p);
    case pushMessageContentGiveaway::ID:
      return pushMessageContentGiveaway::fetch(env, p);
    case pushMessageContentGift::ID:
      return pushMessageContentGift::fetch(env, p);
    case pushMessageContentUpgradedGift::ID:
      return pushMessageContentUpgradedGift::fetch(env, p);
    case pushMessageContentScreenshotTaken::ID:
      return pushMessageContentScreenshotTaken::fetch(env, p);
    case pushMessageContentSticker::ID:
      return pushMessageContentSticker::fetch(env, p);
    case pushMessageContentStory::ID:
      return pushMessageContentStory::fetch(env, p);
    case pushMessageContentText::ID:
      return pushMessageContentText::fetch(env, p);
    case pushMessageContentChecklist::ID:
      return pushMessageContentChecklist::fetch(env, p);
    case pushMessageContentVideo::ID:
      return pushMessageContentVideo::fetch(env, p);
    case pushMessageContentVideoNote::ID:
      return pushMessageContentVideoNote::fetch(env, p);
    case pushMessageContentVoiceNote::ID:
      return pushMessageContentVoiceNote::fetch(env, p);
    case pushMessageContentBasicGroupChatCreate::ID:
      return pushMessageContentBasicGroupChatCreate::fetch(env, p);
    case pushMessageContentVideoChatStarted::ID:
      return pushMessageContentVideoChatStarted::fetch(env, p);
    case pushMessageContentVideoChatEnded::ID:
      return pushMessageContentVideoChatEnded::fetch(env, p);
    case pushMessageContentInviteVideoChatParticipants::ID:
      return pushMessageContentInviteVideoChatParticipants::fetch(env, p);
    case pushMessageContentChatAddMembers::ID:
      return pushMessageContentChatAddMembers::fetch(env, p);
    case pushMessageContentChatChangePhoto::ID:
      return pushMessageContentChatChangePhoto::fetch(env, p);
    case pushMessageContentChatChangeTitle::ID:
      return pushMessageContentChatChangeTitle::fetch(env, p);
    case pushMessageContentChatSetBackground::ID:
      return pushMessageContentChatSetBackground::fetch(env, p);
    case pushMessageContentChatSetTheme::ID:
      return pushMessageContentChatSetTheme::fetch(env, p);
    case pushMessageContentChatDeleteMember::ID:
      return pushMessageContentChatDeleteMember::fetch(env, p);
    case pushMessageContentChatJoinByLink::ID:
      return pushMessageContentChatJoinByLink::fetch(env, p);
    case pushMessageContentChatJoinByRequest::ID:
      return pushMessageContentChatJoinByRequest::fetch(env, p);
    case pushMessageContentRecurringPayment::ID:
      return pushMessageContentRecurringPayment::fetch(env, p);
    case pushMessageContentSuggestProfilePhoto::ID:
      return pushMessageContentSuggestProfilePhoto::fetch(env, p);
    case pushMessageContentSuggestBirthdate::ID:
      return pushMessageContentSuggestBirthdate::fetch(env, p);
    case pushMessageContentProximityAlertTriggered::ID:
      return pushMessageContentProximityAlertTriggered::fetch(env, p);
    case pushMessageContentChecklistTasksAdded::ID:
      return pushMessageContentChecklistTasksAdded::fetch(env, p);
    case pushMessageContentChecklistTasksDone::ID:
      return pushMessageContentChecklistTasksDone::fetch(env, p);
    case pushMessageContentPollOptionAdded::ID:
      return pushMessageContentPollOptionAdded::fetch(env, p);
    case pushMessageContentMessageForwards::ID:
      return pushMessageContentMessageForwards::fetch(env, p);
    case pushMessageContentMediaAlbum::ID:
      return pushMessageContentMediaAlbum::fetch(env, p);
    case pushReceiverId::ID:
      return pushReceiverId::fetch(env, p);
    case quickReplyMessage::ID:
      return quickReplyMessage::fetch(env, p);
    case quickReplyMessages::ID:
      return quickReplyMessages::fetch(env, p);
    case quickReplyShortcut::ID:
      return quickReplyShortcut::fetch(env, p);
    case reactionNotificationSettings::ID:
      return reactionNotificationSettings::fetch(env, p);
    case reactionNotificationSourceNone::ID:
      return reactionNotificationSourceNone::fetch(env, p);
    case reactionNotificationSourceContacts::ID:
      return reactionNotificationSourceContacts::fetch(env, p);
    case reactionNotificationSourceAll::ID:
      return reactionNotificationSourceAll::fetch(env, p);
    case reactionTypeEmoji::ID:
      return reactionTypeEmoji::fetch(env, p);
    case reactionTypeCustomEmoji::ID:
      return reactionTypeCustomEmoji::fetch(env, p);
    case reactionTypePaid::ID:
      return reactionTypePaid::fetch(env, p);
    case reactionUnavailabilityReasonAnonymousAdministrator::ID:
      return reactionUnavailabilityReasonAnonymousAdministrator::fetch(env, p);
    case reactionUnavailabilityReasonGuest::ID:
      return reactionUnavailabilityReasonGuest::fetch(env, p);
    case reactionUnavailabilityReasonRestricted::ID:
      return reactionUnavailabilityReasonRestricted::fetch(env, p);
    case readDatePrivacySettings::ID:
      return readDatePrivacySettings::fetch(env, p);
    case receivedGift::ID:
      return receivedGift::fetch(env, p);
    case receivedGifts::ID:
      return receivedGifts::fetch(env, p);
    case recommendedChatFolder::ID:
      return recommendedChatFolder::fetch(env, p);
    case recommendedChatFolders::ID:
      return recommendedChatFolders::fetch(env, p);
    case recoveryEmailAddress::ID:
      return recoveryEmailAddress::fetch(env, p);
    case remoteFile::ID:
      return remoteFile::fetch(env, p);
    case replyMarkupRemoveKeyboard::ID:
      return replyMarkupRemoveKeyboard::fetch(env, p);
    case replyMarkupForceReply::ID:
      return replyMarkupForceReply::fetch(env, p);
    case replyMarkupShowKeyboard::ID:
      return replyMarkupShowKeyboard::fetch(env, p);
    case replyMarkupInlineKeyboard::ID:
      return replyMarkupInlineKeyboard::fetch(env, p);
    case reportChatResultOk::ID:
      return reportChatResultOk::fetch(env, p);
    case reportChatResultOptionRequired::ID:
      return reportChatResultOptionRequired::fetch(env, p);
    case reportChatResultTextRequired::ID:
      return reportChatResultTextRequired::fetch(env, p);
    case reportChatResultMessagesRequired::ID:
      return reportChatResultMessagesRequired::fetch(env, p);
    case reportOption::ID:
      return reportOption::fetch(env, p);
    case reportReasonSpam::ID:
      return reportReasonSpam::fetch(env, p);
    case reportReasonViolence::ID:
      return reportReasonViolence::fetch(env, p);
    case reportReasonPornography::ID:
      return reportReasonPornography::fetch(env, p);
    case reportReasonChildAbuse::ID:
      return reportReasonChildAbuse::fetch(env, p);
    case reportReasonCopyright::ID:
      return reportReasonCopyright::fetch(env, p);
    case reportReasonUnrelatedLocation::ID:
      return reportReasonUnrelatedLocation::fetch(env, p);
    case reportReasonFake::ID:
      return reportReasonFake::fetch(env, p);
    case reportReasonIllegalDrugs::ID:
      return reportReasonIllegalDrugs::fetch(env, p);
    case reportReasonPersonalDetails::ID:
      return reportReasonPersonalDetails::fetch(env, p);
    case reportReasonCustom::ID:
      return reportReasonCustom::fetch(env, p);
    case reportSponsoredResultOk::ID:
      return reportSponsoredResultOk::fetch(env, p);
    case reportSponsoredResultFailed::ID:
      return reportSponsoredResultFailed::fetch(env, p);
    case reportSponsoredResultOptionRequired::ID:
      return reportSponsoredResultOptionRequired::fetch(env, p);
    case reportSponsoredResultAdsHidden::ID:
      return reportSponsoredResultAdsHidden::fetch(env, p);
    case reportSponsoredResultPremiumRequired::ID:
      return reportSponsoredResultPremiumRequired::fetch(env, p);
    case reportStoryResultOk::ID:
      return reportStoryResultOk::fetch(env, p);
    case reportStoryResultOptionRequired::ID:
      return reportStoryResultOptionRequired::fetch(env, p);
    case reportStoryResultTextRequired::ID:
      return reportStoryResultTextRequired::fetch(env, p);
    case resendCodeReasonUserRequest::ID:
      return resendCodeReasonUserRequest::fetch(env, p);
    case resendCodeReasonVerificationFailed::ID:
      return resendCodeReasonVerificationFailed::fetch(env, p);
    case resetPasswordResultOk::ID:
      return resetPasswordResultOk::fetch(env, p);
    case resetPasswordResultPending::ID:
      return resetPasswordResultPending::fetch(env, p);
    case resetPasswordResultDeclined::ID:
      return resetPasswordResultDeclined::fetch(env, p);
    case restrictionInfo::ID:
      return restrictionInfo::fetch(env, p);
    case revenueWithdrawalStatePending::ID:
      return revenueWithdrawalStatePending::fetch(env, p);
    case revenueWithdrawalStateSucceeded::ID:
      return revenueWithdrawalStateSucceeded::fetch(env, p);
    case revenueWithdrawalStateFailed::ID:
      return revenueWithdrawalStateFailed::fetch(env, p);
    case richTextPlain::ID:
      return richTextPlain::fetch(env, p);
    case richTextBold::ID:
      return richTextBold::fetch(env, p);
    case richTextItalic::ID:
      return richTextItalic::fetch(env, p);
    case richTextUnderline::ID:
      return richTextUnderline::fetch(env, p);
    case richTextStrikethrough::ID:
      return richTextStrikethrough::fetch(env, p);
    case richTextFixed::ID:
      return richTextFixed::fetch(env, p);
    case richTextUrl::ID:
      return richTextUrl::fetch(env, p);
    case richTextEmailAddress::ID:
      return richTextEmailAddress::fetch(env, p);
    case richTextSubscript::ID:
      return richTextSubscript::fetch(env, p);
    case richTextSuperscript::ID:
      return richTextSuperscript::fetch(env, p);
    case richTextMarked::ID:
      return richTextMarked::fetch(env, p);
    case richTextPhoneNumber::ID:
      return richTextPhoneNumber::fetch(env, p);
    case richTextIcon::ID:
      return richTextIcon::fetch(env, p);
    case richTextReference::ID:
      return richTextReference::fetch(env, p);
    case richTextAnchor::ID:
      return richTextAnchor::fetch(env, p);
    case richTextAnchorLink::ID:
      return richTextAnchorLink::fetch(env, p);
    case richTexts::ID:
      return richTexts::fetch(env, p);
    case rtmpUrl::ID:
      return rtmpUrl::fetch(env, p);
    case savedCredentials::ID:
      return savedCredentials::fetch(env, p);
    case savedMessagesTag::ID:
      return savedMessagesTag::fetch(env, p);
    case savedMessagesTags::ID:
      return savedMessagesTags::fetch(env, p);
    case savedMessagesTopic::ID:
      return savedMessagesTopic::fetch(env, p);
    case savedMessagesTopicTypeMyNotes::ID:
      return savedMessagesTopicTypeMyNotes::fetch(env, p);
    case savedMessagesTopicTypeAuthorHidden::ID:
      return savedMessagesTopicTypeAuthorHidden::fetch(env, p);
    case savedMessagesTopicTypeSavedFromChat::ID:
      return savedMessagesTopicTypeSavedFromChat::fetch(env, p);
    case scopeAutosaveSettings::ID:
      return scopeAutosaveSettings::fetch(env, p);
    case scopeNotificationSettings::ID:
      return scopeNotificationSettings::fetch(env, p);
    case searchMessagesChatTypeFilterPrivate::ID:
      return searchMessagesChatTypeFilterPrivate::fetch(env, p);
    case searchMessagesChatTypeFilterGroup::ID:
      return searchMessagesChatTypeFilterGroup::fetch(env, p);
    case searchMessagesChatTypeFilterChannel::ID:
      return searchMessagesChatTypeFilterChannel::fetch(env, p);
    case searchMessagesFilterEmpty::ID:
      return searchMessagesFilterEmpty::fetch(env, p);
    case searchMessagesFilterAnimation::ID:
      return searchMessagesFilterAnimation::fetch(env, p);
    case searchMessagesFilterAudio::ID:
      return searchMessagesFilterAudio::fetch(env, p);
    case searchMessagesFilterDocument::ID:
      return searchMessagesFilterDocument::fetch(env, p);
    case searchMessagesFilterPhoto::ID:
      return searchMessagesFilterPhoto::fetch(env, p);
    case searchMessagesFilterPoll::ID:
      return searchMessagesFilterPoll::fetch(env, p);
    case searchMessagesFilterVideo::ID:
      return searchMessagesFilterVideo::fetch(env, p);
    case searchMessagesFilterVoiceNote::ID:
      return searchMessagesFilterVoiceNote::fetch(env, p);
    case searchMessagesFilterPhotoAndVideo::ID:
      return searchMessagesFilterPhotoAndVideo::fetch(env, p);
    case searchMessagesFilterUrl::ID:
      return searchMessagesFilterUrl::fetch(env, p);
    case searchMessagesFilterChatPhoto::ID:
      return searchMessagesFilterChatPhoto::fetch(env, p);
    case searchMessagesFilterVideoNote::ID:
      return searchMessagesFilterVideoNote::fetch(env, p);
    case searchMessagesFilterVoiceAndVideoNote::ID:
      return searchMessagesFilterVoiceAndVideoNote::fetch(env, p);
    case searchMessagesFilterMention::ID:
      return searchMessagesFilterMention::fetch(env, p);
    case searchMessagesFilterUnreadMention::ID:
      return searchMessagesFilterUnreadMention::fetch(env, p);
    case searchMessagesFilterUnreadReaction::ID:
      return searchMessagesFilterUnreadReaction::fetch(env, p);
    case searchMessagesFilterUnreadPollVote::ID:
      return searchMessagesFilterUnreadPollVote::fetch(env, p);
    case searchMessagesFilterFailedToSend::ID:
      return searchMessagesFilterFailedToSend::fetch(env, p);
    case searchMessagesFilterPinned::ID:
      return searchMessagesFilterPinned::fetch(env, p);
    case seconds::ID:
      return seconds::fetch(env, p);
    case secretChat::ID:
      return secretChat::fetch(env, p);
    case secretChatStatePending::ID:
      return secretChatStatePending::fetch(env, p);
    case secretChatStateReady::ID:
      return secretChatStateReady::fetch(env, p);
    case secretChatStateClosed::ID:
      return secretChatStateClosed::fetch(env, p);
    case sentGiftRegular::ID:
      return sentGiftRegular::fetch(env, p);
    case sentGiftUpgraded::ID:
      return sentGiftUpgraded::fetch(env, p);
    case session::ID:
      return session::fetch(env, p);
    case sessionTypeAndroid::ID:
      return sessionTypeAndroid::fetch(env, p);
    case sessionTypeApple::ID:
      return sessionTypeApple::fetch(env, p);
    case sessionTypeBrave::ID:
      return sessionTypeBrave::fetch(env, p);
    case sessionTypeChrome::ID:
      return sessionTypeChrome::fetch(env, p);
    case sessionTypeEdge::ID:
      return sessionTypeEdge::fetch(env, p);
    case sessionTypeFirefox::ID:
      return sessionTypeFirefox::fetch(env, p);
    case sessionTypeIpad::ID:
      return sessionTypeIpad::fetch(env, p);
    case sessionTypeIphone::ID:
      return sessionTypeIphone::fetch(env, p);
    case sessionTypeLinux::ID:
      return sessionTypeLinux::fetch(env, p);
    case sessionTypeMac::ID:
      return sessionTypeMac::fetch(env, p);
    case sessionTypeOpera::ID:
      return sessionTypeOpera::fetch(env, p);
    case sessionTypeSafari::ID:
      return sessionTypeSafari::fetch(env, p);
    case sessionTypeUbuntu::ID:
      return sessionTypeUbuntu::fetch(env, p);
    case sessionTypeUnknown::ID:
      return sessionTypeUnknown::fetch(env, p);
    case sessionTypeVivaldi::ID:
      return sessionTypeVivaldi::fetch(env, p);
    case sessionTypeWindows::ID:
      return sessionTypeWindows::fetch(env, p);
    case sessionTypeXbox::ID:
      return sessionTypeXbox::fetch(env, p);
    case sessions::ID:
      return sessions::fetch(env, p);
    case settingsSectionAppearance::ID:
      return settingsSectionAppearance::fetch(env, p);
    case settingsSectionAskQuestion::ID:
      return settingsSectionAskQuestion::fetch(env, p);
    case settingsSectionBusiness::ID:
      return settingsSectionBusiness::fetch(env, p);
    case settingsSectionChatFolders::ID:
      return settingsSectionChatFolders::fetch(env, p);
    case settingsSectionDataAndStorage::ID:
      return settingsSectionDataAndStorage::fetch(env, p);
    case settingsSectionDevices::ID:
      return settingsSectionDevices::fetch(env, p);
    case settingsSectionEditProfile::ID:
      return settingsSectionEditProfile::fetch(env, p);
    case settingsSectionFaq::ID:
      return settingsSectionFaq::fetch(env, p);
    case settingsSectionFeatures::ID:
      return settingsSectionFeatures::fetch(env, p);
    case settingsSectionInAppBrowser::ID:
      return settingsSectionInAppBrowser::fetch(env, p);
    case settingsSectionLanguage::ID:
      return settingsSectionLanguage::fetch(env, p);
    case settingsSectionMyStars::ID:
      return settingsSectionMyStars::fetch(env, p);
    case settingsSectionMyToncoins::ID:
      return settingsSectionMyToncoins::fetch(env, p);
    case settingsSectionNotifications::ID:
      return settingsSectionNotifications::fetch(env, p);
    case settingsSectionPowerSaving::ID:
      return settingsSectionPowerSaving::fetch(env, p);
    case settingsSectionPremium::ID:
      return settingsSectionPremium::fetch(env, p);
    case settingsSectionPrivacyAndSecurity::ID:
      return settingsSectionPrivacyAndSecurity::fetch(env, p);
    case settingsSectionPrivacyPolicy::ID:
      return settingsSectionPrivacyPolicy::fetch(env, p);
    case settingsSectionQrCode::ID:
      return settingsSectionQrCode::fetch(env, p);
    case settingsSectionSearch::ID:
      return settingsSectionSearch::fetch(env, p);
    case settingsSectionSendGift::ID:
      return settingsSectionSendGift::fetch(env, p);
    case sharedChat::ID:
      return sharedChat::fetch(env, p);
    case sharedUser::ID:
      return sharedUser::fetch(env, p);
    case shippingOption::ID:
      return shippingOption::fetch(env, p);
    case speechRecognitionResultPending::ID:
      return speechRecognitionResultPending::fetch(env, p);
    case speechRecognitionResultText::ID:
      return speechRecognitionResultText::fetch(env, p);
    case speechRecognitionResultError::ID:
      return speechRecognitionResultError::fetch(env, p);
    case sponsoredChat::ID:
      return sponsoredChat::fetch(env, p);
    case sponsoredChats::ID:
      return sponsoredChats::fetch(env, p);
    case sponsoredMessage::ID:
      return sponsoredMessage::fetch(env, p);
    case sponsoredMessages::ID:
      return sponsoredMessages::fetch(env, p);
    case stakeDiceState::ID:
      return stakeDiceState::fetch(env, p);
    case starAmount::ID:
      return starAmount::fetch(env, p);
    case starCount::ID:
      return starCount::fetch(env, p);
    case starGiveawayPaymentOption::ID:
      return starGiveawayPaymentOption::fetch(env, p);
    case starGiveawayPaymentOptions::ID:
      return starGiveawayPaymentOptions::fetch(env, p);
    case starGiveawayWinnerOption::ID:
      return starGiveawayWinnerOption::fetch(env, p);
    case starPaymentOption::ID:
      return starPaymentOption::fetch(env, p);
    case starPaymentOptions::ID:
      return starPaymentOptions::fetch(env, p);
    case starRevenueStatistics::ID:
      return starRevenueStatistics::fetch(env, p);
    case starRevenueStatus::ID:
      return starRevenueStatus::fetch(env, p);
    case starSubscription::ID:
      return starSubscription::fetch(env, p);
    case starSubscriptionPricing::ID:
      return starSubscriptionPricing::fetch(env, p);
    case starSubscriptionTypeChannel::ID:
      return starSubscriptionTypeChannel::fetch(env, p);
    case starSubscriptionTypeBot::ID:
      return starSubscriptionTypeBot::fetch(env, p);
    case starSubscriptions::ID:
      return starSubscriptions::fetch(env, p);
    case starTransaction::ID:
      return starTransaction::fetch(env, p);
    case starTransactionTypePremiumBotDeposit::ID:
      return starTransactionTypePremiumBotDeposit::fetch(env, p);
    case starTransactionTypeAppStoreDeposit::ID:
      return starTransactionTypeAppStoreDeposit::fetch(env, p);
    case starTransactionTypeGooglePlayDeposit::ID:
      return starTransactionTypeGooglePlayDeposit::fetch(env, p);
    case starTransactionTypeFragmentDeposit::ID:
      return starTransactionTypeFragmentDeposit::fetch(env, p);
    case starTransactionTypeUserDeposit::ID:
      return starTransactionTypeUserDeposit::fetch(env, p);
    case starTransactionTypeGiveawayDeposit::ID:
      return starTransactionTypeGiveawayDeposit::fetch(env, p);
    case starTransactionTypeFragmentWithdrawal::ID:
      return starTransactionTypeFragmentWithdrawal::fetch(env, p);
    case starTransactionTypeTelegramAdsWithdrawal::ID:
      return starTransactionTypeTelegramAdsWithdrawal::fetch(env, p);
    case starTransactionTypeTelegramApiUsage::ID:
      return starTransactionTypeTelegramApiUsage::fetch(env, p);
    case starTransactionTypeBotPaidMediaPurchase::ID:
      return starTransactionTypeBotPaidMediaPurchase::fetch(env, p);
    case starTransactionTypeBotPaidMediaSale::ID:
      return starTransactionTypeBotPaidMediaSale::fetch(env, p);
    case starTransactionTypeChannelPaidMediaPurchase::ID:
      return starTransactionTypeChannelPaidMediaPurchase::fetch(env, p);
    case starTransactionTypeChannelPaidMediaSale::ID:
      return starTransactionTypeChannelPaidMediaSale::fetch(env, p);
    case starTransactionTypeBotInvoicePurchase::ID:
      return starTransactionTypeBotInvoicePurchase::fetch(env, p);
    case starTransactionTypeBotInvoiceSale::ID:
      return starTransactionTypeBotInvoiceSale::fetch(env, p);
    case starTransactionTypeBotSubscriptionPurchase::ID:
      return starTransactionTypeBotSubscriptionPurchase::fetch(env, p);
    case starTransactionTypeBotSubscriptionSale::ID:
      return starTransactionTypeBotSubscriptionSale::fetch(env, p);
    case starTransactionTypeChannelSubscriptionPurchase::ID:
      return starTransactionTypeChannelSubscriptionPurchase::fetch(env, p);
    case starTransactionTypeChannelSubscriptionSale::ID:
      return starTransactionTypeChannelSubscriptionSale::fetch(env, p);
    case starTransactionTypeGiftAuctionBid::ID:
      return starTransactionTypeGiftAuctionBid::fetch(env, p);
    case starTransactionTypeGiftPurchase::ID:
      return starTransactionTypeGiftPurchase::fetch(env, p);
    case starTransactionTypeGiftPurchaseOffer::ID:
      return starTransactionTypeGiftPurchaseOffer::fetch(env, p);
    case starTransactionTypeGiftTransfer::ID:
      return starTransactionTypeGiftTransfer::fetch(env, p);
    case starTransactionTypeGiftOriginalDetailsDrop::ID:
      return starTransactionTypeGiftOriginalDetailsDrop::fetch(env, p);
    case starTransactionTypeGiftSale::ID:
      return starTransactionTypeGiftSale::fetch(env, p);
    case starTransactionTypeGiftUpgrade::ID:
      return starTransactionTypeGiftUpgrade::fetch(env, p);
    case starTransactionTypeGiftUpgradePurchase::ID:
      return starTransactionTypeGiftUpgradePurchase::fetch(env, p);
    case starTransactionTypeUpgradedGiftPurchase::ID:
      return starTransactionTypeUpgradedGiftPurchase::fetch(env, p);
    case starTransactionTypeUpgradedGiftSale::ID:
      return starTransactionTypeUpgradedGiftSale::fetch(env, p);
    case starTransactionTypeChannelPaidReactionSend::ID:
      return starTransactionTypeChannelPaidReactionSend::fetch(env, p);
    case starTransactionTypeChannelPaidReactionReceive::ID:
      return starTransactionTypeChannelPaidReactionReceive::fetch(env, p);
    case starTransactionTypeAffiliateProgramCommission::ID:
      return starTransactionTypeAffiliateProgramCommission::fetch(env, p);
    case starTransactionTypePaidMessageSend::ID:
      return starTransactionTypePaidMessageSend::fetch(env, p);
    case starTransactionTypePaidMessageReceive::ID:
      return starTransactionTypePaidMessageReceive::fetch(env, p);
    case starTransactionTypePaidGroupCallMessageSend::ID:
      return starTransactionTypePaidGroupCallMessageSend::fetch(env, p);
    case starTransactionTypePaidGroupCallMessageReceive::ID:
      return starTransactionTypePaidGroupCallMessageReceive::fetch(env, p);
    case starTransactionTypePaidGroupCallReactionSend::ID:
      return starTransactionTypePaidGroupCallReactionSend::fetch(env, p);
    case starTransactionTypePaidGroupCallReactionReceive::ID:
      return starTransactionTypePaidGroupCallReactionReceive::fetch(env, p);
    case starTransactionTypeSuggestedPostPaymentSend::ID:
      return starTransactionTypeSuggestedPostPaymentSend::fetch(env, p);
    case starTransactionTypeSuggestedPostPaymentReceive::ID:
      return starTransactionTypeSuggestedPostPaymentReceive::fetch(env, p);
    case starTransactionTypePremiumPurchase::ID:
      return starTransactionTypePremiumPurchase::fetch(env, p);
    case starTransactionTypeBusinessBotTransferSend::ID:
      return starTransactionTypeBusinessBotTransferSend::fetch(env, p);
    case starTransactionTypeBusinessBotTransferReceive::ID:
      return starTransactionTypeBusinessBotTransferReceive::fetch(env, p);
    case starTransactionTypePublicPostSearch::ID:
      return starTransactionTypePublicPostSearch::fetch(env, p);
    case starTransactionTypeUnsupported::ID:
      return starTransactionTypeUnsupported::fetch(env, p);
    case starTransactions::ID:
      return starTransactions::fetch(env, p);
    case startLiveStoryResultOk::ID:
      return startLiveStoryResultOk::fetch(env, p);
    case startLiveStoryResultFail::ID:
      return startLiveStoryResultFail::fetch(env, p);
    case statisticalGraphData::ID:
      return statisticalGraphData::fetch(env, p);
    case statisticalGraphAsync::ID:
      return statisticalGraphAsync::fetch(env, p);
    case statisticalGraphError::ID:
      return statisticalGraphError::fetch(env, p);
    case statisticalValue::ID:
      return statisticalValue::fetch(env, p);
    case sticker::ID:
      return sticker::fetch(env, p);
    case stickerFormatWebp::ID:
      return stickerFormatWebp::fetch(env, p);
    case stickerFormatTgs::ID:
      return stickerFormatTgs::fetch(env, p);
    case stickerFormatWebm::ID:
      return stickerFormatWebm::fetch(env, p);
    case stickerFullTypeRegular::ID:
      return stickerFullTypeRegular::fetch(env, p);
    case stickerFullTypeMask::ID:
      return stickerFullTypeMask::fetch(env, p);
    case stickerFullTypeCustomEmoji::ID:
      return stickerFullTypeCustomEmoji::fetch(env, p);
    case stickerSet::ID:
      return stickerSet::fetch(env, p);
    case stickerSetInfo::ID:
      return stickerSetInfo::fetch(env, p);
    case stickerSets::ID:
      return stickerSets::fetch(env, p);
    case stickerTypeRegular::ID:
      return stickerTypeRegular::fetch(env, p);
    case stickerTypeMask::ID:
      return stickerTypeMask::fetch(env, p);
    case stickerTypeCustomEmoji::ID:
      return stickerTypeCustomEmoji::fetch(env, p);
    case stickers::ID:
      return stickers::fetch(env, p);
    case storageStatistics::ID:
      return storageStatistics::fetch(env, p);
    case storageStatisticsByChat::ID:
      return storageStatisticsByChat::fetch(env, p);
    case storageStatisticsByFileType::ID:
      return storageStatisticsByFileType::fetch(env, p);
    case storageStatisticsFast::ID:
      return storageStatisticsFast::fetch(env, p);
    case storePaymentPurposePremiumSubscription::ID:
      return storePaymentPurposePremiumSubscription::fetch(env, p);
    case storePaymentPurposePremiumGift::ID:
      return storePaymentPurposePremiumGift::fetch(env, p);
    case storePaymentPurposePremiumGiftCodes::ID:
      return storePaymentPurposePremiumGiftCodes::fetch(env, p);
    case storePaymentPurposePremiumGiveaway::ID:
      return storePaymentPurposePremiumGiveaway::fetch(env, p);
    case storePaymentPurposeStarGiveaway::ID:
      return storePaymentPurposeStarGiveaway::fetch(env, p);
    case storePaymentPurposeStars::ID:
      return storePaymentPurposeStars::fetch(env, p);
    case storePaymentPurposeGiftedStars::ID:
      return storePaymentPurposeGiftedStars::fetch(env, p);
    case storeTransactionAppStore::ID:
      return storeTransactionAppStore::fetch(env, p);
    case storeTransactionGooglePlay::ID:
      return storeTransactionGooglePlay::fetch(env, p);
    case stories::ID:
      return stories::fetch(env, p);
    case story::ID:
      return story::fetch(env, p);
    case storyAlbum::ID:
      return storyAlbum::fetch(env, p);
    case storyAlbums::ID:
      return storyAlbums::fetch(env, p);
    case storyArea::ID:
      return storyArea::fetch(env, p);
    case storyAreaPosition::ID:
      return storyAreaPosition::fetch(env, p);
    case storyAreaTypeLocation::ID:
      return storyAreaTypeLocation::fetch(env, p);
    case storyAreaTypeVenue::ID:
      return storyAreaTypeVenue::fetch(env, p);
    case storyAreaTypeSuggestedReaction::ID:
      return storyAreaTypeSuggestedReaction::fetch(env, p);
    case storyAreaTypeMessage::ID:
      return storyAreaTypeMessage::fetch(env, p);
    case storyAreaTypeLink::ID:
      return storyAreaTypeLink::fetch(env, p);
    case storyAreaTypeWeather::ID:
      return storyAreaTypeWeather::fetch(env, p);
    case storyAreaTypeUpgradedGift::ID:
      return storyAreaTypeUpgradedGift::fetch(env, p);
    case storyContentPhoto::ID:
      return storyContentPhoto::fetch(env, p);
    case storyContentVideo::ID:
      return storyContentVideo::fetch(env, p);
    case storyContentLive::ID:
      return storyContentLive::fetch(env, p);
    case storyContentUnsupported::ID:
      return storyContentUnsupported::fetch(env, p);
    case storyContentTypePhoto::ID:
      return storyContentTypePhoto::fetch(env, p);
    case storyContentTypeVideo::ID:
      return storyContentTypeVideo::fetch(env, p);
    case storyContentTypeLive::ID:
      return storyContentTypeLive::fetch(env, p);
    case storyContentTypeUnsupported::ID:
      return storyContentTypeUnsupported::fetch(env, p);
    case storyFullId::ID:
      return storyFullId::fetch(env, p);
    case storyInfo::ID:
      return storyInfo::fetch(env, p);
    case storyInteraction::ID:
      return storyInteraction::fetch(env, p);
    case storyInteractionInfo::ID:
      return storyInteractionInfo::fetch(env, p);
    case storyInteractionTypeView::ID:
      return storyInteractionTypeView::fetch(env, p);
    case storyInteractionTypeForward::ID:
      return storyInteractionTypeForward::fetch(env, p);
    case storyInteractionTypeRepost::ID:
      return storyInteractionTypeRepost::fetch(env, p);
    case storyInteractions::ID:
      return storyInteractions::fetch(env, p);
    case storyListMain::ID:
      return storyListMain::fetch(env, p);
    case storyListArchive::ID:
      return storyListArchive::fetch(env, p);
    case storyOriginPublicStory::ID:
      return storyOriginPublicStory::fetch(env, p);
    case storyOriginHiddenUser::ID:
      return storyOriginHiddenUser::fetch(env, p);
    case storyPrivacySettingsEveryone::ID:
      return storyPrivacySettingsEveryone::fetch(env, p);
    case storyPrivacySettingsContacts::ID:
      return storyPrivacySettingsContacts::fetch(env, p);
    case storyPrivacySettingsCloseFriends::ID:
      return storyPrivacySettingsCloseFriends::fetch(env, p);
    case storyPrivacySettingsSelectedUsers::ID:
      return storyPrivacySettingsSelectedUsers::fetch(env, p);
    case storyRepostInfo::ID:
      return storyRepostInfo::fetch(env, p);
    case storyStatistics::ID:
      return storyStatistics::fetch(env, p);
    case storyVideo::ID:
      return storyVideo::fetch(env, p);
    case suggestedActionEnableArchiveAndMuteNewChats::ID:
      return suggestedActionEnableArchiveAndMuteNewChats::fetch(env, p);
    case suggestedActionCheckPassword::ID:
      return suggestedActionCheckPassword::fetch(env, p);
    case suggestedActionCheckPhoneNumber::ID:
      return suggestedActionCheckPhoneNumber::fetch(env, p);
    case suggestedActionViewChecksHint::ID:
      return suggestedActionViewChecksHint::fetch(env, p);
    case suggestedActionConvertToBroadcastGroup::ID:
      return suggestedActionConvertToBroadcastGroup::fetch(env, p);
    case suggestedActionSetPassword::ID:
      return suggestedActionSetPassword::fetch(env, p);
    case suggestedActionUpgradePremium::ID:
      return suggestedActionUpgradePremium::fetch(env, p);
    case suggestedActionRestorePremium::ID:
      return suggestedActionRestorePremium::fetch(env, p);
    case suggestedActionSubscribeToAnnualPremium::ID:
      return suggestedActionSubscribeToAnnualPremium::fetch(env, p);
    case suggestedActionGiftPremiumForChristmas::ID:
      return suggestedActionGiftPremiumForChristmas::fetch(env, p);
    case suggestedActionSetBirthdate::ID:
      return suggestedActionSetBirthdate::fetch(env, p);
    case suggestedActionSetProfilePhoto::ID:
      return suggestedActionSetProfilePhoto::fetch(env, p);
    case suggestedActionExtendPremium::ID:
      return suggestedActionExtendPremium::fetch(env, p);
    case suggestedActionExtendStarSubscriptions::ID:
      return suggestedActionExtendStarSubscriptions::fetch(env, p);
    case suggestedActionCustom::ID:
      return suggestedActionCustom::fetch(env, p);
    case suggestedActionSetLoginEmailAddress::ID:
      return suggestedActionSetLoginEmailAddress::fetch(env, p);
    case suggestedActionAddLoginPasskey::ID:
      return suggestedActionAddLoginPasskey::fetch(env, p);
    case suggestedPostInfo::ID:
      return suggestedPostInfo::fetch(env, p);
    case suggestedPostPriceStar::ID:
      return suggestedPostPriceStar::fetch(env, p);
    case suggestedPostPriceTon::ID:
      return suggestedPostPriceTon::fetch(env, p);
    case suggestedPostRefundReasonPostDeleted::ID:
      return suggestedPostRefundReasonPostDeleted::fetch(env, p);
    case suggestedPostRefundReasonPaymentRefunded::ID:
      return suggestedPostRefundReasonPaymentRefunded::fetch(env, p);
    case suggestedPostStatePending::ID:
      return suggestedPostStatePending::fetch(env, p);
    case suggestedPostStateApproved::ID:
      return suggestedPostStateApproved::fetch(env, p);
    case suggestedPostStateDeclined::ID:
      return suggestedPostStateDeclined::fetch(env, p);
    case supergroup::ID:
      return supergroup::fetch(env, p);
    case supergroupFullInfo::ID:
      return supergroupFullInfo::fetch(env, p);
    case supergroupMembersFilterRecent::ID:
      return supergroupMembersFilterRecent::fetch(env, p);
    case supergroupMembersFilterContacts::ID:
      return supergroupMembersFilterContacts::fetch(env, p);
    case supergroupMembersFilterAdministrators::ID:
      return supergroupMembersFilterAdministrators::fetch(env, p);
    case supergroupMembersFilterSearch::ID:
      return supergroupMembersFilterSearch::fetch(env, p);
    case supergroupMembersFilterRestricted::ID:
      return supergroupMembersFilterRestricted::fetch(env, p);
    case supergroupMembersFilterBanned::ID:
      return supergroupMembersFilterBanned::fetch(env, p);
    case supergroupMembersFilterMention::ID:
      return supergroupMembersFilterMention::fetch(env, p);
    case supergroupMembersFilterBots::ID:
      return supergroupMembersFilterBots::fetch(env, p);
    case tMeUrl::ID:
      return tMeUrl::fetch(env, p);
    case tMeUrlTypeUser::ID:
      return tMeUrlTypeUser::fetch(env, p);
    case tMeUrlTypeSupergroup::ID:
      return tMeUrlTypeSupergroup::fetch(env, p);
    case tMeUrlTypeChatInvite::ID:
      return tMeUrlTypeChatInvite::fetch(env, p);
    case tMeUrlTypeStickerSet::ID:
      return tMeUrlTypeStickerSet::fetch(env, p);
    case tMeUrls::ID:
      return tMeUrls::fetch(env, p);
    case targetChatCurrent::ID:
      return targetChatCurrent::fetch(env, p);
    case targetChatChosen::ID:
      return targetChatChosen::fetch(env, p);
    case targetChatInternalLink::ID:
      return targetChatInternalLink::fetch(env, p);
    case targetChatTypes::ID:
      return targetChatTypes::fetch(env, p);
    case telegramPaymentPurposePremiumGift::ID:
      return telegramPaymentPurposePremiumGift::fetch(env, p);
    case telegramPaymentPurposePremiumGiftCodes::ID:
      return telegramPaymentPurposePremiumGiftCodes::fetch(env, p);
    case telegramPaymentPurposePremiumGiveaway::ID:
      return telegramPaymentPurposePremiumGiveaway::fetch(env, p);
    case telegramPaymentPurposeStars::ID:
      return telegramPaymentPurposeStars::fetch(env, p);
    case telegramPaymentPurposeGiftedStars::ID:
      return telegramPaymentPurposeGiftedStars::fetch(env, p);
    case telegramPaymentPurposeStarGiveaway::ID:
      return telegramPaymentPurposeStarGiveaway::fetch(env, p);
    case telegramPaymentPurposeJoinChat::ID:
      return telegramPaymentPurposeJoinChat::fetch(env, p);
    case temporaryPasswordState::ID:
      return temporaryPasswordState::fetch(env, p);
    case termsOfService::ID:
      return termsOfService::fetch(env, p);
    case testBytes::ID:
      return testBytes::fetch(env, p);
    case testInt::ID:
      return testInt::fetch(env, p);
    case testString::ID:
      return testString::fetch(env, p);
    case testVectorInt::ID:
      return testVectorInt::fetch(env, p);
    case testVectorIntObject::ID:
      return testVectorIntObject::fetch(env, p);
    case testVectorString::ID:
      return testVectorString::fetch(env, p);
    case testVectorStringObject::ID:
      return testVectorStringObject::fetch(env, p);
    case text::ID:
      return text::fetch(env, p);
    case textCompositionStyle::ID:
      return textCompositionStyle::fetch(env, p);
    case textCompositionStyleExample::ID:
      return textCompositionStyleExample::fetch(env, p);
    case textEntities::ID:
      return textEntities::fetch(env, p);
    case textEntity::ID:
      return textEntity::fetch(env, p);
    case textEntityTypeMention::ID:
      return textEntityTypeMention::fetch(env, p);
    case textEntityTypeHashtag::ID:
      return textEntityTypeHashtag::fetch(env, p);
    case textEntityTypeCashtag::ID:
      return textEntityTypeCashtag::fetch(env, p);
    case textEntityTypeBotCommand::ID:
      return textEntityTypeBotCommand::fetch(env, p);
    case textEntityTypeUrl::ID:
      return textEntityTypeUrl::fetch(env, p);
    case textEntityTypeEmailAddress::ID:
      return textEntityTypeEmailAddress::fetch(env, p);
    case textEntityTypePhoneNumber::ID:
      return textEntityTypePhoneNumber::fetch(env, p);
    case textEntityTypeBankCardNumber::ID:
      return textEntityTypeBankCardNumber::fetch(env, p);
    case textEntityTypeBold::ID:
      return textEntityTypeBold::fetch(env, p);
    case textEntityTypeItalic::ID:
      return textEntityTypeItalic::fetch(env, p);
    case textEntityTypeUnderline::ID:
      return textEntityTypeUnderline::fetch(env, p);
    case textEntityTypeStrikethrough::ID:
      return textEntityTypeStrikethrough::fetch(env, p);
    case textEntityTypeSpoiler::ID:
      return textEntityTypeSpoiler::fetch(env, p);
    case textEntityTypeCode::ID:
      return textEntityTypeCode::fetch(env, p);
    case textEntityTypePre::ID:
      return textEntityTypePre::fetch(env, p);
    case textEntityTypePreCode::ID:
      return textEntityTypePreCode::fetch(env, p);
    case textEntityTypeBlockQuote::ID:
      return textEntityTypeBlockQuote::fetch(env, p);
    case textEntityTypeExpandableBlockQuote::ID:
      return textEntityTypeExpandableBlockQuote::fetch(env, p);
    case textEntityTypeTextUrl::ID:
      return textEntityTypeTextUrl::fetch(env, p);
    case textEntityTypeMentionName::ID:
      return textEntityTypeMentionName::fetch(env, p);
    case textEntityTypeCustomEmoji::ID:
      return textEntityTypeCustomEmoji::fetch(env, p);
    case textEntityTypeMediaTimestamp::ID:
      return textEntityTypeMediaTimestamp::fetch(env, p);
    case textEntityTypeDateTime::ID:
      return textEntityTypeDateTime::fetch(env, p);
    case textParseModeMarkdown::ID:
      return textParseModeMarkdown::fetch(env, p);
    case textParseModeHTML::ID:
      return textParseModeHTML::fetch(env, p);
    case textQuote::ID:
      return textQuote::fetch(env, p);
    case themeParameters::ID:
      return themeParameters::fetch(env, p);
    case themeSettings::ID:
      return themeSettings::fetch(env, p);
    case thumbnail::ID:
      return thumbnail::fetch(env, p);
    case thumbnailFormatJpeg::ID:
      return thumbnailFormatJpeg::fetch(env, p);
    case thumbnailFormatGif::ID:
      return thumbnailFormatGif::fetch(env, p);
    case thumbnailFormatMpeg4::ID:
      return thumbnailFormatMpeg4::fetch(env, p);
    case thumbnailFormatPng::ID:
      return thumbnailFormatPng::fetch(env, p);
    case thumbnailFormatTgs::ID:
      return thumbnailFormatTgs::fetch(env, p);
    case thumbnailFormatWebm::ID:
      return thumbnailFormatWebm::fetch(env, p);
    case thumbnailFormatWebp::ID:
      return thumbnailFormatWebp::fetch(env, p);
    case timeZone::ID:
      return timeZone::fetch(env, p);
    case timeZones::ID:
      return timeZones::fetch(env, p);
    case tonRevenueStatistics::ID:
      return tonRevenueStatistics::fetch(env, p);
    case tonRevenueStatus::ID:
      return tonRevenueStatus::fetch(env, p);
    case tonTransaction::ID:
      return tonTransaction::fetch(env, p);
    case tonTransactionTypeFragmentDeposit::ID:
      return tonTransactionTypeFragmentDeposit::fetch(env, p);
    case tonTransactionTypeFragmentWithdrawal::ID:
      return tonTransactionTypeFragmentWithdrawal::fetch(env, p);
    case tonTransactionTypeSuggestedPostPayment::ID:
      return tonTransactionTypeSuggestedPostPayment::fetch(env, p);
    case tonTransactionTypeGiftPurchaseOffer::ID:
      return tonTransactionTypeGiftPurchaseOffer::fetch(env, p);
    case tonTransactionTypeUpgradedGiftPurchase::ID:
      return tonTransactionTypeUpgradedGiftPurchase::fetch(env, p);
    case tonTransactionTypeUpgradedGiftSale::ID:
      return tonTransactionTypeUpgradedGiftSale::fetch(env, p);
    case tonTransactionTypeStakeDiceStake::ID:
      return tonTransactionTypeStakeDiceStake::fetch(env, p);
    case tonTransactionTypeStakeDicePayout::ID:
      return tonTransactionTypeStakeDicePayout::fetch(env, p);
    case tonTransactionTypeUnsupported::ID:
      return tonTransactionTypeUnsupported::fetch(env, p);
    case tonTransactions::ID:
      return tonTransactions::fetch(env, p);
    case topChatCategoryUsers::ID:
      return topChatCategoryUsers::fetch(env, p);
    case topChatCategoryBots::ID:
      return topChatCategoryBots::fetch(env, p);
    case topChatCategoryGroups::ID:
      return topChatCategoryGroups::fetch(env, p);
    case topChatCategoryChannels::ID:
      return topChatCategoryChannels::fetch(env, p);
    case topChatCategoryInlineBots::ID:
      return topChatCategoryInlineBots::fetch(env, p);
    case topChatCategoryGuestBots::ID:
      return topChatCategoryGuestBots::fetch(env, p);
    case topChatCategoryWebAppBots::ID:
      return topChatCategoryWebAppBots::fetch(env, p);
    case topChatCategoryCalls::ID:
      return topChatCategoryCalls::fetch(env, p);
    case topChatCategoryForwardChats::ID:
      return topChatCategoryForwardChats::fetch(env, p);
    case transactionDirectionIncoming::ID:
      return transactionDirectionIncoming::fetch(env, p);
    case transactionDirectionOutgoing::ID:
      return transactionDirectionOutgoing::fetch(env, p);
    case trendingStickerSets::ID:
      return trendingStickerSets::fetch(env, p);
    case unconfirmedSession::ID:
      return unconfirmedSession::fetch(env, p);
    case unreadReaction::ID:
      return unreadReaction::fetch(env, p);
    case updateAuthorizationState::ID:
      return updateAuthorizationState::fetch(env, p);
    case updateNewMessage::ID:
      return updateNewMessage::fetch(env, p);
    case updateMessageSendAcknowledged::ID:
      return updateMessageSendAcknowledged::fetch(env, p);
    case updateMessageSendSucceeded::ID:
      return updateMessageSendSucceeded::fetch(env, p);
    case updateMessageSendFailed::ID:
      return updateMessageSendFailed::fetch(env, p);
    case updateMessageContent::ID:
      return updateMessageContent::fetch(env, p);
    case updateMessageEdited::ID:
      return updateMessageEdited::fetch(env, p);
    case updateMessageIsPinned::ID:
      return updateMessageIsPinned::fetch(env, p);
    case updateMessageInteractionInfo::ID:
      return updateMessageInteractionInfo::fetch(env, p);
    case updateMessageContentOpened::ID:
      return updateMessageContentOpened::fetch(env, p);
    case updateMessageMentionRead::ID:
      return updateMessageMentionRead::fetch(env, p);
    case updateMessageUnreadReactions::ID:
      return updateMessageUnreadReactions::fetch(env, p);
    case updateMessageContainsUnreadPollVotes::ID:
      return updateMessageContainsUnreadPollVotes::fetch(env, p);
    case updateMessageFactCheck::ID:
      return updateMessageFactCheck::fetch(env, p);
    case updateMessageSuggestedPostInfo::ID:
      return updateMessageSuggestedPostInfo::fetch(env, p);
    case updateMessageLiveLocationViewed::ID:
      return updateMessageLiveLocationViewed::fetch(env, p);
    case updateVideoPublished::ID:
      return updateVideoPublished::fetch(env, p);
    case updateNewChat::ID:
      return updateNewChat::fetch(env, p);
    case updateChatTitle::ID:
      return updateChatTitle::fetch(env, p);
    case updateChatPhoto::ID:
      return updateChatPhoto::fetch(env, p);
    case updateChatAccentColors::ID:
      return updateChatAccentColors::fetch(env, p);
    case updateChatPermissions::ID:
      return updateChatPermissions::fetch(env, p);
    case updateChatLastMessage::ID:
      return updateChatLastMessage::fetch(env, p);
    case updateChatPosition::ID:
      return updateChatPosition::fetch(env, p);
    case updateChatAddedToList::ID:
      return updateChatAddedToList::fetch(env, p);
    case updateChatRemovedFromList::ID:
      return updateChatRemovedFromList::fetch(env, p);
    case updateChatReadInbox::ID:
      return updateChatReadInbox::fetch(env, p);
    case updateChatReadOutbox::ID:
      return updateChatReadOutbox::fetch(env, p);
    case updateChatActionBar::ID:
      return updateChatActionBar::fetch(env, p);
    case updateChatBusinessBotManageBar::ID:
      return updateChatBusinessBotManageBar::fetch(env, p);
    case updateChatAvailableReactions::ID:
      return updateChatAvailableReactions::fetch(env, p);
    case updateChatDraftMessage::ID:
      return updateChatDraftMessage::fetch(env, p);
    case updateChatEmojiStatus::ID:
      return updateChatEmojiStatus::fetch(env, p);
    case updateChatMessageSender::ID:
      return updateChatMessageSender::fetch(env, p);
    case updateChatMessageAutoDeleteTime::ID:
      return updateChatMessageAutoDeleteTime::fetch(env, p);
    case updateChatNotificationSettings::ID:
      return updateChatNotificationSettings::fetch(env, p);
    case updateChatPendingJoinRequests::ID:
      return updateChatPendingJoinRequests::fetch(env, p);
    case updateChatReplyMarkup::ID:
      return updateChatReplyMarkup::fetch(env, p);
    case updateChatBackground::ID:
      return updateChatBackground::fetch(env, p);
    case updateChatTheme::ID:
      return updateChatTheme::fetch(env, p);
    case updateChatUnreadMentionCount::ID:
      return updateChatUnreadMentionCount::fetch(env, p);
    case updateChatUnreadReactionCount::ID:
      return updateChatUnreadReactionCount::fetch(env, p);
    case updateChatUnreadPollVoteCount::ID:
      return updateChatUnreadPollVoteCount::fetch(env, p);
    case updateChatVideoChat::ID:
      return updateChatVideoChat::fetch(env, p);
    case updateChatDefaultDisableNotification::ID:
      return updateChatDefaultDisableNotification::fetch(env, p);
    case updateChatHasProtectedContent::ID:
      return updateChatHasProtectedContent::fetch(env, p);
    case updateChatIsTranslatable::ID:
      return updateChatIsTranslatable::fetch(env, p);
    case updateChatIsMarkedAsUnread::ID:
      return updateChatIsMarkedAsUnread::fetch(env, p);
    case updateChatViewAsTopics::ID:
      return updateChatViewAsTopics::fetch(env, p);
    case updateChatBlockList::ID:
      return updateChatBlockList::fetch(env, p);
    case updateChatHasScheduledMessages::ID:
      return updateChatHasScheduledMessages::fetch(env, p);
    case updateChatFolders::ID:
      return updateChatFolders::fetch(env, p);
    case updateChatOnlineMemberCount::ID:
      return updateChatOnlineMemberCount::fetch(env, p);
    case updateSavedMessagesTopic::ID:
      return updateSavedMessagesTopic::fetch(env, p);
    case updateSavedMessagesTopicCount::ID:
      return updateSavedMessagesTopicCount::fetch(env, p);
    case updateDirectMessagesChatTopic::ID:
      return updateDirectMessagesChatTopic::fetch(env, p);
    case updateTopicMessageCount::ID:
      return updateTopicMessageCount::fetch(env, p);
    case updateQuickReplyShortcut::ID:
      return updateQuickReplyShortcut::fetch(env, p);
    case updateQuickReplyShortcutDeleted::ID:
      return updateQuickReplyShortcutDeleted::fetch(env, p);
    case updateQuickReplyShortcuts::ID:
      return updateQuickReplyShortcuts::fetch(env, p);
    case updateQuickReplyShortcutMessages::ID:
      return updateQuickReplyShortcutMessages::fetch(env, p);
    case updateForumTopicInfo::ID:
      return updateForumTopicInfo::fetch(env, p);
    case updateForumTopic::ID:
      return updateForumTopic::fetch(env, p);
    case updateScopeNotificationSettings::ID:
      return updateScopeNotificationSettings::fetch(env, p);
    case updateReactionNotificationSettings::ID:
      return updateReactionNotificationSettings::fetch(env, p);
    case updateNotification::ID:
      return updateNotification::fetch(env, p);
    case updateNotificationGroup::ID:
      return updateNotificationGroup::fetch(env, p);
    case updateActiveNotifications::ID:
      return updateActiveNotifications::fetch(env, p);
    case updateHavePendingNotifications::ID:
      return updateHavePendingNotifications::fetch(env, p);
    case updateDeleteMessages::ID:
      return updateDeleteMessages::fetch(env, p);
    case updateChatAction::ID:
      return updateChatAction::fetch(env, p);
    case updatePendingTextMessage::ID:
      return updatePendingTextMessage::fetch(env, p);
    case updateUserStatus::ID:
      return updateUserStatus::fetch(env, p);
    case updateUser::ID:
      return updateUser::fetch(env, p);
    case updateBasicGroup::ID:
      return updateBasicGroup::fetch(env, p);
    case updateSupergroup::ID:
      return updateSupergroup::fetch(env, p);
    case updateSecretChat::ID:
      return updateSecretChat::fetch(env, p);
    case updateUserFullInfo::ID:
      return updateUserFullInfo::fetch(env, p);
    case updateBasicGroupFullInfo::ID:
      return updateBasicGroupFullInfo::fetch(env, p);
    case updateSupergroupFullInfo::ID:
      return updateSupergroupFullInfo::fetch(env, p);
    case updateServiceNotification::ID:
      return updateServiceNotification::fetch(env, p);
    case updateNewOauthRequest::ID:
      return updateNewOauthRequest::fetch(env, p);
    case updateFile::ID:
      return updateFile::fetch(env, p);
    case updateFileGenerationStart::ID:
      return updateFileGenerationStart::fetch(env, p);
    case updateFileGenerationStop::ID:
      return updateFileGenerationStop::fetch(env, p);
    case updateFileDownloads::ID:
      return updateFileDownloads::fetch(env, p);
    case updateFileAddedToDownloads::ID:
      return updateFileAddedToDownloads::fetch(env, p);
    case updateFileDownload::ID:
      return updateFileDownload::fetch(env, p);
    case updateFileRemovedFromDownloads::ID:
      return updateFileRemovedFromDownloads::fetch(env, p);
    case updateApplicationVerificationRequired::ID:
      return updateApplicationVerificationRequired::fetch(env, p);
    case updateApplicationRecaptchaVerificationRequired::ID:
      return updateApplicationRecaptchaVerificationRequired::fetch(env, p);
    case updateCall::ID:
      return updateCall::fetch(env, p);
    case updateGroupCall::ID:
      return updateGroupCall::fetch(env, p);
    case updateGroupCallParticipant::ID:
      return updateGroupCallParticipant::fetch(env, p);
    case updateGroupCallParticipants::ID:
      return updateGroupCallParticipants::fetch(env, p);
    case updateGroupCallVerificationState::ID:
      return updateGroupCallVerificationState::fetch(env, p);
    case updateNewGroupCallMessage::ID:
      return updateNewGroupCallMessage::fetch(env, p);
    case updateNewGroupCallPaidReaction::ID:
      return updateNewGroupCallPaidReaction::fetch(env, p);
    case updateGroupCallMessageSendFailed::ID:
      return updateGroupCallMessageSendFailed::fetch(env, p);
    case updateGroupCallMessagesDeleted::ID:
      return updateGroupCallMessagesDeleted::fetch(env, p);
    case updateLiveStoryTopDonors::ID:
      return updateLiveStoryTopDonors::fetch(env, p);
    case updateNewCallSignalingData::ID:
      return updateNewCallSignalingData::fetch(env, p);
    case updateGiftAuctionState::ID:
      return updateGiftAuctionState::fetch(env, p);
    case updateActiveGiftAuctions::ID:
      return updateActiveGiftAuctions::fetch(env, p);
    case updateUserPrivacySettingRules::ID:
      return updateUserPrivacySettingRules::fetch(env, p);
    case updateUnreadMessageCount::ID:
      return updateUnreadMessageCount::fetch(env, p);
    case updateUnreadChatCount::ID:
      return updateUnreadChatCount::fetch(env, p);
    case updateStory::ID:
      return updateStory::fetch(env, p);
    case updateStoryDeleted::ID:
      return updateStoryDeleted::fetch(env, p);
    case updateStoryPostSucceeded::ID:
      return updateStoryPostSucceeded::fetch(env, p);
    case updateStoryPostFailed::ID:
      return updateStoryPostFailed::fetch(env, p);
    case updateChatActiveStories::ID:
      return updateChatActiveStories::fetch(env, p);
    case updateStoryListChatCount::ID:
      return updateStoryListChatCount::fetch(env, p);
    case updateStoryStealthMode::ID:
      return updateStoryStealthMode::fetch(env, p);
    case updateTrustedMiniAppBots::ID:
      return updateTrustedMiniAppBots::fetch(env, p);
    case updateOption::ID:
      return updateOption::fetch(env, p);
    case updateStickerSet::ID:
      return updateStickerSet::fetch(env, p);
    case updateInstalledStickerSets::ID:
      return updateInstalledStickerSets::fetch(env, p);
    case updateTrendingStickerSets::ID:
      return updateTrendingStickerSets::fetch(env, p);
    case updateRecentStickers::ID:
      return updateRecentStickers::fetch(env, p);
    case updateFavoriteStickers::ID:
      return updateFavoriteStickers::fetch(env, p);
    case updateSavedAnimations::ID:
      return updateSavedAnimations::fetch(env, p);
    case updateSavedNotificationSounds::ID:
      return updateSavedNotificationSounds::fetch(env, p);
    case updateDefaultBackground::ID:
      return updateDefaultBackground::fetch(env, p);
    case updateEmojiChatThemes::ID:
      return updateEmojiChatThemes::fetch(env, p);
    case updateAccentColors::ID:
      return updateAccentColors::fetch(env, p);
    case updateProfileAccentColors::ID:
      return updateProfileAccentColors::fetch(env, p);
    case updateLanguagePackStrings::ID:
      return updateLanguagePackStrings::fetch(env, p);
    case updateConnectionState::ID:
      return updateConnectionState::fetch(env, p);
    case updateFreezeState::ID:
      return updateFreezeState::fetch(env, p);
    case updateAgeVerificationParameters::ID:
      return updateAgeVerificationParameters::fetch(env, p);
    case updateTermsOfService::ID:
      return updateTermsOfService::fetch(env, p);
    case updateUnconfirmedSession::ID:
      return updateUnconfirmedSession::fetch(env, p);
    case updateAttachmentMenuBots::ID:
      return updateAttachmentMenuBots::fetch(env, p);
    case updateWebAppMessageSent::ID:
      return updateWebAppMessageSent::fetch(env, p);
    case updateActiveEmojiReactions::ID:
      return updateActiveEmojiReactions::fetch(env, p);
    case updateAvailableMessageEffects::ID:
      return updateAvailableMessageEffects::fetch(env, p);
    case updateDefaultReactionType::ID:
      return updateDefaultReactionType::fetch(env, p);
    case updateDefaultPaidReactionType::ID:
      return updateDefaultPaidReactionType::fetch(env, p);
    case updateSavedMessagesTags::ID:
      return updateSavedMessagesTags::fetch(env, p);
    case updateActiveLiveLocationMessages::ID:
      return updateActiveLiveLocationMessages::fetch(env, p);
    case updateOwnedStarCount::ID:
      return updateOwnedStarCount::fetch(env, p);
    case updateOwnedTonCount::ID:
      return updateOwnedTonCount::fetch(env, p);
    case updateChatRevenueAmount::ID:
      return updateChatRevenueAmount::fetch(env, p);
    case updateStarRevenueStatus::ID:
      return updateStarRevenueStatus::fetch(env, p);
    case updateTonRevenueStatus::ID:
      return updateTonRevenueStatus::fetch(env, p);
    case updateSpeechRecognitionTrial::ID:
      return updateSpeechRecognitionTrial::fetch(env, p);
    case updateGroupCallMessageLevels::ID:
      return updateGroupCallMessageLevels::fetch(env, p);
    case updateDiceEmojis::ID:
      return updateDiceEmojis::fetch(env, p);
    case updateStakeDiceState::ID:
      return updateStakeDiceState::fetch(env, p);
    case updateAnimatedEmojiMessageClicked::ID:
      return updateAnimatedEmojiMessageClicked::fetch(env, p);
    case updateAnimationSearchParameters::ID:
      return updateAnimationSearchParameters::fetch(env, p);
    case updateTextCompositionStyles::ID:
      return updateTextCompositionStyles::fetch(env, p);
    case updateSuggestedActions::ID:
      return updateSuggestedActions::fetch(env, p);
    case updateSpeedLimitNotification::ID:
      return updateSpeedLimitNotification::fetch(env, p);
    case updateContactCloseBirthdays::ID:
      return updateContactCloseBirthdays::fetch(env, p);
    case updateAutosaveSettings::ID:
      return updateAutosaveSettings::fetch(env, p);
    case updateBusinessConnection::ID:
      return updateBusinessConnection::fetch(env, p);
    case updateNewBusinessMessage::ID:
      return updateNewBusinessMessage::fetch(env, p);
    case updateBusinessMessageEdited::ID:
      return updateBusinessMessageEdited::fetch(env, p);
    case updateBusinessMessagesDeleted::ID:
      return updateBusinessMessagesDeleted::fetch(env, p);
    case updateNewInlineQuery::ID:
      return updateNewInlineQuery::fetch(env, p);
    case updateNewChosenInlineResult::ID:
      return updateNewChosenInlineResult::fetch(env, p);
    case updateNewGuestQuery::ID:
      return updateNewGuestQuery::fetch(env, p);
    case updateNewCallbackQuery::ID:
      return updateNewCallbackQuery::fetch(env, p);
    case updateNewInlineCallbackQuery::ID:
      return updateNewInlineCallbackQuery::fetch(env, p);
    case updateNewBusinessCallbackQuery::ID:
      return updateNewBusinessCallbackQuery::fetch(env, p);
    case updateNewShippingQuery::ID:
      return updateNewShippingQuery::fetch(env, p);
    case updateNewPreCheckoutQuery::ID:
      return updateNewPreCheckoutQuery::fetch(env, p);
    case updateNewCustomEvent::ID:
      return updateNewCustomEvent::fetch(env, p);
    case updateNewCustomQuery::ID:
      return updateNewCustomQuery::fetch(env, p);
    case updatePoll::ID:
      return updatePoll::fetch(env, p);
    case updatePollAnswer::ID:
      return updatePollAnswer::fetch(env, p);
    case updateManagedBot::ID:
      return updateManagedBot::fetch(env, p);
    case updateChatMember::ID:
      return updateChatMember::fetch(env, p);
    case updateNewChatJoinRequest::ID:
      return updateNewChatJoinRequest::fetch(env, p);
    case updateChatBoost::ID:
      return updateChatBoost::fetch(env, p);
    case updateMessageReaction::ID:
      return updateMessageReaction::fetch(env, p);
    case updateMessageReactions::ID:
      return updateMessageReactions::fetch(env, p);
    case updatePaidMediaPurchased::ID:
      return updatePaidMediaPurchased::fetch(env, p);
    case updates::ID:
      return updates::fetch(env, p);
    case upgradeGiftResult::ID:
      return upgradeGiftResult::fetch(env, p);
    case upgradedGift::ID:
      return upgradedGift::fetch(env, p);
    case upgradedGiftAttributeIdModel::ID:
      return upgradedGiftAttributeIdModel::fetch(env, p);
    case upgradedGiftAttributeIdSymbol::ID:
      return upgradedGiftAttributeIdSymbol::fetch(env, p);
    case upgradedGiftAttributeIdBackdrop::ID:
      return upgradedGiftAttributeIdBackdrop::fetch(env, p);
    case upgradedGiftAttributeRarityPerMille::ID:
      return upgradedGiftAttributeRarityPerMille::fetch(env, p);
    case upgradedGiftAttributeRarityUncommon::ID:
      return upgradedGiftAttributeRarityUncommon::fetch(env, p);
    case upgradedGiftAttributeRarityRare::ID:
      return upgradedGiftAttributeRarityRare::fetch(env, p);
    case upgradedGiftAttributeRarityEpic::ID:
      return upgradedGiftAttributeRarityEpic::fetch(env, p);
    case upgradedGiftAttributeRarityLegendary::ID:
      return upgradedGiftAttributeRarityLegendary::fetch(env, p);
    case upgradedGiftBackdrop::ID:
      return upgradedGiftBackdrop::fetch(env, p);
    case upgradedGiftBackdropColors::ID:
      return upgradedGiftBackdropColors::fetch(env, p);
    case upgradedGiftBackdropCount::ID:
      return upgradedGiftBackdropCount::fetch(env, p);
    case upgradedGiftColors::ID:
      return upgradedGiftColors::fetch(env, p);
    case upgradedGiftModel::ID:
      return upgradedGiftModel::fetch(env, p);
    case upgradedGiftModelCount::ID:
      return upgradedGiftModelCount::fetch(env, p);
    case upgradedGiftOriginUpgrade::ID:
      return upgradedGiftOriginUpgrade::fetch(env, p);
    case upgradedGiftOriginTransfer::ID:
      return upgradedGiftOriginTransfer::fetch(env, p);
    case upgradedGiftOriginResale::ID:
      return upgradedGiftOriginResale::fetch(env, p);
    case upgradedGiftOriginBlockchain::ID:
      return upgradedGiftOriginBlockchain::fetch(env, p);
    case upgradedGiftOriginPrepaidUpgrade::ID:
      return upgradedGiftOriginPrepaidUpgrade::fetch(env, p);
    case upgradedGiftOriginOffer::ID:
      return upgradedGiftOriginOffer::fetch(env, p);
    case upgradedGiftOriginCraft::ID:
      return upgradedGiftOriginCraft::fetch(env, p);
    case upgradedGiftOriginalDetails::ID:
      return upgradedGiftOriginalDetails::fetch(env, p);
    case upgradedGiftSymbol::ID:
      return upgradedGiftSymbol::fetch(env, p);
    case upgradedGiftSymbolCount::ID:
      return upgradedGiftSymbolCount::fetch(env, p);
    case upgradedGiftValueInfo::ID:
      return upgradedGiftValueInfo::fetch(env, p);
    case user::ID:
      return user::fetch(env, p);
    case userAuctionBid::ID:
      return userAuctionBid::fetch(env, p);
    case userFullInfo::ID:
      return userFullInfo::fetch(env, p);
    case userLink::ID:
      return userLink::fetch(env, p);
    case userPrivacySettingShowStatus::ID:
      return userPrivacySettingShowStatus::fetch(env, p);
    case userPrivacySettingShowProfilePhoto::ID:
      return userPrivacySettingShowProfilePhoto::fetch(env, p);
    case userPrivacySettingShowLinkInForwardedMessages::ID:
      return userPrivacySettingShowLinkInForwardedMessages::fetch(env, p);
    case userPrivacySettingShowPhoneNumber::ID:
      return userPrivacySettingShowPhoneNumber::fetch(env, p);
    case userPrivacySettingShowBio::ID:
      return userPrivacySettingShowBio::fetch(env, p);
    case userPrivacySettingShowBirthdate::ID:
      return userPrivacySettingShowBirthdate::fetch(env, p);
    case userPrivacySettingShowProfileAudio::ID:
      return userPrivacySettingShowProfileAudio::fetch(env, p);
    case userPrivacySettingAllowChatInvites::ID:
      return userPrivacySettingAllowChatInvites::fetch(env, p);
    case userPrivacySettingAllowCalls::ID:
      return userPrivacySettingAllowCalls::fetch(env, p);
    case userPrivacySettingAllowPeerToPeerCalls::ID:
      return userPrivacySettingAllowPeerToPeerCalls::fetch(env, p);
    case userPrivacySettingAllowFindingByPhoneNumber::ID:
      return userPrivacySettingAllowFindingByPhoneNumber::fetch(env, p);
    case userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages::ID:
      return userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages::fetch(env, p);
    case userPrivacySettingAutosaveGifts::ID:
      return userPrivacySettingAutosaveGifts::fetch(env, p);
    case userPrivacySettingAllowUnpaidMessages::ID:
      return userPrivacySettingAllowUnpaidMessages::fetch(env, p);
    case userPrivacySettingRuleAllowAll::ID:
      return userPrivacySettingRuleAllowAll::fetch(env, p);
    case userPrivacySettingRuleAllowContacts::ID:
      return userPrivacySettingRuleAllowContacts::fetch(env, p);
    case userPrivacySettingRuleAllowBots::ID:
      return userPrivacySettingRuleAllowBots::fetch(env, p);
    case userPrivacySettingRuleAllowPremiumUsers::ID:
      return userPrivacySettingRuleAllowPremiumUsers::fetch(env, p);
    case userPrivacySettingRuleAllowUsers::ID:
      return userPrivacySettingRuleAllowUsers::fetch(env, p);
    case userPrivacySettingRuleAllowChatMembers::ID:
      return userPrivacySettingRuleAllowChatMembers::fetch(env, p);
    case userPrivacySettingRuleRestrictAll::ID:
      return userPrivacySettingRuleRestrictAll::fetch(env, p);
    case userPrivacySettingRuleRestrictContacts::ID:
      return userPrivacySettingRuleRestrictContacts::fetch(env, p);
    case userPrivacySettingRuleRestrictBots::ID:
      return userPrivacySettingRuleRestrictBots::fetch(env, p);
    case userPrivacySettingRuleRestrictUsers::ID:
      return userPrivacySettingRuleRestrictUsers::fetch(env, p);
    case userPrivacySettingRuleRestrictChatMembers::ID:
      return userPrivacySettingRuleRestrictChatMembers::fetch(env, p);
    case userPrivacySettingRules::ID:
      return userPrivacySettingRules::fetch(env, p);
    case userRating::ID:
      return userRating::fetch(env, p);
    case userStatusEmpty::ID:
      return userStatusEmpty::fetch(env, p);
    case userStatusOnline::ID:
      return userStatusOnline::fetch(env, p);
    case userStatusOffline::ID:
      return userStatusOffline::fetch(env, p);
    case userStatusRecently::ID:
      return userStatusRecently::fetch(env, p);
    case userStatusLastWeek::ID:
      return userStatusLastWeek::fetch(env, p);
    case userStatusLastMonth::ID:
      return userStatusLastMonth::fetch(env, p);
    case userSupportInfo::ID:
      return userSupportInfo::fetch(env, p);
    case userTypeRegular::ID:
      return userTypeRegular::fetch(env, p);
    case userTypeDeleted::ID:
      return userTypeDeleted::fetch(env, p);
    case userTypeBot::ID:
      return userTypeBot::fetch(env, p);
    case userTypeUnknown::ID:
      return userTypeUnknown::fetch(env, p);
    case usernames::ID:
      return usernames::fetch(env, p);
    case users::ID:
      return users::fetch(env, p);
    case validatedOrderInfo::ID:
      return validatedOrderInfo::fetch(env, p);
    case vectorPathCommandLine::ID:
      return vectorPathCommandLine::fetch(env, p);
    case vectorPathCommandCubicBezierCurve::ID:
      return vectorPathCommandCubicBezierCurve::fetch(env, p);
    case venue::ID:
      return venue::fetch(env, p);
    case verificationStatus::ID:
      return verificationStatus::fetch(env, p);
    case video::ID:
      return video::fetch(env, p);
    case videoChat::ID:
      return videoChat::fetch(env, p);
    case videoMessageAdvertisement::ID:
      return videoMessageAdvertisement::fetch(env, p);
    case videoMessageAdvertisements::ID:
      return videoMessageAdvertisements::fetch(env, p);
    case videoNote::ID:
      return videoNote::fetch(env, p);
    case videoStoryboard::ID:
      return videoStoryboard::fetch(env, p);
    case voiceNote::ID:
      return voiceNote::fetch(env, p);
    case webApp::ID:
      return webApp::fetch(env, p);
    case webAppInfo::ID:
      return webAppInfo::fetch(env, p);
    case webAppOpenModeCompact::ID:
      return webAppOpenModeCompact::fetch(env, p);
    case webAppOpenModeFullSize::ID:
      return webAppOpenModeFullSize::fetch(env, p);
    case webAppOpenModeFullScreen::ID:
      return webAppOpenModeFullScreen::fetch(env, p);
    case webAppOpenParameters::ID:
      return webAppOpenParameters::fetch(env, p);
    case webPageInstantView::ID:
      return webPageInstantView::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void Object::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$Object").c_str());
    return true;
  }();
  (void)is_inited;
}

jclass Function::Class;

object_ptr<Function> Function::fetch(JNIEnv *env, jobject &p) {
  if (p == nullptr) { return nullptr; }
  jint constructor = env->CallIntMethod(p, jni::GetConstructorID);  switch (constructor) {
    case acceptCall::ID:
      return acceptCall::fetch(env, p);
    case acceptOauthRequest::ID:
      return acceptOauthRequest::fetch(env, p);
    case acceptTermsOfService::ID:
      return acceptTermsOfService::fetch(env, p);
    case activateStoryStealthMode::ID:
      return activateStoryStealthMode::fetch(env, p);
    case addBotMediaPreview::ID:
      return addBotMediaPreview::fetch(env, p);
    case addChatFolderByInviteLink::ID:
      return addChatFolderByInviteLink::fetch(env, p);
    case addChatMember::ID:
      return addChatMember::fetch(env, p);
    case addChatMembers::ID:
      return addChatMembers::fetch(env, p);
    case addChatToList::ID:
      return addChatToList::fetch(env, p);
    case addChecklistTasks::ID:
      return addChecklistTasks::fetch(env, p);
    case addContact::ID:
      return addContact::fetch(env, p);
    case addCustomServerLanguagePack::ID:
      return addCustomServerLanguagePack::fetch(env, p);
    case addFavoriteSticker::ID:
      return addFavoriteSticker::fetch(env, p);
    case addFileToDownloads::ID:
      return addFileToDownloads::fetch(env, p);
    case addGiftCollectionGifts::ID:
      return addGiftCollectionGifts::fetch(env, p);
    case addLocalMessage::ID:
      return addLocalMessage::fetch(env, p);
    case addLogMessage::ID:
      return addLogMessage::fetch(env, p);
    case addLoginPasskey::ID:
      return addLoginPasskey::fetch(env, p);
    case addMessageReaction::ID:
      return addMessageReaction::fetch(env, p);
    case addNetworkStatistics::ID:
      return addNetworkStatistics::fetch(env, p);
    case addOffer::ID:
      return addOffer::fetch(env, p);
    case addPendingLiveStoryReaction::ID:
      return addPendingLiveStoryReaction::fetch(env, p);
    case addPendingPaidMessageReaction::ID:
      return addPendingPaidMessageReaction::fetch(env, p);
    case addPollOption::ID:
      return addPollOption::fetch(env, p);
    case addProfileAudio::ID:
      return addProfileAudio::fetch(env, p);
    case addProxy::ID:
      return addProxy::fetch(env, p);
    case addQuickReplyShortcutInlineQueryResultMessage::ID:
      return addQuickReplyShortcutInlineQueryResultMessage::fetch(env, p);
    case addQuickReplyShortcutMessage::ID:
      return addQuickReplyShortcutMessage::fetch(env, p);
    case addQuickReplyShortcutMessageAlbum::ID:
      return addQuickReplyShortcutMessageAlbum::fetch(env, p);
    case addRecentSticker::ID:
      return addRecentSticker::fetch(env, p);
    case addRecentlyFoundChat::ID:
      return addRecentlyFoundChat::fetch(env, p);
    case addSavedAnimation::ID:
      return addSavedAnimation::fetch(env, p);
    case addSavedNotificationSound::ID:
      return addSavedNotificationSound::fetch(env, p);
    case addStickerToSet::ID:
      return addStickerToSet::fetch(env, p);
    case addStoryAlbumStories::ID:
      return addStoryAlbumStories::fetch(env, p);
    case addTextCompositionStyle::ID:
      return addTextCompositionStyle::fetch(env, p);
    case allowBotToSendMessages::ID:
      return allowBotToSendMessages::fetch(env, p);
    case allowUnpaidMessagesFromUser::ID:
      return allowUnpaidMessagesFromUser::fetch(env, p);
    case answerCallbackQuery::ID:
      return answerCallbackQuery::fetch(env, p);
    case answerCustomQuery::ID:
      return answerCustomQuery::fetch(env, p);
    case answerGuestQuery::ID:
      return answerGuestQuery::fetch(env, p);
    case answerInlineQuery::ID:
      return answerInlineQuery::fetch(env, p);
    case answerPreCheckoutQuery::ID:
      return answerPreCheckoutQuery::fetch(env, p);
    case answerShippingQuery::ID:
      return answerShippingQuery::fetch(env, p);
    case answerWebAppQuery::ID:
      return answerWebAppQuery::fetch(env, p);
    case applyPremiumGiftCode::ID:
      return applyPremiumGiftCode::fetch(env, p);
    case approveSuggestedPost::ID:
      return approveSuggestedPost::fetch(env, p);
    case assignStoreTransaction::ID:
      return assignStoreTransaction::fetch(env, p);
    case banChatMember::ID:
      return banChatMember::fetch(env, p);
    case banGroupCallParticipants::ID:
      return banGroupCallParticipants::fetch(env, p);
    case blockMessageSenderFromReplies::ID:
      return blockMessageSenderFromReplies::fetch(env, p);
    case boostChat::ID:
      return boostChat::fetch(env, p);
    case buyGiftUpgrade::ID:
      return buyGiftUpgrade::fetch(env, p);
    case canBotSendMessages::ID:
      return canBotSendMessages::fetch(env, p);
    case canPostStory::ID:
      return canPostStory::fetch(env, p);
    case canPurchaseFromStore::ID:
      return canPurchaseFromStore::fetch(env, p);
    case canSendGift::ID:
      return canSendGift::fetch(env, p);
    case canSendMessageToUser::ID:
      return canSendMessageToUser::fetch(env, p);
    case canTransferOwnership::ID:
      return canTransferOwnership::fetch(env, p);
    case cancelDownloadFile::ID:
      return cancelDownloadFile::fetch(env, p);
    case cancelPasswordReset::ID:
      return cancelPasswordReset::fetch(env, p);
    case cancelPreliminaryUploadFile::ID:
      return cancelPreliminaryUploadFile::fetch(env, p);
    case cancelRecoveryEmailAddressVerification::ID:
      return cancelRecoveryEmailAddressVerification::fetch(env, p);
    case changeImportedContacts::ID:
      return changeImportedContacts::fetch(env, p);
    case changeStickerSet::ID:
      return changeStickerSet::fetch(env, p);
    case checkAuthenticationBotToken::ID:
      return checkAuthenticationBotToken::fetch(env, p);
    case checkAuthenticationCode::ID:
      return checkAuthenticationCode::fetch(env, p);
    case checkAuthenticationEmailCode::ID:
      return checkAuthenticationEmailCode::fetch(env, p);
    case checkAuthenticationPasskey::ID:
      return checkAuthenticationPasskey::fetch(env, p);
    case checkAuthenticationPassword::ID:
      return checkAuthenticationPassword::fetch(env, p);
    case checkAuthenticationPasswordRecoveryCode::ID:
      return checkAuthenticationPasswordRecoveryCode::fetch(env, p);
    case checkAuthenticationPremiumPurchase::ID:
      return checkAuthenticationPremiumPurchase::fetch(env, p);
    case checkBotUsername::ID:
      return checkBotUsername::fetch(env, p);
    case checkChatFolderInviteLink::ID:
      return checkChatFolderInviteLink::fetch(env, p);
    case checkChatInviteLink::ID:
      return checkChatInviteLink::fetch(env, p);
    case checkChatUsername::ID:
      return checkChatUsername::fetch(env, p);
    case checkCreatedPublicChatsLimit::ID:
      return checkCreatedPublicChatsLimit::fetch(env, p);
    case checkEmailAddressVerificationCode::ID:
      return checkEmailAddressVerificationCode::fetch(env, p);
    case checkLoginEmailAddressCode::ID:
      return checkLoginEmailAddressCode::fetch(env, p);
    case checkOauthRequestMatchCode::ID:
      return checkOauthRequestMatchCode::fetch(env, p);
    case checkPasswordRecoveryCode::ID:
      return checkPasswordRecoveryCode::fetch(env, p);
    case checkPhoneNumberCode::ID:
      return checkPhoneNumberCode::fetch(env, p);
    case checkPremiumGiftCode::ID:
      return checkPremiumGiftCode::fetch(env, p);
    case checkQuickReplyShortcutName::ID:
      return checkQuickReplyShortcutName::fetch(env, p);
    case checkRecoveryEmailAddressCode::ID:
      return checkRecoveryEmailAddressCode::fetch(env, p);
    case checkStickerSetName::ID:
      return checkStickerSetName::fetch(env, p);
    case checkWebAppFileDownload::ID:
      return checkWebAppFileDownload::fetch(env, p);
    case cleanFileName::ID:
      return cleanFileName::fetch(env, p);
    case clearAllDraftMessages::ID:
      return clearAllDraftMessages::fetch(env, p);
    case clearAutosaveSettingsExceptions::ID:
      return clearAutosaveSettingsExceptions::fetch(env, p);
    case clearImportedContacts::ID:
      return clearImportedContacts::fetch(env, p);
    case clearRecentEmojiStatuses::ID:
      return clearRecentEmojiStatuses::fetch(env, p);
    case clearRecentReactions::ID:
      return clearRecentReactions::fetch(env, p);
    case clearRecentStickers::ID:
      return clearRecentStickers::fetch(env, p);
    case clearRecentlyFoundChats::ID:
      return clearRecentlyFoundChats::fetch(env, p);
    case clearSearchedForTags::ID:
      return clearSearchedForTags::fetch(env, p);
    case clickAnimatedEmojiMessage::ID:
      return clickAnimatedEmojiMessage::fetch(env, p);
    case clickChatSponsoredMessage::ID:
      return clickChatSponsoredMessage::fetch(env, p);
    case clickPremiumSubscriptionButton::ID:
      return clickPremiumSubscriptionButton::fetch(env, p);
    case clickVideoMessageAdvertisement::ID:
      return clickVideoMessageAdvertisement::fetch(env, p);
    case close::ID:
      return close::fetch(env, p);
    case closeChat::ID:
      return closeChat::fetch(env, p);
    case closeGiftAuction::ID:
      return closeGiftAuction::fetch(env, p);
    case closeSecretChat::ID:
      return closeSecretChat::fetch(env, p);
    case closeStory::ID:
      return closeStory::fetch(env, p);
    case closeWebApp::ID:
      return closeWebApp::fetch(env, p);
    case commitPendingLiveStoryReactions::ID:
      return commitPendingLiveStoryReactions::fetch(env, p);
    case commitPendingPaidMessageReactions::ID:
      return commitPendingPaidMessageReactions::fetch(env, p);
    case composeTextWithAi::ID:
      return composeTextWithAi::fetch(env, p);
    case confirmQrCodeAuthentication::ID:
      return confirmQrCodeAuthentication::fetch(env, p);
    case confirmSession::ID:
      return confirmSession::fetch(env, p);
    case connectAffiliateProgram::ID:
      return connectAffiliateProgram::fetch(env, p);
    case craftGift::ID:
      return craftGift::fetch(env, p);
    case createBasicGroupChat::ID:
      return createBasicGroupChat::fetch(env, p);
    case createBot::ID:
      return createBot::fetch(env, p);
    case createBusinessChatLink::ID:
      return createBusinessChatLink::fetch(env, p);
    case createCall::ID:
      return createCall::fetch(env, p);
    case createChatFolder::ID:
      return createChatFolder::fetch(env, p);
    case createChatFolderInviteLink::ID:
      return createChatFolderInviteLink::fetch(env, p);
    case createChatInviteLink::ID:
      return createChatInviteLink::fetch(env, p);
    case createChatSubscriptionInviteLink::ID:
      return createChatSubscriptionInviteLink::fetch(env, p);
    case createForumTopic::ID:
      return createForumTopic::fetch(env, p);
    case createGiftCollection::ID:
      return createGiftCollection::fetch(env, p);
    case createGroupCall::ID:
      return createGroupCall::fetch(env, p);
    case createInvoiceLink::ID:
      return createInvoiceLink::fetch(env, p);
    case createNewBasicGroupChat::ID:
      return createNewBasicGroupChat::fetch(env, p);
    case createNewSecretChat::ID:
      return createNewSecretChat::fetch(env, p);
    case createNewStickerSet::ID:
      return createNewStickerSet::fetch(env, p);
    case createNewSupergroupChat::ID:
      return createNewSupergroupChat::fetch(env, p);
    case createPrivateChat::ID:
      return createPrivateChat::fetch(env, p);
    case createSecretChat::ID:
      return createSecretChat::fetch(env, p);
    case createStoryAlbum::ID:
      return createStoryAlbum::fetch(env, p);
    case createSupergroupChat::ID:
      return createSupergroupChat::fetch(env, p);
    case createTemporaryPassword::ID:
      return createTemporaryPassword::fetch(env, p);
    case createTextCompositionStyle::ID:
      return createTextCompositionStyle::fetch(env, p);
    case createVideoChat::ID:
      return createVideoChat::fetch(env, p);
    case declineGroupCallInvitation::ID:
      return declineGroupCallInvitation::fetch(env, p);
    case declineOauthRequest::ID:
      return declineOauthRequest::fetch(env, p);
    case declineSuggestedPost::ID:
      return declineSuggestedPost::fetch(env, p);
    case decryptGroupCallData::ID:
      return decryptGroupCallData::fetch(env, p);
    case deleteAccount::ID:
      return deleteAccount::fetch(env, p);
    case deleteAllCallMessages::ID:
      return deleteAllCallMessages::fetch(env, p);
    case deleteAllRecentMessageReactionsFromSender::ID:
      return deleteAllRecentMessageReactionsFromSender::fetch(env, p);
    case deleteAllRevokedChatInviteLinks::ID:
      return deleteAllRevokedChatInviteLinks::fetch(env, p);
    case deleteBotMediaPreviews::ID:
      return deleteBotMediaPreviews::fetch(env, p);
    case deleteBusinessChatLink::ID:
      return deleteBusinessChatLink::fetch(env, p);
    case deleteBusinessConnectedBot::ID:
      return deleteBusinessConnectedBot::fetch(env, p);
    case deleteBusinessMessages::ID:
      return deleteBusinessMessages::fetch(env, p);
    case deleteBusinessStory::ID:
      return deleteBusinessStory::fetch(env, p);
    case deleteChat::ID:
      return deleteChat::fetch(env, p);
    case deleteChatBackground::ID:
      return deleteChatBackground::fetch(env, p);
    case deleteChatFolder::ID:
      return deleteChatFolder::fetch(env, p);
    case deleteChatFolderInviteLink::ID:
      return deleteChatFolderInviteLink::fetch(env, p);
    case deleteChatHistory::ID:
      return deleteChatHistory::fetch(env, p);
    case deleteChatMessagesByDate::ID:
      return deleteChatMessagesByDate::fetch(env, p);
    case deleteChatMessagesBySender::ID:
      return deleteChatMessagesBySender::fetch(env, p);
    case deleteChatReplyMarkup::ID:
      return deleteChatReplyMarkup::fetch(env, p);
    case deleteCommands::ID:
      return deleteCommands::fetch(env, p);
    case deleteDefaultBackground::ID:
      return deleteDefaultBackground::fetch(env, p);
    case deleteDirectMessagesChatTopicHistory::ID:
      return deleteDirectMessagesChatTopicHistory::fetch(env, p);
    case deleteDirectMessagesChatTopicMessagesByDate::ID:
      return deleteDirectMessagesChatTopicMessagesByDate::fetch(env, p);
    case deleteFile::ID:
      return deleteFile::fetch(env, p);
    case deleteForumTopic::ID:
      return deleteForumTopic::fetch(env, p);
    case deleteGiftCollection::ID:
      return deleteGiftCollection::fetch(env, p);
    case deleteGroupCallMessages::ID:
      return deleteGroupCallMessages::fetch(env, p);
    case deleteGroupCallMessagesBySender::ID:
      return deleteGroupCallMessagesBySender::fetch(env, p);
    case deleteLanguagePack::ID:
      return deleteLanguagePack::fetch(env, p);
    case deleteMessageReactionsFromSender::ID:
      return deleteMessageReactionsFromSender::fetch(env, p);
    case deleteMessages::ID:
      return deleteMessages::fetch(env, p);
    case deletePassportElement::ID:
      return deletePassportElement::fetch(env, p);
    case deletePollOption::ID:
      return deletePollOption::fetch(env, p);
    case deleteProfilePhoto::ID:
      return deleteProfilePhoto::fetch(env, p);
    case deleteQuickReplyShortcut::ID:
      return deleteQuickReplyShortcut::fetch(env, p);
    case deleteQuickReplyShortcutMessages::ID:
      return deleteQuickReplyShortcutMessages::fetch(env, p);
    case deleteRevokedChatInviteLink::ID:
      return deleteRevokedChatInviteLink::fetch(env, p);
    case deleteSavedCredentials::ID:
      return deleteSavedCredentials::fetch(env, p);
    case deleteSavedMessagesTopicHistory::ID:
      return deleteSavedMessagesTopicHistory::fetch(env, p);
    case deleteSavedMessagesTopicMessagesByDate::ID:
      return deleteSavedMessagesTopicMessagesByDate::fetch(env, p);
    case deleteSavedOrderInfo::ID:
      return deleteSavedOrderInfo::fetch(env, p);
    case deleteStickerSet::ID:
      return deleteStickerSet::fetch(env, p);
    case deleteStory::ID:
      return deleteStory::fetch(env, p);
    case deleteStoryAlbum::ID:
      return deleteStoryAlbum::fetch(env, p);
    case deleteTextCompositionStyle::ID:
      return deleteTextCompositionStyle::fetch(env, p);
    case destroy::ID:
      return destroy::fetch(env, p);
    case disableAllSupergroupUsernames::ID:
      return disableAllSupergroupUsernames::fetch(env, p);
    case disableProxy::ID:
      return disableProxy::fetch(env, p);
    case discardCall::ID:
      return discardCall::fetch(env, p);
    case disconnectAffiliateProgram::ID:
      return disconnectAffiliateProgram::fetch(env, p);
    case disconnectAllWebsites::ID:
      return disconnectAllWebsites::fetch(env, p);
    case disconnectWebsite::ID:
      return disconnectWebsite::fetch(env, p);
    case downloadFile::ID:
      return downloadFile::fetch(env, p);
    case dropGiftOriginalDetails::ID:
      return dropGiftOriginalDetails::fetch(env, p);
    case editBotMediaPreview::ID:
      return editBotMediaPreview::fetch(env, p);
    case editBusinessChatLink::ID:
      return editBusinessChatLink::fetch(env, p);
    case editBusinessMessageCaption::ID:
      return editBusinessMessageCaption::fetch(env, p);
    case editBusinessMessageChecklist::ID:
      return editBusinessMessageChecklist::fetch(env, p);
    case editBusinessMessageLiveLocation::ID:
      return editBusinessMessageLiveLocation::fetch(env, p);
    case editBusinessMessageMedia::ID:
      return editBusinessMessageMedia::fetch(env, p);
    case editBusinessMessageReplyMarkup::ID:
      return editBusinessMessageReplyMarkup::fetch(env, p);
    case editBusinessMessageText::ID:
      return editBusinessMessageText::fetch(env, p);
    case editBusinessStory::ID:
      return editBusinessStory::fetch(env, p);
    case editChatFolder::ID:
      return editChatFolder::fetch(env, p);
    case editChatFolderInviteLink::ID:
      return editChatFolderInviteLink::fetch(env, p);
    case editChatInviteLink::ID:
      return editChatInviteLink::fetch(env, p);
    case editChatSubscriptionInviteLink::ID:
      return editChatSubscriptionInviteLink::fetch(env, p);
    case editCustomLanguagePackInfo::ID:
      return editCustomLanguagePackInfo::fetch(env, p);
    case editForumTopic::ID:
      return editForumTopic::fetch(env, p);
    case editInlineMessageCaption::ID:
      return editInlineMessageCaption::fetch(env, p);
    case editInlineMessageLiveLocation::ID:
      return editInlineMessageLiveLocation::fetch(env, p);
    case editInlineMessageMedia::ID:
      return editInlineMessageMedia::fetch(env, p);
    case editInlineMessageReplyMarkup::ID:
      return editInlineMessageReplyMarkup::fetch(env, p);
    case editInlineMessageText::ID:
      return editInlineMessageText::fetch(env, p);
    case editMessageCaption::ID:
      return editMessageCaption::fetch(env, p);
    case editMessageChecklist::ID:
      return editMessageChecklist::fetch(env, p);
    case editMessageLiveLocation::ID:
      return editMessageLiveLocation::fetch(env, p);
    case editMessageMedia::ID:
      return editMessageMedia::fetch(env, p);
    case editMessageReplyMarkup::ID:
      return editMessageReplyMarkup::fetch(env, p);
    case editMessageSchedulingState::ID:
      return editMessageSchedulingState::fetch(env, p);
    case editMessageText::ID:
      return editMessageText::fetch(env, p);
    case editProxy::ID:
      return editProxy::fetch(env, p);
    case editQuickReplyMessage::ID:
      return editQuickReplyMessage::fetch(env, p);
    case editStarSubscription::ID:
      return editStarSubscription::fetch(env, p);
    case editStory::ID:
      return editStory::fetch(env, p);
    case editStoryCover::ID:
      return editStoryCover::fetch(env, p);
    case editTextCompositionStyle::ID:
      return editTextCompositionStyle::fetch(env, p);
    case editUserStarSubscription::ID:
      return editUserStarSubscription::fetch(env, p);
    case enableProxy::ID:
      return enableProxy::fetch(env, p);
    case encryptGroupCallData::ID:
      return encryptGroupCallData::fetch(env, p);
    case endGroupCall::ID:
      return endGroupCall::fetch(env, p);
    case endGroupCallRecording::ID:
      return endGroupCallRecording::fetch(env, p);
    case endGroupCallScreenSharing::ID:
      return endGroupCallScreenSharing::fetch(env, p);
    case finishFileGeneration::ID:
      return finishFileGeneration::fetch(env, p);
    case fixTextWithAi::ID:
      return fixTextWithAi::fetch(env, p);
    case forwardMessages::ID:
      return forwardMessages::fetch(env, p);
    case getAccountTtl::ID:
      return getAccountTtl::fetch(env, p);
    case getActiveSessions::ID:
      return getActiveSessions::fetch(env, p);
    case getAllPassportElements::ID:
      return getAllPassportElements::fetch(env, p);
    case getAllStickerEmojis::ID:
      return getAllStickerEmojis::fetch(env, p);
    case getAnimatedEmoji::ID:
      return getAnimatedEmoji::fetch(env, p);
    case getApplicationConfig::ID:
      return getApplicationConfig::fetch(env, p);
    case getApplicationDownloadLink::ID:
      return getApplicationDownloadLink::fetch(env, p);
    case getArchiveChatListSettings::ID:
      return getArchiveChatListSettings::fetch(env, p);
    case getArchivedStickerSets::ID:
      return getArchivedStickerSets::fetch(env, p);
    case getAttachedStickerSets::ID:
      return getAttachedStickerSets::fetch(env, p);
    case getAttachmentMenuBot::ID:
      return getAttachmentMenuBot::fetch(env, p);
    case getAuthenticationPasskeyParameters::ID:
      return getAuthenticationPasskeyParameters::fetch(env, p);
    case getAuthorizationState::ID:
      return getAuthorizationState::fetch(env, p);
    case getAutoDownloadSettingsPresets::ID:
      return getAutoDownloadSettingsPresets::fetch(env, p);
    case getAutosaveSettings::ID:
      return getAutosaveSettings::fetch(env, p);
    case getAvailableChatBoostSlots::ID:
      return getAvailableChatBoostSlots::fetch(env, p);
    case getAvailableGifts::ID:
      return getAvailableGifts::fetch(env, p);
    case getBackgroundUrl::ID:
      return getBackgroundUrl::fetch(env, p);
    case getBankCardInfo::ID:
      return getBankCardInfo::fetch(env, p);
    case getBasicGroup::ID:
      return getBasicGroup::fetch(env, p);
    case getBasicGroupFullInfo::ID:
      return getBasicGroupFullInfo::fetch(env, p);
    case getBlockedMessageSenders::ID:
      return getBlockedMessageSenders::fetch(env, p);
    case getBotInfoDescription::ID:
      return getBotInfoDescription::fetch(env, p);
    case getBotInfoShortDescription::ID:
      return getBotInfoShortDescription::fetch(env, p);
    case getBotMediaPreviewInfo::ID:
      return getBotMediaPreviewInfo::fetch(env, p);
    case getBotMediaPreviews::ID:
      return getBotMediaPreviews::fetch(env, p);
    case getBotName::ID:
      return getBotName::fetch(env, p);
    case getBotSimilarBotCount::ID:
      return getBotSimilarBotCount::fetch(env, p);
    case getBotSimilarBots::ID:
      return getBotSimilarBots::fetch(env, p);
    case getBusinessAccountStarAmount::ID:
      return getBusinessAccountStarAmount::fetch(env, p);
    case getBusinessChatLinkInfo::ID:
      return getBusinessChatLinkInfo::fetch(env, p);
    case getBusinessChatLinks::ID:
      return getBusinessChatLinks::fetch(env, p);
    case getBusinessConnectedBot::ID:
      return getBusinessConnectedBot::fetch(env, p);
    case getBusinessConnection::ID:
      return getBusinessConnection::fetch(env, p);
    case getBusinessFeatures::ID:
      return getBusinessFeatures::fetch(env, p);
    case getCallbackQueryAnswer::ID:
      return getCallbackQueryAnswer::fetch(env, p);
    case getCallbackQueryMessage::ID:
      return getCallbackQueryMessage::fetch(env, p);
    case getChat::ID:
      return getChat::fetch(env, p);
    case getChatActiveStories::ID:
      return getChatActiveStories::fetch(env, p);
    case getChatAdministrators::ID:
      return getChatAdministrators::fetch(env, p);
    case getChatArchivedStories::ID:
      return getChatArchivedStories::fetch(env, p);
    case getChatAvailableMessageSenders::ID:
      return getChatAvailableMessageSenders::fetch(env, p);
    case getChatAvailablePaidMessageReactionSenders::ID:
      return getChatAvailablePaidMessageReactionSenders::fetch(env, p);
    case getChatBoostFeatures::ID:
      return getChatBoostFeatures::fetch(env, p);
    case getChatBoostLevelFeatures::ID:
      return getChatBoostLevelFeatures::fetch(env, p);
    case getChatBoostLink::ID:
      return getChatBoostLink::fetch(env, p);
    case getChatBoostLinkInfo::ID:
      return getChatBoostLinkInfo::fetch(env, p);
    case getChatBoostStatus::ID:
      return getChatBoostStatus::fetch(env, p);
    case getChatBoosts::ID:
      return getChatBoosts::fetch(env, p);
    case getChatEventLog::ID:
      return getChatEventLog::fetch(env, p);
    case getChatFolder::ID:
      return getChatFolder::fetch(env, p);
    case getChatFolderChatCount::ID:
      return getChatFolderChatCount::fetch(env, p);
    case getChatFolderChatsToLeave::ID:
      return getChatFolderChatsToLeave::fetch(env, p);
    case getChatFolderDefaultIconName::ID:
      return getChatFolderDefaultIconName::fetch(env, p);
    case getChatFolderInviteLinks::ID:
      return getChatFolderInviteLinks::fetch(env, p);
    case getChatFolderNewChats::ID:
      return getChatFolderNewChats::fetch(env, p);
    case getChatHistory::ID:
      return getChatHistory::fetch(env, p);
    case getChatInviteLink::ID:
      return getChatInviteLink::fetch(env, p);
    case getChatInviteLinkCounts::ID:
      return getChatInviteLinkCounts::fetch(env, p);
    case getChatInviteLinkMembers::ID:
      return getChatInviteLinkMembers::fetch(env, p);
    case getChatInviteLinks::ID:
      return getChatInviteLinks::fetch(env, p);
    case getChatJoinRequests::ID:
      return getChatJoinRequests::fetch(env, p);
    case getChatListsToAddChat::ID:
      return getChatListsToAddChat::fetch(env, p);
    case getChatMember::ID:
      return getChatMember::fetch(env, p);
    case getChatMessageByDate::ID:
      return getChatMessageByDate::fetch(env, p);
    case getChatMessageCalendar::ID:
      return getChatMessageCalendar::fetch(env, p);
    case getChatMessageCount::ID:
      return getChatMessageCount::fetch(env, p);
    case getChatMessagePosition::ID:
      return getChatMessagePosition::fetch(env, p);
    case getChatNotificationSettingsExceptions::ID:
      return getChatNotificationSettingsExceptions::fetch(env, p);
    case getChatOwnerAfterLeaving::ID:
      return getChatOwnerAfterLeaving::fetch(env, p);
    case getChatPinnedMessage::ID:
      return getChatPinnedMessage::fetch(env, p);
    case getChatPostedToChatPageStories::ID:
      return getChatPostedToChatPageStories::fetch(env, p);
    case getChatRevenueStatistics::ID:
      return getChatRevenueStatistics::fetch(env, p);
    case getChatRevenueTransactions::ID:
      return getChatRevenueTransactions::fetch(env, p);
    case getChatRevenueWithdrawalUrl::ID:
      return getChatRevenueWithdrawalUrl::fetch(env, p);
    case getChatScheduledMessages::ID:
      return getChatScheduledMessages::fetch(env, p);
    case getChatSimilarChatCount::ID:
      return getChatSimilarChatCount::fetch(env, p);
    case getChatSimilarChats::ID:
      return getChatSimilarChats::fetch(env, p);
    case getChatSparseMessagePositions::ID:
      return getChatSparseMessagePositions::fetch(env, p);
    case getChatSponsoredMessages::ID:
      return getChatSponsoredMessages::fetch(env, p);
    case getChatStatistics::ID:
      return getChatStatistics::fetch(env, p);
    case getChatStoryAlbums::ID:
      return getChatStoryAlbums::fetch(env, p);
    case getChatStoryInteractions::ID:
      return getChatStoryInteractions::fetch(env, p);
    case getChats::ID:
      return getChats::fetch(env, p);
    case getChatsForChatFolderInviteLink::ID:
      return getChatsForChatFolderInviteLink::fetch(env, p);
    case getChatsToPostStories::ID:
      return getChatsToPostStories::fetch(env, p);
    case getCloseFriends::ID:
      return getCloseFriends::fetch(env, p);
    case getCollectibleItemInfo::ID:
      return getCollectibleItemInfo::fetch(env, p);
    case getCommands::ID:
      return getCommands::fetch(env, p);
    case getConnectedAffiliateProgram::ID:
      return getConnectedAffiliateProgram::fetch(env, p);
    case getConnectedAffiliatePrograms::ID:
      return getConnectedAffiliatePrograms::fetch(env, p);
    case getConnectedWebsites::ID:
      return getConnectedWebsites::fetch(env, p);
    case getContacts::ID:
      return getContacts::fetch(env, p);
    case getCountries::ID:
      return getCountries::fetch(env, p);
    case getCountryCode::ID:
      return getCountryCode::fetch(env, p);
    case getCountryFlagEmoji::ID:
      return getCountryFlagEmoji::fetch(env, p);
    case getCreatedPublicChats::ID:
      return getCreatedPublicChats::fetch(env, p);
    case getCurrentState::ID:
      return getCurrentState::fetch(env, p);
    case getCurrentWeather::ID:
      return getCurrentWeather::fetch(env, p);
    case getCustomEmojiReactionAnimations::ID:
      return getCustomEmojiReactionAnimations::fetch(env, p);
    case getCustomEmojiStickers::ID:
      return getCustomEmojiStickers::fetch(env, p);
    case getDatabaseStatistics::ID:
      return getDatabaseStatistics::fetch(env, p);
    case getDeepLinkInfo::ID:
      return getDeepLinkInfo::fetch(env, p);
    case getDefaultBackgroundCustomEmojiStickers::ID:
      return getDefaultBackgroundCustomEmojiStickers::fetch(env, p);
    case getDefaultChatEmojiStatuses::ID:
      return getDefaultChatEmojiStatuses::fetch(env, p);
    case getDefaultChatPhotoCustomEmojiStickers::ID:
      return getDefaultChatPhotoCustomEmojiStickers::fetch(env, p);
    case getDefaultEmojiStatuses::ID:
      return getDefaultEmojiStatuses::fetch(env, p);
    case getDefaultMessageAutoDeleteTime::ID:
      return getDefaultMessageAutoDeleteTime::fetch(env, p);
    case getDefaultProfilePhotoCustomEmojiStickers::ID:
      return getDefaultProfilePhotoCustomEmojiStickers::fetch(env, p);
    case getDirectMessagesChatTopic::ID:
      return getDirectMessagesChatTopic::fetch(env, p);
    case getDirectMessagesChatTopicHistory::ID:
      return getDirectMessagesChatTopicHistory::fetch(env, p);
    case getDirectMessagesChatTopicMessageByDate::ID:
      return getDirectMessagesChatTopicMessageByDate::fetch(env, p);
    case getDirectMessagesChatTopicRevenue::ID:
      return getDirectMessagesChatTopicRevenue::fetch(env, p);
    case getDisallowedChatEmojiStatuses::ID:
      return getDisallowedChatEmojiStatuses::fetch(env, p);
    case getEmojiCategories::ID:
      return getEmojiCategories::fetch(env, p);
    case getEmojiReaction::ID:
      return getEmojiReaction::fetch(env, p);
    case getEmojiSuggestionsUrl::ID:
      return getEmojiSuggestionsUrl::fetch(env, p);
    case getExternalLink::ID:
      return getExternalLink::fetch(env, p);
    case getExternalLinkInfo::ID:
      return getExternalLinkInfo::fetch(env, p);
    case getFavoriteStickers::ID:
      return getFavoriteStickers::fetch(env, p);
    case getFile::ID:
      return getFile::fetch(env, p);
    case getFileDownloadedPrefixSize::ID:
      return getFileDownloadedPrefixSize::fetch(env, p);
    case getFileExtension::ID:
      return getFileExtension::fetch(env, p);
    case getFileMimeType::ID:
      return getFileMimeType::fetch(env, p);
    case getForumTopic::ID:
      return getForumTopic::fetch(env, p);
    case getForumTopicDefaultIcons::ID:
      return getForumTopicDefaultIcons::fetch(env, p);
    case getForumTopicHistory::ID:
      return getForumTopicHistory::fetch(env, p);
    case getForumTopicLink::ID:
      return getForumTopicLink::fetch(env, p);
    case getForumTopics::ID:
      return getForumTopics::fetch(env, p);
    case getGameHighScores::ID:
      return getGameHighScores::fetch(env, p);
    case getGiftAuctionAcquiredGifts::ID:
      return getGiftAuctionAcquiredGifts::fetch(env, p);
    case getGiftAuctionState::ID:
      return getGiftAuctionState::fetch(env, p);
    case getGiftChatThemes::ID:
      return getGiftChatThemes::fetch(env, p);
    case getGiftCollections::ID:
      return getGiftCollections::fetch(env, p);
    case getGiftUpgradePreview::ID:
      return getGiftUpgradePreview::fetch(env, p);
    case getGiftsForCrafting::ID:
      return getGiftsForCrafting::fetch(env, p);
    case getGiveawayInfo::ID:
      return getGiveawayInfo::fetch(env, p);
    case getGreetingStickers::ID:
      return getGreetingStickers::fetch(env, p);
    case getGrossingWebAppBots::ID:
      return getGrossingWebAppBots::fetch(env, p);
    case getGroupCall::ID:
      return getGroupCall::fetch(env, p);
    case getGroupCallParticipants::ID:
      return getGroupCallParticipants::fetch(env, p);
    case getGroupCallStreamSegment::ID:
      return getGroupCallStreamSegment::fetch(env, p);
    case getGroupCallStreams::ID:
      return getGroupCallStreams::fetch(env, p);
    case getGroupsInCommon::ID:
      return getGroupsInCommon::fetch(env, p);
    case getImportedContactCount::ID:
      return getImportedContactCount::fetch(env, p);
    case getInactiveSupergroupChats::ID:
      return getInactiveSupergroupChats::fetch(env, p);
    case getInlineGameHighScores::ID:
      return getInlineGameHighScores::fetch(env, p);
    case getInlineQueryResults::ID:
      return getInlineQueryResults::fetch(env, p);
    case getInstalledBackgrounds::ID:
      return getInstalledBackgrounds::fetch(env, p);
    case getInstalledStickerSets::ID:
      return getInstalledStickerSets::fetch(env, p);
    case getInternalLink::ID:
      return getInternalLink::fetch(env, p);
    case getInternalLinkType::ID:
      return getInternalLinkType::fetch(env, p);
    case getJsonString::ID:
      return getJsonString::fetch(env, p);
    case getJsonValue::ID:
      return getJsonValue::fetch(env, p);
    case getKeywordEmojis::ID:
      return getKeywordEmojis::fetch(env, p);
    case getLanguagePackInfo::ID:
      return getLanguagePackInfo::fetch(env, p);
    case getLanguagePackString::ID:
      return getLanguagePackString::fetch(env, p);
    case getLanguagePackStrings::ID:
      return getLanguagePackStrings::fetch(env, p);
    case getLinkPreview::ID:
      return getLinkPreview::fetch(env, p);
    case getLiveStoryAvailableMessageSenders::ID:
      return getLiveStoryAvailableMessageSenders::fetch(env, p);
    case getLiveStoryRtmpUrl::ID:
      return getLiveStoryRtmpUrl::fetch(env, p);
    case getLiveStoryStreamer::ID:
      return getLiveStoryStreamer::fetch(env, p);
    case getLiveStoryTopDonors::ID:
      return getLiveStoryTopDonors::fetch(env, p);
    case getLocalizationTargetInfo::ID:
      return getLocalizationTargetInfo::fetch(env, p);
    case getLogStream::ID:
      return getLogStream::fetch(env, p);
    case getLogTagVerbosityLevel::ID:
      return getLogTagVerbosityLevel::fetch(env, p);
    case getLogTags::ID:
      return getLogTags::fetch(env, p);
    case getLogVerbosityLevel::ID:
      return getLogVerbosityLevel::fetch(env, p);
    case getLoginPasskeys::ID:
      return getLoginPasskeys::fetch(env, p);
    case getLoginUrl::ID:
      return getLoginUrl::fetch(env, p);
    case getLoginUrlInfo::ID:
      return getLoginUrlInfo::fetch(env, p);
    case getMainWebApp::ID:
      return getMainWebApp::fetch(env, p);
    case getManagedBotAccessSettings::ID:
      return getManagedBotAccessSettings::fetch(env, p);
    case getManagedBotToken::ID:
      return getManagedBotToken::fetch(env, p);
    case getMapThumbnailFile::ID:
      return getMapThumbnailFile::fetch(env, p);
    case getMarkdownText::ID:
      return getMarkdownText::fetch(env, p);
    case getMe::ID:
      return getMe::fetch(env, p);
    case getMenuButton::ID:
      return getMenuButton::fetch(env, p);
    case getMessage::ID:
      return getMessage::fetch(env, p);
    case getMessageAddedReactions::ID:
      return getMessageAddedReactions::fetch(env, p);
    case getMessageAuthor::ID:
      return getMessageAuthor::fetch(env, p);
    case getMessageAvailableReactions::ID:
      return getMessageAvailableReactions::fetch(env, p);
    case getMessageEffect::ID:
      return getMessageEffect::fetch(env, p);
    case getMessageEmbeddingCode::ID:
      return getMessageEmbeddingCode::fetch(env, p);
    case getMessageFileType::ID:
      return getMessageFileType::fetch(env, p);
    case getMessageImportConfirmationText::ID:
      return getMessageImportConfirmationText::fetch(env, p);
    case getMessageLink::ID:
      return getMessageLink::fetch(env, p);
    case getMessageLinkInfo::ID:
      return getMessageLinkInfo::fetch(env, p);
    case getMessageLocally::ID:
      return getMessageLocally::fetch(env, p);
    case getMessageProperties::ID:
      return getMessageProperties::fetch(env, p);
    case getMessagePublicForwards::ID:
      return getMessagePublicForwards::fetch(env, p);
    case getMessageReadDate::ID:
      return getMessageReadDate::fetch(env, p);
    case getMessageStatistics::ID:
      return getMessageStatistics::fetch(env, p);
    case getMessageThread::ID:
      return getMessageThread::fetch(env, p);
    case getMessageThreadHistory::ID:
      return getMessageThreadHistory::fetch(env, p);
    case getMessageViewers::ID:
      return getMessageViewers::fetch(env, p);
    case getMessages::ID:
      return getMessages::fetch(env, p);
    case getNetworkStatistics::ID:
      return getNetworkStatistics::fetch(env, p);
    case getNewChatPrivacySettings::ID:
      return getNewChatPrivacySettings::fetch(env, p);
    case getOauthLinkInfo::ID:
      return getOauthLinkInfo::fetch(env, p);
    case getOption::ID:
      return getOption::fetch(env, p);
    case getOwnedBots::ID:
      return getOwnedBots::fetch(env, p);
    case getOwnedStickerSets::ID:
      return getOwnedStickerSets::fetch(env, p);
    case getPaidMessageRevenue::ID:
      return getPaidMessageRevenue::fetch(env, p);
    case getPasskeyParameters::ID:
      return getPasskeyParameters::fetch(env, p);
    case getPassportAuthorizationForm::ID:
      return getPassportAuthorizationForm::fetch(env, p);
    case getPassportAuthorizationFormAvailableElements::ID:
      return getPassportAuthorizationFormAvailableElements::fetch(env, p);
    case getPassportElement::ID:
      return getPassportElement::fetch(env, p);
    case getPasswordState::ID:
      return getPasswordState::fetch(env, p);
    case getPaymentForm::ID:
      return getPaymentForm::fetch(env, p);
    case getPaymentReceipt::ID:
      return getPaymentReceipt::fetch(env, p);
    case getPersonalChatHistory::ID:
      return getPersonalChatHistory::fetch(env, p);
    case getPhoneNumberInfo::ID:
      return getPhoneNumberInfo::fetch(env, p);
    case getPhoneNumberInfoSync::ID:
      return getPhoneNumberInfoSync::fetch(env, p);
    case getPollOptionProperties::ID:
      return getPollOptionProperties::fetch(env, p);
    case getPollVoteStatistics::ID:
      return getPollVoteStatistics::fetch(env, p);
    case getPollVoters::ID:
      return getPollVoters::fetch(env, p);
    case getPreferredCountryLanguage::ID:
      return getPreferredCountryLanguage::fetch(env, p);
    case getPremiumFeatures::ID:
      return getPremiumFeatures::fetch(env, p);
    case getPremiumGiftPaymentOptions::ID:
      return getPremiumGiftPaymentOptions::fetch(env, p);
    case getPremiumGiveawayPaymentOptions::ID:
      return getPremiumGiveawayPaymentOptions::fetch(env, p);
    case getPremiumInfoSticker::ID:
      return getPremiumInfoSticker::fetch(env, p);
    case getPremiumLimit::ID:
      return getPremiumLimit::fetch(env, p);
    case getPremiumState::ID:
      return getPremiumState::fetch(env, p);
    case getPremiumStickerExamples::ID:
      return getPremiumStickerExamples::fetch(env, p);
    case getPremiumStickers::ID:
      return getPremiumStickers::fetch(env, p);
    case getPreparedInlineMessage::ID:
      return getPreparedInlineMessage::fetch(env, p);
    case getPreparedKeyboardButton::ID:
      return getPreparedKeyboardButton::fetch(env, p);
    case getProxies::ID:
      return getProxies::fetch(env, p);
    case getPublicPostSearchLimits::ID:
      return getPublicPostSearchLimits::fetch(env, p);
    case getPushReceiverId::ID:
      return getPushReceiverId::fetch(env, p);
    case getReadDatePrivacySettings::ID:
      return getReadDatePrivacySettings::fetch(env, p);
    case getReceivedGift::ID:
      return getReceivedGift::fetch(env, p);
    case getReceivedGifts::ID:
      return getReceivedGifts::fetch(env, p);
    case getRecentEmojiStatuses::ID:
      return getRecentEmojiStatuses::fetch(env, p);
    case getRecentInlineBots::ID:
      return getRecentInlineBots::fetch(env, p);
    case getRecentStickers::ID:
      return getRecentStickers::fetch(env, p);
    case getRecentlyOpenedChats::ID:
      return getRecentlyOpenedChats::fetch(env, p);
    case getRecentlyVisitedTMeUrls::ID:
      return getRecentlyVisitedTMeUrls::fetch(env, p);
    case getRecommendedChatFolders::ID:
      return getRecommendedChatFolders::fetch(env, p);
    case getRecommendedChats::ID:
      return getRecommendedChats::fetch(env, p);
    case getRecoveryEmailAddress::ID:
      return getRecoveryEmailAddress::fetch(env, p);
    case getRemoteFile::ID:
      return getRemoteFile::fetch(env, p);
    case getRepliedMessage::ID:
      return getRepliedMessage::fetch(env, p);
    case getSavedAnimations::ID:
      return getSavedAnimations::fetch(env, p);
    case getSavedMessagesTags::ID:
      return getSavedMessagesTags::fetch(env, p);
    case getSavedMessagesTopicHistory::ID:
      return getSavedMessagesTopicHistory::fetch(env, p);
    case getSavedMessagesTopicMessageByDate::ID:
      return getSavedMessagesTopicMessageByDate::fetch(env, p);
    case getSavedNotificationSound::ID:
      return getSavedNotificationSound::fetch(env, p);
    case getSavedNotificationSounds::ID:
      return getSavedNotificationSounds::fetch(env, p);
    case getSavedOrderInfo::ID:
      return getSavedOrderInfo::fetch(env, p);
    case getScopeNotificationSettings::ID:
      return getScopeNotificationSettings::fetch(env, p);
    case getSearchSponsoredChats::ID:
      return getSearchSponsoredChats::fetch(env, p);
    case getSearchedForTags::ID:
      return getSearchedForTags::fetch(env, p);
    case getSecretChat::ID:
      return getSecretChat::fetch(env, p);
    case getStakeDiceState::ID:
      return getStakeDiceState::fetch(env, p);
    case getStarAdAccountUrl::ID:
      return getStarAdAccountUrl::fetch(env, p);
    case getStarGiftPaymentOptions::ID:
      return getStarGiftPaymentOptions::fetch(env, p);
    case getStarGiveawayPaymentOptions::ID:
      return getStarGiveawayPaymentOptions::fetch(env, p);
    case getStarPaymentOptions::ID:
      return getStarPaymentOptions::fetch(env, p);
    case getStarRevenueStatistics::ID:
      return getStarRevenueStatistics::fetch(env, p);
    case getStarSubscriptions::ID:
      return getStarSubscriptions::fetch(env, p);
    case getStarTransactions::ID:
      return getStarTransactions::fetch(env, p);
    case getStarWithdrawalUrl::ID:
      return getStarWithdrawalUrl::fetch(env, p);
    case getStatisticalGraph::ID:
      return getStatisticalGraph::fetch(env, p);
    case getStickerEmojis::ID:
      return getStickerEmojis::fetch(env, p);
    case getStickerOutline::ID:
      return getStickerOutline::fetch(env, p);
    case getStickerOutlineSvgPath::ID:
      return getStickerOutlineSvgPath::fetch(env, p);
    case getStickerSet::ID:
      return getStickerSet::fetch(env, p);
    case getStickerSetName::ID:
      return getStickerSetName::fetch(env, p);
    case getStickers::ID:
      return getStickers::fetch(env, p);
    case getStorageStatistics::ID:
      return getStorageStatistics::fetch(env, p);
    case getStorageStatisticsFast::ID:
      return getStorageStatisticsFast::fetch(env, p);
    case getStory::ID:
      return getStory::fetch(env, p);
    case getStoryAlbumStories::ID:
      return getStoryAlbumStories::fetch(env, p);
    case getStoryAvailableReactions::ID:
      return getStoryAvailableReactions::fetch(env, p);
    case getStoryInteractions::ID:
      return getStoryInteractions::fetch(env, p);
    case getStoryNotificationSettingsExceptions::ID:
      return getStoryNotificationSettingsExceptions::fetch(env, p);
    case getStoryPublicForwards::ID:
      return getStoryPublicForwards::fetch(env, p);
    case getStoryStatistics::ID:
      return getStoryStatistics::fetch(env, p);
    case getSuggestedFileName::ID:
      return getSuggestedFileName::fetch(env, p);
    case getSuggestedStickerSetName::ID:
      return getSuggestedStickerSetName::fetch(env, p);
    case getSuitableDiscussionChats::ID:
      return getSuitableDiscussionChats::fetch(env, p);
    case getSuitablePersonalChats::ID:
      return getSuitablePersonalChats::fetch(env, p);
    case getSupergroup::ID:
      return getSupergroup::fetch(env, p);
    case getSupergroupFullInfo::ID:
      return getSupergroupFullInfo::fetch(env, p);
    case getSupergroupMembers::ID:
      return getSupergroupMembers::fetch(env, p);
    case getSupportName::ID:
      return getSupportName::fetch(env, p);
    case getSupportUser::ID:
      return getSupportUser::fetch(env, p);
    case getTemporaryPasswordState::ID:
      return getTemporaryPasswordState::fetch(env, p);
    case getTextCompositionStyleExample::ID:
      return getTextCompositionStyleExample::fetch(env, p);
    case getTextEntities::ID:
      return getTextEntities::fetch(env, p);
    case getThemeParametersJsonString::ID:
      return getThemeParametersJsonString::fetch(env, p);
    case getThemedChatEmojiStatuses::ID:
      return getThemedChatEmojiStatuses::fetch(env, p);
    case getThemedEmojiStatuses::ID:
      return getThemedEmojiStatuses::fetch(env, p);
    case getTimeZones::ID:
      return getTimeZones::fetch(env, p);
    case getTonRevenueStatistics::ID:
      return getTonRevenueStatistics::fetch(env, p);
    case getTonTransactions::ID:
      return getTonTransactions::fetch(env, p);
    case getTonWithdrawalUrl::ID:
      return getTonWithdrawalUrl::fetch(env, p);
    case getTopChats::ID:
      return getTopChats::fetch(env, p);
    case getTrendingStickerSets::ID:
      return getTrendingStickerSets::fetch(env, p);
    case getUpgradedGift::ID:
      return getUpgradedGift::fetch(env, p);
    case getUpgradedGiftEmojiStatuses::ID:
      return getUpgradedGiftEmojiStatuses::fetch(env, p);
    case getUpgradedGiftValueInfo::ID:
      return getUpgradedGiftValueInfo::fetch(env, p);
    case getUpgradedGiftVariants::ID:
      return getUpgradedGiftVariants::fetch(env, p);
    case getUpgradedGiftWithdrawalUrl::ID:
      return getUpgradedGiftWithdrawalUrl::fetch(env, p);
    case getUpgradedGiftsPromotionalAnimation::ID:
      return getUpgradedGiftsPromotionalAnimation::fetch(env, p);
    case getUser::ID:
      return getUser::fetch(env, p);
    case getUserChatBoosts::ID:
      return getUserChatBoosts::fetch(env, p);
    case getUserFullInfo::ID:
      return getUserFullInfo::fetch(env, p);
    case getUserLink::ID:
      return getUserLink::fetch(env, p);
    case getUserPrivacySettingRules::ID:
      return getUserPrivacySettingRules::fetch(env, p);
    case getUserProfileAudios::ID:
      return getUserProfileAudios::fetch(env, p);
    case getUserProfilePhotos::ID:
      return getUserProfilePhotos::fetch(env, p);
    case getUserSupportInfo::ID:
      return getUserSupportInfo::fetch(env, p);
    case getVideoChatAvailableParticipants::ID:
      return getVideoChatAvailableParticipants::fetch(env, p);
    case getVideoChatInviteLink::ID:
      return getVideoChatInviteLink::fetch(env, p);
    case getVideoChatRtmpUrl::ID:
      return getVideoChatRtmpUrl::fetch(env, p);
    case getVideoMessageAdvertisements::ID:
      return getVideoMessageAdvertisements::fetch(env, p);
    case getWebAppLinkUrl::ID:
      return getWebAppLinkUrl::fetch(env, p);
    case getWebAppPlaceholder::ID:
      return getWebAppPlaceholder::fetch(env, p);
    case getWebAppUrl::ID:
      return getWebAppUrl::fetch(env, p);
    case getWebPageInstantView::ID:
      return getWebPageInstantView::fetch(env, p);
    case giftPremiumWithStars::ID:
      return giftPremiumWithStars::fetch(env, p);
    case hideContactCloseBirthdays::ID:
      return hideContactCloseBirthdays::fetch(env, p);
    case hideSuggestedAction::ID:
      return hideSuggestedAction::fetch(env, p);
    case importContacts::ID:
      return importContacts::fetch(env, p);
    case importMessages::ID:
      return importMessages::fetch(env, p);
    case increaseGiftAuctionBid::ID:
      return increaseGiftAuctionBid::fetch(env, p);
    case inviteGroupCallParticipant::ID:
      return inviteGroupCallParticipant::fetch(env, p);
    case inviteVideoChatParticipants::ID:
      return inviteVideoChatParticipants::fetch(env, p);
    case isLoginEmailAddressRequired::ID:
      return isLoginEmailAddressRequired::fetch(env, p);
    case isProfileAudio::ID:
      return isProfileAudio::fetch(env, p);
    case joinChat::ID:
      return joinChat::fetch(env, p);
    case joinChatByInviteLink::ID:
      return joinChatByInviteLink::fetch(env, p);
    case joinGroupCall::ID:
      return joinGroupCall::fetch(env, p);
    case joinLiveStory::ID:
      return joinLiveStory::fetch(env, p);
    case joinVideoChat::ID:
      return joinVideoChat::fetch(env, p);
    case launchPrepaidGiveaway::ID:
      return launchPrepaidGiveaway::fetch(env, p);
    case leaveChat::ID:
      return leaveChat::fetch(env, p);
    case leaveGroupCall::ID:
      return leaveGroupCall::fetch(env, p);
    case listenToAudio::ID:
      return listenToAudio::fetch(env, p);
    case loadActiveStories::ID:
      return loadActiveStories::fetch(env, p);
    case loadChats::ID:
      return loadChats::fetch(env, p);
    case loadDirectMessagesChatTopics::ID:
      return loadDirectMessagesChatTopics::fetch(env, p);
    case loadGroupCallParticipants::ID:
      return loadGroupCallParticipants::fetch(env, p);
    case loadQuickReplyShortcutMessages::ID:
      return loadQuickReplyShortcutMessages::fetch(env, p);
    case loadQuickReplyShortcuts::ID:
      return loadQuickReplyShortcuts::fetch(env, p);
    case loadSavedMessagesTopics::ID:
      return loadSavedMessagesTopics::fetch(env, p);
    case logOut::ID:
      return logOut::fetch(env, p);
    case markChecklistTasksAsDone::ID:
      return markChecklistTasksAsDone::fetch(env, p);
    case openBotSimilarBot::ID:
      return openBotSimilarBot::fetch(env, p);
    case openChat::ID:
      return openChat::fetch(env, p);
    case openChatSimilarChat::ID:
      return openChatSimilarChat::fetch(env, p);
    case openGiftAuction::ID:
      return openGiftAuction::fetch(env, p);
    case openMessageContent::ID:
      return openMessageContent::fetch(env, p);
    case openSponsoredChat::ID:
      return openSponsoredChat::fetch(env, p);
    case openStory::ID:
      return openStory::fetch(env, p);
    case openWebApp::ID:
      return openWebApp::fetch(env, p);
    case optimizeStorage::ID:
      return optimizeStorage::fetch(env, p);
    case parseMarkdown::ID:
      return parseMarkdown::fetch(env, p);
    case parseTextEntities::ID:
      return parseTextEntities::fetch(env, p);
    case pinChatMessage::ID:
      return pinChatMessage::fetch(env, p);
    case pingProxy::ID:
      return pingProxy::fetch(env, p);
    case placeGiftAuctionBid::ID:
      return placeGiftAuctionBid::fetch(env, p);
    case postStory::ID:
      return postStory::fetch(env, p);
    case preliminaryUploadFile::ID:
      return preliminaryUploadFile::fetch(env, p);
    case processChatFolderNewChats::ID:
      return processChatFolderNewChats::fetch(env, p);
    case processChatHasProtectedContentDisableRequest::ID:
      return processChatHasProtectedContentDisableRequest::fetch(env, p);
    case processChatJoinRequest::ID:
      return processChatJoinRequest::fetch(env, p);
    case processChatJoinRequests::ID:
      return processChatJoinRequests::fetch(env, p);
    case processGiftPurchaseOffer::ID:
      return processGiftPurchaseOffer::fetch(env, p);
    case processPushNotification::ID:
      return processPushNotification::fetch(env, p);
    case rateSpeechRecognition::ID:
      return rateSpeechRecognition::fetch(env, p);
    case readAllChatMentions::ID:
      return readAllChatMentions::fetch(env, p);
    case readAllChatPollVotes::ID:
      return readAllChatPollVotes::fetch(env, p);
    case readAllChatReactions::ID:
      return readAllChatReactions::fetch(env, p);
    case readAllDirectMessagesChatTopicReactions::ID:
      return readAllDirectMessagesChatTopicReactions::fetch(env, p);
    case readAllForumTopicMentions::ID:
      return readAllForumTopicMentions::fetch(env, p);
    case readAllForumTopicPollVotes::ID:
      return readAllForumTopicPollVotes::fetch(env, p);
    case readAllForumTopicReactions::ID:
      return readAllForumTopicReactions::fetch(env, p);
    case readBusinessMessage::ID:
      return readBusinessMessage::fetch(env, p);
    case readChatList::ID:
      return readChatList::fetch(env, p);
    case readFilePart::ID:
      return readFilePart::fetch(env, p);
    case readdQuickReplyShortcutMessages::ID:
      return readdQuickReplyShortcutMessages::fetch(env, p);
    case recognizeSpeech::ID:
      return recognizeSpeech::fetch(env, p);
    case recoverAuthenticationPassword::ID:
      return recoverAuthenticationPassword::fetch(env, p);
    case recoverPassword::ID:
      return recoverPassword::fetch(env, p);
    case refundStarPayment::ID:
      return refundStarPayment::fetch(env, p);
    case registerDevice::ID:
      return registerDevice::fetch(env, p);
    case registerUser::ID:
      return registerUser::fetch(env, p);
    case removeAllFilesFromDownloads::ID:
      return removeAllFilesFromDownloads::fetch(env, p);
    case removeBusinessConnectedBotFromChat::ID:
      return removeBusinessConnectedBotFromChat::fetch(env, p);
    case removeChatActionBar::ID:
      return removeChatActionBar::fetch(env, p);
    case removeContacts::ID:
      return removeContacts::fetch(env, p);
    case removeFavoriteSticker::ID:
      return removeFavoriteSticker::fetch(env, p);
    case removeFileFromDownloads::ID:
      return removeFileFromDownloads::fetch(env, p);
    case removeGiftCollectionGifts::ID:
      return removeGiftCollectionGifts::fetch(env, p);
    case removeInstalledBackground::ID:
      return removeInstalledBackground::fetch(env, p);
    case removeLoginPasskey::ID:
      return removeLoginPasskey::fetch(env, p);
    case removeMessageReaction::ID:
      return removeMessageReaction::fetch(env, p);
    case removeMessageSenderBotVerification::ID:
      return removeMessageSenderBotVerification::fetch(env, p);
    case removeNotification::ID:
      return removeNotification::fetch(env, p);
    case removeNotificationGroup::ID:
      return removeNotificationGroup::fetch(env, p);
    case removePendingLiveStoryReactions::ID:
      return removePendingLiveStoryReactions::fetch(env, p);
    case removePendingPaidMessageReactions::ID:
      return removePendingPaidMessageReactions::fetch(env, p);
    case removeProfileAudio::ID:
      return removeProfileAudio::fetch(env, p);
    case removeProxy::ID:
      return removeProxy::fetch(env, p);
    case removeRecentHashtag::ID:
      return removeRecentHashtag::fetch(env, p);
    case removeRecentSticker::ID:
      return removeRecentSticker::fetch(env, p);
    case removeRecentlyFoundChat::ID:
      return removeRecentlyFoundChat::fetch(env, p);
    case removeSavedAnimation::ID:
      return removeSavedAnimation::fetch(env, p);
    case removeSavedNotificationSound::ID:
      return removeSavedNotificationSound::fetch(env, p);
    case removeSearchedForTag::ID:
      return removeSearchedForTag::fetch(env, p);
    case removeStickerFromSet::ID:
      return removeStickerFromSet::fetch(env, p);
    case removeStoryAlbumStories::ID:
      return removeStoryAlbumStories::fetch(env, p);
    case removeTextCompositionStyle::ID:
      return removeTextCompositionStyle::fetch(env, p);
    case removeTopChat::ID:
      return removeTopChat::fetch(env, p);
    case reorderActiveUsernames::ID:
      return reorderActiveUsernames::fetch(env, p);
    case reorderBotActiveUsernames::ID:
      return reorderBotActiveUsernames::fetch(env, p);
    case reorderBotMediaPreviews::ID:
      return reorderBotMediaPreviews::fetch(env, p);
    case reorderChatFolders::ID:
      return reorderChatFolders::fetch(env, p);
    case reorderGiftCollectionGifts::ID:
      return reorderGiftCollectionGifts::fetch(env, p);
    case reorderGiftCollections::ID:
      return reorderGiftCollections::fetch(env, p);
    case reorderInstalledStickerSets::ID:
      return reorderInstalledStickerSets::fetch(env, p);
    case reorderQuickReplyShortcuts::ID:
      return reorderQuickReplyShortcuts::fetch(env, p);
    case reorderStoryAlbumStories::ID:
      return reorderStoryAlbumStories::fetch(env, p);
    case reorderStoryAlbums::ID:
      return reorderStoryAlbums::fetch(env, p);
    case reorderSupergroupActiveUsernames::ID:
      return reorderSupergroupActiveUsernames::fetch(env, p);
    case replaceLiveStoryRtmpUrl::ID:
      return replaceLiveStoryRtmpUrl::fetch(env, p);
    case replacePrimaryChatInviteLink::ID:
      return replacePrimaryChatInviteLink::fetch(env, p);
    case replaceStickerInSet::ID:
      return replaceStickerInSet::fetch(env, p);
    case replaceVideoChatRtmpUrl::ID:
      return replaceVideoChatRtmpUrl::fetch(env, p);
    case reportAuthenticationCodeMissing::ID:
      return reportAuthenticationCodeMissing::fetch(env, p);
    case reportChat::ID:
      return reportChat::fetch(env, p);
    case reportChatPhoto::ID:
      return reportChatPhoto::fetch(env, p);
    case reportChatSponsoredMessage::ID:
      return reportChatSponsoredMessage::fetch(env, p);
    case reportMessageReactions::ID:
      return reportMessageReactions::fetch(env, p);
    case reportPhoneNumberCodeMissing::ID:
      return reportPhoneNumberCodeMissing::fetch(env, p);
    case reportSponsoredChat::ID:
      return reportSponsoredChat::fetch(env, p);
    case reportStory::ID:
      return reportStory::fetch(env, p);
    case reportSupergroupAntiSpamFalsePositive::ID:
      return reportSupergroupAntiSpamFalsePositive::fetch(env, p);
    case reportSupergroupSpam::ID:
      return reportSupergroupSpam::fetch(env, p);
    case reportVideoMessageAdvertisement::ID:
      return reportVideoMessageAdvertisement::fetch(env, p);
    case requestAuthenticationPasswordRecovery::ID:
      return requestAuthenticationPasswordRecovery::fetch(env, p);
    case requestPasswordRecovery::ID:
      return requestPasswordRecovery::fetch(env, p);
    case requestQrCodeAuthentication::ID:
      return requestQrCodeAuthentication::fetch(env, p);
    case resendAuthenticationCode::ID:
      return resendAuthenticationCode::fetch(env, p);
    case resendEmailAddressVerificationCode::ID:
      return resendEmailAddressVerificationCode::fetch(env, p);
    case resendLoginEmailAddressCode::ID:
      return resendLoginEmailAddressCode::fetch(env, p);
    case resendMessages::ID:
      return resendMessages::fetch(env, p);
    case resendPhoneNumberCode::ID:
      return resendPhoneNumberCode::fetch(env, p);
    case resendRecoveryEmailAddressCode::ID:
      return resendRecoveryEmailAddressCode::fetch(env, p);
    case resetAllNotificationSettings::ID:
      return resetAllNotificationSettings::fetch(env, p);
    case resetAuthenticationEmailAddress::ID:
      return resetAuthenticationEmailAddress::fetch(env, p);
    case resetInstalledBackgrounds::ID:
      return resetInstalledBackgrounds::fetch(env, p);
    case resetNetworkStatistics::ID:
      return resetNetworkStatistics::fetch(env, p);
    case resetPassword::ID:
      return resetPassword::fetch(env, p);
    case reuseStarSubscription::ID:
      return reuseStarSubscription::fetch(env, p);
    case revokeChatInviteLink::ID:
      return revokeChatInviteLink::fetch(env, p);
    case revokeGroupCallInviteLink::ID:
      return revokeGroupCallInviteLink::fetch(env, p);
    case saveApplicationLogEvent::ID:
      return saveApplicationLogEvent::fetch(env, p);
    case savePreparedInlineMessage::ID:
      return savePreparedInlineMessage::fetch(env, p);
    case savePreparedKeyboardButton::ID:
      return savePreparedKeyboardButton::fetch(env, p);
    case searchAffiliatePrograms::ID:
      return searchAffiliatePrograms::fetch(env, p);
    case searchBackground::ID:
      return searchBackground::fetch(env, p);
    case searchCallMessages::ID:
      return searchCallMessages::fetch(env, p);
    case searchChatAffiliateProgram::ID:
      return searchChatAffiliateProgram::fetch(env, p);
    case searchChatMembers::ID:
      return searchChatMembers::fetch(env, p);
    case searchChatMessages::ID:
      return searchChatMessages::fetch(env, p);
    case searchChatRecentLocationMessages::ID:
      return searchChatRecentLocationMessages::fetch(env, p);
    case searchChats::ID:
      return searchChats::fetch(env, p);
    case searchChatsOnServer::ID:
      return searchChatsOnServer::fetch(env, p);
    case searchContacts::ID:
      return searchContacts::fetch(env, p);
    case searchEmojis::ID:
      return searchEmojis::fetch(env, p);
    case searchFileDownloads::ID:
      return searchFileDownloads::fetch(env, p);
    case searchGiftsForResale::ID:
      return searchGiftsForResale::fetch(env, p);
    case searchHashtags::ID:
      return searchHashtags::fetch(env, p);
    case searchInstalledStickerSets::ID:
      return searchInstalledStickerSets::fetch(env, p);
    case searchMessages::ID:
      return searchMessages::fetch(env, p);
    case searchOutgoingDocumentMessages::ID:
      return searchOutgoingDocumentMessages::fetch(env, p);
    case searchPublicChat::ID:
      return searchPublicChat::fetch(env, p);
    case searchPublicChats::ID:
      return searchPublicChats::fetch(env, p);
    case searchPublicMessagesByTag::ID:
      return searchPublicMessagesByTag::fetch(env, p);
    case searchPublicPosts::ID:
      return searchPublicPosts::fetch(env, p);
    case searchPublicStoriesByLocation::ID:
      return searchPublicStoriesByLocation::fetch(env, p);
    case searchPublicStoriesByTag::ID:
      return searchPublicStoriesByTag::fetch(env, p);
    case searchPublicStoriesByVenue::ID:
      return searchPublicStoriesByVenue::fetch(env, p);
    case searchQuote::ID:
      return searchQuote::fetch(env, p);
    case searchRecentlyFoundChats::ID:
      return searchRecentlyFoundChats::fetch(env, p);
    case searchSavedMessages::ID:
      return searchSavedMessages::fetch(env, p);
    case searchSecretMessages::ID:
      return searchSecretMessages::fetch(env, p);
    case searchStickerSet::ID:
      return searchStickerSet::fetch(env, p);
    case searchStickerSets::ID:
      return searchStickerSets::fetch(env, p);
    case searchStickers::ID:
      return searchStickers::fetch(env, p);
    case searchStringsByPrefix::ID:
      return searchStringsByPrefix::fetch(env, p);
    case searchTextCompositionStyle::ID:
      return searchTextCompositionStyle::fetch(env, p);
    case searchUserByPhoneNumber::ID:
      return searchUserByPhoneNumber::fetch(env, p);
    case searchUserByToken::ID:
      return searchUserByToken::fetch(env, p);
    case searchWebApp::ID:
      return searchWebApp::fetch(env, p);
    case sellGift::ID:
      return sellGift::fetch(env, p);
    case sendAuthenticationFirebaseSms::ID:
      return sendAuthenticationFirebaseSms::fetch(env, p);
    case sendBotStartMessage::ID:
      return sendBotStartMessage::fetch(env, p);
    case sendBusinessMessage::ID:
      return sendBusinessMessage::fetch(env, p);
    case sendBusinessMessageAlbum::ID:
      return sendBusinessMessageAlbum::fetch(env, p);
    case sendCallDebugInformation::ID:
      return sendCallDebugInformation::fetch(env, p);
    case sendCallLog::ID:
      return sendCallLog::fetch(env, p);
    case sendCallRating::ID:
      return sendCallRating::fetch(env, p);
    case sendCallSignalingData::ID:
      return sendCallSignalingData::fetch(env, p);
    case sendChatAction::ID:
      return sendChatAction::fetch(env, p);
    case sendCustomRequest::ID:
      return sendCustomRequest::fetch(env, p);
    case sendEmailAddressVerificationCode::ID:
      return sendEmailAddressVerificationCode::fetch(env, p);
    case sendGift::ID:
      return sendGift::fetch(env, p);
    case sendGiftPurchaseOffer::ID:
      return sendGiftPurchaseOffer::fetch(env, p);
    case sendGroupCallMessage::ID:
      return sendGroupCallMessage::fetch(env, p);
    case sendInlineQueryResultMessage::ID:
      return sendInlineQueryResultMessage::fetch(env, p);
    case sendMessage::ID:
      return sendMessage::fetch(env, p);
    case sendMessageAlbum::ID:
      return sendMessageAlbum::fetch(env, p);
    case sendMessageViewMetrics::ID:
      return sendMessageViewMetrics::fetch(env, p);
    case sendPassportAuthorizationForm::ID:
      return sendPassportAuthorizationForm::fetch(env, p);
    case sendPaymentForm::ID:
      return sendPaymentForm::fetch(env, p);
    case sendPhoneNumberCode::ID:
      return sendPhoneNumberCode::fetch(env, p);
    case sendPhoneNumberFirebaseSms::ID:
      return sendPhoneNumberFirebaseSms::fetch(env, p);
    case sendQuickReplyShortcutMessages::ID:
      return sendQuickReplyShortcutMessages::fetch(env, p);
    case sendResoldGift::ID:
      return sendResoldGift::fetch(env, p);
    case sendTextMessageDraft::ID:
      return sendTextMessageDraft::fetch(env, p);
    case sendWebAppCustomRequest::ID:
      return sendWebAppCustomRequest::fetch(env, p);
    case sendWebAppData::ID:
      return sendWebAppData::fetch(env, p);
    case setAccentColor::ID:
      return setAccentColor::fetch(env, p);
    case setAccountTtl::ID:
      return setAccountTtl::fetch(env, p);
    case setAlarm::ID:
      return setAlarm::fetch(env, p);
    case setApplicationVerificationToken::ID:
      return setApplicationVerificationToken::fetch(env, p);
    case setArchiveChatListSettings::ID:
      return setArchiveChatListSettings::fetch(env, p);
    case setAuthenticationEmailAddress::ID:
      return setAuthenticationEmailAddress::fetch(env, p);
    case setAuthenticationPhoneNumber::ID:
      return setAuthenticationPhoneNumber::fetch(env, p);
    case setAuthenticationPremiumPurchaseTransaction::ID:
      return setAuthenticationPremiumPurchaseTransaction::fetch(env, p);
    case setAutoDownloadSettings::ID:
      return setAutoDownloadSettings::fetch(env, p);
    case setAutosaveSettings::ID:
      return setAutosaveSettings::fetch(env, p);
    case setBio::ID:
      return setBio::fetch(env, p);
    case setBirthdate::ID:
      return setBirthdate::fetch(env, p);
    case setBotInfoDescription::ID:
      return setBotInfoDescription::fetch(env, p);
    case setBotInfoShortDescription::ID:
      return setBotInfoShortDescription::fetch(env, p);
    case setBotName::ID:
      return setBotName::fetch(env, p);
    case setBotProfilePhoto::ID:
      return setBotProfilePhoto::fetch(env, p);
    case setBotUpdatesStatus::ID:
      return setBotUpdatesStatus::fetch(env, p);
    case setBusinessAccountBio::ID:
      return setBusinessAccountBio::fetch(env, p);
    case setBusinessAccountGiftSettings::ID:
      return setBusinessAccountGiftSettings::fetch(env, p);
    case setBusinessAccountName::ID:
      return setBusinessAccountName::fetch(env, p);
    case setBusinessAccountProfilePhoto::ID:
      return setBusinessAccountProfilePhoto::fetch(env, p);
    case setBusinessAccountUsername::ID:
      return setBusinessAccountUsername::fetch(env, p);
    case setBusinessAwayMessageSettings::ID:
      return setBusinessAwayMessageSettings::fetch(env, p);
    case setBusinessConnectedBot::ID:
      return setBusinessConnectedBot::fetch(env, p);
    case setBusinessGreetingMessageSettings::ID:
      return setBusinessGreetingMessageSettings::fetch(env, p);
    case setBusinessLocation::ID:
      return setBusinessLocation::fetch(env, p);
    case setBusinessMessageIsPinned::ID:
      return setBusinessMessageIsPinned::fetch(env, p);
    case setBusinessOpeningHours::ID:
      return setBusinessOpeningHours::fetch(env, p);
    case setBusinessStartPage::ID:
      return setBusinessStartPage::fetch(env, p);
    case setChatAccentColor::ID:
      return setChatAccentColor::fetch(env, p);
    case setChatActiveStoriesList::ID:
      return setChatActiveStoriesList::fetch(env, p);
    case setChatAffiliateProgram::ID:
      return setChatAffiliateProgram::fetch(env, p);
    case setChatAvailableReactions::ID:
      return setChatAvailableReactions::fetch(env, p);
    case setChatBackground::ID:
      return setChatBackground::fetch(env, p);
    case setChatClientData::ID:
      return setChatClientData::fetch(env, p);
    case setChatDescription::ID:
      return setChatDescription::fetch(env, p);
    case setChatDirectMessagesGroup::ID:
      return setChatDirectMessagesGroup::fetch(env, p);
    case setChatDiscussionGroup::ID:
      return setChatDiscussionGroup::fetch(env, p);
    case setChatDraftMessage::ID:
      return setChatDraftMessage::fetch(env, p);
    case setChatEmojiStatus::ID:
      return setChatEmojiStatus::fetch(env, p);
    case setChatLocation::ID:
      return setChatLocation::fetch(env, p);
    case setChatMemberStatus::ID:
      return setChatMemberStatus::fetch(env, p);
    case setChatMemberTag::ID:
      return setChatMemberTag::fetch(env, p);
    case setChatMessageAutoDeleteTime::ID:
      return setChatMessageAutoDeleteTime::fetch(env, p);
    case setChatMessageSender::ID:
      return setChatMessageSender::fetch(env, p);
    case setChatNotificationSettings::ID:
      return setChatNotificationSettings::fetch(env, p);
    case setChatPaidMessageStarCount::ID:
      return setChatPaidMessageStarCount::fetch(env, p);
    case setChatPermissions::ID:
      return setChatPermissions::fetch(env, p);
    case setChatPhoto::ID:
      return setChatPhoto::fetch(env, p);
    case setChatPinnedStories::ID:
      return setChatPinnedStories::fetch(env, p);
    case setChatProfileAccentColor::ID:
      return setChatProfileAccentColor::fetch(env, p);
    case setChatSlowModeDelay::ID:
      return setChatSlowModeDelay::fetch(env, p);
    case setChatTheme::ID:
      return setChatTheme::fetch(env, p);
    case setChatTitle::ID:
      return setChatTitle::fetch(env, p);
    case setCloseFriends::ID:
      return setCloseFriends::fetch(env, p);
    case setCommands::ID:
      return setCommands::fetch(env, p);
    case setCustomEmojiStickerSetThumbnail::ID:
      return setCustomEmojiStickerSetThumbnail::fetch(env, p);
    case setCustomLanguagePack::ID:
      return setCustomLanguagePack::fetch(env, p);
    case setCustomLanguagePackString::ID:
      return setCustomLanguagePackString::fetch(env, p);
    case setDatabaseEncryptionKey::ID:
      return setDatabaseEncryptionKey::fetch(env, p);
    case setDefaultBackground::ID:
      return setDefaultBackground::fetch(env, p);
    case setDefaultChannelAdministratorRights::ID:
      return setDefaultChannelAdministratorRights::fetch(env, p);
    case setDefaultGroupAdministratorRights::ID:
      return setDefaultGroupAdministratorRights::fetch(env, p);
    case setDefaultMessageAutoDeleteTime::ID:
      return setDefaultMessageAutoDeleteTime::fetch(env, p);
    case setDefaultReactionType::ID:
      return setDefaultReactionType::fetch(env, p);
    case setDirectMessagesChatTopicIsMarkedAsUnread::ID:
      return setDirectMessagesChatTopicIsMarkedAsUnread::fetch(env, p);
    case setEmojiStatus::ID:
      return setEmojiStatus::fetch(env, p);
    case setFileGenerationProgress::ID:
      return setFileGenerationProgress::fetch(env, p);
    case setForumTopicNotificationSettings::ID:
      return setForumTopicNotificationSettings::fetch(env, p);
    case setGameScore::ID:
      return setGameScore::fetch(env, p);
    case setGiftCollectionName::ID:
      return setGiftCollectionName::fetch(env, p);
    case setGiftResalePrice::ID:
      return setGiftResalePrice::fetch(env, p);
    case setGiftSettings::ID:
      return setGiftSettings::fetch(env, p);
    case setGroupCallPaidMessageStarCount::ID:
      return setGroupCallPaidMessageStarCount::fetch(env, p);
    case setGroupCallParticipantIsSpeaking::ID:
      return setGroupCallParticipantIsSpeaking::fetch(env, p);
    case setGroupCallParticipantVolumeLevel::ID:
      return setGroupCallParticipantVolumeLevel::fetch(env, p);
    case setInactiveSessionTtl::ID:
      return setInactiveSessionTtl::fetch(env, p);
    case setInlineGameScore::ID:
      return setInlineGameScore::fetch(env, p);
    case setLiveStoryMessageSender::ID:
      return setLiveStoryMessageSender::fetch(env, p);
    case setLogStream::ID:
      return setLogStream::fetch(env, p);
    case setLogTagVerbosityLevel::ID:
      return setLogTagVerbosityLevel::fetch(env, p);
    case setLogVerbosityLevel::ID:
      return setLogVerbosityLevel::fetch(env, p);
    case setLoginEmailAddress::ID:
      return setLoginEmailAddress::fetch(env, p);
    case setMainProfileTab::ID:
      return setMainProfileTab::fetch(env, p);
    case setManagedBotAccessSettings::ID:
      return setManagedBotAccessSettings::fetch(env, p);
    case setMenuButton::ID:
      return setMenuButton::fetch(env, p);
    case setMessageFactCheck::ID:
      return setMessageFactCheck::fetch(env, p);
    case setMessageReactions::ID:
      return setMessageReactions::fetch(env, p);
    case setMessageSenderBlockList::ID:
      return setMessageSenderBlockList::fetch(env, p);
    case setMessageSenderBotVerification::ID:
      return setMessageSenderBotVerification::fetch(env, p);
    case setName::ID:
      return setName::fetch(env, p);
    case setNetworkType::ID:
      return setNetworkType::fetch(env, p);
    case setNewChatPrivacySettings::ID:
      return setNewChatPrivacySettings::fetch(env, p);
    case setOption::ID:
      return setOption::fetch(env, p);
    case setPaidMessageReactionType::ID:
      return setPaidMessageReactionType::fetch(env, p);
    case setPassportElement::ID:
      return setPassportElement::fetch(env, p);
    case setPassportElementErrors::ID:
      return setPassportElementErrors::fetch(env, p);
    case setPassword::ID:
      return setPassword::fetch(env, p);
    case setPersonalChat::ID:
      return setPersonalChat::fetch(env, p);
    case setPinnedChats::ID:
      return setPinnedChats::fetch(env, p);
    case setPinnedForumTopics::ID:
      return setPinnedForumTopics::fetch(env, p);
    case setPinnedGifts::ID:
      return setPinnedGifts::fetch(env, p);
    case setPinnedSavedMessagesTopics::ID:
      return setPinnedSavedMessagesTopics::fetch(env, p);
    case setPollAnswer::ID:
      return setPollAnswer::fetch(env, p);
    case setProfileAccentColor::ID:
      return setProfileAccentColor::fetch(env, p);
    case setProfileAudioPosition::ID:
      return setProfileAudioPosition::fetch(env, p);
    case setProfilePhoto::ID:
      return setProfilePhoto::fetch(env, p);
    case setQuickReplyShortcutName::ID:
      return setQuickReplyShortcutName::fetch(env, p);
    case setReactionNotificationSettings::ID:
      return setReactionNotificationSettings::fetch(env, p);
    case setReadDatePrivacySettings::ID:
      return setReadDatePrivacySettings::fetch(env, p);
    case setRecoveryEmailAddress::ID:
      return setRecoveryEmailAddress::fetch(env, p);
    case setSavedMessagesTagLabel::ID:
      return setSavedMessagesTagLabel::fetch(env, p);
    case setScopeNotificationSettings::ID:
      return setScopeNotificationSettings::fetch(env, p);
    case setStickerEmojis::ID:
      return setStickerEmojis::fetch(env, p);
    case setStickerKeywords::ID:
      return setStickerKeywords::fetch(env, p);
    case setStickerMaskPosition::ID:
      return setStickerMaskPosition::fetch(env, p);
    case setStickerPositionInSet::ID:
      return setStickerPositionInSet::fetch(env, p);
    case setStickerSetThumbnail::ID:
      return setStickerSetThumbnail::fetch(env, p);
    case setStickerSetTitle::ID:
      return setStickerSetTitle::fetch(env, p);
    case setStoryAlbumName::ID:
      return setStoryAlbumName::fetch(env, p);
    case setStoryPrivacySettings::ID:
      return setStoryPrivacySettings::fetch(env, p);
    case setStoryReaction::ID:
      return setStoryReaction::fetch(env, p);
    case setSupergroupCustomEmojiStickerSet::ID:
      return setSupergroupCustomEmojiStickerSet::fetch(env, p);
    case setSupergroupMainProfileTab::ID:
      return setSupergroupMainProfileTab::fetch(env, p);
    case setSupergroupStickerSet::ID:
      return setSupergroupStickerSet::fetch(env, p);
    case setSupergroupUnrestrictBoostCount::ID:
      return setSupergroupUnrestrictBoostCount::fetch(env, p);
    case setSupergroupUsername::ID:
      return setSupergroupUsername::fetch(env, p);
    case setTdlibParameters::ID:
      return setTdlibParameters::fetch(env, p);
    case setUpgradedGiftColors::ID:
      return setUpgradedGiftColors::fetch(env, p);
    case setUserEmojiStatus::ID:
      return setUserEmojiStatus::fetch(env, p);
    case setUserNote::ID:
      return setUserNote::fetch(env, p);
    case setUserPersonalProfilePhoto::ID:
      return setUserPersonalProfilePhoto::fetch(env, p);
    case setUserPrivacySettingRules::ID:
      return setUserPrivacySettingRules::fetch(env, p);
    case setUserSupportInfo::ID:
      return setUserSupportInfo::fetch(env, p);
    case setUsername::ID:
      return setUsername::fetch(env, p);
    case setVideoChatDefaultParticipant::ID:
      return setVideoChatDefaultParticipant::fetch(env, p);
    case setVideoChatTitle::ID:
      return setVideoChatTitle::fetch(env, p);
    case shareChatWithBot::ID:
      return shareChatWithBot::fetch(env, p);
    case sharePhoneNumber::ID:
      return sharePhoneNumber::fetch(env, p);
    case shareUsersWithBot::ID:
      return shareUsersWithBot::fetch(env, p);
    case startGroupCallRecording::ID:
      return startGroupCallRecording::fetch(env, p);
    case startGroupCallScreenSharing::ID:
      return startGroupCallScreenSharing::fetch(env, p);
    case startLiveStory::ID:
      return startLiveStory::fetch(env, p);
    case startScheduledVideoChat::ID:
      return startScheduledVideoChat::fetch(env, p);
    case stopBusinessPoll::ID:
      return stopBusinessPoll::fetch(env, p);
    case stopPoll::ID:
      return stopPoll::fetch(env, p);
    case suggestUserBirthdate::ID:
      return suggestUserBirthdate::fetch(env, p);
    case suggestUserProfilePhoto::ID:
      return suggestUserProfilePhoto::fetch(env, p);
    case summarizeMessage::ID:
      return summarizeMessage::fetch(env, p);
    case synchronizeLanguagePack::ID:
      return synchronizeLanguagePack::fetch(env, p);
    case terminateAllOtherSessions::ID:
      return terminateAllOtherSessions::fetch(env, p);
    case terminateSession::ID:
      return terminateSession::fetch(env, p);
    case testCallBytes::ID:
      return testCallBytes::fetch(env, p);
    case testCallEmpty::ID:
      return testCallEmpty::fetch(env, p);
    case testCallString::ID:
      return testCallString::fetch(env, p);
    case testCallVectorInt::ID:
      return testCallVectorInt::fetch(env, p);
    case testCallVectorIntObject::ID:
      return testCallVectorIntObject::fetch(env, p);
    case testCallVectorString::ID:
      return testCallVectorString::fetch(env, p);
    case testCallVectorStringObject::ID:
      return testCallVectorStringObject::fetch(env, p);
    case testGetDifference::ID:
      return testGetDifference::fetch(env, p);
    case testNetwork::ID:
      return testNetwork::fetch(env, p);
    case testProxy::ID:
      return testProxy::fetch(env, p);
    case testReturnError::ID:
      return testReturnError::fetch(env, p);
    case testSquareInt::ID:
      return testSquareInt::fetch(env, p);
    case testUseUpdate::ID:
      return testUseUpdate::fetch(env, p);
    case toggleAllDownloadsArePaused::ID:
      return toggleAllDownloadsArePaused::fetch(env, p);
    case toggleBotCanManageEmojiStatus::ID:
      return toggleBotCanManageEmojiStatus::fetch(env, p);
    case toggleBotIsAddedToAttachmentMenu::ID:
      return toggleBotIsAddedToAttachmentMenu::fetch(env, p);
    case toggleBotUsernameIsActive::ID:
      return toggleBotUsernameIsActive::fetch(env, p);
    case toggleBusinessConnectedBotChatIsPaused::ID:
      return toggleBusinessConnectedBotChatIsPaused::fetch(env, p);
    case toggleChatDefaultDisableNotification::ID:
      return toggleChatDefaultDisableNotification::fetch(env, p);
    case toggleChatFolderTags::ID:
      return toggleChatFolderTags::fetch(env, p);
    case toggleChatGiftNotifications::ID:
      return toggleChatGiftNotifications::fetch(env, p);
    case toggleChatHasProtectedContent::ID:
      return toggleChatHasProtectedContent::fetch(env, p);
    case toggleChatIsMarkedAsUnread::ID:
      return toggleChatIsMarkedAsUnread::fetch(env, p);
    case toggleChatIsPinned::ID:
      return toggleChatIsPinned::fetch(env, p);
    case toggleChatIsTranslatable::ID:
      return toggleChatIsTranslatable::fetch(env, p);
    case toggleChatViewAsTopics::ID:
      return toggleChatViewAsTopics::fetch(env, p);
    case toggleDirectMessagesChatTopicCanSendUnpaidMessages::ID:
      return toggleDirectMessagesChatTopicCanSendUnpaidMessages::fetch(env, p);
    case toggleDownloadIsPaused::ID:
      return toggleDownloadIsPaused::fetch(env, p);
    case toggleForumTopicIsClosed::ID:
      return toggleForumTopicIsClosed::fetch(env, p);
    case toggleForumTopicIsPinned::ID:
      return toggleForumTopicIsPinned::fetch(env, p);
    case toggleGeneralForumTopicIsHidden::ID:
      return toggleGeneralForumTopicIsHidden::fetch(env, p);
    case toggleGiftIsSaved::ID:
      return toggleGiftIsSaved::fetch(env, p);
    case toggleGroupCallAreMessagesAllowed::ID:
      return toggleGroupCallAreMessagesAllowed::fetch(env, p);
    case toggleGroupCallIsMyVideoEnabled::ID:
      return toggleGroupCallIsMyVideoEnabled::fetch(env, p);
    case toggleGroupCallIsMyVideoPaused::ID:
      return toggleGroupCallIsMyVideoPaused::fetch(env, p);
    case toggleGroupCallParticipantIsHandRaised::ID:
      return toggleGroupCallParticipantIsHandRaised::fetch(env, p);
    case toggleGroupCallParticipantIsMuted::ID:
      return toggleGroupCallParticipantIsMuted::fetch(env, p);
    case toggleGroupCallScreenSharingIsPaused::ID:
      return toggleGroupCallScreenSharingIsPaused::fetch(env, p);
    case toggleHasSponsoredMessagesEnabled::ID:
      return toggleHasSponsoredMessagesEnabled::fetch(env, p);
    case toggleSavedMessagesTopicIsPinned::ID:
      return toggleSavedMessagesTopicIsPinned::fetch(env, p);
    case toggleSessionCanAcceptCalls::ID:
      return toggleSessionCanAcceptCalls::fetch(env, p);
    case toggleSessionCanAcceptSecretChats::ID:
      return toggleSessionCanAcceptSecretChats::fetch(env, p);
    case toggleStoryIsPostedToChatPage::ID:
      return toggleStoryIsPostedToChatPage::fetch(env, p);
    case toggleSupergroupCanHaveSponsoredMessages::ID:
      return toggleSupergroupCanHaveSponsoredMessages::fetch(env, p);
    case toggleSupergroupHasAggressiveAntiSpamEnabled::ID:
      return toggleSupergroupHasAggressiveAntiSpamEnabled::fetch(env, p);
    case toggleSupergroupHasAutomaticTranslation::ID:
      return toggleSupergroupHasAutomaticTranslation::fetch(env, p);
    case toggleSupergroupHasHiddenMembers::ID:
      return toggleSupergroupHasHiddenMembers::fetch(env, p);
    case toggleSupergroupIsAllHistoryAvailable::ID:
      return toggleSupergroupIsAllHistoryAvailable::fetch(env, p);
    case toggleSupergroupIsBroadcastGroup::ID:
      return toggleSupergroupIsBroadcastGroup::fetch(env, p);
    case toggleSupergroupIsForum::ID:
      return toggleSupergroupIsForum::fetch(env, p);
    case toggleSupergroupJoinByRequest::ID:
      return toggleSupergroupJoinByRequest::fetch(env, p);
    case toggleSupergroupJoinToSendMessages::ID:
      return toggleSupergroupJoinToSendMessages::fetch(env, p);
    case toggleSupergroupSignMessages::ID:
      return toggleSupergroupSignMessages::fetch(env, p);
    case toggleSupergroupUsernameIsActive::ID:
      return toggleSupergroupUsernameIsActive::fetch(env, p);
    case toggleUsernameIsActive::ID:
      return toggleUsernameIsActive::fetch(env, p);
    case toggleVideoChatEnabledStartNotification::ID:
      return toggleVideoChatEnabledStartNotification::fetch(env, p);
    case toggleVideoChatMuteNewParticipants::ID:
      return toggleVideoChatMuteNewParticipants::fetch(env, p);
    case transferBusinessAccountStars::ID:
      return transferBusinessAccountStars::fetch(env, p);
    case transferChatOwnership::ID:
      return transferChatOwnership::fetch(env, p);
    case transferGift::ID:
      return transferGift::fetch(env, p);
    case translateMessageText::ID:
      return translateMessageText::fetch(env, p);
    case translateText::ID:
      return translateText::fetch(env, p);
    case unpinAllChatMessages::ID:
      return unpinAllChatMessages::fetch(env, p);
    case unpinAllDirectMessagesChatTopicMessages::ID:
      return unpinAllDirectMessagesChatTopicMessages::fetch(env, p);
    case unpinAllForumTopicMessages::ID:
      return unpinAllForumTopicMessages::fetch(env, p);
    case unpinChatMessage::ID:
      return unpinChatMessage::fetch(env, p);
    case upgradeBasicGroupChatToSupergroupChat::ID:
      return upgradeBasicGroupChatToSupergroupChat::fetch(env, p);
    case upgradeGift::ID:
      return upgradeGift::fetch(env, p);
    case uploadStickerFile::ID:
      return uploadStickerFile::fetch(env, p);
    case validateOrderInfo::ID:
      return validateOrderInfo::fetch(env, p);
    case viewMessages::ID:
      return viewMessages::fetch(env, p);
    case viewPremiumFeature::ID:
      return viewPremiumFeature::fetch(env, p);
    case viewSponsoredChat::ID:
      return viewSponsoredChat::fetch(env, p);
    case viewTrendingStickerSets::ID:
      return viewTrendingStickerSets::fetch(env, p);
    case viewVideoMessageAdvertisement::ID:
      return viewVideoMessageAdvertisement::fetch(env, p);
    case writeGeneratedFilePart::ID:
      return writeGeneratedFilePart::fetch(env, p);
    default:
      LOG(WARNING) << "Unknown Java API constructor found " << format::as_hex(constructor);
      return nullptr;
  }
}

void Function::init_jni_vars(JNIEnv *env) {
  static bool is_inited = [&] {
    Class = jni::get_jclass(env, (PSLICE() << get_package_name_ref() << "/TdApi$Function").c_str());
    return true;
  }();
  (void)is_inited;
}
}  // namespace td_api
}  // namespace td
