{"action":"created","comment":{"url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/comments/69218473","id":69218473,"diff_hunk":"@@ -101,29 +107,99 @@ var Collection = function(collection, config) {\n     return _this;\n   }\n \n-  this.predict = function(data) {\n+  this.predict = function(data, config) {\n     _this.promise_chain = _this.promise_chain.then(function() {\n       var deferred = Promise.pending();\n+      var config = addKeywordArguments(config || {}, _this.baseConfig);\n       if (typeof data === 'undefined') {\n         var msg = \"Must submit data in string format 'data'. You can also submit multiple in a list.\";\n         deferred.reject(new Error(msg));\n       }\n \n       var batch = (typeof data !== 'undefined' && typeof data !== 'string') ? true : false;\n \n-      makeRequest('/custom/predict', this.version, data, batch, _this.baseConfig).then(function(res) {\n+      makeRequest('/custom/predict', this.version, data, batch, config).then(function(res) {\n         deferred.resolve(res);\n       });\n       return deferred.promise;\n     });\n     return _this;\n   };\n \n-  this.clear = function() {\n+  this.clear = function(config) {\n     _this.promise_chain = _this.promise_chain.then(function() {\n       var deferred = Promise.pending();\n+      var config = addKeywordArguments(config || {}, _this.baseConfig);\n+      makeRequest('/custom/clear_collection', this.version, {}, false, config).then(function(res) {\n+          deferred.resolve(res);\n+      });\n+      return deferred.promise;\n+    });\n+    return _this;\n+  }\n+\n+  this.rename = function(name, config)  {\n+    _this.promise_chain = _this.promise_chain.then(function() {\n+      var deferred = Promise.pending();\n+\n+      var config = addKeywordArguments(config || {}, _this.baseConfig);\n+      config['name'] = name;\n+\n+      makeRequest('/custom/rename', this.version, {}, false, config).then(function(res) {\n+          _this.baseConfig['collection'] = name;\n+          _this.collection = name;\n+          deferred.resolve(res);\n+      });\n+      return deferred.promise;\n+    });\n+    return _this;\n+  }\n+\n+  this.register = function(config)  {\n+    _this.promise_chain = _this.promise_chain.then(function() {\n+      var deferred = Promise.pending();\n+      var config = addKeywordArguments(config || {}, _this.baseConfig);\n+\n+      makeRequest('/custom/register', this.version, {}, false, config).then(function(res) {\n+          deferred.resolve(res);\n+      });\n+      return deferred.promise;\n+    });\n+    return _this;\n+  }\n+\n+  this.deregister = function(config)  {\n+    _this.promise_chain = _this.promise_chain.then(function() {\n+      var deferred = Promise.pending();\n+      var config = addKeywordArguments(config || {}, _this.baseConfig);\n+\n+      makeRequest('/custom/deregister', this.version, {}, false, config).then(function(res) {\n+          deferred.resolve(res);\n+      });\n+      return deferred.promise;\n+    });\n+    return _this;\n+  }\n+\n+  this.authorize = function(email, config)  {\n+    _this.promise_chain = _this.promise_chain.then(function() {\n+      var deferred = Promise.pending();\n+      var config = addKeywordArguments(config || {}, _this.baseConfig);\n+\n+      makeRequest('/custom/authorize', this.version, {}, false, config).then(function(res) {","path":"lib/custom.js","position":178,"original_position":178,"commit_id":"9b55dd7463a0421f033dd3a556ba2fbad2c82550","original_commit_id":"9b55dd7463a0421f033dd3a556ba2fbad2c82550","user":{"login":"madisonmay","id":2645393,"avatar_url":"https://avatars.githubusercontent.com/u/2645393?v=3","gravatar_id":"","url":"https://api.github.com/users/madisonmay","html_url":"https://github.com/madisonmay","followers_url":"https://api.github.com/users/madisonmay/followers","following_url":"https://api.github.com/users/madisonmay/following{/other_user}","gists_url":"https://api.github.com/users/madisonmay/gists{/gist_id}","starred_url":"https://api.github.com/users/madisonmay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madisonmay/subscriptions","organizations_url":"https://api.github.com/users/madisonmay/orgs","repos_url":"https://api.github.com/users/madisonmay/repos","events_url":"https://api.github.com/users/madisonmay/events{/privacy}","received_events_url":"https://api.github.com/users/madisonmay/received_events","type":"User","site_admin":false},"body":"yeah but I wouldn't have noticed this until the test failed. thanks for the catch.","created_at":"2016-06-30T22:02:47Z","updated_at":"2016-06-30T22:02:47Z","html_url":"https://github.com/IndicoDataSolutions/IndicoIo-node/pull/116#discussion_r69218473","pull_request_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/116","_links":{"self":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/comments/69218473"},"html":{"href":"https://github.com/IndicoDataSolutions/IndicoIo-node/pull/116#discussion_r69218473"},"pull_request":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/116"}}},"pull_request":{"url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/116","id":75887037,"html_url":"https://github.com/IndicoDataSolutions/IndicoIo-node/pull/116","diff_url":"https://github.com/IndicoDataSolutions/IndicoIo-node/pull/116.diff","patch_url":"https://github.com/IndicoDataSolutions/IndicoIo-node/pull/116.patch","issue_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/116","number":116,"state":"open","locked":false,"title":"WIP: custom collections permissioning support","user":{"login":"madisonmay","id":2645393,"avatar_url":"https://avatars.githubusercontent.com/u/2645393?v=3","gravatar_id":"","url":"https://api.github.com/users/madisonmay","html_url":"https://github.com/madisonmay","followers_url":"https://api.github.com/users/madisonmay/followers","following_url":"https://api.github.com/users/madisonmay/following{/other_user}","gists_url":"https://api.github.com/users/madisonmay/gists{/gist_id}","starred_url":"https://api.github.com/users/madisonmay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madisonmay/subscriptions","organizations_url":"https://api.github.com/users/madisonmay/orgs","repos_url":"https://api.github.com/users/madisonmay/repos","events_url":"https://api.github.com/users/madisonmay/events{/privacy}","received_events_url":"https://api.github.com/users/madisonmay/received_events","type":"User","site_admin":false},"body":"<!--- For the author to fill in -->\r\nReviewers: \r\n----------\r\n<!--- Check yourself off the list after review -->\r\n- [ ] @mention\r\n\r\nWhat's the purpose of the PR?\r\n-----------------------------\r\n<!--- Does it resolve an issue?  Does it add a feature?  Is it a refactor? -->\r\n<!--- Trello ticket links? Design document links?-->\r\n<!--- List out intended functionality. -->\r\n\r\nDescription of changes\r\n----------------------\r\n<!--- What code was changed? Why? -->\r\n\r\nNotes to reviewers\r\n------------------\r\n<!--- Is there anything in particular you want reviewers to check for? -->\r\n\r\n\r\n<!--- For the reviewer -->\r\nKeep in mind while reviewing code:\r\n----------------------------------\r\n- Is relevant code tested?\r\n- Are added functions/methods documented?\r\n- Separation of concerns (SOC)\r\n- Don't repeat yourself (DRY) \r\n- Limit the number of positional arguments\r\n- Is function/method length reasonable?\r\n- Can code be broken down into smaller components?\r\n- Where do added functions/methods belong?\r\n- Are variable names descriptive?\r\n- Are errors handled appropriately?\r\n- Can logic be simplified?\r\n- Does the code make sense in context? (expand the diff)\r\n\r\n…ument","created_at":"2016-06-30T20:41:15Z","updated_at":"2016-06-30T22:02:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99f94df109842c88724108f6f5c5e21329f2f0d9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/116/commits","review_comments_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/116/comments","review_comment_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/116/comments","statuses_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/statuses/9b55dd7463a0421f033dd3a556ba2fbad2c82550","head":{"label":"IndicoDataSolutions:madison/collection-permissioning","ref":"madison/collection-permissioning","sha":"9b55dd7463a0421f033dd3a556ba2fbad2c82550","user":{"login":"IndicoDataSolutions","id":6751793,"avatar_url":"https://avatars.githubusercontent.com/u/6751793?v=3","gravatar_id":"","url":"https://api.github.com/users/IndicoDataSolutions","html_url":"https://github.com/IndicoDataSolutions","followers_url":"https://api.github.com/users/IndicoDataSolutions/followers","following_url":"https://api.github.com/users/IndicoDataSolutions/following{/other_user}","gists_url":"https://api.github.com/users/IndicoDataSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/IndicoDataSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IndicoDataSolutions/subscriptions","organizations_url":"https://api.github.com/users/IndicoDataSolutions/orgs","repos_url":"https://api.github.com/users/IndicoDataSolutions/repos","events_url":"https://api.github.com/users/IndicoDataSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/IndicoDataSolutions/received_events","type":"Organization","site_admin":false},"repo":{"id":20789554,"name":"IndicoIo-node","full_name":"IndicoDataSolutions/IndicoIo-node","owner":{"login":"IndicoDataSolutions","id":6751793,"avatar_url":"https://avatars.githubusercontent.com/u/6751793?v=3","gravatar_id":"","url":"https://api.github.com/users/IndicoDataSolutions","html_url":"https://github.com/IndicoDataSolutions","followers_url":"https://api.github.com/users/IndicoDataSolutions/followers","following_url":"https://api.github.com/users/IndicoDataSolutions/following{/other_user}","gists_url":"https://api.github.com/users/IndicoDataSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/IndicoDataSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IndicoDataSolutions/subscriptions","organizations_url":"https://api.github.com/users/IndicoDataSolutions/orgs","repos_url":"https://api.github.com/users/IndicoDataSolutions/repos","events_url":"https://api.github.com/users/IndicoDataSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/IndicoDataSolutions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IndicoDataSolutions/IndicoIo-node","description":"A Node.js wrapper for the Indico API","fork":false,"url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node","forks_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/forks","keys_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/teams","hooks_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/hooks","issue_events_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/events{/number}","events_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/events","assignees_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/assignees{/user}","branches_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/branches{/branch}","tags_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/tags","blobs_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/statuses/{sha}","languages_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/languages","stargazers_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/stargazers","contributors_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/contributors","subscribers_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/subscribers","subscription_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/subscription","commits_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/contents/{+path}","compare_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/merges","archive_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/downloads","issues_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues{/number}","pulls_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls{/number}","milestones_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/milestones{/number}","notifications_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/labels{/name}","releases_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/releases{/id}","deployments_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/deployments","created_at":"2014-06-13T02:23:12Z","updated_at":"2016-05-26T11:21:28Z","pushed_at":"2016-06-30T21:27:39Z","git_url":"git://github.com/IndicoDataSolutions/IndicoIo-node.git","ssh_url":"git@github.com:IndicoDataSolutions/IndicoIo-node.git","clone_url":"https://github.com/IndicoDataSolutions/IndicoIo-node.git","svn_url":"https://github.com/IndicoDataSolutions/IndicoIo-node","homepage":"","size":305,"stargazers_count":29,"watchers_count":29,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":29,"default_branch":"master"}},"base":{"label":"IndicoDataSolutions:master","ref":"master","sha":"04f350e6a675c9a09709fef76c65a6bbd8b74fd6","user":{"login":"IndicoDataSolutions","id":6751793,"avatar_url":"https://avatars.githubusercontent.com/u/6751793?v=3","gravatar_id":"","url":"https://api.github.com/users/IndicoDataSolutions","html_url":"https://github.com/IndicoDataSolutions","followers_url":"https://api.github.com/users/IndicoDataSolutions/followers","following_url":"https://api.github.com/users/IndicoDataSolutions/following{/other_user}","gists_url":"https://api.github.com/users/IndicoDataSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/IndicoDataSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IndicoDataSolutions/subscriptions","organizations_url":"https://api.github.com/users/IndicoDataSolutions/orgs","repos_url":"https://api.github.com/users/IndicoDataSolutions/repos","events_url":"https://api.github.com/users/IndicoDataSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/IndicoDataSolutions/received_events","type":"Organization","site_admin":false},"repo":{"id":20789554,"name":"IndicoIo-node","full_name":"IndicoDataSolutions/IndicoIo-node","owner":{"login":"IndicoDataSolutions","id":6751793,"avatar_url":"https://avatars.githubusercontent.com/u/6751793?v=3","gravatar_id":"","url":"https://api.github.com/users/IndicoDataSolutions","html_url":"https://github.com/IndicoDataSolutions","followers_url":"https://api.github.com/users/IndicoDataSolutions/followers","following_url":"https://api.github.com/users/IndicoDataSolutions/following{/other_user}","gists_url":"https://api.github.com/users/IndicoDataSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/IndicoDataSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IndicoDataSolutions/subscriptions","organizations_url":"https://api.github.com/users/IndicoDataSolutions/orgs","repos_url":"https://api.github.com/users/IndicoDataSolutions/repos","events_url":"https://api.github.com/users/IndicoDataSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/IndicoDataSolutions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IndicoDataSolutions/IndicoIo-node","description":"A Node.js wrapper for the Indico API","fork":false,"url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node","forks_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/forks","keys_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/teams","hooks_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/hooks","issue_events_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/events{/number}","events_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/events","assignees_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/assignees{/user}","branches_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/branches{/branch}","tags_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/tags","blobs_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/statuses/{sha}","languages_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/languages","stargazers_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/stargazers","contributors_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/contributors","subscribers_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/subscribers","subscription_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/subscription","commits_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/contents/{+path}","compare_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/merges","archive_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/downloads","issues_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues{/number}","pulls_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls{/number}","milestones_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/milestones{/number}","notifications_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/labels{/name}","releases_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/releases{/id}","deployments_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/deployments","created_at":"2014-06-13T02:23:12Z","updated_at":"2016-05-26T11:21:28Z","pushed_at":"2016-06-30T21:27:39Z","git_url":"git://github.com/IndicoDataSolutions/IndicoIo-node.git","ssh_url":"git@github.com:IndicoDataSolutions/IndicoIo-node.git","clone_url":"https://github.com/IndicoDataSolutions/IndicoIo-node.git","svn_url":"https://github.com/IndicoDataSolutions/IndicoIo-node","homepage":"","size":305,"stargazers_count":29,"watchers_count":29,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/116"},"html":{"href":"https://github.com/IndicoDataSolutions/IndicoIo-node/pull/116"},"issue":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/116"},"comments":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/116/comments"},"review_comments":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/116/comments"},"review_comment":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/116/commits"},"statuses":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/statuses/9b55dd7463a0421f033dd3a556ba2fbad2c82550"}}}}
{"actor":{"display_login":"madisonmay"}}