{"action":"created","comment":{"url":"https://api.github.com/repos/screwdriver-cd/models/pulls/comments/126570826","pull_request_review_id":49067361,"id":126570826,"diff_hunk":"@@ -883,6 +883,88 @@ token.refresh()\n     });\n ```\n \n+### Collection Factory\n+#### Search\n+```js\n+'use strict';\n+const Model = require('screwdriver-models');\n+const factory = Model.CollectionFactory.getInstance({\n+    datastore\n+});\n+const config = {\n+    params: {\n+        userId: 12345\n+    }\n+};\n+\n+factory.list(config).then(collections => {\n+    // Do stuff with list of collections\n+});\n+```\n+\n+| Parameter     | Type   | Description         |\n+| :-------------| :------| :-------------------|\n+| config        | Object | Config object       |\n+| config.params | Object | Fields to search on |\n+\n+#### Create\n+```js\n+factory.create(config).then(model => {\n+    // do stuff with collection model\n+});\n+```\n+\n+| Parameter          | Type   | Required | Description                                              |\n+| :------------------| :------| :--------| :--------------------------------------------------------|\n+| config             | Object | Yes      | Configuration Object                                     |\n+| config.userId      | Number | Yes      | User that this collection belongs to                     |\n+| config.name        | String | Yes      | Collection name                                          |\n+| config.description | String | No       | Collection description                                   |\n+| config.pipelineIds | Array  | No       | List of ids of pipelines associated with this collection |\n+\n+#### Get\n+Get a collection based on unique id of collection.","path":"README.md","position":44,"original_position":44,"commit_id":"152eb81e9aa3cc40dac8f3b44854a2b629853241","original_commit_id":"152eb81e9aa3cc40dac8f3b44854a2b629853241","user":{"login":"ian-fox","id":7689953,"avatar_url":"https://avatars3.githubusercontent.com/u/7689953?v=3","gravatar_id":"","url":"https://api.github.com/users/ian-fox","html_url":"https://github.com/ian-fox","followers_url":"https://api.github.com/users/ian-fox/followers","following_url":"https://api.github.com/users/ian-fox/following{/other_user}","gists_url":"https://api.github.com/users/ian-fox/gists{/gist_id}","starred_url":"https://api.github.com/users/ian-fox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ian-fox/subscriptions","organizations_url":"https://api.github.com/users/ian-fox/orgs","repos_url":"https://api.github.com/users/ian-fox/repos","events_url":"https://api.github.com/users/ian-fox/events{/privacy}","received_events_url":"https://api.github.com/users/ian-fox/received_events","type":"User","site_admin":false},"body":"If userId+name also uniquely determine a collection, those can be passed in here too. See https://github.com/screwdriver-cd/models/pull/178/files#diff-04c6e90faac2675aa89e2176d2eec7d8R552","created_at":"2017-07-11T00:39:58Z","updated_at":"2017-07-11T00:39:58Z","html_url":"https://github.com/screwdriver-cd/models/pull/178#discussion_r126570826","pull_request_url":"https://api.github.com/repos/screwdriver-cd/models/pulls/178","_links":{"self":{"href":"https://api.github.com/repos/screwdriver-cd/models/pulls/comments/126570826"},"html":{"href":"https://github.com/screwdriver-cd/models/pull/178#discussion_r126570826"},"pull_request":{"href":"https://api.github.com/repos/screwdriver-cd/models/pulls/178"}}},"pull_request":{"url":"https://api.github.com/repos/screwdriver-cd/models/pulls/178","id":129743560,"html_url":"https://github.com/screwdriver-cd/models/pull/178","diff_url":"https://github.com/screwdriver-cd/models/pull/178.diff","patch_url":"https://github.com/screwdriver-cd/models/pull/178.patch","issue_url":"https://api.github.com/repos/screwdriver-cd/models/issues/178","number":178,"state":"open","locked":false,"title":"feat(523): Add collection model and factory with tests","user":{"login":"joelseq","id":12389411,"avatar_url":"https://avatars3.githubusercontent.com/u/12389411?v=3","gravatar_id":"","url":"https://api.github.com/users/joelseq","html_url":"https://github.com/joelseq","followers_url":"https://api.github.com/users/joelseq/followers","following_url":"https://api.github.com/users/joelseq/following{/other_user}","gists_url":"https://api.github.com/users/joelseq/gists{/gist_id}","starred_url":"https://api.github.com/users/joelseq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelseq/subscriptions","organizations_url":"https://api.github.com/users/joelseq/orgs","repos_url":"https://api.github.com/users/joelseq/repos","events_url":"https://api.github.com/users/joelseq/events{/privacy}","received_events_url":"https://api.github.com/users/joelseq/received_events","type":"User","site_admin":false},"body":"# Context\r\n\r\nTo be able to perform CRUD operations for collections, we need a CollectionModel and CollectionFactory to interface with the datastore.\r\n\r\n# Objective\r\n\r\nThis PR adds a CollectionModel and CollectionFactory along with some tests\r\n\r\n# References\r\n\r\nissue: [screwdriver-cd/screwdriver#523](https://github.com/screwdriver-cd/screwdriver/issues/523)\r\n\r\nThis is the first pass for the CollectionModel and CollectionFactory so it will change when I start working on adding / updating / removing pipelines from Collections.","created_at":"2017-07-10T18:28:04Z","updated_at":"2017-07-11T00:39:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"47953cbfbea5c313b1a06a2f813b4a82b4757c08","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/screwdriver-cd/models/pulls/178/commits","review_comments_url":"https://api.github.com/repos/screwdriver-cd/models/pulls/178/comments","review_comment_url":"https://api.github.com/repos/screwdriver-cd/models/pulls/comments{/number}","comments_url":"https://api.github.com/repos/screwdriver-cd/models/issues/178/comments","statuses_url":"https://api.github.com/repos/screwdriver-cd/models/statuses/152eb81e9aa3cc40dac8f3b44854a2b629853241","head":{"label":"screwdriver-cd:add-collections","ref":"add-collections","sha":"152eb81e9aa3cc40dac8f3b44854a2b629853241","user":{"login":"screwdriver-cd","id":19417863,"avatar_url":"https://avatars3.githubusercontent.com/u/19417863?v=3","gravatar_id":"","url":"https://api.github.com/users/screwdriver-cd","html_url":"https://github.com/screwdriver-cd","followers_url":"https://api.github.com/users/screwdriver-cd/followers","following_url":"https://api.github.com/users/screwdriver-cd/following{/other_user}","gists_url":"https://api.github.com/users/screwdriver-cd/gists{/gist_id}","starred_url":"https://api.github.com/users/screwdriver-cd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screwdriver-cd/subscriptions","organizations_url":"https://api.github.com/users/screwdriver-cd/orgs","repos_url":"https://api.github.com/users/screwdriver-cd/repos","events_url":"https://api.github.com/users/screwdriver-cd/events{/privacy}","received_events_url":"https://api.github.com/users/screwdriver-cd/received_events","type":"Organization","site_admin":false},"repo":{"id":62759755,"name":"models","full_name":"screwdriver-cd/models","owner":{"login":"screwdriver-cd","id":19417863,"avatar_url":"https://avatars3.githubusercontent.com/u/19417863?v=3","gravatar_id":"","url":"https://api.github.com/users/screwdriver-cd","html_url":"https://github.com/screwdriver-cd","followers_url":"https://api.github.com/users/screwdriver-cd/followers","following_url":"https://api.github.com/users/screwdriver-cd/following{/other_user}","gists_url":"https://api.github.com/users/screwdriver-cd/gists{/gist_id}","starred_url":"https://api.github.com/users/screwdriver-cd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screwdriver-cd/subscriptions","organizations_url":"https://api.github.com/users/screwdriver-cd/orgs","repos_url":"https://api.github.com/users/screwdriver-cd/repos","events_url":"https://api.github.com/users/screwdriver-cd/events{/privacy}","received_events_url":"https://api.github.com/users/screwdriver-cd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/screwdriver-cd/models","description":"Screwdriver Models","fork":false,"url":"https://api.github.com/repos/screwdriver-cd/models","forks_url":"https://api.github.com/repos/screwdriver-cd/models/forks","keys_url":"https://api.github.com/repos/screwdriver-cd/models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/screwdriver-cd/models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/screwdriver-cd/models/teams","hooks_url":"https://api.github.com/repos/screwdriver-cd/models/hooks","issue_events_url":"https://api.github.com/repos/screwdriver-cd/models/issues/events{/number}","events_url":"https://api.github.com/repos/screwdriver-cd/models/events","assignees_url":"https://api.github.com/repos/screwdriver-cd/models/assignees{/user}","branches_url":"https://api.github.com/repos/screwdriver-cd/models/branches{/branch}","tags_url":"https://api.github.com/repos/screwdriver-cd/models/tags","blobs_url":"https://api.github.com/repos/screwdriver-cd/models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/screwdriver-cd/models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/screwdriver-cd/models/git/refs{/sha}","trees_url":"https://api.github.com/repos/screwdriver-cd/models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/screwdriver-cd/models/statuses/{sha}","languages_url":"https://api.github.com/repos/screwdriver-cd/models/languages","stargazers_url":"https://api.github.com/repos/screwdriver-cd/models/stargazers","contributors_url":"https://api.github.com/repos/screwdriver-cd/models/contributors","subscribers_url":"https://api.github.com/repos/screwdriver-cd/models/subscribers","subscription_url":"https://api.github.com/repos/screwdriver-cd/models/subscription","commits_url":"https://api.github.com/repos/screwdriver-cd/models/commits{/sha}","git_commits_url":"https://api.github.com/repos/screwdriver-cd/models/git/commits{/sha}","comments_url":"https://api.github.com/repos/screwdriver-cd/models/comments{/number}","issue_comment_url":"https://api.github.com/repos/screwdriver-cd/models/issues/comments{/number}","contents_url":"https://api.github.com/repos/screwdriver-cd/models/contents/{+path}","compare_url":"https://api.github.com/repos/screwdriver-cd/models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/screwdriver-cd/models/merges","archive_url":"https://api.github.com/repos/screwdriver-cd/models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/screwdriver-cd/models/downloads","issues_url":"https://api.github.com/repos/screwdriver-cd/models/issues{/number}","pulls_url":"https://api.github.com/repos/screwdriver-cd/models/pulls{/number}","milestones_url":"https://api.github.com/repos/screwdriver-cd/models/milestones{/number}","notifications_url":"https://api.github.com/repos/screwdriver-cd/models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/screwdriver-cd/models/labels{/name}","releases_url":"https://api.github.com/repos/screwdriver-cd/models/releases{/id}","deployments_url":"https://api.github.com/repos/screwdriver-cd/models/deployments","created_at":"2016-07-06T23:24:04Z","updated_at":"2017-04-30T08:25:55Z","pushed_at":"2017-07-10T22:13:57Z","git_url":"git://github.com/screwdriver-cd/models.git","ssh_url":"git@github.com:screwdriver-cd/models.git","clone_url":"https://github.com/screwdriver-cd/models.git","svn_url":"https://github.com/screwdriver-cd/models","homepage":"https://www.npmjs.com/package/screwdriver-models","size":392,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":6,"default_branch":"master"}},"base":{"label":"screwdriver-cd:master","ref":"master","sha":"8903884a524e33cf0d80ccd5270143c28a532149","user":{"login":"screwdriver-cd","id":19417863,"avatar_url":"https://avatars3.githubusercontent.com/u/19417863?v=3","gravatar_id":"","url":"https://api.github.com/users/screwdriver-cd","html_url":"https://github.com/screwdriver-cd","followers_url":"https://api.github.com/users/screwdriver-cd/followers","following_url":"https://api.github.com/users/screwdriver-cd/following{/other_user}","gists_url":"https://api.github.com/users/screwdriver-cd/gists{/gist_id}","starred_url":"https://api.github.com/users/screwdriver-cd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screwdriver-cd/subscriptions","organizations_url":"https://api.github.com/users/screwdriver-cd/orgs","repos_url":"https://api.github.com/users/screwdriver-cd/repos","events_url":"https://api.github.com/users/screwdriver-cd/events{/privacy}","received_events_url":"https://api.github.com/users/screwdriver-cd/received_events","type":"Organization","site_admin":false},"repo":{"id":62759755,"name":"models","full_name":"screwdriver-cd/models","owner":{"login":"screwdriver-cd","id":19417863,"avatar_url":"https://avatars3.githubusercontent.com/u/19417863?v=3","gravatar_id":"","url":"https://api.github.com/users/screwdriver-cd","html_url":"https://github.com/screwdriver-cd","followers_url":"https://api.github.com/users/screwdriver-cd/followers","following_url":"https://api.github.com/users/screwdriver-cd/following{/other_user}","gists_url":"https://api.github.com/users/screwdriver-cd/gists{/gist_id}","starred_url":"https://api.github.com/users/screwdriver-cd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screwdriver-cd/subscriptions","organizations_url":"https://api.github.com/users/screwdriver-cd/orgs","repos_url":"https://api.github.com/users/screwdriver-cd/repos","events_url":"https://api.github.com/users/screwdriver-cd/events{/privacy}","received_events_url":"https://api.github.com/users/screwdriver-cd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/screwdriver-cd/models","description":"Screwdriver Models","fork":false,"url":"https://api.github.com/repos/screwdriver-cd/models","forks_url":"https://api.github.com/repos/screwdriver-cd/models/forks","keys_url":"https://api.github.com/repos/screwdriver-cd/models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/screwdriver-cd/models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/screwdriver-cd/models/teams","hooks_url":"https://api.github.com/repos/screwdriver-cd/models/hooks","issue_events_url":"https://api.github.com/repos/screwdriver-cd/models/issues/events{/number}","events_url":"https://api.github.com/repos/screwdriver-cd/models/events","assignees_url":"https://api.github.com/repos/screwdriver-cd/models/assignees{/user}","branches_url":"https://api.github.com/repos/screwdriver-cd/models/branches{/branch}","tags_url":"https://api.github.com/repos/screwdriver-cd/models/tags","blobs_url":"https://api.github.com/repos/screwdriver-cd/models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/screwdriver-cd/models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/screwdriver-cd/models/git/refs{/sha}","trees_url":"https://api.github.com/repos/screwdriver-cd/models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/screwdriver-cd/models/statuses/{sha}","languages_url":"https://api.github.com/repos/screwdriver-cd/models/languages","stargazers_url":"https://api.github.com/repos/screwdriver-cd/models/stargazers","contributors_url":"https://api.github.com/repos/screwdriver-cd/models/contributors","subscribers_url":"https://api.github.com/repos/screwdriver-cd/models/subscribers","subscription_url":"https://api.github.com/repos/screwdriver-cd/models/subscription","commits_url":"https://api.github.com/repos/screwdriver-cd/models/commits{/sha}","git_commits_url":"https://api.github.com/repos/screwdriver-cd/models/git/commits{/sha}","comments_url":"https://api.github.com/repos/screwdriver-cd/models/comments{/number}","issue_comment_url":"https://api.github.com/repos/screwdriver-cd/models/issues/comments{/number}","contents_url":"https://api.github.com/repos/screwdriver-cd/models/contents/{+path}","compare_url":"https://api.github.com/repos/screwdriver-cd/models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/screwdriver-cd/models/merges","archive_url":"https://api.github.com/repos/screwdriver-cd/models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/screwdriver-cd/models/downloads","issues_url":"https://api.github.com/repos/screwdriver-cd/models/issues{/number}","pulls_url":"https://api.github.com/repos/screwdriver-cd/models/pulls{/number}","milestones_url":"https://api.github.com/repos/screwdriver-cd/models/milestones{/number}","notifications_url":"https://api.github.com/repos/screwdriver-cd/models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/screwdriver-cd/models/labels{/name}","releases_url":"https://api.github.com/repos/screwdriver-cd/models/releases{/id}","deployments_url":"https://api.github.com/repos/screwdriver-cd/models/deployments","created_at":"2016-07-06T23:24:04Z","updated_at":"2017-04-30T08:25:55Z","pushed_at":"2017-07-10T22:13:57Z","git_url":"git://github.com/screwdriver-cd/models.git","ssh_url":"git@github.com:screwdriver-cd/models.git","clone_url":"https://github.com/screwdriver-cd/models.git","svn_url":"https://github.com/screwdriver-cd/models","homepage":"https://www.npmjs.com/package/screwdriver-models","size":392,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/screwdriver-cd/models/pulls/178"},"html":{"href":"https://github.com/screwdriver-cd/models/pull/178"},"issue":{"href":"https://api.github.com/repos/screwdriver-cd/models/issues/178"},"comments":{"href":"https://api.github.com/repos/screwdriver-cd/models/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/screwdriver-cd/models/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/screwdriver-cd/models/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/screwdriver-cd/models/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/screwdriver-cd/models/statuses/152eb81e9aa3cc40dac8f3b44854a2b629853241"}}}}
{"actor":{"display_login":"ian-fox"}}