{"action":"created","comment":{"url":"https://api.github.com/repos/Wishell/iOSTestTask/pulls/comments/233337695","pull_request_review_id":174721818,"id":233337695,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzMzNzY5NQ==","diff_hunk":"@@ -0,0 +1,57 @@\n+//\n+//  APIClient.swift\n+//  JsonCoddableUrlSession\n+//\n+//  Created by Maksim Vialykh on 08/11/2018.\n+//  Copyright © 2018 Vialyx. All rights reserved.\n+//\n+\n+import Foundation\n+\n+// TODO: - Move to the separated file Resource.swift\n+struct Resource {\n+    let url: URL\n+    let method: String = \"GET\"\n+}\n+\n+// TODO: - Move to the separated file GenericResult.swift\n+enum Result<T> {\n+    case success(T)\n+    case failure(Error)\n+}\n+\n+enum APIClientError: Error {\n+    case noData\n+}\n+\n+// TODO: - Move to the separated file URLRequest+Resource.swift\n+extension URLRequest {\n+    \n+    init(_ resource: Resource) {\n+        self.init(url: resource.url)\n+        self.httpMethod = resource.method\n+    }\n+    \n+}\n+\n+final class APIClient {\n+    \n+    func load(_ resource: Resource, result: @escaping ((Result<Data>) -> Void)) {\n+        var request = URLRequest(resource)\n+        // Headers\n+        request.allHTTPHeaderFields?[\"Authorization\"] = KeychainSingleton.shared.keychain[\"fitbit.token\"]","path":"FitBitApi/FitBitApi/Modules/Presenter/Model/APIClient.swift","position":42,"original_position":42,"commit_id":"875ced559d7537069a6c9b82c44b9c453dc67283","original_commit_id":"875ced559d7537069a6c9b82c44b9c453dc67283","user":{"login":"vialyx","id":8024661,"node_id":"MDQ6VXNlcjgwMjQ2NjE=","avatar_url":"https://avatars1.githubusercontent.com/u/8024661?v=4","gravatar_id":"","url":"https://api.github.com/users/vialyx","html_url":"https://github.com/vialyx","followers_url":"https://api.github.com/users/vialyx/followers","following_url":"https://api.github.com/users/vialyx/following{/other_user}","gists_url":"https://api.github.com/users/vialyx/gists{/gist_id}","starred_url":"https://api.github.com/users/vialyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vialyx/subscriptions","organizations_url":"https://api.github.com/users/vialyx/orgs","repos_url":"https://api.github.com/users/vialyx/repos","events_url":"https://api.github.com/users/vialyx/events{/privacy}","received_events_url":"https://api.github.com/users/vialyx/received_events","type":"User","site_admin":false},"body":"don't use thirparty keychain directly","created_at":"2018-11-14T07:34:34Z","updated_at":"2018-11-14T07:42:15Z","html_url":"https://github.com/Wishell/iOSTestTask/pull/1#discussion_r233337695","pull_request_url":"https://api.github.com/repos/Wishell/iOSTestTask/pulls/1","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Wishell/iOSTestTask/pulls/comments/233337695"},"html":{"href":"https://github.com/Wishell/iOSTestTask/pull/1#discussion_r233337695"},"pull_request":{"href":"https://api.github.com/repos/Wishell/iOSTestTask/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Wishell/iOSTestTask/pulls/1","id":230731380,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNzMxMzgw","html_url":"https://github.com/Wishell/iOSTestTask/pull/1","diff_url":"https://github.com/Wishell/iOSTestTask/pull/1.diff","patch_url":"https://github.com/Wishell/iOSTestTask/pull/1.patch","issue_url":"https://api.github.com/repos/Wishell/iOSTestTask/issues/1","number":1,"state":"open","locked":false,"title":"Fit bit2","user":{"login":"Wishell","id":34252267,"node_id":"MDQ6VXNlcjM0MjUyMjY3","avatar_url":"https://avatars1.githubusercontent.com/u/34252267?v=4","gravatar_id":"","url":"https://api.github.com/users/Wishell","html_url":"https://github.com/Wishell","followers_url":"https://api.github.com/users/Wishell/followers","following_url":"https://api.github.com/users/Wishell/following{/other_user}","gists_url":"https://api.github.com/users/Wishell/gists{/gist_id}","starred_url":"https://api.github.com/users/Wishell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wishell/subscriptions","organizations_url":"https://api.github.com/users/Wishell/orgs","repos_url":"https://api.github.com/users/Wishell/repos","events_url":"https://api.github.com/users/Wishell/events{/privacy}","received_events_url":"https://api.github.com/users/Wishell/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-14T07:07:19Z","updated_at":"2018-11-14T07:42:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4517a6d50a2d76c05175bba596808048b9c71957","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Wishell/iOSTestTask/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Wishell/iOSTestTask/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Wishell/iOSTestTask/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wishell/iOSTestTask/issues/1/comments","statuses_url":"https://api.github.com/repos/Wishell/iOSTestTask/statuses/875ced559d7537069a6c9b82c44b9c453dc67283","head":{"label":"Wishell:FitBit2","ref":"FitBit2","sha":"875ced559d7537069a6c9b82c44b9c453dc67283","user":{"login":"Wishell","id":34252267,"node_id":"MDQ6VXNlcjM0MjUyMjY3","avatar_url":"https://avatars1.githubusercontent.com/u/34252267?v=4","gravatar_id":"","url":"https://api.github.com/users/Wishell","html_url":"https://github.com/Wishell","followers_url":"https://api.github.com/users/Wishell/followers","following_url":"https://api.github.com/users/Wishell/following{/other_user}","gists_url":"https://api.github.com/users/Wishell/gists{/gist_id}","starred_url":"https://api.github.com/users/Wishell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wishell/subscriptions","organizations_url":"https://api.github.com/users/Wishell/orgs","repos_url":"https://api.github.com/users/Wishell/repos","events_url":"https://api.github.com/users/Wishell/events{/privacy}","received_events_url":"https://api.github.com/users/Wishell/received_events","type":"User","site_admin":false},"repo":{"id":156252922,"node_id":"MDEwOlJlcG9zaXRvcnkxNTYyNTI5MjI=","name":"iOSTestTask","full_name":"Wishell/iOSTestTask","private":false,"owner":{"login":"Wishell","id":34252267,"node_id":"MDQ6VXNlcjM0MjUyMjY3","avatar_url":"https://avatars1.githubusercontent.com/u/34252267?v=4","gravatar_id":"","url":"https://api.github.com/users/Wishell","html_url":"https://github.com/Wishell","followers_url":"https://api.github.com/users/Wishell/followers","following_url":"https://api.github.com/users/Wishell/following{/other_user}","gists_url":"https://api.github.com/users/Wishell/gists{/gist_id}","starred_url":"https://api.github.com/users/Wishell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wishell/subscriptions","organizations_url":"https://api.github.com/users/Wishell/orgs","repos_url":"https://api.github.com/users/Wishell/repos","events_url":"https://api.github.com/users/Wishell/events{/privacy}","received_events_url":"https://api.github.com/users/Wishell/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Wishell/iOSTestTask","description":null,"fork":false,"url":"https://api.github.com/repos/Wishell/iOSTestTask","forks_url":"https://api.github.com/repos/Wishell/iOSTestTask/forks","keys_url":"https://api.github.com/repos/Wishell/iOSTestTask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wishell/iOSTestTask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wishell/iOSTestTask/teams","hooks_url":"https://api.github.com/repos/Wishell/iOSTestTask/hooks","issue_events_url":"https://api.github.com/repos/Wishell/iOSTestTask/issues/events{/number}","events_url":"https://api.github.com/repos/Wishell/iOSTestTask/events","assignees_url":"https://api.github.com/repos/Wishell/iOSTestTask/assignees{/user}","branches_url":"https://api.github.com/repos/Wishell/iOSTestTask/branches{/branch}","tags_url":"https://api.github.com/repos/Wishell/iOSTestTask/tags","blobs_url":"https://api.github.com/repos/Wishell/iOSTestTask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wishell/iOSTestTask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wishell/iOSTestTask/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wishell/iOSTestTask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wishell/iOSTestTask/statuses/{sha}","languages_url":"https://api.github.com/repos/Wishell/iOSTestTask/languages","stargazers_url":"https://api.github.com/repos/Wishell/iOSTestTask/stargazers","contributors_url":"https://api.github.com/repos/Wishell/iOSTestTask/contributors","subscribers_url":"https://api.github.com/repos/Wishell/iOSTestTask/subscribers","subscription_url":"https://api.github.com/repos/Wishell/iOSTestTask/subscription","commits_url":"https://api.github.com/repos/Wishell/iOSTestTask/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wishell/iOSTestTask/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wishell/iOSTestTask/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wishell/iOSTestTask/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wishell/iOSTestTask/contents/{+path}","compare_url":"https://api.github.com/repos/Wishell/iOSTestTask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wishell/iOSTestTask/merges","archive_url":"https://api.github.com/repos/Wishell/iOSTestTask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wishell/iOSTestTask/downloads","issues_url":"https://api.github.com/repos/Wishell/iOSTestTask/issues{/number}","pulls_url":"https://api.github.com/repos/Wishell/iOSTestTask/pulls{/number}","milestones_url":"https://api.github.com/repos/Wishell/iOSTestTask/milestones{/number}","notifications_url":"https://api.github.com/repos/Wishell/iOSTestTask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wishell/iOSTestTask/labels{/name}","releases_url":"https://api.github.com/repos/Wishell/iOSTestTask/releases{/id}","deployments_url":"https://api.github.com/repos/Wishell/iOSTestTask/deployments","created_at":"2018-11-05T17:03:30Z","updated_at":"2018-11-09T18:21:44Z","pushed_at":"2018-11-14T07:07:20Z","git_url":"git://github.com/Wishell/iOSTestTask.git","ssh_url":"git@github.com:Wishell/iOSTestTask.git","clone_url":"https://github.com/Wishell/iOSTestTask.git","svn_url":"https://github.com/Wishell/iOSTestTask","homepage":null,"size":210,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Wishell:master","ref":"master","sha":"dc4841ac4314e3f42e4922de8fc32309ddf2111a","user":{"login":"Wishell","id":34252267,"node_id":"MDQ6VXNlcjM0MjUyMjY3","avatar_url":"https://avatars1.githubusercontent.com/u/34252267?v=4","gravatar_id":"","url":"https://api.github.com/users/Wishell","html_url":"https://github.com/Wishell","followers_url":"https://api.github.com/users/Wishell/followers","following_url":"https://api.github.com/users/Wishell/following{/other_user}","gists_url":"https://api.github.com/users/Wishell/gists{/gist_id}","starred_url":"https://api.github.com/users/Wishell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wishell/subscriptions","organizations_url":"https://api.github.com/users/Wishell/orgs","repos_url":"https://api.github.com/users/Wishell/repos","events_url":"https://api.github.com/users/Wishell/events{/privacy}","received_events_url":"https://api.github.com/users/Wishell/received_events","type":"User","site_admin":false},"repo":{"id":156252922,"node_id":"MDEwOlJlcG9zaXRvcnkxNTYyNTI5MjI=","name":"iOSTestTask","full_name":"Wishell/iOSTestTask","private":false,"owner":{"login":"Wishell","id":34252267,"node_id":"MDQ6VXNlcjM0MjUyMjY3","avatar_url":"https://avatars1.githubusercontent.com/u/34252267?v=4","gravatar_id":"","url":"https://api.github.com/users/Wishell","html_url":"https://github.com/Wishell","followers_url":"https://api.github.com/users/Wishell/followers","following_url":"https://api.github.com/users/Wishell/following{/other_user}","gists_url":"https://api.github.com/users/Wishell/gists{/gist_id}","starred_url":"https://api.github.com/users/Wishell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wishell/subscriptions","organizations_url":"https://api.github.com/users/Wishell/orgs","repos_url":"https://api.github.com/users/Wishell/repos","events_url":"https://api.github.com/users/Wishell/events{/privacy}","received_events_url":"https://api.github.com/users/Wishell/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Wishell/iOSTestTask","description":null,"fork":false,"url":"https://api.github.com/repos/Wishell/iOSTestTask","forks_url":"https://api.github.com/repos/Wishell/iOSTestTask/forks","keys_url":"https://api.github.com/repos/Wishell/iOSTestTask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wishell/iOSTestTask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wishell/iOSTestTask/teams","hooks_url":"https://api.github.com/repos/Wishell/iOSTestTask/hooks","issue_events_url":"https://api.github.com/repos/Wishell/iOSTestTask/issues/events{/number}","events_url":"https://api.github.com/repos/Wishell/iOSTestTask/events","assignees_url":"https://api.github.com/repos/Wishell/iOSTestTask/assignees{/user}","branches_url":"https://api.github.com/repos/Wishell/iOSTestTask/branches{/branch}","tags_url":"https://api.github.com/repos/Wishell/iOSTestTask/tags","blobs_url":"https://api.github.com/repos/Wishell/iOSTestTask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wishell/iOSTestTask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wishell/iOSTestTask/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wishell/iOSTestTask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wishell/iOSTestTask/statuses/{sha}","languages_url":"https://api.github.com/repos/Wishell/iOSTestTask/languages","stargazers_url":"https://api.github.com/repos/Wishell/iOSTestTask/stargazers","contributors_url":"https://api.github.com/repos/Wishell/iOSTestTask/contributors","subscribers_url":"https://api.github.com/repos/Wishell/iOSTestTask/subscribers","subscription_url":"https://api.github.com/repos/Wishell/iOSTestTask/subscription","commits_url":"https://api.github.com/repos/Wishell/iOSTestTask/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wishell/iOSTestTask/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wishell/iOSTestTask/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wishell/iOSTestTask/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wishell/iOSTestTask/contents/{+path}","compare_url":"https://api.github.com/repos/Wishell/iOSTestTask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wishell/iOSTestTask/merges","archive_url":"https://api.github.com/repos/Wishell/iOSTestTask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wishell/iOSTestTask/downloads","issues_url":"https://api.github.com/repos/Wishell/iOSTestTask/issues{/number}","pulls_url":"https://api.github.com/repos/Wishell/iOSTestTask/pulls{/number}","milestones_url":"https://api.github.com/repos/Wishell/iOSTestTask/milestones{/number}","notifications_url":"https://api.github.com/repos/Wishell/iOSTestTask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wishell/iOSTestTask/labels{/name}","releases_url":"https://api.github.com/repos/Wishell/iOSTestTask/releases{/id}","deployments_url":"https://api.github.com/repos/Wishell/iOSTestTask/deployments","created_at":"2018-11-05T17:03:30Z","updated_at":"2018-11-09T18:21:44Z","pushed_at":"2018-11-14T07:07:20Z","git_url":"git://github.com/Wishell/iOSTestTask.git","ssh_url":"git@github.com:Wishell/iOSTestTask.git","clone_url":"https://github.com/Wishell/iOSTestTask.git","svn_url":"https://github.com/Wishell/iOSTestTask","homepage":null,"size":210,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wishell/iOSTestTask/pulls/1"},"html":{"href":"https://github.com/Wishell/iOSTestTask/pull/1"},"issue":{"href":"https://api.github.com/repos/Wishell/iOSTestTask/issues/1"},"comments":{"href":"https://api.github.com/repos/Wishell/iOSTestTask/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Wishell/iOSTestTask/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Wishell/iOSTestTask/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wishell/iOSTestTask/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Wishell/iOSTestTask/statuses/875ced559d7537069a6c9b82c44b9c453dc67283"}},"author_association":"OWNER"}}
{"actor":{"display_login":"vialyx"}}