{"action":"opened","number":171,"pull_request":{"url":"https://api.github.com/repos/adimichele/hubspot-ruby/pulls/171","id":240250895,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwMjUwODk1","html_url":"https://github.com/adimichele/hubspot-ruby/pull/171","diff_url":"https://github.com/adimichele/hubspot-ruby/pull/171.diff","patch_url":"https://github.com/adimichele/hubspot-ruby/pull/171.patch","issue_url":"https://api.github.com/repos/adimichele/hubspot-ruby/issues/171","number":171,"state":"open","locked":false,"title":"update a company","user":{"login":"SViccari","id":4016985,"node_id":"MDQ6VXNlcjQwMTY5ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/4016985?v=4","gravatar_id":"","url":"https://api.github.com/users/SViccari","html_url":"https://github.com/SViccari","followers_url":"https://api.github.com/users/SViccari/followers","following_url":"https://api.github.com/users/SViccari/following{/other_user}","gists_url":"https://api.github.com/users/SViccari/gists{/gist_id}","starred_url":"https://api.github.com/users/SViccari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SViccari/subscriptions","organizations_url":"https://api.github.com/users/SViccari/orgs","repos_url":"https://api.github.com/users/SViccari/repos","events_url":"https://api.github.com/users/SViccari/events{/privacy}","received_events_url":"https://api.github.com/users/SViccari/received_events","type":"User","site_admin":false},"body":"What does an `update` action return?\r\n\r\nDepending on which class you're using, calling `.update!` or `#update!` will vary between returning a hash or an instance of the class.\r\n\r\nHow can we make this consistent and give our users the best experience?\r\nI'd like to suggest that we always return a `Hubspot::Response` object that contains the parsed JSON\r\nand avoid parsing the HubSpot API response to a domain object, (ie: `Deal`).\r\n\r\nMy thought process behind this approach:\r\n- We want to return all the fields that are returned by the HubSpot API. I've used API wrappers in the past that limit the fields the gem user could access and it made for a poor user experience.\r\n- Keep the interface simple. Define one class level `.update!` action and remove existing instance `#update!` methods.\r\n- Adding support for new endpoints should be easy. We want maintainers and contributors to enjoy adding to this project, keeping this project useful and up-to-date with the HubSpot API.\r\n\r\nIf everyone likes this approach, next steps include:\r\n1) Document this change in History.md\r\n1) We can merge this PR as is because the `update` actions that return a class instance are not using the response from `Connection.put_json`\r\n1) Alter the `update` actions that return a class instance to be class level methods that return a `Hubspot::Response`.\r\n1) Apply this approach to `GET`, `POST`, and `DELETE` actions","created_at":"2018-12-20T17:42:37Z","updated_at":"2018-12-20T17:42:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/adimichele/hubspot-ruby/pulls/171/commits","review_comments_url":"https://api.github.com/repos/adimichele/hubspot-ruby/pulls/171/comments","review_comment_url":"https://api.github.com/repos/adimichele/hubspot-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/adimichele/hubspot-ruby/issues/171/comments","statuses_url":"https://api.github.com/repos/adimichele/hubspot-ruby/statuses/2b179d705c9c22c7cbb8dcd362758acccf15748a","head":{"label":"adimichele:sv-update-a-company","ref":"sv-update-a-company","sha":"2b179d705c9c22c7cbb8dcd362758acccf15748a","user":{"login":"adimichele","id":1189624,"node_id":"MDQ6VXNlcjExODk2MjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1189624?v=4","gravatar_id":"","url":"https://api.github.com/users/adimichele","html_url":"https://github.com/adimichele","followers_url":"https://api.github.com/users/adimichele/followers","following_url":"https://api.github.com/users/adimichele/following{/other_user}","gists_url":"https://api.github.com/users/adimichele/gists{/gist_id}","starred_url":"https://api.github.com/users/adimichele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adimichele/subscriptions","organizations_url":"https://api.github.com/users/adimichele/orgs","repos_url":"https://api.github.com/users/adimichele/repos","events_url":"https://api.github.com/users/adimichele/events{/privacy}","received_events_url":"https://api.github.com/users/adimichele/received_events","type":"User","site_admin":false},"repo":{"id":8259215,"node_id":"MDEwOlJlcG9zaXRvcnk4MjU5MjE1","name":"hubspot-ruby","full_name":"adimichele/hubspot-ruby","private":false,"owner":{"login":"adimichele","id":1189624,"node_id":"MDQ6VXNlcjExODk2MjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1189624?v=4","gravatar_id":"","url":"https://api.github.com/users/adimichele","html_url":"https://github.com/adimichele","followers_url":"https://api.github.com/users/adimichele/followers","following_url":"https://api.github.com/users/adimichele/following{/other_user}","gists_url":"https://api.github.com/users/adimichele/gists{/gist_id}","starred_url":"https://api.github.com/users/adimichele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adimichele/subscriptions","organizations_url":"https://api.github.com/users/adimichele/orgs","repos_url":"https://api.github.com/users/adimichele/repos","events_url":"https://api.github.com/users/adimichele/events{/privacy}","received_events_url":"https://api.github.com/users/adimichele/received_events","type":"User","site_admin":false},"html_url":"https://github.com/adimichele/hubspot-ruby","description":"Ruby wrappers for the HubSpot REST API","fork":false,"url":"https://api.github.com/repos/adimichele/hubspot-ruby","forks_url":"https://api.github.com/repos/adimichele/hubspot-ruby/forks","keys_url":"https://api.github.com/repos/adimichele/hubspot-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adimichele/hubspot-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adimichele/hubspot-ruby/teams","hooks_url":"https://api.github.com/repos/adimichele/hubspot-ruby/hooks","issue_events_url":"https://api.github.com/repos/adimichele/hubspot-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/adimichele/hubspot-ruby/events","assignees_url":"https://api.github.com/repos/adimichele/hubspot-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/adimichele/hubspot-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/adimichele/hubspot-ruby/tags","blobs_url":"https://api.github.com/repos/adimichele/hubspot-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adimichele/hubspot-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adimichele/hubspot-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/adimichele/hubspot-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adimichele/hubspot-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/adimichele/hubspot-ruby/languages","stargazers_url":"https://api.github.com/repos/adimichele/hubspot-ruby/stargazers","contributors_url":"https://api.github.com/repos/adimichele/hubspot-ruby/contributors","subscribers_url":"https://api.github.com/repos/adimichele/hubspot-ruby/subscribers","subscription_url":"https://api.github.com/repos/adimichele/hubspot-ruby/subscription","commits_url":"https://api.github.com/repos/adimichele/hubspot-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/adimichele/hubspot-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/adimichele/hubspot-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/adimichele/hubspot-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/adimichele/hubspot-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/adimichele/hubspot-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adimichele/hubspot-ruby/merges","archive_url":"https://api.github.com/repos/adimichele/hubspot-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adimichele/hubspot-ruby/downloads","issues_url":"https://api.github.com/repos/adimichele/hubspot-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/adimichele/hubspot-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/adimichele/hubspot-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/adimichele/hubspot-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adimichele/hubspot-ruby/labels{/name}","releases_url":"https://api.github.com/repos/adimichele/hubspot-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/adimichele/hubspot-ruby/deployments","created_at":"2013-02-18T00:52:23Z","updated_at":"2018-12-20T16:26:04Z","pushed_at":"2018-12-20T17:09:24Z","git_url":"git://github.com/adimichele/hubspot-ruby.git","ssh_url":"git@github.com:adimichele/hubspot-ruby.git","clone_url":"https://github.com/adimichele/hubspot-ruby.git","svn_url":"https://github.com/adimichele/hubspot-ruby","homepage":"https://developers.hubspot.com/docs/endpoints","size":3922,"stargazers_count":104,"watchers_count":104,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":175,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":175,"open_issues":11,"watchers":104,"default_branch":"master"}},"base":{"label":"adimichele:master","ref":"master","sha":"764decb7f5b30f264c1807774d9c4036e27e97e9","user":{"login":"adimichele","id":1189624,"node_id":"MDQ6VXNlcjExODk2MjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1189624?v=4","gravatar_id":"","url":"https://api.github.com/users/adimichele","html_url":"https://github.com/adimichele","followers_url":"https://api.github.com/users/adimichele/followers","following_url":"https://api.github.com/users/adimichele/following{/other_user}","gists_url":"https://api.github.com/users/adimichele/gists{/gist_id}","starred_url":"https://api.github.com/users/adimichele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adimichele/subscriptions","organizations_url":"https://api.github.com/users/adimichele/orgs","repos_url":"https://api.github.com/users/adimichele/repos","events_url":"https://api.github.com/users/adimichele/events{/privacy}","received_events_url":"https://api.github.com/users/adimichele/received_events","type":"User","site_admin":false},"repo":{"id":8259215,"node_id":"MDEwOlJlcG9zaXRvcnk4MjU5MjE1","name":"hubspot-ruby","full_name":"adimichele/hubspot-ruby","private":false,"owner":{"login":"adimichele","id":1189624,"node_id":"MDQ6VXNlcjExODk2MjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1189624?v=4","gravatar_id":"","url":"https://api.github.com/users/adimichele","html_url":"https://github.com/adimichele","followers_url":"https://api.github.com/users/adimichele/followers","following_url":"https://api.github.com/users/adimichele/following{/other_user}","gists_url":"https://api.github.com/users/adimichele/gists{/gist_id}","starred_url":"https://api.github.com/users/adimichele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adimichele/subscriptions","organizations_url":"https://api.github.com/users/adimichele/orgs","repos_url":"https://api.github.com/users/adimichele/repos","events_url":"https://api.github.com/users/adimichele/events{/privacy}","received_events_url":"https://api.github.com/users/adimichele/received_events","type":"User","site_admin":false},"html_url":"https://github.com/adimichele/hubspot-ruby","description":"Ruby wrappers for the HubSpot REST API","fork":false,"url":"https://api.github.com/repos/adimichele/hubspot-ruby","forks_url":"https://api.github.com/repos/adimichele/hubspot-ruby/forks","keys_url":"https://api.github.com/repos/adimichele/hubspot-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adimichele/hubspot-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adimichele/hubspot-ruby/teams","hooks_url":"https://api.github.com/repos/adimichele/hubspot-ruby/hooks","issue_events_url":"https://api.github.com/repos/adimichele/hubspot-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/adimichele/hubspot-ruby/events","assignees_url":"https://api.github.com/repos/adimichele/hubspot-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/adimichele/hubspot-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/adimichele/hubspot-ruby/tags","blobs_url":"https://api.github.com/repos/adimichele/hubspot-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adimichele/hubspot-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adimichele/hubspot-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/adimichele/hubspot-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adimichele/hubspot-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/adimichele/hubspot-ruby/languages","stargazers_url":"https://api.github.com/repos/adimichele/hubspot-ruby/stargazers","contributors_url":"https://api.github.com/repos/adimichele/hubspot-ruby/contributors","subscribers_url":"https://api.github.com/repos/adimichele/hubspot-ruby/subscribers","subscription_url":"https://api.github.com/repos/adimichele/hubspot-ruby/subscription","commits_url":"https://api.github.com/repos/adimichele/hubspot-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/adimichele/hubspot-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/adimichele/hubspot-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/adimichele/hubspot-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/adimichele/hubspot-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/adimichele/hubspot-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adimichele/hubspot-ruby/merges","archive_url":"https://api.github.com/repos/adimichele/hubspot-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adimichele/hubspot-ruby/downloads","issues_url":"https://api.github.com/repos/adimichele/hubspot-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/adimichele/hubspot-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/adimichele/hubspot-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/adimichele/hubspot-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adimichele/hubspot-ruby/labels{/name}","releases_url":"https://api.github.com/repos/adimichele/hubspot-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/adimichele/hubspot-ruby/deployments","created_at":"2013-02-18T00:52:23Z","updated_at":"2018-12-20T16:26:04Z","pushed_at":"2018-12-20T17:09:24Z","git_url":"git://github.com/adimichele/hubspot-ruby.git","ssh_url":"git@github.com:adimichele/hubspot-ruby.git","clone_url":"https://github.com/adimichele/hubspot-ruby.git","svn_url":"https://github.com/adimichele/hubspot-ruby","homepage":"https://developers.hubspot.com/docs/endpoints","size":3922,"stargazers_count":104,"watchers_count":104,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":175,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":175,"open_issues":11,"watchers":104,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adimichele/hubspot-ruby/pulls/171"},"html":{"href":"https://github.com/adimichele/hubspot-ruby/pull/171"},"issue":{"href":"https://api.github.com/repos/adimichele/hubspot-ruby/issues/171"},"comments":{"href":"https://api.github.com/repos/adimichele/hubspot-ruby/issues/171/comments"},"review_comments":{"href":"https://api.github.com/repos/adimichele/hubspot-ruby/pulls/171/comments"},"review_comment":{"href":"https://api.github.com/repos/adimichele/hubspot-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/adimichele/hubspot-ruby/pulls/171/commits"},"statuses":{"href":"https://api.github.com/repos/adimichele/hubspot-ruby/statuses/2b179d705c9c22c7cbb8dcd362758acccf15748a"}},"author_association":"COLLABORATOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":3,"additions":213,"deletions":40,"changed_files":10}}
{"actor":{"display_login":"SViccari"}}