class UserResponse {
  UserResponse({
    required this.data,
  });

  List<User> data;

  factory UserResponse.fromJson(Map<String, dynamic> json) => UserResponse(
        data: List<User>.from(json["data"].map((x) => User.fromJson(x))),
      );

  Map<String, dynamic> toJson() => {
        "data": List<dynamic>.from(data.map((x) => x.toJson())),
      };
}

class User {
  String firstName;
  String lastName;
  String username;
  String email;
  String phone;
  String password;

  User({
    required this.firstName,
    required this.lastName,
    required this.username,
    required this.email,
    required this.phone,
    required this.password,
  });

  factory User.fromJson(Map<String, dynamic> json) => User(
        firstName: json["first_name"],
        lastName: json["last_name"],
        username: json["username"],
        email: json["email"],
        phone: json["phone"],
        password: json["password"],
      );

  Map<String, dynamic> toJson() => {
        "first_name": firstName,
        "last_name": lastName,
        "username": username,
        "email": email,
        "phone": phone,
        "password": password,
      };
}

class RegisterMessage {
  String message;

  RegisterMessage({
    required this.message,
  });

  factory RegisterMessage.fromJson(Map<String, dynamic> json) =>
      RegisterMessage(
        message: json["message"],
      );

  Map<String, dynamic> toJson() => {
        "message": message,
      };
}
