create static method

TelegramClientLibraryClientData create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "telegramClientLibraryClientData",
  3. num? id,
  4. String? created_at,
  5. num? client_tg_user_id,
  6. String? client_title,
  7. String? client_token,
  8. num? owner_user_id,
  9. String? client_type,
  10. Object? from_bot_type,
  11. bool? can_join_groups,
  12. bool? can_read_all_group_messages,
  13. num? from_bot_user_id,
  14. num? expire_date,
  15. String? client_username,
  16. String? version,
  17. num? client_id,
  18. String? client_data,
})
override

return original data json

Implementation

static TelegramClientLibraryClientData create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "telegramClientLibraryClientData",
  num? id,
  String? created_at,
  num? client_tg_user_id,
  String? client_title,
  String? client_token,
  num? owner_user_id,
  String? client_type,
  Object? from_bot_type,
  bool? can_join_groups,
  bool? can_read_all_group_messages,
  num? from_bot_user_id,
  num? expire_date,
  String? client_username,
  String? version,
  num? client_id,
  String? client_data,
}) {
  // TelegramClientLibraryClientData telegramClientLibraryClientData = TelegramClientLibraryClientData({
  final Map telegramClientLibraryClientData_data_create_json = {
    "@type": special_type,
    "id": id,
    "created_at": created_at,
    "client_tg_user_id": client_tg_user_id,
    "client_title": client_title,
    "client_token": client_token,
    "owner_user_id": owner_user_id,
    "client_type": client_type,
    "from_bot_type": from_bot_type,
    "can_join_groups": can_join_groups,
    "can_read_all_group_messages": can_read_all_group_messages,
    "from_bot_user_id": from_bot_user_id,
    "expire_date": expire_date,
    "client_username": client_username,
    "version": version,
    "client_id": client_id,
    "client_data": client_data,
  };

  telegramClientLibraryClientData_data_create_json
      .removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (telegramClientLibraryClientData_data_create_json.containsKey(key) ==
          false) {
        telegramClientLibraryClientData_data_create_json[key] = value;
      }
    });
  }
  return TelegramClientLibraryClientData(
      telegramClientLibraryClientData_data_create_json);
}