CommentsForPullRequest.fromJson constructor

CommentsForPullRequest.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory CommentsForPullRequest.fromJson(Map<String, dynamic> json) {
  return CommentsForPullRequest(
    afterBlobId: json['afterBlobId'] as String?,
    afterCommitId: json['afterCommitId'] as String?,
    beforeBlobId: json['beforeBlobId'] as String?,
    beforeCommitId: json['beforeCommitId'] as String?,
    comments: (json['comments'] as List?)
        ?.whereNotNull()
        .map((e) => Comment.fromJson(e as Map<String, dynamic>))
        .toList(),
    location: json['location'] != null
        ? Location.fromJson(json['location'] as Map<String, dynamic>)
        : null,
    pullRequestId: json['pullRequestId'] as String?,
    repositoryName: json['repositoryName'] as String?,
  );
}