import 'package:json_annotation/json_annotation.dart';
import 'dart:convert';

part 'dict_response_entity.g.dart';

@JsonSerializable()
class DictResponseEntity {
  factory DictResponseEntity.fromJson(Map<String, dynamic> json) =>
      _$DictResponseEntityFromJson(json);

  DictResponseEntity();

  late DictResponseHeaders headers;
  late DictResponseOriginal original;
  String? exception;

  Map<String, dynamic> toJson() => _$DictResponseEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class DictResponseHeaders {
  DictResponseHeaders();

  factory DictResponseHeaders.fromJson(Map<String, dynamic> json) =>
      _$DictResponseHeadersFromJson(json);

  Map<String, dynamic> toJson() => _$DictResponseHeadersToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class DictResponseOriginal {
  factory DictResponseOriginal.fromJson(Map<String, dynamic> json) =>
      _$DictResponseOriginalFromJson(json);

  DictResponseOriginal();

  int? overall;
  int? page;
  int? perpage;
  List<dynamic>? data;
  Map<String, List<String>>? errors;
  String? message;

  Map<String, dynamic> toJson() => _$DictResponseOriginalToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
