{"action":"created","comment":{"url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls/comments/28784215","id":28784215,"diff_hunk":"@@ -0,0 +1,45 @@\n+//\n+//  FBUserEventsRequest.swift\n+//  PSix\n+//\n+//  Created by Turzion, Avihu on 4/20/15.\n+//  Copyright (c) 2015 PayPal. All rights reserved.\n+//\n+\n+import Foundation\n+\n+\n+extension String {\n+    func contains(other: String) -> Bool {\n+        return rangeOfString(other) != nil\n+    }\n+}","path":"PSix/FBUserEventsRequest.swift","position":null,"original_position":16,"commit_id":"d80a713f1a70387a3c33253f19846ea44b149678","original_commit_id":"ae5b8bd7a31e96264221a8b51e57250c1f4ba1ed","user":{"login":"avihut","id":821024,"avatar_url":"https://avatars.githubusercontent.com/u/821024?v=3","gravatar_id":"","url":"https://api.github.com/users/avihut","html_url":"https://github.com/avihut","followers_url":"https://api.github.com/users/avihut/followers","following_url":"https://api.github.com/users/avihut/following{/other_user}","gists_url":"https://api.github.com/users/avihut/gists{/gist_id}","starred_url":"https://api.github.com/users/avihut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avihut/subscriptions","organizations_url":"https://api.github.com/users/avihut/orgs","repos_url":"https://api.github.com/users/avihut/repos","events_url":"https://api.github.com/users/avihut/events{/privacy}","received_events_url":"https://api.github.com/users/avihut/received_events","type":"User","site_admin":false},"body":"Moved","created_at":"2015-04-21T14:42:08Z","updated_at":"2015-04-21T14:42:08Z","html_url":"https://github.com/iic-ninjas/PSix-iOS/pull/4#discussion_r28784215","pull_request_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls/comments/28784215"},"html":{"href":"https://github.com/iic-ninjas/PSix-iOS/pull/4#discussion_r28784215"},"pull_request":{"href":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls/4","id":33738463,"html_url":"https://github.com/iic-ninjas/PSix-iOS/pull/4","diff_url":"https://github.com/iic-ninjas/PSix-iOS/pull/4.diff","patch_url":"https://github.com/iic-ninjas/PSix-iOS/pull/4.patch","issue_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/issues/4","number":4,"state":"open","locked":false,"title":"Facebook Requests Refactor","user":{"login":"avihut","id":821024,"avatar_url":"https://avatars.githubusercontent.com/u/821024?v=3","gravatar_id":"","url":"https://api.github.com/users/avihut","html_url":"https://github.com/avihut","followers_url":"https://api.github.com/users/avihut/followers","following_url":"https://api.github.com/users/avihut/following{/other_user}","gists_url":"https://api.github.com/users/avihut/gists{/gist_id}","starred_url":"https://api.github.com/users/avihut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avihut/subscriptions","organizations_url":"https://api.github.com/users/avihut/orgs","repos_url":"https://api.github.com/users/avihut/repos","events_url":"https://api.github.com/users/avihut/events{/privacy}","received_events_url":"https://api.github.com/users/avihut/received_events","type":"User","site_admin":false},"body":"There are no visual changes. This started as a refactor to simplify the interfaces between the different services and parsers, but grew into something bigger the merits its own pull request.\r\n\r\nI created a chainable Facebook request class that allows for better readability.\r\n\r\nCode like this:\r\n\r\n    let request = FBSDKGraphRequest(graphPath: \"me\", parameters[\"fields\": \"name,id\"])\r\n    request.startWithCompletionHandler() { /* handle response */ }\r\n\r\nTurns into this:\r\n\r\n    FBRequest(forResource: \"me\").addParam(\"fields\", \"name,id\").execute() { /* handle response */ }\r\n\r\nWhich I further simplified by subclassing `FBRequest` with request classes for specific resources:\r\n\r\n    FBUserRequest(fbId: \"me\").attributes([\"name\", \"id\"]).execute() { /* handle response */ }\r\n\r\nThough the biggest change comes to the events request as you'll be able to see in the diff of `FacebookService.swift`\r\n\r\nFurthermore the request execution accepts 2 callback handlers `success` and `failure`. `failure` is given only `NSError?`, and `success` is given an `FBResponse` object. `FBResponse` is wrap around the regular `JSON` response that gives the same basic read interface through `subscript` and also *drumroll* handles paginated requests. Just check if the response has a next page, and it will generate an `FBRequest` for that next page automatically.","created_at":"2015-04-21T08:23:04Z","updated_at":"2015-04-21T14:42:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce48ac8c4a238abea2a2735c3bf40affd8f57d29","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls/4/commits","review_comments_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls/4/comments","review_comment_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/issues/4/comments","statuses_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/statuses/d80a713f1a70387a3c33253f19846ea44b149678","head":{"label":"iic-ninjas:FBrequest","ref":"FBrequest","sha":"d80a713f1a70387a3c33253f19846ea44b149678","user":{"login":"iic-ninjas","id":5079491,"avatar_url":"https://avatars.githubusercontent.com/u/5079491?v=3","gravatar_id":"","url":"https://api.github.com/users/iic-ninjas","html_url":"https://github.com/iic-ninjas","followers_url":"https://api.github.com/users/iic-ninjas/followers","following_url":"https://api.github.com/users/iic-ninjas/following{/other_user}","gists_url":"https://api.github.com/users/iic-ninjas/gists{/gist_id}","starred_url":"https://api.github.com/users/iic-ninjas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iic-ninjas/subscriptions","organizations_url":"https://api.github.com/users/iic-ninjas/orgs","repos_url":"https://api.github.com/users/iic-ninjas/repos","events_url":"https://api.github.com/users/iic-ninjas/events{/privacy}","received_events_url":"https://api.github.com/users/iic-ninjas/received_events","type":"Organization","site_admin":false},"repo":{"id":33816465,"name":"PSix-iOS","full_name":"iic-ninjas/PSix-iOS","owner":{"login":"iic-ninjas","id":5079491,"avatar_url":"https://avatars.githubusercontent.com/u/5079491?v=3","gravatar_id":"","url":"https://api.github.com/users/iic-ninjas","html_url":"https://github.com/iic-ninjas","followers_url":"https://api.github.com/users/iic-ninjas/followers","following_url":"https://api.github.com/users/iic-ninjas/following{/other_user}","gists_url":"https://api.github.com/users/iic-ninjas/gists{/gist_id}","starred_url":"https://api.github.com/users/iic-ninjas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iic-ninjas/subscriptions","organizations_url":"https://api.github.com/users/iic-ninjas/orgs","repos_url":"https://api.github.com/users/iic-ninjas/repos","events_url":"https://api.github.com/users/iic-ninjas/events{/privacy}","received_events_url":"https://api.github.com/users/iic-ninjas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iic-ninjas/PSix-iOS","description":"Social payments for Facebook events","fork":false,"url":"https://api.github.com/repos/iic-ninjas/PSix-iOS","forks_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/forks","keys_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/teams","hooks_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/hooks","issue_events_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/events","assignees_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/tags","blobs_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/languages","stargazers_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/stargazers","contributors_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/contributors","subscribers_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/subscribers","subscription_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/subscription","commits_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/merges","archive_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/downloads","issues_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/labels{/name}","releases_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/releases{/id}","created_at":"2015-04-12T12:44:37Z","updated_at":"2015-04-15T14:34:32Z","pushed_at":"2015-04-21T14:42:04Z","git_url":"git://github.com/iic-ninjas/PSix-iOS.git","ssh_url":"git@github.com:iic-ninjas/PSix-iOS.git","clone_url":"https://github.com/iic-ninjas/PSix-iOS.git","svn_url":"https://github.com/iic-ninjas/PSix-iOS","homepage":null,"size":11296,"stargazers_count":1,"watchers_count":1,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"iic-ninjas:data-model","ref":"data-model","sha":"f1f318dd33675327921ce81bcfbf05e863148571","user":{"login":"iic-ninjas","id":5079491,"avatar_url":"https://avatars.githubusercontent.com/u/5079491?v=3","gravatar_id":"","url":"https://api.github.com/users/iic-ninjas","html_url":"https://github.com/iic-ninjas","followers_url":"https://api.github.com/users/iic-ninjas/followers","following_url":"https://api.github.com/users/iic-ninjas/following{/other_user}","gists_url":"https://api.github.com/users/iic-ninjas/gists{/gist_id}","starred_url":"https://api.github.com/users/iic-ninjas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iic-ninjas/subscriptions","organizations_url":"https://api.github.com/users/iic-ninjas/orgs","repos_url":"https://api.github.com/users/iic-ninjas/repos","events_url":"https://api.github.com/users/iic-ninjas/events{/privacy}","received_events_url":"https://api.github.com/users/iic-ninjas/received_events","type":"Organization","site_admin":false},"repo":{"id":33816465,"name":"PSix-iOS","full_name":"iic-ninjas/PSix-iOS","owner":{"login":"iic-ninjas","id":5079491,"avatar_url":"https://avatars.githubusercontent.com/u/5079491?v=3","gravatar_id":"","url":"https://api.github.com/users/iic-ninjas","html_url":"https://github.com/iic-ninjas","followers_url":"https://api.github.com/users/iic-ninjas/followers","following_url":"https://api.github.com/users/iic-ninjas/following{/other_user}","gists_url":"https://api.github.com/users/iic-ninjas/gists{/gist_id}","starred_url":"https://api.github.com/users/iic-ninjas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iic-ninjas/subscriptions","organizations_url":"https://api.github.com/users/iic-ninjas/orgs","repos_url":"https://api.github.com/users/iic-ninjas/repos","events_url":"https://api.github.com/users/iic-ninjas/events{/privacy}","received_events_url":"https://api.github.com/users/iic-ninjas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iic-ninjas/PSix-iOS","description":"Social payments for Facebook events","fork":false,"url":"https://api.github.com/repos/iic-ninjas/PSix-iOS","forks_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/forks","keys_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/teams","hooks_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/hooks","issue_events_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/events","assignees_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/tags","blobs_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/languages","stargazers_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/stargazers","contributors_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/contributors","subscribers_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/subscribers","subscription_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/subscription","commits_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/merges","archive_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/downloads","issues_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/labels{/name}","releases_url":"https://api.github.com/repos/iic-ninjas/PSix-iOS/releases{/id}","created_at":"2015-04-12T12:44:37Z","updated_at":"2015-04-15T14:34:32Z","pushed_at":"2015-04-21T14:42:04Z","git_url":"git://github.com/iic-ninjas/PSix-iOS.git","ssh_url":"git@github.com:iic-ninjas/PSix-iOS.git","clone_url":"https://github.com/iic-ninjas/PSix-iOS.git","svn_url":"https://github.com/iic-ninjas/PSix-iOS","homepage":null,"size":11296,"stargazers_count":1,"watchers_count":1,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls/4"},"html":{"href":"https://github.com/iic-ninjas/PSix-iOS/pull/4"},"issue":{"href":"https://api.github.com/repos/iic-ninjas/PSix-iOS/issues/4"},"comments":{"href":"https://api.github.com/repos/iic-ninjas/PSix-iOS/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iic-ninjas/PSix-iOS/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/iic-ninjas/PSix-iOS/statuses/d80a713f1a70387a3c33253f19846ea44b149678"}}}}