{"action":"created","comment":{"url":"https://api.github.com/repos/ONSdigital/zebedee/pulls/comments/141881472","pull_request_review_id":66163105,"id":141881472,"diff_hunk":"@@ -162,4 +166,36 @@ public ApprovalStatus getApprovalStatus() {\n     public void setApprovalStatus(ApprovalStatus approvalStatus) {\n         this.approvalStatus = approvalStatus;\n     }\n+\n+    public Set<CollectionInstance> getInstances() {\n+\n+        if (this.instances == null) {\n+            this.instances = new HashSet<>();\n+        }\n+\n+        return instances;\n+    }\n+\n+    public Optional<CollectionInstance> getInstance(String instanceID) {\n+\n+        if (this.instances == null)\n+            return Optional.empty();\n+\n+        return this.instances.stream()\n+                .filter(i -> i.getId().equals(instanceID)).findFirst();\n+    }\n+\n+    public void addInstance(CollectionInstance instance) {\n+        if (this.instances == null)\n+            this.instances = new HashSet<>();","path":"zebedee-cms/src/main/java/com/github/onsdigital/zebedee/json/CollectionDescription.java","position":45,"original_position":45,"commit_id":"a2318a8bb62e6d46a37a7a092aed1f83ed1be01e","original_commit_id":"a2318a8bb62e6d46a37a7a092aed1f83ed1be01e","user":{"login":"daiLlew","id":14196957,"avatar_url":"https://avatars3.githubusercontent.com/u/14196957?v=4","gravatar_id":"","url":"https://api.github.com/users/daiLlew","html_url":"https://github.com/daiLlew","followers_url":"https://api.github.com/users/daiLlew/followers","following_url":"https://api.github.com/users/daiLlew/following{/other_user}","gists_url":"https://api.github.com/users/daiLlew/gists{/gist_id}","starred_url":"https://api.github.com/users/daiLlew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daiLlew/subscriptions","organizations_url":"https://api.github.com/users/daiLlew/orgs","repos_url":"https://api.github.com/users/daiLlew/repos","events_url":"https://api.github.com/users/daiLlew/events{/privacy}","received_events_url":"https://api.github.com/users/daiLlew/received_events","type":"User","site_admin":false},"body":"add brackets around if the clause or move on to same line.","created_at":"2017-09-29T14:24:59Z","updated_at":"2017-09-29T14:26:25Z","html_url":"https://github.com/ONSdigital/zebedee/pull/106#discussion_r141881472","pull_request_url":"https://api.github.com/repos/ONSdigital/zebedee/pulls/106","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/zebedee/pulls/comments/141881472"},"html":{"href":"https://github.com/ONSdigital/zebedee/pull/106#discussion_r141881472"},"pull_request":{"href":"https://api.github.com/repos/ONSdigital/zebedee/pulls/106"}}},"pull_request":{"url":"https://api.github.com/repos/ONSdigital/zebedee/pulls/106","id":143621447,"html_url":"https://github.com/ONSdigital/zebedee/pull/106","diff_url":"https://github.com/ONSdigital/zebedee/pull/106.diff","patch_url":"https://github.com/ONSdigital/zebedee/pull/106.patch","issue_url":"https://api.github.com/repos/ONSdigital/zebedee/issues/106","number":106,"state":"open","locked":false,"title":"Add HTTP PUT and DELETE endpoint for adding instances to a collection.","user":{"login":"CarlHembrough","id":1786012,"avatar_url":"https://avatars0.githubusercontent.com/u/1786012?v=4","gravatar_id":"","url":"https://api.github.com/users/CarlHembrough","html_url":"https://github.com/CarlHembrough","followers_url":"https://api.github.com/users/CarlHembrough/followers","following_url":"https://api.github.com/users/CarlHembrough/following{/other_user}","gists_url":"https://api.github.com/users/CarlHembrough/gists{/gist_id}","starred_url":"https://api.github.com/users/CarlHembrough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarlHembrough/subscriptions","organizations_url":"https://api.github.com/users/CarlHembrough/orgs","repos_url":"https://api.github.com/users/CarlHembrough/repos","events_url":"https://api.github.com/users/CarlHembrough/events{/privacy}","received_events_url":"https://api.github.com/users/CarlHembrough/received_events","type":"User","site_admin":false},"body":"### What\r\n\r\nAdd HTTP PUT and DELETE endpoint for adding instances to a collection.\r\n\r\nWhen an instance is added to a collection Zebedee will call the dataset API to retrieve instance data. It calls both the instance endpoint and dataset endpoint on the dataset API. It expects the edition and version fields to be populated on the instance.\r\n\r\n### How to review\r\n\r\nReview code changes\r\n\r\n### Who can review\r\n\r\nAnyone\r\n","created_at":"2017-09-28T11:21:42Z","updated_at":"2017-09-29T14:26:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f7d982913156b6c15f2a7bdada343ad04379bce","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ONSdigital/zebedee/pulls/106/commits","review_comments_url":"https://api.github.com/repos/ONSdigital/zebedee/pulls/106/comments","review_comment_url":"https://api.github.com/repos/ONSdigital/zebedee/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ONSdigital/zebedee/issues/106/comments","statuses_url":"https://api.github.com/repos/ONSdigital/zebedee/statuses/a2318a8bb62e6d46a37a7a092aed1f83ed1be01e","head":{"label":"ONSdigital:feature/collection-instances","ref":"feature/collection-instances","sha":"a2318a8bb62e6d46a37a7a092aed1f83ed1be01e","user":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":31659554,"name":"zebedee","full_name":"ONSdigital/zebedee","owner":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/zebedee","description":"Simple CMS back-end","fork":false,"url":"https://api.github.com/repos/ONSdigital/zebedee","forks_url":"https://api.github.com/repos/ONSdigital/zebedee/forks","keys_url":"https://api.github.com/repos/ONSdigital/zebedee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/zebedee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/zebedee/teams","hooks_url":"https://api.github.com/repos/ONSdigital/zebedee/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/zebedee/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/zebedee/events","assignees_url":"https://api.github.com/repos/ONSdigital/zebedee/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/zebedee/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/zebedee/tags","blobs_url":"https://api.github.com/repos/ONSdigital/zebedee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/zebedee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/zebedee/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/zebedee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/zebedee/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/zebedee/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/zebedee/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/zebedee/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/zebedee/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/zebedee/subscription","commits_url":"https://api.github.com/repos/ONSdigital/zebedee/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/zebedee/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/zebedee/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/zebedee/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/zebedee/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/zebedee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/zebedee/merges","archive_url":"https://api.github.com/repos/ONSdigital/zebedee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/zebedee/downloads","issues_url":"https://api.github.com/repos/ONSdigital/zebedee/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/zebedee/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/zebedee/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/zebedee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/zebedee/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/zebedee/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/zebedee/deployments","created_at":"2015-03-04T13:56:34Z","updated_at":"2016-10-26T10:47:19Z","pushed_at":"2017-09-28T11:21:43Z","git_url":"git://github.com/ONSdigital/zebedee.git","ssh_url":"git@github.com:ONSdigital/zebedee.git","clone_url":"https://github.com/ONSdigital/zebedee.git","svn_url":"https://github.com/ONSdigital/zebedee","homepage":null,"size":22171,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"develop"}},"base":{"label":"ONSdigital:cmd-develop","ref":"cmd-develop","sha":"20b3422fe8bba945d2e528ec784c82137a34ff49","user":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":31659554,"name":"zebedee","full_name":"ONSdigital/zebedee","owner":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/zebedee","description":"Simple CMS back-end","fork":false,"url":"https://api.github.com/repos/ONSdigital/zebedee","forks_url":"https://api.github.com/repos/ONSdigital/zebedee/forks","keys_url":"https://api.github.com/repos/ONSdigital/zebedee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/zebedee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/zebedee/teams","hooks_url":"https://api.github.com/repos/ONSdigital/zebedee/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/zebedee/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/zebedee/events","assignees_url":"https://api.github.com/repos/ONSdigital/zebedee/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/zebedee/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/zebedee/tags","blobs_url":"https://api.github.com/repos/ONSdigital/zebedee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/zebedee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/zebedee/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/zebedee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/zebedee/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/zebedee/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/zebedee/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/zebedee/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/zebedee/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/zebedee/subscription","commits_url":"https://api.github.com/repos/ONSdigital/zebedee/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/zebedee/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/zebedee/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/zebedee/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/zebedee/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/zebedee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/zebedee/merges","archive_url":"https://api.github.com/repos/ONSdigital/zebedee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/zebedee/downloads","issues_url":"https://api.github.com/repos/ONSdigital/zebedee/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/zebedee/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/zebedee/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/zebedee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/zebedee/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/zebedee/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/zebedee/deployments","created_at":"2015-03-04T13:56:34Z","updated_at":"2016-10-26T10:47:19Z","pushed_at":"2017-09-28T11:21:43Z","git_url":"git://github.com/ONSdigital/zebedee.git","ssh_url":"git@github.com:ONSdigital/zebedee.git","clone_url":"https://github.com/ONSdigital/zebedee.git","svn_url":"https://github.com/ONSdigital/zebedee","homepage":null,"size":22171,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/zebedee/pulls/106"},"html":{"href":"https://github.com/ONSdigital/zebedee/pull/106"},"issue":{"href":"https://api.github.com/repos/ONSdigital/zebedee/issues/106"},"comments":{"href":"https://api.github.com/repos/ONSdigital/zebedee/issues/106/comments"},"review_comments":{"href":"https://api.github.com/repos/ONSdigital/zebedee/pulls/106/comments"},"review_comment":{"href":"https://api.github.com/repos/ONSdigital/zebedee/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ONSdigital/zebedee/pulls/106/commits"},"statuses":{"href":"https://api.github.com/repos/ONSdigital/zebedee/statuses/a2318a8bb62e6d46a37a7a092aed1f83ed1be01e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"daiLlew"}}