fromJson static method

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

Implementation

static ChatInviteLinkInfo? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return ChatInviteLinkInfo(
    chatId: (json['chat_id'] as int?) ?? 0,
    accessibleFor: (json['accessible_for'] as int?) ?? 0,
    type: InviteLinkChatType.fromJson(tdMapFromJson(json['type'])),
    title: (json['title'] as String?) ?? '',
    photo: ChatPhotoInfo.fromJson(tdMapFromJson(json['photo'])),
    accentColorId: (json['accent_color_id'] as int?) ?? 0,
    description: (json['description'] as String?) ?? '',
    memberCount: (json['member_count'] as int?) ?? 0,
    memberUserIds: List<int>.from(
      tdListFromJson(
        json['member_user_ids'],
      ).map((item) => int.tryParse((item as dynamic)?.toString() ?? '') ?? 0),
    ),
    subscriptionInfo: ChatInviteLinkSubscriptionInfo.fromJson(
      tdMapFromJson(json['subscription_info']),
    ),
    createsJoinRequest: (json['creates_join_request'] as bool?) ?? false,
    isPublic: (json['is_public'] as bool?) ?? false,
    verificationStatus: VerificationStatus.fromJson(
      tdMapFromJson(json['verification_status']),
    ),
  );
}