PollListGetRequest constructor

PollListGetRequest({
  1. required String channelUrl,
  2. required ChannelType channelType,
  3. String? token,
  4. int limit = 20,
})

Implementation

PollListGetRequest({
  required String channelUrl,
  required ChannelType channelType,
  String? token,
  int limit = 20,
}) : assert(1 <= limit && limit <= 20) {
  url = 'polls';

  queryParams = {
    'channel_url': channelUrl,
    'token': token,
    'limit': limit,
    'channel_type': channelType.urlString,
  };

  queryParams.removeWhere((key, value) => value == null);
}