class RefreshTokenResponse {
  RefreshTokenResponse({
    required this.status,
    required this.message,
    required this.accessToken,
    required this.refreshToken,
    required this.tokenType,
    required this.expiresIn,
  });

  factory RefreshTokenResponse.fromJson(Map<String, dynamic> json) {
    final data = json['data'] as Map<String, dynamic>? ?? {};

    return RefreshTokenResponse(
      status: json['status']?.toString() ?? '',
      message: json['message']?.toString() ?? '',
      accessToken: data['access_token']?.toString() ?? '',
      refreshToken: data['refresh_token']?.toString() ?? '',
      tokenType: data['token_type']?.toString() ?? '',
      expiresIn: int.tryParse(data['expires_in']?.toString() ?? '0') ?? 0,
    );
  }

  final String status;
  final String message;
  final String accessToken;
  final String refreshToken;
  final String tokenType;
  final int expiresIn;
}
