import 'package:json_annotation/json_annotation.dart';

import 'package:pshared/api/responses/type.dart';

part 'message.g.dart';


@JsonSerializable(explicitToJson: true)
class HTTPMessage {

  @JsonKey(fromJson: MessageTypeExtension.fromJson, toJson: MessageTypeExtension.toJson)
  final MessageType status;
  final Map<String, dynamic> data;

  const HTTPMessage({ required this.data, required this.status });

  factory HTTPMessage.fromJson(Map<String, dynamic> json) => _$HTTPMessageFromJson(json);
  Map<String, dynamic> toJson() => _$HTTPMessageToJson(this);
}