Skip to content

Commit

Permalink
Pull Request Comment Creation
Browse files Browse the repository at this point in the history
  • Loading branch information
azenla committed Aug 28, 2014
1 parent 1d5da3a commit cab4fa1
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 79 deletions.
8 changes: 8 additions & 0 deletions lib/src/common/events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,21 @@ class Event {
DateTime createdAt;

String id;

String type;

Map<String, dynamic> json;

Map<String, dynamic> payload;

Event(this.github);

static Event fromJSON(GitHub github, input) {
var event = new Event(github);

event.json = input;

event.type = input['type'];

event
..repo = Repository.fromJSON(github, input['repo'])
Expand Down
52 changes: 41 additions & 11 deletions lib/src/common/issues.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,32 @@ class Issue {
* Issue Number
*/
int number;

/**
* Issue State
*/
String state;

/**
* Issue Title
*/
String title;

/**
* User who created the issue.
*/
User user;

/**
* Issue Labels
*/
List<IssueLabel> labels;

/**
* The User that the issue is assigned to
*/
User assignee;

/**
* The Milestone
*/
Expand Down Expand Up @@ -150,7 +150,7 @@ class IssueLabel {
* Label Name
*/
String name;

/**
* Label Color
*/
Expand All @@ -176,22 +176,22 @@ class Milestone {
* Milestone Number
*/
int number;

/**
* Milestone State
*/
String state;

/**
* Milestone Title
*/
String title;

/**
* Milestone Description
*/
String description;

/**
* Milestone Creator
*/
Expand Down Expand Up @@ -244,3 +244,33 @@ class Milestone {
..dueOn = parseDateTime(input['due_on']);
}
}


class IssueComment {
final GitHub github;

int id;

@ApiName("html_url")
String url;

String body;

User user;

DateTime createdAt;
DateTime updatedAt;

IssueComment(this.github);

static IssueComment fromJSON(GitHub github, input) {
if (input == null) return null;

return new IssueComment(github)
..id = input['id']
..body = input['body']
..user = User.fromJSON(github, input['user'])
..createdAt = parseDateTime(input['created_at'])
..updatedAt = parseDateTime(input['updated_at']);
}
}
Loading

0 comments on commit cab4fa1

Please sign in to comment.