fromJson static method

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

Implementation

static Invite fromJson(Map<String, dynamic> json) {
  return Invite(
    code: json['code'],
    guild: ifNotNull(Guild.fromJson, json['guild']),
    channel: Channel.fromJson(json['channel']!),
    inviter: ifNotNull(User.fromJson, json['inviter']),
    targetUser: ifNotNull(User.fromJson, json['target_user']),
    targetUserType: ifNotNull(
      TargetUserType.forValue,
      json['target_user_type'],
    ),
    approximatePresenceCount: json['approximate_presence_count'],
    approximateMemberCount: json['approximate_member_count'],
  );
}