EntitiesResponse<T>.fromJson constructor

EntitiesResponse<T>.fromJson(
  1. dynamic json
)

Constructs a new EntitiesResponse instance from a JSON Map.

Implementation

factory EntitiesResponse.fromJson(dynamic json) {
  if (json is List) {
    return EntitiesResponse<T>(items: json.cast<T>());
  } else {
    return EntitiesResponse<T>(
      items: json['items'].cast<T>(),
      pageMetaData: PageMetaData.fromJson(json),
    );
  }
}