{"action":"created","comment":{"url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls/comments/205887015","pull_request_review_id":141253301,"id":205887015,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTg4NzAxNQ==","diff_hunk":"@@ -407,14 +409,103 @@ JS.class(ClientSuccessClient, {\n \n \t\t\treturn response;\n \t\t},\n+\n+\t\t/**\n+\t\t * Get ClientSuccess product ID based on product name\n+\t\t * @param  {String} productName - Name of the Product\n+\t\t * @return {Integer}            - ID of the Product\n+\t\t */\n+\t\tgetProductID : async function(productName) {\n+\t\t\tconst clientSuccessProducts = await this.hitClientSuccessAPI('GET', 'products');\n+\t\t\tfor (let x = 0; x < clientSuccessProducts.length; x++) {\n+\t\t\t\tif (clientSuccessProducts[x].active === true && clientSuccessProducts[x].name == productName) {\n+\t\t\t\t\treturn clientSuccessProducts[x].id;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tthrow new CustomError({ status : 404, message : 'Product not found' });\n+\t\t},\n+\n+\t\t/**\n+\t\t * Create a new ClientSuccess Product Type\n+\t\t * @param  {String}  name               - Name of the new Product Type\n+\t\t * @param  {Boolean} [recurring = true] - Denotes if Subscription is recurring or not\n+\t\t * @return Promise<Object>              - Resulting ClientSuccess Subscription object\n+\t\t */\n+\t\tcreateProductType : async function({ name = undefined, recurring = true } = {}) {","path":"clientSuccessClient.js","position":49,"original_position":49,"commit_id":"6eee45371a76a77fbac16476ee4bbd490e25c1e2","original_commit_id":"6eee45371a76a77fbac16476ee4bbd490e25c1e2","user":{"login":"juuxstar","id":1746268,"node_id":"MDQ6VXNlcjE3NDYyNjg=","avatar_url":"https://avatars0.githubusercontent.com/u/1746268?v=4","gravatar_id":"","url":"https://api.github.com/users/juuxstar","html_url":"https://github.com/juuxstar","followers_url":"https://api.github.com/users/juuxstar/followers","following_url":"https://api.github.com/users/juuxstar/following{/other_user}","gists_url":"https://api.github.com/users/juuxstar/gists{/gist_id}","starred_url":"https://api.github.com/users/juuxstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juuxstar/subscriptions","organizations_url":"https://api.github.com/users/juuxstar/orgs","repos_url":"https://api.github.com/users/juuxstar/repos","events_url":"https://api.github.com/users/juuxstar/events{/privacy}","received_events_url":"https://api.github.com/users/juuxstar/received_events","type":"User","site_admin":false},"body":"Why is the `name` parameter an option with a default value of undefined when clearly the function requires it.\r\n\r\nI'd change the signature to: `async function(name, { recurring=true })`","created_at":"2018-07-27T20:13:52Z","updated_at":"2018-07-27T20:22:32Z","html_url":"https://github.com/Roadmunk/clientSuccessClient/pull/5#discussion_r205887015","pull_request_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls/5","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls/comments/205887015"},"html":{"href":"https://github.com/Roadmunk/clientSuccessClient/pull/5#discussion_r205887015"},"pull_request":{"href":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls/5","id":204526756,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0NTI2NzU2","html_url":"https://github.com/Roadmunk/clientSuccessClient/pull/5","diff_url":"https://github.com/Roadmunk/clientSuccessClient/pull/5.diff","patch_url":"https://github.com/Roadmunk/clientSuccessClient/pull/5.patch","issue_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/issues/5","number":5,"state":"open","locked":false,"title":"Subscription management","user":{"login":"willmero","id":6343859,"node_id":"MDQ6VXNlcjYzNDM4NTk=","avatar_url":"https://avatars1.githubusercontent.com/u/6343859?v=4","gravatar_id":"","url":"https://api.github.com/users/willmero","html_url":"https://github.com/willmero","followers_url":"https://api.github.com/users/willmero/followers","following_url":"https://api.github.com/users/willmero/following{/other_user}","gists_url":"https://api.github.com/users/willmero/gists{/gist_id}","starred_url":"https://api.github.com/users/willmero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willmero/subscriptions","organizations_url":"https://api.github.com/users/willmero/orgs","repos_url":"https://api.github.com/users/willmero/repos","events_url":"https://api.github.com/users/willmero/events{/privacy}","received_events_url":"https://api.github.com/users/willmero/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-27T20:01:00Z","updated_at":"2018-07-27T20:22:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4dccc6f5879f7500ad9f7070ea4dad082892180f","assignee":{"login":"willmero","id":6343859,"node_id":"MDQ6VXNlcjYzNDM4NTk=","avatar_url":"https://avatars1.githubusercontent.com/u/6343859?v=4","gravatar_id":"","url":"https://api.github.com/users/willmero","html_url":"https://github.com/willmero","followers_url":"https://api.github.com/users/willmero/followers","following_url":"https://api.github.com/users/willmero/following{/other_user}","gists_url":"https://api.github.com/users/willmero/gists{/gist_id}","starred_url":"https://api.github.com/users/willmero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willmero/subscriptions","organizations_url":"https://api.github.com/users/willmero/orgs","repos_url":"https://api.github.com/users/willmero/repos","events_url":"https://api.github.com/users/willmero/events{/privacy}","received_events_url":"https://api.github.com/users/willmero/received_events","type":"User","site_admin":false},"assignees":[{"login":"willmero","id":6343859,"node_id":"MDQ6VXNlcjYzNDM4NTk=","avatar_url":"https://avatars1.githubusercontent.com/u/6343859?v=4","gravatar_id":"","url":"https://api.github.com/users/willmero","html_url":"https://github.com/willmero","followers_url":"https://api.github.com/users/willmero/followers","following_url":"https://api.github.com/users/willmero/following{/other_user}","gists_url":"https://api.github.com/users/willmero/gists{/gist_id}","starred_url":"https://api.github.com/users/willmero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willmero/subscriptions","organizations_url":"https://api.github.com/users/willmero/orgs","repos_url":"https://api.github.com/users/willmero/repos","events_url":"https://api.github.com/users/willmero/events{/privacy}","received_events_url":"https://api.github.com/users/willmero/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"bewmar","id":2381691,"node_id":"MDQ6VXNlcjIzODE2OTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2381691?v=4","gravatar_id":"","url":"https://api.github.com/users/bewmar","html_url":"https://github.com/bewmar","followers_url":"https://api.github.com/users/bewmar/followers","following_url":"https://api.github.com/users/bewmar/following{/other_user}","gists_url":"https://api.github.com/users/bewmar/gists{/gist_id}","starred_url":"https://api.github.com/users/bewmar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bewmar/subscriptions","organizations_url":"https://api.github.com/users/bewmar/orgs","repos_url":"https://api.github.com/users/bewmar/repos","events_url":"https://api.github.com/users/bewmar/events{/privacy}","received_events_url":"https://api.github.com/users/bewmar/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls/5/commits","review_comments_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls/5/comments","review_comment_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/issues/5/comments","statuses_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/statuses/6eee45371a76a77fbac16476ee4bbd490e25c1e2","head":{"label":"Roadmunk:subscription-management","ref":"subscription-management","sha":"6eee45371a76a77fbac16476ee4bbd490e25c1e2","user":{"login":"Roadmunk","id":9951284,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NTEyODQ=","avatar_url":"https://avatars1.githubusercontent.com/u/9951284?v=4","gravatar_id":"","url":"https://api.github.com/users/Roadmunk","html_url":"https://github.com/Roadmunk","followers_url":"https://api.github.com/users/Roadmunk/followers","following_url":"https://api.github.com/users/Roadmunk/following{/other_user}","gists_url":"https://api.github.com/users/Roadmunk/gists{/gist_id}","starred_url":"https://api.github.com/users/Roadmunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Roadmunk/subscriptions","organizations_url":"https://api.github.com/users/Roadmunk/orgs","repos_url":"https://api.github.com/users/Roadmunk/repos","events_url":"https://api.github.com/users/Roadmunk/events{/privacy}","received_events_url":"https://api.github.com/users/Roadmunk/received_events","type":"Organization","site_admin":false},"repo":{"id":132181720,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIxODE3MjA=","name":"clientSuccessClient","full_name":"Roadmunk/clientSuccessClient","owner":{"login":"Roadmunk","id":9951284,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NTEyODQ=","avatar_url":"https://avatars1.githubusercontent.com/u/9951284?v=4","gravatar_id":"","url":"https://api.github.com/users/Roadmunk","html_url":"https://github.com/Roadmunk","followers_url":"https://api.github.com/users/Roadmunk/followers","following_url":"https://api.github.com/users/Roadmunk/following{/other_user}","gists_url":"https://api.github.com/users/Roadmunk/gists{/gist_id}","starred_url":"https://api.github.com/users/Roadmunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Roadmunk/subscriptions","organizations_url":"https://api.github.com/users/Roadmunk/orgs","repos_url":"https://api.github.com/users/Roadmunk/repos","events_url":"https://api.github.com/users/Roadmunk/events{/privacy}","received_events_url":"https://api.github.com/users/Roadmunk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Roadmunk/clientSuccessClient","description":"Client lib for the ClientSuccess API.","fork":false,"url":"https://api.github.com/repos/Roadmunk/clientSuccessClient","forks_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/forks","keys_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/teams","hooks_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/hooks","issue_events_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/issues/events{/number}","events_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/events","assignees_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/assignees{/user}","branches_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/branches{/branch}","tags_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/tags","blobs_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/git/refs{/sha}","trees_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/statuses/{sha}","languages_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/languages","stargazers_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/stargazers","contributors_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/contributors","subscribers_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/subscribers","subscription_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/subscription","commits_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/commits{/sha}","git_commits_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/git/commits{/sha}","comments_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/comments{/number}","issue_comment_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/issues/comments{/number}","contents_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/contents/{+path}","compare_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/merges","archive_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/downloads","issues_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/issues{/number}","pulls_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls{/number}","milestones_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/milestones{/number}","notifications_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/labels{/name}","releases_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/releases{/id}","deployments_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/deployments","created_at":"2018-05-04T19:38:23Z","updated_at":"2018-06-28T18:39:22Z","pushed_at":"2018-07-27T20:01:01Z","git_url":"git://github.com/Roadmunk/clientSuccessClient.git","ssh_url":"git@github.com:Roadmunk/clientSuccessClient.git","clone_url":"https://github.com/Roadmunk/clientSuccessClient.git","svn_url":"https://github.com/Roadmunk/clientSuccessClient","homepage":null,"size":53,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Roadmunk:event-tracking","ref":"event-tracking","sha":"3bedca4e629f5101ab796432a72a850e5f3d236f","user":{"login":"Roadmunk","id":9951284,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NTEyODQ=","avatar_url":"https://avatars1.githubusercontent.com/u/9951284?v=4","gravatar_id":"","url":"https://api.github.com/users/Roadmunk","html_url":"https://github.com/Roadmunk","followers_url":"https://api.github.com/users/Roadmunk/followers","following_url":"https://api.github.com/users/Roadmunk/following{/other_user}","gists_url":"https://api.github.com/users/Roadmunk/gists{/gist_id}","starred_url":"https://api.github.com/users/Roadmunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Roadmunk/subscriptions","organizations_url":"https://api.github.com/users/Roadmunk/orgs","repos_url":"https://api.github.com/users/Roadmunk/repos","events_url":"https://api.github.com/users/Roadmunk/events{/privacy}","received_events_url":"https://api.github.com/users/Roadmunk/received_events","type":"Organization","site_admin":false},"repo":{"id":132181720,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIxODE3MjA=","name":"clientSuccessClient","full_name":"Roadmunk/clientSuccessClient","owner":{"login":"Roadmunk","id":9951284,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NTEyODQ=","avatar_url":"https://avatars1.githubusercontent.com/u/9951284?v=4","gravatar_id":"","url":"https://api.github.com/users/Roadmunk","html_url":"https://github.com/Roadmunk","followers_url":"https://api.github.com/users/Roadmunk/followers","following_url":"https://api.github.com/users/Roadmunk/following{/other_user}","gists_url":"https://api.github.com/users/Roadmunk/gists{/gist_id}","starred_url":"https://api.github.com/users/Roadmunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Roadmunk/subscriptions","organizations_url":"https://api.github.com/users/Roadmunk/orgs","repos_url":"https://api.github.com/users/Roadmunk/repos","events_url":"https://api.github.com/users/Roadmunk/events{/privacy}","received_events_url":"https://api.github.com/users/Roadmunk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Roadmunk/clientSuccessClient","description":"Client lib for the ClientSuccess API.","fork":false,"url":"https://api.github.com/repos/Roadmunk/clientSuccessClient","forks_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/forks","keys_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/teams","hooks_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/hooks","issue_events_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/issues/events{/number}","events_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/events","assignees_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/assignees{/user}","branches_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/branches{/branch}","tags_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/tags","blobs_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/git/refs{/sha}","trees_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/statuses/{sha}","languages_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/languages","stargazers_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/stargazers","contributors_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/contributors","subscribers_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/subscribers","subscription_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/subscription","commits_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/commits{/sha}","git_commits_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/git/commits{/sha}","comments_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/comments{/number}","issue_comment_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/issues/comments{/number}","contents_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/contents/{+path}","compare_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/merges","archive_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/downloads","issues_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/issues{/number}","pulls_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls{/number}","milestones_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/milestones{/number}","notifications_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/labels{/name}","releases_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/releases{/id}","deployments_url":"https://api.github.com/repos/Roadmunk/clientSuccessClient/deployments","created_at":"2018-05-04T19:38:23Z","updated_at":"2018-06-28T18:39:22Z","pushed_at":"2018-07-27T20:01:01Z","git_url":"git://github.com/Roadmunk/clientSuccessClient.git","ssh_url":"git@github.com:Roadmunk/clientSuccessClient.git","clone_url":"https://github.com/Roadmunk/clientSuccessClient.git","svn_url":"https://github.com/Roadmunk/clientSuccessClient","homepage":null,"size":53,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls/5"},"html":{"href":"https://github.com/Roadmunk/clientSuccessClient/pull/5"},"issue":{"href":"https://api.github.com/repos/Roadmunk/clientSuccessClient/issues/5"},"comments":{"href":"https://api.github.com/repos/Roadmunk/clientSuccessClient/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Roadmunk/clientSuccessClient/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/Roadmunk/clientSuccessClient/statuses/6eee45371a76a77fbac16476ee4bbd490e25c1e2"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"juuxstar"}}