class RtcTokenDto {
  RtcTokenDto({
    required this.uid,
    required this.expiresAt,
    required this.channel,
    required this.token,
  });

  int uid;
  DateTime expiresAt;
  String channel;
  String token;

  factory RtcTokenDto.fromJson(Map<dynamic, dynamic> json) => RtcTokenDto(
    uid: json["uid"],
    expiresAt: DateTime.parse(json["expires_at"]),
    channel: json["channel"],
    token: json["token"],
  );

  Map<dynamic, dynamic> toJson() => {
    "uid": uid,
    "expires_at": expiresAt.toIso8601String(),
    "channel": channel,
    "token": token,
  };
}
