{"action":"created","comment":{"url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls/comments/174556234","pull_request_review_id":103934987,"id":174556234,"diff_hunk":"@@ -77,153 +81,182 @@ export default class OneSphere {\n \n   // users\n \n-  getUsers() {\n-    return fetcher(`${this.host}/rest/users`, { headers: this.headers });\n+  getUsers(args) {\n+    const params = args ? getUrlParams(args) : '';","path":"src/index.js","position":22,"original_position":22,"commit_id":"6383c025eb4b8949dc95c1d5d9abb5b599533295","original_commit_id":"6383c025eb4b8949dc95c1d5d9abb5b599533295","user":{"login":"karatechops","id":5983843,"avatar_url":"https://avatars1.githubusercontent.com/u/5983843?v=4","gravatar_id":"","url":"https://api.github.com/users/karatechops","html_url":"https://github.com/karatechops","followers_url":"https://api.github.com/users/karatechops/followers","following_url":"https://api.github.com/users/karatechops/following{/other_user}","gists_url":"https://api.github.com/users/karatechops/gists{/gist_id}","starred_url":"https://api.github.com/users/karatechops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karatechops/subscriptions","organizations_url":"https://api.github.com/users/karatechops/orgs","repos_url":"https://api.github.com/users/karatechops/repos","events_url":"https://api.github.com/users/karatechops/events{/privacy}","received_events_url":"https://api.github.com/users/karatechops/received_events","type":"User","site_admin":false},"body":"Lets DRY this up a bit, we shouldn't be using the same ternary over and over. How about a `handleArgs` method that has the ternary? This way if we every want to handle defining the `params` differently we only need to change one block. Let me know if that doesn't make sense.","created_at":"2018-03-14T18:02:18Z","updated_at":"2018-03-14T18:02:18Z","html_url":"https://github.com/HewlettPackard/hpe-onesphere-js/pull/4#discussion_r174556234","pull_request_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls/4","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls/comments/174556234"},"html":{"href":"https://github.com/HewlettPackard/hpe-onesphere-js/pull/4#discussion_r174556234"},"pull_request":{"href":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls/4","id":173116824,"html_url":"https://github.com/HewlettPackard/hpe-onesphere-js/pull/4","diff_url":"https://github.com/HewlettPackard/hpe-onesphere-js/pull/4.diff","patch_url":"https://github.com/HewlettPackard/hpe-onesphere-js/pull/4.patch","issue_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/issues/4","number":4,"state":"open","locked":false,"title":"Adding optional args for every methods","user":{"login":"portepa","id":6834375,"avatar_url":"https://avatars2.githubusercontent.com/u/6834375?v=4","gravatar_id":"","url":"https://api.github.com/users/portepa","html_url":"https://github.com/portepa","followers_url":"https://api.github.com/users/portepa/followers","following_url":"https://api.github.com/users/portepa/following{/other_user}","gists_url":"https://api.github.com/users/portepa/gists{/gist_id}","starred_url":"https://api.github.com/users/portepa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portepa/subscriptions","organizations_url":"https://api.github.com/users/portepa/orgs","repos_url":"https://api.github.com/users/portepa/repos","events_url":"https://api.github.com/users/portepa/events{/privacy}","received_events_url":"https://api.github.com/users/portepa/received_events","type":"User","site_admin":false},"body":"I've added args for every function. I'm not sure this is the best way to handle the requests. However the API documentation does not state in all cases if there's query parameter that can be passed. Having it on every function as the last and optional parameter seemed ok to me.\r\n\r\nIf you have any remarks on this I'll update the code regarding those.","created_at":"2018-03-06T10:31:46Z","updated_at":"2018-03-14T18:02:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"163d900fd1569fa6451c77fbb7d2a61870906b76","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls/4/commits","review_comments_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls/4/comments","review_comment_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/issues/4/comments","statuses_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/statuses/6383c025eb4b8949dc95c1d5d9abb5b599533295","head":{"label":"portepa:master","ref":"master","sha":"6383c025eb4b8949dc95c1d5d9abb5b599533295","user":{"login":"portepa","id":6834375,"avatar_url":"https://avatars2.githubusercontent.com/u/6834375?v=4","gravatar_id":"","url":"https://api.github.com/users/portepa","html_url":"https://github.com/portepa","followers_url":"https://api.github.com/users/portepa/followers","following_url":"https://api.github.com/users/portepa/following{/other_user}","gists_url":"https://api.github.com/users/portepa/gists{/gist_id}","starred_url":"https://api.github.com/users/portepa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portepa/subscriptions","organizations_url":"https://api.github.com/users/portepa/orgs","repos_url":"https://api.github.com/users/portepa/repos","events_url":"https://api.github.com/users/portepa/events{/privacy}","received_events_url":"https://api.github.com/users/portepa/received_events","type":"User","site_admin":false},"repo":{"id":123557733,"name":"hpe-onesphere-js","full_name":"portepa/hpe-onesphere-js","owner":{"login":"portepa","id":6834375,"avatar_url":"https://avatars2.githubusercontent.com/u/6834375?v=4","gravatar_id":"","url":"https://api.github.com/users/portepa","html_url":"https://github.com/portepa","followers_url":"https://api.github.com/users/portepa/followers","following_url":"https://api.github.com/users/portepa/following{/other_user}","gists_url":"https://api.github.com/users/portepa/gists{/gist_id}","starred_url":"https://api.github.com/users/portepa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portepa/subscriptions","organizations_url":"https://api.github.com/users/portepa/orgs","repos_url":"https://api.github.com/users/portepa/repos","events_url":"https://api.github.com/users/portepa/events{/privacy}","received_events_url":"https://api.github.com/users/portepa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/portepa/hpe-onesphere-js","description":null,"fork":true,"url":"https://api.github.com/repos/portepa/hpe-onesphere-js","forks_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/forks","keys_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/teams","hooks_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/hooks","issue_events_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/issues/events{/number}","events_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/events","assignees_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/assignees{/user}","branches_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/branches{/branch}","tags_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/tags","blobs_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/statuses/{sha}","languages_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/languages","stargazers_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/stargazers","contributors_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/contributors","subscribers_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/subscribers","subscription_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/subscription","commits_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/contents/{+path}","compare_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/merges","archive_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/downloads","issues_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/issues{/number}","pulls_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/pulls{/number}","milestones_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/milestones{/number}","notifications_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/labels{/name}","releases_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/releases{/id}","deployments_url":"https://api.github.com/repos/portepa/hpe-onesphere-js/deployments","created_at":"2018-03-02T09:14:35Z","updated_at":"2018-03-02T09:14:37Z","pushed_at":"2018-03-12T12:00:27Z","git_url":"git://github.com/portepa/hpe-onesphere-js.git","ssh_url":"git@github.com:portepa/hpe-onesphere-js.git","clone_url":"https://github.com/portepa/hpe-onesphere-js.git","svn_url":"https://github.com/portepa/hpe-onesphere-js","homepage":null,"size":312,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"HewlettPackard:master","ref":"master","sha":"1ca6af5ccf23b572abe44d5ba4679f57a6fe2013","user":{"login":"HewlettPackard","id":6004705,"avatar_url":"https://avatars0.githubusercontent.com/u/6004705?v=4","gravatar_id":"","url":"https://api.github.com/users/HewlettPackard","html_url":"https://github.com/HewlettPackard","followers_url":"https://api.github.com/users/HewlettPackard/followers","following_url":"https://api.github.com/users/HewlettPackard/following{/other_user}","gists_url":"https://api.github.com/users/HewlettPackard/gists{/gist_id}","starred_url":"https://api.github.com/users/HewlettPackard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HewlettPackard/subscriptions","organizations_url":"https://api.github.com/users/HewlettPackard/orgs","repos_url":"https://api.github.com/users/HewlettPackard/repos","events_url":"https://api.github.com/users/HewlettPackard/events{/privacy}","received_events_url":"https://api.github.com/users/HewlettPackard/received_events","type":"Organization","site_admin":false},"repo":{"id":113074031,"name":"hpe-onesphere-js","full_name":"HewlettPackard/hpe-onesphere-js","owner":{"login":"HewlettPackard","id":6004705,"avatar_url":"https://avatars0.githubusercontent.com/u/6004705?v=4","gravatar_id":"","url":"https://api.github.com/users/HewlettPackard","html_url":"https://github.com/HewlettPackard","followers_url":"https://api.github.com/users/HewlettPackard/followers","following_url":"https://api.github.com/users/HewlettPackard/following{/other_user}","gists_url":"https://api.github.com/users/HewlettPackard/gists{/gist_id}","starred_url":"https://api.github.com/users/HewlettPackard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HewlettPackard/subscriptions","organizations_url":"https://api.github.com/users/HewlettPackard/orgs","repos_url":"https://api.github.com/users/HewlettPackard/repos","events_url":"https://api.github.com/users/HewlettPackard/events{/privacy}","received_events_url":"https://api.github.com/users/HewlettPackard/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HewlettPackard/hpe-onesphere-js","description":null,"fork":false,"url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js","forks_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/forks","keys_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/teams","hooks_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/hooks","issue_events_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/issues/events{/number}","events_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/events","assignees_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/assignees{/user}","branches_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/branches{/branch}","tags_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/tags","blobs_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/statuses/{sha}","languages_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/languages","stargazers_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/stargazers","contributors_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/contributors","subscribers_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/subscribers","subscription_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/subscription","commits_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/contents/{+path}","compare_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/merges","archive_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/downloads","issues_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/issues{/number}","pulls_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls{/number}","milestones_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/milestones{/number}","notifications_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/labels{/name}","releases_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/releases{/id}","deployments_url":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/deployments","created_at":"2017-12-04T17:35:29Z","updated_at":"2018-03-09T13:10:52Z","pushed_at":"2018-03-12T12:00:29Z","git_url":"git://github.com/HewlettPackard/hpe-onesphere-js.git","ssh_url":"git@github.com:HewlettPackard/hpe-onesphere-js.git","clone_url":"https://github.com/HewlettPackard/hpe-onesphere-js.git","svn_url":"https://github.com/HewlettPackard/hpe-onesphere-js","homepage":null,"size":307,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls/4"},"html":{"href":"https://github.com/HewlettPackard/hpe-onesphere-js/pull/4"},"issue":{"href":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/issues/4"},"comments":{"href":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/HewlettPackard/hpe-onesphere-js/statuses/6383c025eb4b8949dc95c1d5d9abb5b599533295"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"karatechops"}}