GetSubscriptionsSearchResponse.fromJson constructor

GetSubscriptionsSearchResponse.fromJson(
  1. Object? json
)

Implementation

factory GetSubscriptionsSearchResponse.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return GetSubscriptionsSearchResponse(
    data: (map['data'] as List<Object?>)
        .map((el) => Subscription.fromJson(el))
        .toList(),
    hasMore: (map['has_more'] as bool),
    nextPage: map['next_page'] == null ? null : (map['next_page'] as String),
    totalCount: map['total_count'] == null
        ? null
        : (map['total_count'] as num).toInt(),
    url: (map['url'] as String),
  );
}