toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var endIndex = this.endIndex;
  var items = this.items;
  var maxResults = this.maxResults;
  var size = this.size;
  var startIndex = this.startIndex;

  final json = <String, Object?>{};
  if (endIndex != null) {
    json[r'end-index'] = endIndex;
  }
  json[r'items'] = items.map((i) => i.toJson()).toList();
  if (maxResults != null) {
    json[r'max-results'] = maxResults;
  }
  if (size != null) {
    json[r'size'] = size;
  }
  if (startIndex != null) {
    json[r'start-index'] = startIndex;
  }
  return json;
}