{"action":"created","comment":{"url":"https://api.github.com/repos/xanzy/go-gitlab/pulls/comments/224405542","pull_request_review_id":163760754,"id":224405542,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDQwNTU0Mg==","diff_hunk":"@@ -0,0 +1,1027 @@\n+//\n+// Copyright 2018, Sander van Harmelen\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+//\n+\n+package gitlab\n+\n+import (\n+\t\"fmt\"\n+\t\"net/url\"\n+\t\"time\"\n+)\n+\n+// DiscussionsService handles communication with the discussions related methods\n+// of the GitLab API.\n+//\n+// GitLab API docs: https://docs.gitlab.com/ce/api/discussions.html\n+type DiscussionsService struct {\n+\tclient *Client\n+}\n+\n+// Discussion represents a GitLab discussion.\n+//\n+// GitLab API docs: https://docs.gitlab.com/ce/api/discussions.html\n+type Discussion struct {\n+\tID             string `json:\"id\"`\n+\tIndividualNote bool   `json:\"individual_note\"`\n+\tNotes          []Note `json:\"notes\"`\n+}\n+\n+func (d Discussion) String() string {\n+\treturn Stringify(d)\n+}\n+\n+// ListProjectIssueDiscussionsOptions represents the available\n+// ListIssueDiscussions() options.\n+//\n+// GitLab API docs:\n+// https://docs.gitlab.com/ce/api/discussions.html#list-project-issue-discussions\n+type ListProjectIssueDiscussionsOptions struct {\n+\tListOptions\n+}\n+\n+// ListProjectIssueDiscussions gets a list of all discussions for a single\n+// issue.\n+//\n+// GitLab API docs:\n+// https://docs.gitlab.com/ce/api/discussions.html#list-project-issue-discussions\n+func (s *DiscussionsService) ListProjectIssueDiscussions(pid interface{}, issue int, opt *ListProjectIssueDiscussionsOptions, options ...OptionFunc) ([]*Discussion, *Response, error) {\n+\tproject, err := parseID(pid)\n+\tif err != nil {\n+\t\treturn nil, nil, err\n+\t}\n+\tu := fmt.Sprintf(\"projects/%s/issues/%d/discussions\", url.QueryEscape(project), issue)\n+\n+\treq, err := s.client.NewRequest(\"GET\", u, opt, options)\n+\tif err != nil {\n+\t\treturn nil, nil, err\n+\t}\n+\n+\tvar ds []*Discussion\n+\tresp, err := s.client.Do(req, &ds)\n+\tif err != nil {\n+\t\treturn nil, resp, err\n+\t}\n+\n+\treturn ds, resp, err\n+}\n+\n+// GetIssueDiscussion returns a single discussion for a specific project issue.\n+//\n+// GitLab API docs:\n+// https://docs.gitlab.com/ce/api/discussions.html#get-single-issue-discussion\n+func (s *DiscussionsService) GetIssueDiscussion(pid interface{}, issue int, discussion string, options ...OptionFunc) (*Discussion, *Response, error) {\n+\tproject, err := parseID(pid)\n+\tif err != nil {\n+\t\treturn nil, nil, err\n+\t}\n+\tu := fmt.Sprintf(\"projects/%s/issues/%d/discussions/%s\", url.QueryEscape(project), issue,\n+\t\tdiscussion)\n+\n+\treq, err := s.client.NewRequest(\"GET\", u, nil, options)\n+\tif err != nil {\n+\t\treturn nil, nil, err\n+\t}\n+\n+\td := new(Discussion)\n+\tresp, err := s.client.Do(req, d)\n+\tif err != nil {\n+\t\treturn nil, resp, err\n+\t}\n+\n+\treturn d, resp, err\n+}\n+\n+// CreateIssueDiscussionOptions represents the available CreateIssueDiscussion()\n+// options.\n+//\n+// GitLab API docs:\n+// https://docs.gitlab.com/ce/api/discussions.html#create-new-issue-discussion\n+type CreateIssueDiscussionOptions struct {\n+\tBody      *string    `url:\"body,omitempty\" json:\"body,omitempty\"`\n+\tCreatedAt *time.Time `json:\"created_at,omitempty\"`","path":"discussions.go","position":114,"original_position":114,"commit_id":"35b769e4ab485b8a6ee5e5fbfd7996afb175af08","original_commit_id":"35b769e4ab485b8a6ee5e5fbfd7996afb175af08","user":{"login":"sirlatrom","id":425633,"node_id":"MDQ6VXNlcjQyNTYzMw==","avatar_url":"https://avatars3.githubusercontent.com/u/425633?v=4","gravatar_id":"","url":"https://api.github.com/users/sirlatrom","html_url":"https://github.com/sirlatrom","followers_url":"https://api.github.com/users/sirlatrom/followers","following_url":"https://api.github.com/users/sirlatrom/following{/other_user}","gists_url":"https://api.github.com/users/sirlatrom/gists{/gist_id}","starred_url":"https://api.github.com/users/sirlatrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirlatrom/subscriptions","organizations_url":"https://api.github.com/users/sirlatrom/orgs","repos_url":"https://api.github.com/users/sirlatrom/repos","events_url":"https://api.github.com/users/sirlatrom/events{/privacy}","received_events_url":"https://api.github.com/users/sirlatrom/received_events","type":"User","site_admin":false},"body":"I'll check to make sure. By the way, at least with API v4 / GitLab EE 11.3.4, the `created_at` field is not part of the `author` field.","created_at":"2018-10-11T11:05:08Z","updated_at":"2018-10-11T11:05:08Z","html_url":"https://github.com/xanzy/go-gitlab/pull/481#discussion_r224405542","pull_request_url":"https://api.github.com/repos/xanzy/go-gitlab/pulls/481","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/xanzy/go-gitlab/pulls/comments/224405542"},"html":{"href":"https://github.com/xanzy/go-gitlab/pull/481#discussion_r224405542"},"pull_request":{"href":"https://api.github.com/repos/xanzy/go-gitlab/pulls/481"}},"in_reply_to_id":224351167},"pull_request":{"url":"https://api.github.com/repos/xanzy/go-gitlab/pulls/481","id":219648642,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5NjQ4NjQy","html_url":"https://github.com/xanzy/go-gitlab/pull/481","diff_url":"https://github.com/xanzy/go-gitlab/pull/481.diff","patch_url":"https://github.com/xanzy/go-gitlab/pull/481.patch","issue_url":"https://api.github.com/repos/xanzy/go-gitlab/issues/481","number":481,"state":"open","locked":false,"title":"Add Discussions API implementation","user":{"login":"sirlatrom","id":425633,"node_id":"MDQ6VXNlcjQyNTYzMw==","avatar_url":"https://avatars3.githubusercontent.com/u/425633?v=4","gravatar_id":"","url":"https://api.github.com/users/sirlatrom","html_url":"https://github.com/sirlatrom","followers_url":"https://api.github.com/users/sirlatrom/followers","following_url":"https://api.github.com/users/sirlatrom/following{/other_user}","gists_url":"https://api.github.com/users/sirlatrom/gists{/gist_id}","starred_url":"https://api.github.com/users/sirlatrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirlatrom/subscriptions","organizations_url":"https://api.github.com/users/sirlatrom/orgs","repos_url":"https://api.github.com/users/sirlatrom/repos","events_url":"https://api.github.com/users/sirlatrom/events{/privacy}","received_events_url":"https://api.github.com/users/sirlatrom/received_events","type":"User","site_admin":false},"body":"Mostly copy/paste from NotesService, except some field names are the same and some are additional for discussions in the Discussion type.\r\n\r\nSigned-off-by: Sune Keller <absukl@almbrand.dk>","created_at":"2018-10-02T10:01:53Z","updated_at":"2018-10-11T11:05:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a083f322c29bce580edae5bb89b973052da1539","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/xanzy/go-gitlab/pulls/481/commits","review_comments_url":"https://api.github.com/repos/xanzy/go-gitlab/pulls/481/comments","review_comment_url":"https://api.github.com/repos/xanzy/go-gitlab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xanzy/go-gitlab/issues/481/comments","statuses_url":"https://api.github.com/repos/xanzy/go-gitlab/statuses/35b769e4ab485b8a6ee5e5fbfd7996afb175af08","head":{"label":"sirlatrom:master","ref":"master","sha":"35b769e4ab485b8a6ee5e5fbfd7996afb175af08","user":{"login":"sirlatrom","id":425633,"node_id":"MDQ6VXNlcjQyNTYzMw==","avatar_url":"https://avatars3.githubusercontent.com/u/425633?v=4","gravatar_id":"","url":"https://api.github.com/users/sirlatrom","html_url":"https://github.com/sirlatrom","followers_url":"https://api.github.com/users/sirlatrom/followers","following_url":"https://api.github.com/users/sirlatrom/following{/other_user}","gists_url":"https://api.github.com/users/sirlatrom/gists{/gist_id}","starred_url":"https://api.github.com/users/sirlatrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirlatrom/subscriptions","organizations_url":"https://api.github.com/users/sirlatrom/orgs","repos_url":"https://api.github.com/users/sirlatrom/repos","events_url":"https://api.github.com/users/sirlatrom/events{/privacy}","received_events_url":"https://api.github.com/users/sirlatrom/received_events","type":"User","site_admin":false},"repo":{"id":151233563,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEyMzM1NjM=","name":"go-gitlab","full_name":"sirlatrom/go-gitlab","private":false,"owner":{"login":"sirlatrom","id":425633,"node_id":"MDQ6VXNlcjQyNTYzMw==","avatar_url":"https://avatars3.githubusercontent.com/u/425633?v=4","gravatar_id":"","url":"https://api.github.com/users/sirlatrom","html_url":"https://github.com/sirlatrom","followers_url":"https://api.github.com/users/sirlatrom/followers","following_url":"https://api.github.com/users/sirlatrom/following{/other_user}","gists_url":"https://api.github.com/users/sirlatrom/gists{/gist_id}","starred_url":"https://api.github.com/users/sirlatrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirlatrom/subscriptions","organizations_url":"https://api.github.com/users/sirlatrom/orgs","repos_url":"https://api.github.com/users/sirlatrom/repos","events_url":"https://api.github.com/users/sirlatrom/events{/privacy}","received_events_url":"https://api.github.com/users/sirlatrom/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sirlatrom/go-gitlab","description":"A GitLab API client enabling Go programs to interact with GitLab in a simple and uniform way","fork":true,"url":"https://api.github.com/repos/sirlatrom/go-gitlab","forks_url":"https://api.github.com/repos/sirlatrom/go-gitlab/forks","keys_url":"https://api.github.com/repos/sirlatrom/go-gitlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sirlatrom/go-gitlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sirlatrom/go-gitlab/teams","hooks_url":"https://api.github.com/repos/sirlatrom/go-gitlab/hooks","issue_events_url":"https://api.github.com/repos/sirlatrom/go-gitlab/issues/events{/number}","events_url":"https://api.github.com/repos/sirlatrom/go-gitlab/events","assignees_url":"https://api.github.com/repos/sirlatrom/go-gitlab/assignees{/user}","branches_url":"https://api.github.com/repos/sirlatrom/go-gitlab/branches{/branch}","tags_url":"https://api.github.com/repos/sirlatrom/go-gitlab/tags","blobs_url":"https://api.github.com/repos/sirlatrom/go-gitlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sirlatrom/go-gitlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sirlatrom/go-gitlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/sirlatrom/go-gitlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sirlatrom/go-gitlab/statuses/{sha}","languages_url":"https://api.github.com/repos/sirlatrom/go-gitlab/languages","stargazers_url":"https://api.github.com/repos/sirlatrom/go-gitlab/stargazers","contributors_url":"https://api.github.com/repos/sirlatrom/go-gitlab/contributors","subscribers_url":"https://api.github.com/repos/sirlatrom/go-gitlab/subscribers","subscription_url":"https://api.github.com/repos/sirlatrom/go-gitlab/subscription","commits_url":"https://api.github.com/repos/sirlatrom/go-gitlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/sirlatrom/go-gitlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/sirlatrom/go-gitlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/sirlatrom/go-gitlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/sirlatrom/go-gitlab/contents/{+path}","compare_url":"https://api.github.com/repos/sirlatrom/go-gitlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sirlatrom/go-gitlab/merges","archive_url":"https://api.github.com/repos/sirlatrom/go-gitlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sirlatrom/go-gitlab/downloads","issues_url":"https://api.github.com/repos/sirlatrom/go-gitlab/issues{/number}","pulls_url":"https://api.github.com/repos/sirlatrom/go-gitlab/pulls{/number}","milestones_url":"https://api.github.com/repos/sirlatrom/go-gitlab/milestones{/number}","notifications_url":"https://api.github.com/repos/sirlatrom/go-gitlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sirlatrom/go-gitlab/labels{/name}","releases_url":"https://api.github.com/repos/sirlatrom/go-gitlab/releases{/id}","deployments_url":"https://api.github.com/repos/sirlatrom/go-gitlab/deployments","created_at":"2018-10-02T09:52:24Z","updated_at":"2018-10-10T08:40:58Z","pushed_at":"2018-10-10T08:40:56Z","git_url":"git://github.com/sirlatrom/go-gitlab.git","ssh_url":"git@github.com:sirlatrom/go-gitlab.git","clone_url":"https://github.com/sirlatrom/go-gitlab.git","svn_url":"https://github.com/sirlatrom/go-gitlab","homepage":null,"size":765,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xanzy:master","ref":"master","sha":"074a3f2aabc6f9d0047d78ce4eae30daf9898929","user":{"login":"xanzy","id":8135796,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMzU3OTY=","avatar_url":"https://avatars3.githubusercontent.com/u/8135796?v=4","gravatar_id":"","url":"https://api.github.com/users/xanzy","html_url":"https://github.com/xanzy","followers_url":"https://api.github.com/users/xanzy/followers","following_url":"https://api.github.com/users/xanzy/following{/other_user}","gists_url":"https://api.github.com/users/xanzy/gists{/gist_id}","starred_url":"https://api.github.com/users/xanzy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xanzy/subscriptions","organizations_url":"https://api.github.com/users/xanzy/orgs","repos_url":"https://api.github.com/users/xanzy/repos","events_url":"https://api.github.com/users/xanzy/events{/privacy}","received_events_url":"https://api.github.com/users/xanzy/received_events","type":"Organization","site_admin":false},"repo":{"id":33072974,"node_id":"MDEwOlJlcG9zaXRvcnkzMzA3Mjk3NA==","name":"go-gitlab","full_name":"xanzy/go-gitlab","private":false,"owner":{"login":"xanzy","id":8135796,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMzU3OTY=","avatar_url":"https://avatars3.githubusercontent.com/u/8135796?v=4","gravatar_id":"","url":"https://api.github.com/users/xanzy","html_url":"https://github.com/xanzy","followers_url":"https://api.github.com/users/xanzy/followers","following_url":"https://api.github.com/users/xanzy/following{/other_user}","gists_url":"https://api.github.com/users/xanzy/gists{/gist_id}","starred_url":"https://api.github.com/users/xanzy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xanzy/subscriptions","organizations_url":"https://api.github.com/users/xanzy/orgs","repos_url":"https://api.github.com/users/xanzy/repos","events_url":"https://api.github.com/users/xanzy/events{/privacy}","received_events_url":"https://api.github.com/users/xanzy/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/xanzy/go-gitlab","description":"A GitLab API client enabling Go programs to interact with GitLab in a simple and uniform way","fork":false,"url":"https://api.github.com/repos/xanzy/go-gitlab","forks_url":"https://api.github.com/repos/xanzy/go-gitlab/forks","keys_url":"https://api.github.com/repos/xanzy/go-gitlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xanzy/go-gitlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xanzy/go-gitlab/teams","hooks_url":"https://api.github.com/repos/xanzy/go-gitlab/hooks","issue_events_url":"https://api.github.com/repos/xanzy/go-gitlab/issues/events{/number}","events_url":"https://api.github.com/repos/xanzy/go-gitlab/events","assignees_url":"https://api.github.com/repos/xanzy/go-gitlab/assignees{/user}","branches_url":"https://api.github.com/repos/xanzy/go-gitlab/branches{/branch}","tags_url":"https://api.github.com/repos/xanzy/go-gitlab/tags","blobs_url":"https://api.github.com/repos/xanzy/go-gitlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xanzy/go-gitlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xanzy/go-gitlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/xanzy/go-gitlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xanzy/go-gitlab/statuses/{sha}","languages_url":"https://api.github.com/repos/xanzy/go-gitlab/languages","stargazers_url":"https://api.github.com/repos/xanzy/go-gitlab/stargazers","contributors_url":"https://api.github.com/repos/xanzy/go-gitlab/contributors","subscribers_url":"https://api.github.com/repos/xanzy/go-gitlab/subscribers","subscription_url":"https://api.github.com/repos/xanzy/go-gitlab/subscription","commits_url":"https://api.github.com/repos/xanzy/go-gitlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/xanzy/go-gitlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/xanzy/go-gitlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/xanzy/go-gitlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/xanzy/go-gitlab/contents/{+path}","compare_url":"https://api.github.com/repos/xanzy/go-gitlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xanzy/go-gitlab/merges","archive_url":"https://api.github.com/repos/xanzy/go-gitlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xanzy/go-gitlab/downloads","issues_url":"https://api.github.com/repos/xanzy/go-gitlab/issues{/number}","pulls_url":"https://api.github.com/repos/xanzy/go-gitlab/pulls{/number}","milestones_url":"https://api.github.com/repos/xanzy/go-gitlab/milestones{/number}","notifications_url":"https://api.github.com/repos/xanzy/go-gitlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xanzy/go-gitlab/labels{/name}","releases_url":"https://api.github.com/repos/xanzy/go-gitlab/releases{/id}","deployments_url":"https://api.github.com/repos/xanzy/go-gitlab/deployments","created_at":"2015-03-29T13:01:43Z","updated_at":"2018-10-11T09:26:58Z","pushed_at":"2018-10-10T08:40:58Z","git_url":"git://github.com/xanzy/go-gitlab.git","ssh_url":"git@github.com:xanzy/go-gitlab.git","clone_url":"https://github.com/xanzy/go-gitlab.git","svn_url":"https://github.com/xanzy/go-gitlab","homepage":null,"size":725,"stargazers_count":416,"watchers_count":416,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":217,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":217,"open_issues":11,"watchers":416,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xanzy/go-gitlab/pulls/481"},"html":{"href":"https://github.com/xanzy/go-gitlab/pull/481"},"issue":{"href":"https://api.github.com/repos/xanzy/go-gitlab/issues/481"},"comments":{"href":"https://api.github.com/repos/xanzy/go-gitlab/issues/481/comments"},"review_comments":{"href":"https://api.github.com/repos/xanzy/go-gitlab/pulls/481/comments"},"review_comment":{"href":"https://api.github.com/repos/xanzy/go-gitlab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xanzy/go-gitlab/pulls/481/commits"},"statuses":{"href":"https://api.github.com/repos/xanzy/go-gitlab/statuses/35b769e4ab485b8a6ee5e5fbfd7996afb175af08"}},"author_association":"NONE"}}
{"actor":{"display_login":"sirlatrom"}}