import 'package:json_annotation/json_annotation.dart';

import '../../../apiResponse.dart';

part 'getMessagesResponse.g.dart';

@JsonSerializable(explicitToJson: true)
class GetMessagesResponse extends ApiResponse {
  String base;
  Set<GetMessagesResponseObject> messages;

  GetMessagesResponse(this.base, this.messages);

  factory GetMessagesResponse.fromJson(Map<String, dynamic> json) => _$GetMessagesResponseFromJson(json);
  Map<String, dynamic> toJson() => _$GetMessagesResponseToJson(this);
}

@JsonSerializable(explicitToJson: true)
class GetMessagesResponseObject {
  String name;
  String date;
  String url;

  GetMessagesResponseObject(this.name, this.date, this.url);

  factory GetMessagesResponseObject.fromJson(Map<String, dynamic> json) => _$GetMessagesResponseObjectFromJson(json);
  Map<String, dynamic> toJson() => _$GetMessagesResponseObjectToJson(this);
}