import 'dart:convert';

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

  UserDetail data;

  factory UserDetailResponse.fromJson(Map<String, dynamic> json) =>
      UserDetailResponse(
        data: UserDetail.fromJson(json["data"]),
      );
}

class UserDetail {
  User user;
  String profilePicture;

  UserDetail({
    required this.user,
    required this.profilePicture,
  });

  factory UserDetail.fromJson(Map<String, dynamic> json) => UserDetail(
        user: User.fromJson(json["user"]),
        profilePicture: json["profile_picture"],
      );

  Map<String, dynamic> toJson() => {
        "user": user.toJson(),
        "profile_picture": profilePicture,
      };
}

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

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

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

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