{"action":"created","comment":{"url":"https://api.github.com/repos/clio/zapier-api-client/pulls/comments/33879626","id":33879626,"diff_hunk":"@@ -0,0 +1,231 @@\n+################################################################################\n+#### Zapier hooks\n+################################################################################\n+\n+Zap.create_person_pre_write = (bundle) ->\n+  Zap.create_contact_pre_write(bundle, \"Person\")\n+  \n+Zap.create_company_pre_write = (bundle) ->\n+  Zap.create_contact_pre_write(bundle, \"Company\")\n+\n+Zap.new_contact_post_poll = (bundle) ->\n+  results = JSON.parse(bundle.response.content)\n+  \n+  array = []\n+  for object in results.contacts\n+    # The format of this data MUST match the sample data format in triggers \"Sample Result\"\n+    # To get a sample, build a new object with good data and create a Zap, you should see\n+    # bundle output (from scripting editor quicklinks) once you try and add a field in the\n+    # Zap editor\n+    \n+    data = {}\n+    data.id = object.id\n+    data.created_at = object.created_at\n+    data.updated_at = object.updated_at\n+    data.name = object.name\n+    data.first_name = object.first_name\n+    data.last_name = object.last_name\n+    data.title = object.title\n+    data.company = Zap.transform_nested_attributes(object.company)\n+    data.email_address = Zap.flatten_array(object.email_addresses , [\"name\",\"address\"])\n+    data.phone_number = Zap.flatten_array(object.phone_numbers, [\"name\", \"number\"])\n+    data.instant_messenger = Zap.flatten_array(object.instant_messengers, [\"name\", \"address\"])\n+    data.web_site = Zap.flatten_array(object.web_sites, [\"name\", \"address\"])\n+    data.address = Zap.flatten_array(object.addresses, [\"name\", \"street\", \"city\", \"province\", \"postal_code\", \"country\"])\n+    data.custom_field = Zap.transform_custom_fields(bundle, object, \"Contact\")\n+    array.push data\n+  array\n+\n+Zap.create_contact_post_custom_action_fields = (bundle) ->\n+  Zap.transform_custom_action_fields(bundle, false)\n+\n+Zap.create_person_post_custom_action_fields = (bundle) ->\n+  Zap.transform_custom_action_fields(bundle, false)\n+\n+Zap.create_company_post_custom_action_fields = (bundle) ->\n+  Zap.transform_custom_action_fields(bundle, false)\n+\n+################################################################################\n+#### Helper methods\n+################################################################################\n+\n+Zap.create_contact_pre_write = (bundle, contact_type) ->","path":"src/contact.coffee","position":52,"original_position":52,"commit_id":"aa8eb10a6dca4865ddbb3d36a10097ca2717118b","original_commit_id":"aa8eb10a6dca4865ddbb3d36a10097ca2717118b","user":{"login":"alecclarke","id":8182434,"avatar_url":"https://avatars.githubusercontent.com/u/8182434?v=3","gravatar_id":"","url":"https://api.github.com/users/alecclarke","html_url":"https://github.com/alecclarke","followers_url":"https://api.github.com/users/alecclarke/followers","following_url":"https://api.github.com/users/alecclarke/following{/other_user}","gists_url":"https://api.github.com/users/alecclarke/gists{/gist_id}","starred_url":"https://api.github.com/users/alecclarke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alecclarke/subscriptions","organizations_url":"https://api.github.com/users/alecclarke/orgs","repos_url":"https://api.github.com/users/alecclarke/repos","events_url":"https://api.github.com/users/alecclarke/events{/privacy}","received_events_url":"https://api.github.com/users/alecclarke/received_events","type":"User","site_admin":false},"body":"Same \"Zapier suffix\" method naming question as before. ","created_at":"2015-07-03T20:10:49Z","updated_at":"2015-07-03T20:10:49Z","html_url":"https://github.com/clio/zapier-api-client/pull/21#discussion_r33879626","pull_request_url":"https://api.github.com/repos/clio/zapier-api-client/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/clio/zapier-api-client/pulls/comments/33879626"},"html":{"href":"https://github.com/clio/zapier-api-client/pull/21#discussion_r33879626"},"pull_request":{"href":"https://api.github.com/repos/clio/zapier-api-client/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/clio/zapier-api-client/pulls/21","id":38934934,"html_url":"https://github.com/clio/zapier-api-client/pull/21","diff_url":"https://github.com/clio/zapier-api-client/pull/21.diff","patch_url":"https://github.com/clio/zapier-api-client/pull/21.patch","issue_url":"https://api.github.com/repos/clio/zapier-api-client/issues/21","number":21,"state":"open","locked":false,"title":"CLIO-23779 Refactor code layout.","user":{"login":"kyledemeule","id":3833753,"avatar_url":"https://avatars.githubusercontent.com/u/3833753?v=3","gravatar_id":"","url":"https://api.github.com/users/kyledemeule","html_url":"https://github.com/kyledemeule","followers_url":"https://api.github.com/users/kyledemeule/followers","following_url":"https://api.github.com/users/kyledemeule/following{/other_user}","gists_url":"https://api.github.com/users/kyledemeule/gists{/gist_id}","starred_url":"https://api.github.com/users/kyledemeule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyledemeule/subscriptions","organizations_url":"https://api.github.com/users/kyledemeule/orgs","repos_url":"https://api.github.com/users/kyledemeule/repos","events_url":"https://api.github.com/users/kyledemeule/events{/privacy}","received_events_url":"https://api.github.com/users/kyledemeule/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-30T23:21:49Z","updated_at":"2015-07-03T20:10:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"264bafbb161ecfb9171acd132f95c7bbdc3e1830","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/clio/zapier-api-client/pulls/21/commits","review_comments_url":"https://api.github.com/repos/clio/zapier-api-client/pulls/21/comments","review_comment_url":"https://api.github.com/repos/clio/zapier-api-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clio/zapier-api-client/issues/21/comments","statuses_url":"https://api.github.com/repos/clio/zapier-api-client/statuses/aa8eb10a6dca4865ddbb3d36a10097ca2717118b","head":{"label":"kyledemeule:clio-23779","ref":"clio-23779","sha":"aa8eb10a6dca4865ddbb3d36a10097ca2717118b","user":{"login":"kyledemeule","id":3833753,"avatar_url":"https://avatars.githubusercontent.com/u/3833753?v=3","gravatar_id":"","url":"https://api.github.com/users/kyledemeule","html_url":"https://github.com/kyledemeule","followers_url":"https://api.github.com/users/kyledemeule/followers","following_url":"https://api.github.com/users/kyledemeule/following{/other_user}","gists_url":"https://api.github.com/users/kyledemeule/gists{/gist_id}","starred_url":"https://api.github.com/users/kyledemeule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyledemeule/subscriptions","organizations_url":"https://api.github.com/users/kyledemeule/orgs","repos_url":"https://api.github.com/users/kyledemeule/repos","events_url":"https://api.github.com/users/kyledemeule/events{/privacy}","received_events_url":"https://api.github.com/users/kyledemeule/received_events","type":"User","site_admin":false},"repo":{"id":36758681,"name":"zapier-api-client","full_name":"kyledemeule/zapier-api-client","owner":{"login":"kyledemeule","id":3833753,"avatar_url":"https://avatars.githubusercontent.com/u/3833753?v=3","gravatar_id":"","url":"https://api.github.com/users/kyledemeule","html_url":"https://github.com/kyledemeule","followers_url":"https://api.github.com/users/kyledemeule/followers","following_url":"https://api.github.com/users/kyledemeule/following{/other_user}","gists_url":"https://api.github.com/users/kyledemeule/gists{/gist_id}","starred_url":"https://api.github.com/users/kyledemeule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyledemeule/subscriptions","organizations_url":"https://api.github.com/users/kyledemeule/orgs","repos_url":"https://api.github.com/users/kyledemeule/repos","events_url":"https://api.github.com/users/kyledemeule/events{/privacy}","received_events_url":"https://api.github.com/users/kyledemeule/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kyledemeule/zapier-api-client","description":"","fork":true,"url":"https://api.github.com/repos/kyledemeule/zapier-api-client","forks_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/forks","keys_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/teams","hooks_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/hooks","issue_events_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/issues/events{/number}","events_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/events","assignees_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/assignees{/user}","branches_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/branches{/branch}","tags_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/tags","blobs_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/statuses/{sha}","languages_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/languages","stargazers_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/stargazers","contributors_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/contributors","subscribers_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/subscribers","subscription_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/subscription","commits_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/contents/{+path}","compare_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/merges","archive_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/downloads","issues_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/issues{/number}","pulls_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/pulls{/number}","milestones_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/milestones{/number}","notifications_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/labels{/name}","releases_url":"https://api.github.com/repos/kyledemeule/zapier-api-client/releases{/id}","created_at":"2015-06-02T20:05:21Z","updated_at":"2015-06-02T20:05:21Z","pushed_at":"2015-07-03T01:17:57Z","git_url":"git://github.com/kyledemeule/zapier-api-client.git","ssh_url":"git@github.com:kyledemeule/zapier-api-client.git","clone_url":"https://github.com/kyledemeule/zapier-api-client.git","svn_url":"https://github.com/kyledemeule/zapier-api-client","homepage":null,"size":274,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"clio:master","ref":"master","sha":"8f96b58754031d7d0003494463591dfedfd86bc5","user":{"login":"clio","id":30769,"avatar_url":"https://avatars.githubusercontent.com/u/30769?v=3","gravatar_id":"","url":"https://api.github.com/users/clio","html_url":"https://github.com/clio","followers_url":"https://api.github.com/users/clio/followers","following_url":"https://api.github.com/users/clio/following{/other_user}","gists_url":"https://api.github.com/users/clio/gists{/gist_id}","starred_url":"https://api.github.com/users/clio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clio/subscriptions","organizations_url":"https://api.github.com/users/clio/orgs","repos_url":"https://api.github.com/users/clio/repos","events_url":"https://api.github.com/users/clio/events{/privacy}","received_events_url":"https://api.github.com/users/clio/received_events","type":"Organization","site_admin":false},"repo":{"id":21870975,"name":"zapier-api-client","full_name":"clio/zapier-api-client","owner":{"login":"clio","id":30769,"avatar_url":"https://avatars.githubusercontent.com/u/30769?v=3","gravatar_id":"","url":"https://api.github.com/users/clio","html_url":"https://github.com/clio","followers_url":"https://api.github.com/users/clio/followers","following_url":"https://api.github.com/users/clio/following{/other_user}","gists_url":"https://api.github.com/users/clio/gists{/gist_id}","starred_url":"https://api.github.com/users/clio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clio/subscriptions","organizations_url":"https://api.github.com/users/clio/orgs","repos_url":"https://api.github.com/users/clio/repos","events_url":"https://api.github.com/users/clio/events{/privacy}","received_events_url":"https://api.github.com/users/clio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clio/zapier-api-client","description":"","fork":false,"url":"https://api.github.com/repos/clio/zapier-api-client","forks_url":"https://api.github.com/repos/clio/zapier-api-client/forks","keys_url":"https://api.github.com/repos/clio/zapier-api-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clio/zapier-api-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clio/zapier-api-client/teams","hooks_url":"https://api.github.com/repos/clio/zapier-api-client/hooks","issue_events_url":"https://api.github.com/repos/clio/zapier-api-client/issues/events{/number}","events_url":"https://api.github.com/repos/clio/zapier-api-client/events","assignees_url":"https://api.github.com/repos/clio/zapier-api-client/assignees{/user}","branches_url":"https://api.github.com/repos/clio/zapier-api-client/branches{/branch}","tags_url":"https://api.github.com/repos/clio/zapier-api-client/tags","blobs_url":"https://api.github.com/repos/clio/zapier-api-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clio/zapier-api-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clio/zapier-api-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/clio/zapier-api-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clio/zapier-api-client/statuses/{sha}","languages_url":"https://api.github.com/repos/clio/zapier-api-client/languages","stargazers_url":"https://api.github.com/repos/clio/zapier-api-client/stargazers","contributors_url":"https://api.github.com/repos/clio/zapier-api-client/contributors","subscribers_url":"https://api.github.com/repos/clio/zapier-api-client/subscribers","subscription_url":"https://api.github.com/repos/clio/zapier-api-client/subscription","commits_url":"https://api.github.com/repos/clio/zapier-api-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/clio/zapier-api-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/clio/zapier-api-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/clio/zapier-api-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/clio/zapier-api-client/contents/{+path}","compare_url":"https://api.github.com/repos/clio/zapier-api-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clio/zapier-api-client/merges","archive_url":"https://api.github.com/repos/clio/zapier-api-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clio/zapier-api-client/downloads","issues_url":"https://api.github.com/repos/clio/zapier-api-client/issues{/number}","pulls_url":"https://api.github.com/repos/clio/zapier-api-client/pulls{/number}","milestones_url":"https://api.github.com/repos/clio/zapier-api-client/milestones{/number}","notifications_url":"https://api.github.com/repos/clio/zapier-api-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clio/zapier-api-client/labels{/name}","releases_url":"https://api.github.com/repos/clio/zapier-api-client/releases{/id}","created_at":"2014-07-15T18:26:31Z","updated_at":"2014-12-17T16:48:03Z","pushed_at":"2015-07-03T01:17:58Z","git_url":"git://github.com/clio/zapier-api-client.git","ssh_url":"git@github.com:clio/zapier-api-client.git","clone_url":"https://github.com/clio/zapier-api-client.git","svn_url":"https://github.com/clio/zapier-api-client","homepage":null,"size":462,"stargazers_count":2,"watchers_count":2,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":4,"forks":7,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clio/zapier-api-client/pulls/21"},"html":{"href":"https://github.com/clio/zapier-api-client/pull/21"},"issue":{"href":"https://api.github.com/repos/clio/zapier-api-client/issues/21"},"comments":{"href":"https://api.github.com/repos/clio/zapier-api-client/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/clio/zapier-api-client/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/clio/zapier-api-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clio/zapier-api-client/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/clio/zapier-api-client/statuses/aa8eb10a6dca4865ddbb3d36a10097ca2717118b"}}}}