Merge: github: save Github events ids.
authorJean Privat <jean@pryen.org>
Mon, 30 Nov 2015 15:09:24 +0000 (10:09 -0500)
committerJean Privat <jean@pryen.org>
Mon, 30 Nov 2015 15:09:24 +0000 (10:09 -0500)
Save event IDs so the future loader will know it will not have to process it again.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #1867
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Jean Privat <jean@pryen.org>

lib/github/api.nit
lib/github/events.nit

index 91cc006..18880ec 100644 (file)
@@ -732,6 +732,12 @@ class Issue
                super
        end
 
+       # Issue id.
+       fun id: Int do return json["id"].as(Int)
+
+       # Set issue id.
+       fun id=(id: Int) do json["id"] = id
+
        # Issue title.
        fun title: String do return json["title"].as(String)
 
index df7c8c3..543a786 100644 (file)
@@ -38,6 +38,12 @@ class GithubEvent
                self.json = json
        end
 
+       # Event ID from Github.
+       fun id: String do return json["id"].as(String)
+
+       # Set id.
+       fun id=(id: String) do json["id"] = id
+
        # Action performed by the event.
        fun action: String do return json["action"].as(String)