SupergroupFullInfo.fromJson constructor

SupergroupFullInfo.fromJson(
  1. Map<String, dynamic> json
)

Parses a SupergroupFullInfo from TDLib JSON.

Implementation

factory SupergroupFullInfo.fromJson(
  Map<String, dynamic> json,
) => SupergroupFullInfo(
  photo: _readOptional(json['photo'], ChatPhoto.fromJson),
  communityId: _readInt(json['community_id']),
  description: _readString(json['description']),
  memberCount: _readInt(json['member_count']),
  administratorCount: _readInt(json['administrator_count']),
  restrictedCount: _readInt(json['restricted_count']),
  bannedCount: _readInt(json['banned_count']),
  linkedChatId: _readInt(json['linked_chat_id']),
  directMessagesChatId: _readInt(json['direct_messages_chat_id']),
  slowModeDelay: _readInt(json['slow_mode_delay']),
  slowModeDelayExpiresIn: _readDouble(json['slow_mode_delay_expires_in']),
  canEnablePaidMessages: _readBool(json['can_enable_paid_messages']),
  canEnablePaidReaction: _readBool(json['can_enable_paid_reaction']),
  canGetMembers: _readBool(json['can_get_members']),
  hasHiddenMembers: _readBool(json['has_hidden_members']),
  canHideMembers: _readBool(json['can_hide_members']),
  canSetStickerSet: _readBool(json['can_set_sticker_set']),
  canSetLocation: _readBool(json['can_set_location']),
  canGetStatistics: _readBool(json['can_get_statistics']),
  canGetRevenueStatistics: _readBool(json['can_get_revenue_statistics']),
  canGetStarRevenueStatistics: _readBool(
    json['can_get_star_revenue_statistics'],
  ),
  canSendGift: _readBool(json['can_send_gift']),
  canToggleAggressiveAntiSpam: _readBool(
    json['can_toggle_aggressive_anti_spam'],
  ),
  isAllHistoryAvailable: _readBool(json['is_all_history_available']),
  canHaveSponsoredMessages: _readBool(json['can_have_sponsored_messages']),
  hasAggressiveAntiSpamEnabled: _readBool(
    json['has_aggressive_anti_spam_enabled'],
  ),
  hasPaidMediaAllowed: _readBool(json['has_paid_media_allowed']),
  hasPinnedStories: _readBool(json['has_pinned_stories']),
  giftCount: _readInt(json['gift_count']),
  myBoostCount: _readInt(json['my_boost_count']),
  unrestrictBoostCount: _readInt(json['unrestrict_boost_count']),
  outgoingPaidMessageStarCount: _readInt(
    json['outgoing_paid_message_star_count'],
  ),
  stickerSetId: _readInt(json['sticker_set_id']),
  customEmojiStickerSetId: _readInt(json['custom_emoji_sticker_set_id']),
  location: _readOptional(json['location'], ChatLocation.fromJson),
  inviteLink: _readOptional(json['invite_link'], ChatInviteLink.fromJson),
  guardBotUserId: _readInt(json['guard_bot_user_id']),
  botCommands: _readList<BotCommands>(
    json['bot_commands'],
    (e) => _readObject(e, BotCommands.fromJson),
  ),
  botVerification: _readOptional(
    json['bot_verification'],
    BotVerification.fromJson,
  ),
  mainProfileTab: _readOptional(
    json['main_profile_tab'],
    ProfileTab.fromJson,
  ),
  shareTheme: _readOptional(json['share_theme'], ProfileShareTheme.fromJson),
  upgradedFromBasicGroupId: _readInt(json['upgraded_from_basic_group_id']),
  upgradedFromMaxMessageId: _readInt(json['upgraded_from_max_message_id']),
  extra: json['@extra'],
  clientId: _readClientId(json['@client_id']),
);