{"action":"created","comment":{"url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls/comments/24172003","id":24172003,"diff_hunk":"@@ -0,0 +1,12 @@\n+module Headquarters\n+  class API\n+    module Endpoints","path":"lib/headquarters/api/endpoints.rb","position":3,"original_position":3,"commit_id":"a7581c4bdd37b613ef581751709424fc6f5da339","original_commit_id":"3d359fc2ca0b64d72a8ee0df7fd1eb2223773ded","user":{"login":"naps62","id":283819,"avatar_url":"https://avatars.githubusercontent.com/u/283819?v=3","gravatar_id":"","url":"https://api.github.com/users/naps62","html_url":"https://github.com/naps62","followers_url":"https://api.github.com/users/naps62/followers","following_url":"https://api.github.com/users/naps62/following{/other_user}","gists_url":"https://api.github.com/users/naps62/gists{/gist_id}","starred_url":"https://api.github.com/users/naps62/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naps62/subscriptions","organizations_url":"https://api.github.com/users/naps62/orgs","repos_url":"https://api.github.com/users/naps62/repos","events_url":"https://api.github.com/users/naps62/events{/privacy}","received_events_url":"https://api.github.com/users/naps62/received_events","type":"User","site_admin":false},"body":"there are no methods being mixed in\r\n\r\nwith your solution, we would do `API::MEMBERS`, which doesn't even make sense\r\nwith the current one, we do `API::Endpoints::MEMBERS`","created_at":"2015-02-05T15:49:40Z","updated_at":"2015-02-05T15:49:40Z","html_url":"https://github.com/groupbuddies/headquarters-ruby/pull/12#discussion_r24172003","pull_request_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls/comments/24172003"},"html":{"href":"https://github.com/groupbuddies/headquarters-ruby/pull/12#discussion_r24172003"},"pull_request":{"href":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls/12","id":28728711,"html_url":"https://github.com/groupbuddies/headquarters-ruby/pull/12","diff_url":"https://github.com/groupbuddies/headquarters-ruby/pull/12.diff","patch_url":"https://github.com/groupbuddies/headquarters-ruby/pull/12.patch","issue_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/issues/12","number":12,"state":"open","locked":false,"title":"API v2 support (with OAuth) and major refactor","user":{"login":"naps62","id":283819,"avatar_url":"https://avatars.githubusercontent.com/u/283819?v=3","gravatar_id":"","url":"https://api.github.com/users/naps62","html_url":"https://github.com/naps62","followers_url":"https://api.github.com/users/naps62/followers","following_url":"https://api.github.com/users/naps62/following{/other_user}","gists_url":"https://api.github.com/users/naps62/gists{/gist_id}","starred_url":"https://api.github.com/users/naps62/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naps62/subscriptions","organizations_url":"https://api.github.com/users/naps62/orgs","repos_url":"https://api.github.com/users/naps62/repos","events_url":"https://api.github.com/users/naps62/events{/privacy}","received_events_url":"https://api.github.com/users/naps62/received_events","type":"User","site_admin":false},"body":"This is still a work in progress. It's mostly final, but the test suite needs new tests, as well as adjustments to older ones. The PR is being opened so that we can start discussing the refactor itself\r\n\r\nNotable changes:\r\n\r\n* By default, 'Accept: v2' will be sent as a header, so that the new api version will be used. Once we make v2 the default one on the server, this can be dropped.\r\n* With v2 comes OAuth authentication. This is done by sending a client_id/client_password pair when instantiating a client. An initial request is made to get the access_token\r\n* Since this adds state to the client (the access_token), I felt it was needed to instantiate clients, rather than relying on class methods everywhere. We should now do `client = Headquarters::Client.new`, which is aliased to `Headquarters.new`\r\n* We were previously mixing in every API feature into the main client, which for me is a problem (or rather, it could eventually become one). I took the change to follow the [github_api approach](https://github.com/peter-murach/github) of using namespaces which are lazily instantiated. This means that instead `client.all_members`, we now do `client.members.all`\r\n* There's also no need for the Internal endpoints and separate methods. `client.members.all` will seemlessly return the private data, as long as OAuth authentication was successfull\r\n* Some changes to how we make requests were also made, to simplify the DSL\r\n\r\n# TODO\r\n\r\n* refactor some of the current tests\r\n* add missing tests for new methods\r\n* fix action_mailer strategy\r\n* update the README","created_at":"2015-02-05T14:33:20Z","updated_at":"2015-02-05T15:49:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ef59541712bf0e3b35ad74920deca023e7ff9fe","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls/12/commits","review_comments_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls/12/comments","review_comment_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls/comments/{number}","comments_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/issues/12/comments","statuses_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/statuses/a7581c4bdd37b613ef581751709424fc6f5da339","head":{"label":"groupbuddies:mp-refactor","ref":"mp-refactor","sha":"a7581c4bdd37b613ef581751709424fc6f5da339","user":{"login":"groupbuddies","id":1085467,"avatar_url":"https://avatars.githubusercontent.com/u/1085467?v=3","gravatar_id":"","url":"https://api.github.com/users/groupbuddies","html_url":"https://github.com/groupbuddies","followers_url":"https://api.github.com/users/groupbuddies/followers","following_url":"https://api.github.com/users/groupbuddies/following{/other_user}","gists_url":"https://api.github.com/users/groupbuddies/gists{/gist_id}","starred_url":"https://api.github.com/users/groupbuddies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groupbuddies/subscriptions","organizations_url":"https://api.github.com/users/groupbuddies/orgs","repos_url":"https://api.github.com/users/groupbuddies/repos","events_url":"https://api.github.com/users/groupbuddies/events{/privacy}","received_events_url":"https://api.github.com/users/groupbuddies/received_events","type":"Organization","site_admin":false},"repo":{"id":28080792,"name":"headquarters-ruby","full_name":"groupbuddies/headquarters-ruby","owner":{"login":"groupbuddies","id":1085467,"avatar_url":"https://avatars.githubusercontent.com/u/1085467?v=3","gravatar_id":"","url":"https://api.github.com/users/groupbuddies","html_url":"https://github.com/groupbuddies","followers_url":"https://api.github.com/users/groupbuddies/followers","following_url":"https://api.github.com/users/groupbuddies/following{/other_user}","gists_url":"https://api.github.com/users/groupbuddies/gists{/gist_id}","starred_url":"https://api.github.com/users/groupbuddies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groupbuddies/subscriptions","organizations_url":"https://api.github.com/users/groupbuddies/orgs","repos_url":"https://api.github.com/users/groupbuddies/repos","events_url":"https://api.github.com/users/groupbuddies/events{/privacy}","received_events_url":"https://api.github.com/users/groupbuddies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/groupbuddies/headquarters-ruby","description":"Ruby wrapper for the headquarters API used at Group Buddies","fork":false,"url":"https://api.github.com/repos/groupbuddies/headquarters-ruby","forks_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/forks","keys_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/teams","hooks_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/hooks","issue_events_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/events","assignees_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/tags","blobs_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/languages","stargazers_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/stargazers","contributors_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/contributors","subscribers_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/subscribers","subscription_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/subscription","commits_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/issues/comments/{number}","contents_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/merges","archive_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/downloads","issues_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/labels{/name}","releases_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/releases{/id}","created_at":"2014-12-16T09:54:56Z","updated_at":"2015-02-03T16:55:42Z","pushed_at":"2015-02-05T14:53:36Z","git_url":"git://github.com/groupbuddies/headquarters-ruby.git","ssh_url":"git@github.com:groupbuddies/headquarters-ruby.git","clone_url":"https://github.com/groupbuddies/headquarters-ruby.git","svn_url":"https://github.com/groupbuddies/headquarters-ruby","homepage":null,"size":692,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":0,"default_branch":"master"}},"base":{"label":"groupbuddies:master","ref":"master","sha":"1563920d5a9b335453a2dd1f1d0524794f565256","user":{"login":"groupbuddies","id":1085467,"avatar_url":"https://avatars.githubusercontent.com/u/1085467?v=3","gravatar_id":"","url":"https://api.github.com/users/groupbuddies","html_url":"https://github.com/groupbuddies","followers_url":"https://api.github.com/users/groupbuddies/followers","following_url":"https://api.github.com/users/groupbuddies/following{/other_user}","gists_url":"https://api.github.com/users/groupbuddies/gists{/gist_id}","starred_url":"https://api.github.com/users/groupbuddies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groupbuddies/subscriptions","organizations_url":"https://api.github.com/users/groupbuddies/orgs","repos_url":"https://api.github.com/users/groupbuddies/repos","events_url":"https://api.github.com/users/groupbuddies/events{/privacy}","received_events_url":"https://api.github.com/users/groupbuddies/received_events","type":"Organization","site_admin":false},"repo":{"id":28080792,"name":"headquarters-ruby","full_name":"groupbuddies/headquarters-ruby","owner":{"login":"groupbuddies","id":1085467,"avatar_url":"https://avatars.githubusercontent.com/u/1085467?v=3","gravatar_id":"","url":"https://api.github.com/users/groupbuddies","html_url":"https://github.com/groupbuddies","followers_url":"https://api.github.com/users/groupbuddies/followers","following_url":"https://api.github.com/users/groupbuddies/following{/other_user}","gists_url":"https://api.github.com/users/groupbuddies/gists{/gist_id}","starred_url":"https://api.github.com/users/groupbuddies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groupbuddies/subscriptions","organizations_url":"https://api.github.com/users/groupbuddies/orgs","repos_url":"https://api.github.com/users/groupbuddies/repos","events_url":"https://api.github.com/users/groupbuddies/events{/privacy}","received_events_url":"https://api.github.com/users/groupbuddies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/groupbuddies/headquarters-ruby","description":"Ruby wrapper for the headquarters API used at Group Buddies","fork":false,"url":"https://api.github.com/repos/groupbuddies/headquarters-ruby","forks_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/forks","keys_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/teams","hooks_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/hooks","issue_events_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/events","assignees_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/tags","blobs_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/languages","stargazers_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/stargazers","contributors_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/contributors","subscribers_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/subscribers","subscription_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/subscription","commits_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/issues/comments/{number}","contents_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/merges","archive_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/downloads","issues_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/labels{/name}","releases_url":"https://api.github.com/repos/groupbuddies/headquarters-ruby/releases{/id}","created_at":"2014-12-16T09:54:56Z","updated_at":"2015-02-03T16:55:42Z","pushed_at":"2015-02-05T14:53:36Z","git_url":"git://github.com/groupbuddies/headquarters-ruby.git","ssh_url":"git@github.com:groupbuddies/headquarters-ruby.git","clone_url":"https://github.com/groupbuddies/headquarters-ruby.git","svn_url":"https://github.com/groupbuddies/headquarters-ruby","homepage":null,"size":692,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls/12"},"html":{"href":"https://github.com/groupbuddies/headquarters-ruby/pull/12"},"issue":{"href":"https://api.github.com/repos/groupbuddies/headquarters-ruby/issues/12"},"comments":{"href":"https://api.github.com/repos/groupbuddies/headquarters-ruby/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/groupbuddies/headquarters-ruby/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/groupbuddies/headquarters-ruby/statuses/a7581c4bdd37b613ef581751709424fc6f5da339"}}}}