fromJson static method

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

Implementation

static InviteMetadata fromJson(Map<String, dynamic> json) {
  return InviteMetadata(
    uses: json['uses'],
    maxUses: json['max_uses'],
    maxAge: json['max_age'],
    temporary: json['temporary'],
    createdAt: json['created_at'],
    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'],
  );
}