import 'package:json_annotation/json_annotation.dart';

import '../../../api_params.dart';

part 'create_poll_params.g.dart';

@JsonSerializable()
class CreatePollParams extends ApiParams {
  String question;
  List<String> options;

  /// 0 = Ergebnisse öffentlich, 1 = bis zum Schließen verborgen.
  int resultMode;

  /// Stimmen pro Teilnehmer; 0 = unbegrenzt.
  int maxVotes;

  CreatePollParams({
    required this.question,
    required this.options,
    required this.resultMode,
    required this.maxVotes,
  });
  factory CreatePollParams.fromJson(Map<String, dynamic> json) =>
      _$CreatePollParamsFromJson(json);
  Map<String, dynamic> toJson() => _$CreatePollParamsToJson(this);
}
