part of fever_api;

class FeedsGroup {
  final FeverAPI api;

  late int groupId;
  late List<int> feedIds;

  FeedsGroup(this.api, {
    required this.groupId,
    required this.feedIds,
  });

  FeedsGroup.fromJSON(this.api, Map<String, dynamic> json) {
    groupId = toInt(json['group_id']);
    feedIds = (json['feed_ids'] as String)
      .split(',').map((i) => int.parse(i))
      .toList();
  }

  @override
  String toString() {
    return 'FeedsGroup $groupId -> ${feedIds.join(', ')}';
  }
}
