{"action":"created","comment":{"url":"https://api.github.com/repos/gocd/gocd/pulls/comments/41379457","id":41379457,"diff_hunk":"@@ -43,12 +37,48 @@ def update\n       end\n     end\n \n+    def create\n+      result = HttpLocalizedOperationResult.new\n+\n+      user, created = user_service.withEnableUserMutex do","path":"server/webapp/WEB-INF/rails.new/app/controllers/api_v1/users_controller.rb","position":24,"original_position":24,"commit_id":"77d321c225b9c025f2bfedf8de03dd77d5070b4f","original_commit_id":"77d321c225b9c025f2bfedf8de03dd77d5070b4f","user":{"login":"ketan","id":10598,"avatar_url":"https://avatars.githubusercontent.com/u/10598?v=3","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"body":"Hmm, the `create` method on `UserService` is interesting, I think I should be able to use it.","created_at":"2015-10-07T11:35:14Z","updated_at":"2015-10-07T11:35:14Z","html_url":"https://github.com/gocd/gocd/pull/1542#discussion_r41379457","pull_request_url":"https://api.github.com/repos/gocd/gocd/pulls/1542","_links":{"self":{"href":"https://api.github.com/repos/gocd/gocd/pulls/comments/41379457"},"html":{"href":"https://github.com/gocd/gocd/pull/1542#discussion_r41379457"},"pull_request":{"href":"https://api.github.com/repos/gocd/gocd/pulls/1542"}}},"pull_request":{"url":"https://api.github.com/repos/gocd/gocd/pulls/1542","id":46864742,"html_url":"https://github.com/gocd/gocd/pull/1542","diff_url":"https://github.com/gocd/gocd/pull/1542.diff","patch_url":"https://github.com/gocd/gocd/pull/1542.patch","issue_url":"https://api.github.com/repos/gocd/gocd/issues/1542","number":1542,"state":"closed","locked":false,"title":"Add API endpoint to create a user.","user":{"login":"ketan","id":10598,"avatar_url":"https://avatars.githubusercontent.com/u/10598?v=3","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"body":"The contract is same as that of the `PATCH` API call, with an\nadditional REQUIRED FIELD `login_name`.","created_at":"2015-10-06T05:52:00Z","updated_at":"2015-10-07T11:35:14Z","closed_at":"2015-10-07T09:55:32Z","merged_at":"2015-10-07T09:55:32Z","merge_commit_sha":"d6d4b185c8f7db6c8c50b4b328672784a3ecafdd","assignee":null,"milestone":{"url":"https://api.github.com/repos/gocd/gocd/milestones/6","html_url":"https://github.com/gocd/gocd/milestones/Release%2015.3","labels_url":"https://api.github.com/repos/gocd/gocd/milestones/6/labels","id":1170416,"number":6,"title":"Release 15.3","description":"","creator":{"login":"zabil","id":54427,"avatar_url":"https://avatars.githubusercontent.com/u/54427?v=3","gravatar_id":"","url":"https://api.github.com/users/zabil","html_url":"https://github.com/zabil","followers_url":"https://api.github.com/users/zabil/followers","following_url":"https://api.github.com/users/zabil/following{/other_user}","gists_url":"https://api.github.com/users/zabil/gists{/gist_id}","starred_url":"https://api.github.com/users/zabil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zabil/subscriptions","organizations_url":"https://api.github.com/users/zabil/orgs","repos_url":"https://api.github.com/users/zabil/repos","events_url":"https://api.github.com/users/zabil/events{/privacy}","received_events_url":"https://api.github.com/users/zabil/received_events","type":"User","site_admin":false},"open_issues":57,"closed_issues":78,"state":"open","created_at":"2015-06-18T11:10:13Z","updated_at":"2015-10-07T09:55:32Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/gocd/gocd/pulls/1542/commits","review_comments_url":"https://api.github.com/repos/gocd/gocd/pulls/1542/comments","review_comment_url":"https://api.github.com/repos/gocd/gocd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gocd/gocd/issues/1542/comments","statuses_url":"https://api.github.com/repos/gocd/gocd/statuses/77d321c225b9c025f2bfedf8de03dd77d5070b4f","head":{"label":"ketan:user-create","ref":"user-create","sha":"77d321c225b9c025f2bfedf8de03dd77d5070b4f","user":{"login":"ketan","id":10598,"avatar_url":"https://avatars.githubusercontent.com/u/10598?v=3","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"repo":{"id":30253357,"name":"gocd","full_name":"ketan/gocd","owner":{"login":"ketan","id":10598,"avatar_url":"https://avatars.githubusercontent.com/u/10598?v=3","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ketan/gocd","description":"Main repository for Go Continuous Delivery","fork":true,"url":"https://api.github.com/repos/ketan/gocd","forks_url":"https://api.github.com/repos/ketan/gocd/forks","keys_url":"https://api.github.com/repos/ketan/gocd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ketan/gocd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ketan/gocd/teams","hooks_url":"https://api.github.com/repos/ketan/gocd/hooks","issue_events_url":"https://api.github.com/repos/ketan/gocd/issues/events{/number}","events_url":"https://api.github.com/repos/ketan/gocd/events","assignees_url":"https://api.github.com/repos/ketan/gocd/assignees{/user}","branches_url":"https://api.github.com/repos/ketan/gocd/branches{/branch}","tags_url":"https://api.github.com/repos/ketan/gocd/tags","blobs_url":"https://api.github.com/repos/ketan/gocd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ketan/gocd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ketan/gocd/git/refs{/sha}","trees_url":"https://api.github.com/repos/ketan/gocd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ketan/gocd/statuses/{sha}","languages_url":"https://api.github.com/repos/ketan/gocd/languages","stargazers_url":"https://api.github.com/repos/ketan/gocd/stargazers","contributors_url":"https://api.github.com/repos/ketan/gocd/contributors","subscribers_url":"https://api.github.com/repos/ketan/gocd/subscribers","subscription_url":"https://api.github.com/repos/ketan/gocd/subscription","commits_url":"https://api.github.com/repos/ketan/gocd/commits{/sha}","git_commits_url":"https://api.github.com/repos/ketan/gocd/git/commits{/sha}","comments_url":"https://api.github.com/repos/ketan/gocd/comments{/number}","issue_comment_url":"https://api.github.com/repos/ketan/gocd/issues/comments{/number}","contents_url":"https://api.github.com/repos/ketan/gocd/contents/{+path}","compare_url":"https://api.github.com/repos/ketan/gocd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ketan/gocd/merges","archive_url":"https://api.github.com/repos/ketan/gocd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ketan/gocd/downloads","issues_url":"https://api.github.com/repos/ketan/gocd/issues{/number}","pulls_url":"https://api.github.com/repos/ketan/gocd/pulls{/number}","milestones_url":"https://api.github.com/repos/ketan/gocd/milestones{/number}","notifications_url":"https://api.github.com/repos/ketan/gocd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ketan/gocd/labels{/name}","releases_url":"https://api.github.com/repos/ketan/gocd/releases{/id}","created_at":"2015-02-03T16:49:48Z","updated_at":"2015-05-08T13:55:11Z","pushed_at":"2015-10-07T09:58:25Z","git_url":"git://github.com/ketan/gocd.git","ssh_url":"git@github.com:ketan/gocd.git","clone_url":"https://github.com/ketan/gocd.git","svn_url":"https://github.com/ketan/gocd","homepage":null,"size":222378,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gocd:master","ref":"master","sha":"3cfccd09a80d0365b9adaacf0825f58b00fc1594","user":{"login":"gocd","id":6099846,"avatar_url":"https://avatars.githubusercontent.com/u/6099846?v=3","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"repo":{"id":15155534,"name":"gocd","full_name":"gocd/gocd","owner":{"login":"gocd","id":6099846,"avatar_url":"https://avatars.githubusercontent.com/u/6099846?v=3","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gocd/gocd","description":"Main repository for Go Continuous Delivery","fork":false,"url":"https://api.github.com/repos/gocd/gocd","forks_url":"https://api.github.com/repos/gocd/gocd/forks","keys_url":"https://api.github.com/repos/gocd/gocd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gocd/gocd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gocd/gocd/teams","hooks_url":"https://api.github.com/repos/gocd/gocd/hooks","issue_events_url":"https://api.github.com/repos/gocd/gocd/issues/events{/number}","events_url":"https://api.github.com/repos/gocd/gocd/events","assignees_url":"https://api.github.com/repos/gocd/gocd/assignees{/user}","branches_url":"https://api.github.com/repos/gocd/gocd/branches{/branch}","tags_url":"https://api.github.com/repos/gocd/gocd/tags","blobs_url":"https://api.github.com/repos/gocd/gocd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gocd/gocd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gocd/gocd/git/refs{/sha}","trees_url":"https://api.github.com/repos/gocd/gocd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gocd/gocd/statuses/{sha}","languages_url":"https://api.github.com/repos/gocd/gocd/languages","stargazers_url":"https://api.github.com/repos/gocd/gocd/stargazers","contributors_url":"https://api.github.com/repos/gocd/gocd/contributors","subscribers_url":"https://api.github.com/repos/gocd/gocd/subscribers","subscription_url":"https://api.github.com/repos/gocd/gocd/subscription","commits_url":"https://api.github.com/repos/gocd/gocd/commits{/sha}","git_commits_url":"https://api.github.com/repos/gocd/gocd/git/commits{/sha}","comments_url":"https://api.github.com/repos/gocd/gocd/comments{/number}","issue_comment_url":"https://api.github.com/repos/gocd/gocd/issues/comments{/number}","contents_url":"https://api.github.com/repos/gocd/gocd/contents/{+path}","compare_url":"https://api.github.com/repos/gocd/gocd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gocd/gocd/merges","archive_url":"https://api.github.com/repos/gocd/gocd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gocd/gocd/downloads","issues_url":"https://api.github.com/repos/gocd/gocd/issues{/number}","pulls_url":"https://api.github.com/repos/gocd/gocd/pulls{/number}","milestones_url":"https://api.github.com/repos/gocd/gocd/milestones{/number}","notifications_url":"https://api.github.com/repos/gocd/gocd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gocd/gocd/labels{/name}","releases_url":"https://api.github.com/repos/gocd/gocd/releases{/id}","created_at":"2013-12-13T05:26:16Z","updated_at":"2015-10-07T08:40:32Z","pushed_at":"2015-10-07T09:55:32Z","git_url":"git://github.com/gocd/gocd.git","ssh_url":"git@github.com:gocd/gocd.git","clone_url":"https://github.com/gocd/gocd.git","svn_url":"https://github.com/gocd/gocd","homepage":null,"size":270864,"stargazers_count":1844,"watchers_count":1844,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":309,"mirror_url":null,"open_issues_count":517,"forks":309,"open_issues":517,"watchers":1844,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gocd/gocd/pulls/1542"},"html":{"href":"https://github.com/gocd/gocd/pull/1542"},"issue":{"href":"https://api.github.com/repos/gocd/gocd/issues/1542"},"comments":{"href":"https://api.github.com/repos/gocd/gocd/issues/1542/comments"},"review_comments":{"href":"https://api.github.com/repos/gocd/gocd/pulls/1542/comments"},"review_comment":{"href":"https://api.github.com/repos/gocd/gocd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gocd/gocd/pulls/1542/commits"},"statuses":{"href":"https://api.github.com/repos/gocd/gocd/statuses/77d321c225b9c025f2bfedf8de03dd77d5070b4f"}}}}