
import 'package:dart_json_mapper/dart_json_mapper.dart';

@jsonSerializable
class User {
  @JsonProperty(name: 'id')
  int? id;

  @JsonProperty(name: 'nickname')
  String? nickname;

  @JsonProperty(name: 'account')
  String? account;

  @JsonProperty(name: 'port')
  int? port;

  @JsonProperty(name: 'passwd')
  String? password;

  @JsonProperty(name: 'uuid')
  String? uuid;

  @JsonProperty(name: 'transfer_enable')
  int? transferEnable;

  @JsonProperty(name: 'unusedTraffic')
  String? unusedTraffic;

  @JsonProperty(name: 'u')
  int? u;

  @JsonProperty(name: 'd')
  int? d;

  @JsonProperty(name: 't')
  int? t;

  @JsonProperty(name: 'enable')
  int? enable;

  @JsonProperty(name: 'speed_limit')
  int? speedLimit;

  @JsonProperty(name: 'credit')
  int? credit;

  @JsonProperty(name: 'expired_at')
  String? expiredAt;

  @JsonProperty(name: 'ban_time')
  dynamic? banTime; // it's dynamic because it can be null or some other type

  @JsonProperty(name: 'level')
  String? level;

  @JsonProperty(name: 'group')
  dynamic? group;

  @JsonProperty(name: 'last_login')
  int? lastLogin;

  @JsonProperty(name: 'reset_time')
  dynamic? resetTime;

  @JsonProperty(name: 'invite_num')
  int? inviteNum;

  @JsonProperty(name: 'user_group_id')
  dynamic? userGroupId;

  @JsonProperty(name: 'status')
  int? status;

  @JsonProperty(name: 'code')
  String? code;

  User({
    this.id,
    this.nickname,
    this.account,
    this.port,
    this.password,
    this.uuid,
    this.transferEnable,
    this.unusedTraffic,
    this.u,
    this.d,
    this.t,
    this.enable,
    this.speedLimit,
    this.credit,
    this.expiredAt,
    this.banTime,
    this.level,
    this.group,
    this.lastLogin,
    this.resetTime,
    this.inviteNum,
    this.userGroupId,
    this.status,
    this.code,
  });
}