ChatAdministratorRights.fromJson constructor

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

Creates a new ChatAdministratorRights object from json.

Implementation

factory ChatAdministratorRights.fromJson(Map<String, dynamic> json) {
  return ChatAdministratorRights(
    isAnonymous: json['is_anonymous'] ?? false,
    canManageChat: json['can_manage_chat'] ?? false,
    canDeleteMessages: json['can_delete_messages'] ?? false,
    canManageVideoChats: json['can_manage_video_chats'] ?? false,
    canRestrictMembers: json['can_restrict_members'] ?? false,
    canPromoteMembers: json['can_promote_members'] ?? false,
    canChangeInfo: json['can_change_info'] ?? false,
    canInviteUsers: json['can_invite_users'] ?? false,
    canPostMessages: json['can_post_messages'],
    canEditMessages: json['can_edit_messages'],
    canPinMessages: json['can_pin_messages'],
    canManageForum: json['can_manage_forum'],
    canPostStories: json['can_post_stories'],
    canEditStories: json['can_edit_stories'],
    canDeleteStories: json['can_delete_stories'],
  );
}