search_entity.dart 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. class SearchEntity {
  2. int totalCount;
  3. List<SearchItem> items;
  4. SearchEntity({this.totalCount, this.items});
  5. SearchEntity.fromJson(Map<String, dynamic> json) {
  6. totalCount = json['total_count'];
  7. if (json['items'] != null) {
  8. items = new List<SearchItem>();(json['items'] as List).forEach((v) { items.add(new SearchItem.fromJson(v)); });
  9. }
  10. }
  11. Map<String, dynamic> toJson() {
  12. final Map<String, dynamic> data = new Map<String, dynamic>();
  13. data['total_count'] = this.totalCount;
  14. if (this.items != null) {
  15. data['items'] = this.items.map((v) => v.toJson()).toList();
  16. }
  17. return data;
  18. }
  19. }
  20. class SearchItem {
  21. int stargazersCount;
  22. String pushedAt;
  23. String subscriptionUrl;
  24. String language;
  25. String branchesUrl;
  26. String issueCommentUrl;
  27. String labelsUrl;
  28. double score;
  29. String subscribersUrl;
  30. String releasesUrl;
  31. String svnUrl;
  32. int id;
  33. int forks;
  34. String archiveUrl;
  35. String gitRefsUrl;
  36. String forksUrl;
  37. String statusesUrl;
  38. String sshUrl;
  39. String fullName;
  40. int size;
  41. String languagesUrl;
  42. String htmlUrl;
  43. String collaboratorsUrl;
  44. String cloneUrl;
  45. String name;
  46. String pullsUrl;
  47. String defaultBranch;
  48. String hooksUrl;
  49. String treesUrl;
  50. String tagsUrl;
  51. bool private;
  52. String contributorsUrl;
  53. bool hasDownloads;
  54. String notificationsUrl;
  55. int openIssuesCount;
  56. String description;
  57. String createdAt;
  58. int watchers;
  59. String keysUrl;
  60. String deploymentsUrl;
  61. bool hasProjects;
  62. bool archived;
  63. bool hasWiki;
  64. String updatedAt;
  65. String commentsUrl;
  66. String stargazersUrl;
  67. bool disabled;
  68. String gitUrl;
  69. bool hasPages;
  70. String commitsUrl;
  71. String compareUrl;
  72. String gitCommitsUrl;
  73. String blobsUrl;
  74. String gitTagsUrl;
  75. String mergesUrl;
  76. String downloadsUrl;
  77. bool hasIssues;
  78. String url;
  79. String contentsUrl;
  80. dynamic mirrorUrl;
  81. String milestonesUrl;
  82. String teamsUrl;
  83. bool fork;
  84. String issuesUrl;
  85. String eventsUrl;
  86. String issueEventsUrl;
  87. String assigneesUrl;
  88. int openIssues;
  89. int watchersCount;
  90. String nodeId;
  91. String homepage;
  92. int forksCount;
  93. SearchItem({this.stargazersCount, this.pushedAt, this.subscriptionUrl, this.language, this.branchesUrl, this.issueCommentUrl, this.labelsUrl, this.score, this.subscribersUrl, this.releasesUrl, this.svnUrl, this.id, this.forks, this.archiveUrl, this.gitRefsUrl, this.forksUrl, this.statusesUrl, this.sshUrl, this.fullName, this.size, this.languagesUrl, this.htmlUrl, this.collaboratorsUrl, this.cloneUrl, this.name, this.pullsUrl, this.defaultBranch, this.hooksUrl, this.treesUrl, this.tagsUrl, this.private, this.contributorsUrl, this.hasDownloads, this.notificationsUrl, this.openIssuesCount, this.description, this.createdAt, this.watchers, this.keysUrl, this.deploymentsUrl, this.hasProjects, this.archived, this.hasWiki, this.updatedAt, this.commentsUrl, this.stargazersUrl, this.disabled, this.gitUrl, this.hasPages, this.commitsUrl, this.compareUrl, this.gitCommitsUrl, this.blobsUrl, this.gitTagsUrl, this.mergesUrl, this.downloadsUrl, this.hasIssues, this.url, this.contentsUrl, this.mirrorUrl, this.milestonesUrl, this.teamsUrl, this.fork, this.issuesUrl, this.eventsUrl, this.issueEventsUrl, this.assigneesUrl, this.openIssues, this.watchersCount, this.nodeId, this.homepage, this.forksCount});
  94. SearchItem.fromJson(Map<String, dynamic> json) {
  95. stargazersCount = json['stargazers_count'];
  96. pushedAt = json['pushed_at'];
  97. subscriptionUrl = json['subscription_url'];
  98. language = json['language'];
  99. branchesUrl = json['branches_url'];
  100. issueCommentUrl = json['issue_comment_url'];
  101. labelsUrl = json['labels_url'];
  102. score = json['score'];
  103. subscribersUrl = json['subscribers_url'];
  104. releasesUrl = json['releases_url'];
  105. svnUrl = json['svn_url'];
  106. id = json['id'];
  107. forks = json['forks'];
  108. archiveUrl = json['archive_url'];
  109. gitRefsUrl = json['git_refs_url'];
  110. forksUrl = json['forks_url'];
  111. statusesUrl = json['statuses_url'];
  112. sshUrl = json['ssh_url'];
  113. fullName = json['full_name'];
  114. size = json['size'];
  115. languagesUrl = json['languages_url'];
  116. htmlUrl = json['html_url'];
  117. collaboratorsUrl = json['collaborators_url'];
  118. cloneUrl = json['clone_url'];
  119. name = json['name'];
  120. pullsUrl = json['pulls_url'];
  121. defaultBranch = json['default_branch'];
  122. hooksUrl = json['hooks_url'];
  123. treesUrl = json['trees_url'];
  124. tagsUrl = json['tags_url'];
  125. private = json['private'];
  126. contributorsUrl = json['contributors_url'];
  127. hasDownloads = json['has_downloads'];
  128. notificationsUrl = json['notifications_url'];
  129. openIssuesCount = json['open_issues_count'];
  130. description = json['description'];
  131. createdAt = json['created_at'];
  132. watchers = json['watchers'];
  133. keysUrl = json['keys_url'];
  134. deploymentsUrl = json['deployments_url'];
  135. hasProjects = json['has_projects'];
  136. archived = json['archived'];
  137. hasWiki = json['has_wiki'];
  138. updatedAt = json['updated_at'];
  139. commentsUrl = json['comments_url'];
  140. stargazersUrl = json['stargazers_url'];
  141. disabled = json['disabled'];
  142. gitUrl = json['git_url'];
  143. hasPages = json['has_pages'];
  144. commitsUrl = json['commits_url'];
  145. compareUrl = json['compare_url'];
  146. gitCommitsUrl = json['git_commits_url'];
  147. blobsUrl = json['blobs_url'];
  148. gitTagsUrl = json['git_tags_url'];
  149. mergesUrl = json['merges_url'];
  150. downloadsUrl = json['downloads_url'];
  151. hasIssues = json['has_issues'];
  152. url = json['url'];
  153. contentsUrl = json['contents_url'];
  154. mirrorUrl = json['mirror_url'];
  155. milestonesUrl = json['milestones_url'];
  156. teamsUrl = json['teams_url'];
  157. fork = json['fork'];
  158. issuesUrl = json['issues_url'];
  159. eventsUrl = json['events_url'];
  160. issueEventsUrl = json['issue_events_url'];
  161. assigneesUrl = json['assignees_url'];
  162. openIssues = json['open_issues'];
  163. watchersCount = json['watchers_count'];
  164. nodeId = json['node_id'];
  165. homepage = json['homepage'];
  166. forksCount = json['forks_count'];
  167. }
  168. Map<String, dynamic> toJson() {
  169. final Map<String, dynamic> data = new Map<String, dynamic>();
  170. data['stargazers_count'] = this.stargazersCount;
  171. data['pushed_at'] = this.pushedAt;
  172. data['subscription_url'] = this.subscriptionUrl;
  173. data['language'] = this.language;
  174. data['branches_url'] = this.branchesUrl;
  175. data['issue_comment_url'] = this.issueCommentUrl;
  176. data['labels_url'] = this.labelsUrl;
  177. data['score'] = this.score;
  178. data['subscribers_url'] = this.subscribersUrl;
  179. data['releases_url'] = this.releasesUrl;
  180. data['svn_url'] = this.svnUrl;
  181. data['id'] = this.id;
  182. data['forks'] = this.forks;
  183. data['archive_url'] = this.archiveUrl;
  184. data['git_refs_url'] = this.gitRefsUrl;
  185. data['forks_url'] = this.forksUrl;
  186. data['statuses_url'] = this.statusesUrl;
  187. data['ssh_url'] = this.sshUrl;
  188. data['full_name'] = this.fullName;
  189. data['size'] = this.size;
  190. data['languages_url'] = this.languagesUrl;
  191. data['html_url'] = this.htmlUrl;
  192. data['collaborators_url'] = this.collaboratorsUrl;
  193. data['clone_url'] = this.cloneUrl;
  194. data['name'] = this.name;
  195. data['pulls_url'] = this.pullsUrl;
  196. data['default_branch'] = this.defaultBranch;
  197. data['hooks_url'] = this.hooksUrl;
  198. data['trees_url'] = this.treesUrl;
  199. data['tags_url'] = this.tagsUrl;
  200. data['private'] = this.private;
  201. data['contributors_url'] = this.contributorsUrl;
  202. data['has_downloads'] = this.hasDownloads;
  203. data['notifications_url'] = this.notificationsUrl;
  204. data['open_issues_count'] = this.openIssuesCount;
  205. data['description'] = this.description;
  206. data['created_at'] = this.createdAt;
  207. data['watchers'] = this.watchers;
  208. data['keys_url'] = this.keysUrl;
  209. data['deployments_url'] = this.deploymentsUrl;
  210. data['has_projects'] = this.hasProjects;
  211. data['archived'] = this.archived;
  212. data['has_wiki'] = this.hasWiki;
  213. data['updated_at'] = this.updatedAt;
  214. data['comments_url'] = this.commentsUrl;
  215. data['stargazers_url'] = this.stargazersUrl;
  216. data['disabled'] = this.disabled;
  217. data['git_url'] = this.gitUrl;
  218. data['has_pages'] = this.hasPages;
  219. data['commits_url'] = this.commitsUrl;
  220. data['compare_url'] = this.compareUrl;
  221. data['git_commits_url'] = this.gitCommitsUrl;
  222. data['blobs_url'] = this.blobsUrl;
  223. data['git_tags_url'] = this.gitTagsUrl;
  224. data['merges_url'] = this.mergesUrl;
  225. data['downloads_url'] = this.downloadsUrl;
  226. data['has_issues'] = this.hasIssues;
  227. data['url'] = this.url;
  228. data['contents_url'] = this.contentsUrl;
  229. data['mirror_url'] = this.mirrorUrl;
  230. data['milestones_url'] = this.milestonesUrl;
  231. data['teams_url'] = this.teamsUrl;
  232. data['fork'] = this.fork;
  233. data['issues_url'] = this.issuesUrl;
  234. data['events_url'] = this.eventsUrl;
  235. data['issue_events_url'] = this.issueEventsUrl;
  236. data['assignees_url'] = this.assigneesUrl;
  237. data['open_issues'] = this.openIssues;
  238. data['watchers_count'] = this.watchersCount;
  239. data['node_id'] = this.nodeId;
  240. data['homepage'] = this.homepage;
  241. data['forks_count'] = this.forksCount;
  242. return data;
  243. }
  244. }