{"action":"created","comment":{"url":"https://api.github.com/repos/2600hz/kazoo/pulls/comments/47127749","id":47127749,"diff_hunk":"@@ -0,0 +1,195 @@\n+%%%-------------------------------------------------------------------\n+%%% @copyright (C) 2015, 2600Hz\n+%%% @doc\n+%%% Account document\n+%%% @end\n+%%% @contributors\n+%%%   Peter Defebvre\n+%%%-------------------------------------------------------------------\n+-module(kzd_app).\n+\n+-export([fetch/2]).\n+\n+-export([\n+    id/1\n+    ,published/1\n+    ,name/1\n+    ,i18n/1\n+    ,tags/1\n+    ,icon/1\n+    ,api_url/1\n+    ,source_url/1\n+    ,author/1\n+    ,version/1\n+    ,license/1\n+    ,price/1\n+    ,screenshots/1\n+    ,urls/1\n+    ,account_id/1\n+]).\n+\n+-include(\"kz_documents.hrl\").\n+\n+-define(PUBLISHED, <<\"published\">>).\n+-define(NAME, <<\"name\">>).\n+-define(I18N, <<\"i18n\">>).\n+-define(TAGS, <<\"tags\">>).\n+-define(ICON, <<\"icon\">>).\n+-define(API_URL, <<\"api_url\">>).\n+-define(SOURCE_URL, <<\"source_url\">>).\n+-define(AUTHOR, <<\"author\">>).\n+-define(VERSION, <<\"version\">>).\n+-define(LICENSE, <<\"license\">>).\n+-define(PRICE, <<\"price\">>).\n+-define(SCREENSHOTS, <<\"screenshots\">>).\n+-define(URLS, <<\"urls\">>).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec fetch(api_binary(), api_binary()) -> {'ok', wh_json:object()} | {'error', any()}.\n+fetch('undefined', _) ->\n+    {'error', 'account_id_undefined'};\n+fetch(_, 'undefined') ->\n+    {'error', 'app_id_undefined'};\n+fetch(Account, Id) ->\n+    AccoundDb = wh_util:format_account_id(Account, 'encoded'),\n+    couch_mgr:open_cache_doc(AccoundDb, Id).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec id(wh_json:object()) -> ne_binary().\n+id(JObj) ->\n+    wh_doc:id(JObj).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec published(wh_json:object()) -> ne_binary().\n+published(JObj) ->\n+    wh_json:is_true(?PUBLISHED, JObj, 'true').\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec name(wh_json:object()) -> ne_binary().\n+name(JObj) ->\n+    wh_json:get_binary_value(?NAME, JObj).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec i18n(wh_json:object()) -> ne_binary().\n+i18n(JObj) ->\n+    wh_json:get_json_value(?I18N, JObj).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec tags(wh_json:object()) -> ne_binary().\n+tags(JObj) ->\n+    wh_json:get_list_value(?TAGS, JObj).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec icon(wh_json:object()) -> ne_binary().\n+icon(JObj) ->\n+    wh_json:get_binary_value(?ICON, JObj).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec api_url(wh_json:object()) -> ne_binary().\n+api_url(JObj) ->\n+    wh_json:get_binary_value(?API_URL, JObj).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec source_url(wh_json:object()) -> ne_binary().\n+source_url(JObj) ->\n+    wh_json:get_binary_value(?API_URL, JObj).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec author(wh_json:object()) -> ne_binary().\n+author(JObj) ->\n+    wh_json:get_binary_value(?AUTHOR, JObj).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec version(wh_json:object()) -> ne_binary().\n+version(JObj) ->\n+    wh_json:get_binary_value(?VERSION, JObj).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec license(wh_json:object()) -> ne_binary().\n+license(JObj) ->\n+    wh_json:get_binary_value(?LICENSE, JObj).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec price(wh_json:object()) -> ne_binary().\n+price(JObj) ->\n+    wh_json:get_float_value(?PRICE, JObj).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec screenshots(wh_json:object()) -> ne_binary().\n+screenshots(JObj) ->\n+    wh_json:get_list_value(?SCREENSHOTS, JObj).\n+\n+%%--------------------------------------------------------------------\n+%% @public\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec urls(wh_json:object()) -> ne_binary().","path":"core/kazoo_documents-1.0.0/src/kzd_app.erl","position":183,"original_position":183,"commit_id":"621700341986487c6a4bd8cb2ed41cfa004805f7","original_commit_id":"89627b76bc623fc3213b866e9f57635fd7e8f5e0","user":{"login":"jamesaimonetti","id":160921,"avatar_url":"https://avatars.githubusercontent.com/u/160921?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesaimonetti","html_url":"https://github.com/jamesaimonetti","followers_url":"https://api.github.com/users/jamesaimonetti/followers","following_url":"https://api.github.com/users/jamesaimonetti/following{/other_user}","gists_url":"https://api.github.com/users/jamesaimonetti/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesaimonetti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesaimonetti/subscriptions","organizations_url":"https://api.github.com/users/jamesaimonetti/orgs","repos_url":"https://api.github.com/users/jamesaimonetti/repos","events_url":"https://api.github.com/users/jamesaimonetti/events{/privacy}","received_events_url":"https://api.github.com/users/jamesaimonetti/received_events","type":"User","site_admin":false},"body":"This one isn't fixed.","created_at":"2015-12-09T18:06:50Z","updated_at":"2015-12-09T18:06:50Z","html_url":"https://github.com/2600hz/kazoo/pull/1472#discussion_r47127749","pull_request_url":"https://api.github.com/repos/2600hz/kazoo/pulls/1472","_links":{"self":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/comments/47127749"},"html":{"href":"https://github.com/2600hz/kazoo/pull/1472#discussion_r47127749"},"pull_request":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/1472"}}},"pull_request":{"url":"https://api.github.com/repos/2600hz/kazoo/pulls/1472","id":52606733,"html_url":"https://github.com/2600hz/kazoo/pull/1472","diff_url":"https://github.com/2600hz/kazoo/pull/1472.diff","patch_url":"https://github.com/2600hz/kazoo/pull/1472.patch","issue_url":"https://api.github.com/repos/2600hz/kazoo/issues/1472","number":1472,"state":"open","locked":false,"title":"KAZOO-4369: Add account_id to app_store API return & update kz_apps_s…","user":{"login":"macpie","id":778101,"avatar_url":"https://avatars.githubusercontent.com/u/778101?v=3","gravatar_id":"","url":"https://api.github.com/users/macpie","html_url":"https://github.com/macpie","followers_url":"https://api.github.com/users/macpie/followers","following_url":"https://api.github.com/users/macpie/following{/other_user}","gists_url":"https://api.github.com/users/macpie/gists{/gist_id}","starred_url":"https://api.github.com/users/macpie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macpie/subscriptions","organizations_url":"https://api.github.com/users/macpie/orgs","repos_url":"https://api.github.com/users/macpie/repos","events_url":"https://api.github.com/users/macpie/events{/privacy}","received_events_url":"https://api.github.com/users/macpie/received_events","type":"User","site_admin":false},"body":"…tore to kzd","created_at":"2015-12-03T23:05:51Z","updated_at":"2015-12-09T18:06:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8145844783c8aeabc8ece77adf9fc1539718f18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/2600hz/kazoo/pulls/1472/commits","review_comments_url":"https://api.github.com/repos/2600hz/kazoo/pulls/1472/comments","review_comment_url":"https://api.github.com/repos/2600hz/kazoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/2600hz/kazoo/issues/1472/comments","statuses_url":"https://api.github.com/repos/2600hz/kazoo/statuses/621700341986487c6a4bd8cb2ed41cfa004805f7","head":{"label":"2600hz:KAZOO-4369","ref":"KAZOO-4369","sha":"621700341986487c6a4bd8cb2ed41cfa004805f7","user":{"login":"2600hz","id":408801,"avatar_url":"https://avatars.githubusercontent.com/u/408801?v=3","gravatar_id":"","url":"https://api.github.com/users/2600hz","html_url":"https://github.com/2600hz","followers_url":"https://api.github.com/users/2600hz/followers","following_url":"https://api.github.com/users/2600hz/following{/other_user}","gists_url":"https://api.github.com/users/2600hz/gists{/gist_id}","starred_url":"https://api.github.com/users/2600hz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2600hz/subscriptions","organizations_url":"https://api.github.com/users/2600hz/orgs","repos_url":"https://api.github.com/users/2600hz/repos","events_url":"https://api.github.com/users/2600hz/events{/privacy}","received_events_url":"https://api.github.com/users/2600hz/received_events","type":"Organization","site_admin":false},"repo":{"id":2966241,"name":"kazoo","full_name":"2600hz/kazoo","owner":{"login":"2600hz","id":408801,"avatar_url":"https://avatars.githubusercontent.com/u/408801?v=3","gravatar_id":"","url":"https://api.github.com/users/2600hz","html_url":"https://github.com/2600hz","followers_url":"https://api.github.com/users/2600hz/followers","following_url":"https://api.github.com/users/2600hz/following{/other_user}","gists_url":"https://api.github.com/users/2600hz/gists{/gist_id}","starred_url":"https://api.github.com/users/2600hz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2600hz/subscriptions","organizations_url":"https://api.github.com/users/2600hz/orgs","repos_url":"https://api.github.com/users/2600hz/repos","events_url":"https://api.github.com/users/2600hz/events{/privacy}","received_events_url":"https://api.github.com/users/2600hz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/2600hz/kazoo","description":"","fork":false,"url":"https://api.github.com/repos/2600hz/kazoo","forks_url":"https://api.github.com/repos/2600hz/kazoo/forks","keys_url":"https://api.github.com/repos/2600hz/kazoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/2600hz/kazoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/2600hz/kazoo/teams","hooks_url":"https://api.github.com/repos/2600hz/kazoo/hooks","issue_events_url":"https://api.github.com/repos/2600hz/kazoo/issues/events{/number}","events_url":"https://api.github.com/repos/2600hz/kazoo/events","assignees_url":"https://api.github.com/repos/2600hz/kazoo/assignees{/user}","branches_url":"https://api.github.com/repos/2600hz/kazoo/branches{/branch}","tags_url":"https://api.github.com/repos/2600hz/kazoo/tags","blobs_url":"https://api.github.com/repos/2600hz/kazoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/2600hz/kazoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/2600hz/kazoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/2600hz/kazoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/2600hz/kazoo/statuses/{sha}","languages_url":"https://api.github.com/repos/2600hz/kazoo/languages","stargazers_url":"https://api.github.com/repos/2600hz/kazoo/stargazers","contributors_url":"https://api.github.com/repos/2600hz/kazoo/contributors","subscribers_url":"https://api.github.com/repos/2600hz/kazoo/subscribers","subscription_url":"https://api.github.com/repos/2600hz/kazoo/subscription","commits_url":"https://api.github.com/repos/2600hz/kazoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/2600hz/kazoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/2600hz/kazoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/2600hz/kazoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/2600hz/kazoo/contents/{+path}","compare_url":"https://api.github.com/repos/2600hz/kazoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/2600hz/kazoo/merges","archive_url":"https://api.github.com/repos/2600hz/kazoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/2600hz/kazoo/downloads","issues_url":"https://api.github.com/repos/2600hz/kazoo/issues{/number}","pulls_url":"https://api.github.com/repos/2600hz/kazoo/pulls{/number}","milestones_url":"https://api.github.com/repos/2600hz/kazoo/milestones{/number}","notifications_url":"https://api.github.com/repos/2600hz/kazoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/2600hz/kazoo/labels{/name}","releases_url":"https://api.github.com/repos/2600hz/kazoo/releases{/id}","created_at":"2011-12-12T18:08:02Z","updated_at":"2015-11-29T02:45:07Z","pushed_at":"2015-12-09T16:31:30Z","git_url":"git://github.com/2600hz/kazoo.git","ssh_url":"git@github.com:2600hz/kazoo.git","clone_url":"https://github.com/2600hz/kazoo.git","svn_url":"https://github.com/2600hz/kazoo","homepage":"","size":329819,"stargazers_count":308,"watchers_count":308,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":158,"mirror_url":null,"open_issues_count":28,"forks":158,"open_issues":28,"watchers":308,"default_branch":"master"}},"base":{"label":"2600hz:master","ref":"master","sha":"90f86ae60c1007ff09d6f0ea8b06314ae9c710b3","user":{"login":"2600hz","id":408801,"avatar_url":"https://avatars.githubusercontent.com/u/408801?v=3","gravatar_id":"","url":"https://api.github.com/users/2600hz","html_url":"https://github.com/2600hz","followers_url":"https://api.github.com/users/2600hz/followers","following_url":"https://api.github.com/users/2600hz/following{/other_user}","gists_url":"https://api.github.com/users/2600hz/gists{/gist_id}","starred_url":"https://api.github.com/users/2600hz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2600hz/subscriptions","organizations_url":"https://api.github.com/users/2600hz/orgs","repos_url":"https://api.github.com/users/2600hz/repos","events_url":"https://api.github.com/users/2600hz/events{/privacy}","received_events_url":"https://api.github.com/users/2600hz/received_events","type":"Organization","site_admin":false},"repo":{"id":2966241,"name":"kazoo","full_name":"2600hz/kazoo","owner":{"login":"2600hz","id":408801,"avatar_url":"https://avatars.githubusercontent.com/u/408801?v=3","gravatar_id":"","url":"https://api.github.com/users/2600hz","html_url":"https://github.com/2600hz","followers_url":"https://api.github.com/users/2600hz/followers","following_url":"https://api.github.com/users/2600hz/following{/other_user}","gists_url":"https://api.github.com/users/2600hz/gists{/gist_id}","starred_url":"https://api.github.com/users/2600hz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2600hz/subscriptions","organizations_url":"https://api.github.com/users/2600hz/orgs","repos_url":"https://api.github.com/users/2600hz/repos","events_url":"https://api.github.com/users/2600hz/events{/privacy}","received_events_url":"https://api.github.com/users/2600hz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/2600hz/kazoo","description":"","fork":false,"url":"https://api.github.com/repos/2600hz/kazoo","forks_url":"https://api.github.com/repos/2600hz/kazoo/forks","keys_url":"https://api.github.com/repos/2600hz/kazoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/2600hz/kazoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/2600hz/kazoo/teams","hooks_url":"https://api.github.com/repos/2600hz/kazoo/hooks","issue_events_url":"https://api.github.com/repos/2600hz/kazoo/issues/events{/number}","events_url":"https://api.github.com/repos/2600hz/kazoo/events","assignees_url":"https://api.github.com/repos/2600hz/kazoo/assignees{/user}","branches_url":"https://api.github.com/repos/2600hz/kazoo/branches{/branch}","tags_url":"https://api.github.com/repos/2600hz/kazoo/tags","blobs_url":"https://api.github.com/repos/2600hz/kazoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/2600hz/kazoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/2600hz/kazoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/2600hz/kazoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/2600hz/kazoo/statuses/{sha}","languages_url":"https://api.github.com/repos/2600hz/kazoo/languages","stargazers_url":"https://api.github.com/repos/2600hz/kazoo/stargazers","contributors_url":"https://api.github.com/repos/2600hz/kazoo/contributors","subscribers_url":"https://api.github.com/repos/2600hz/kazoo/subscribers","subscription_url":"https://api.github.com/repos/2600hz/kazoo/subscription","commits_url":"https://api.github.com/repos/2600hz/kazoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/2600hz/kazoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/2600hz/kazoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/2600hz/kazoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/2600hz/kazoo/contents/{+path}","compare_url":"https://api.github.com/repos/2600hz/kazoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/2600hz/kazoo/merges","archive_url":"https://api.github.com/repos/2600hz/kazoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/2600hz/kazoo/downloads","issues_url":"https://api.github.com/repos/2600hz/kazoo/issues{/number}","pulls_url":"https://api.github.com/repos/2600hz/kazoo/pulls{/number}","milestones_url":"https://api.github.com/repos/2600hz/kazoo/milestones{/number}","notifications_url":"https://api.github.com/repos/2600hz/kazoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/2600hz/kazoo/labels{/name}","releases_url":"https://api.github.com/repos/2600hz/kazoo/releases{/id}","created_at":"2011-12-12T18:08:02Z","updated_at":"2015-11-29T02:45:07Z","pushed_at":"2015-12-09T16:31:30Z","git_url":"git://github.com/2600hz/kazoo.git","ssh_url":"git@github.com:2600hz/kazoo.git","clone_url":"https://github.com/2600hz/kazoo.git","svn_url":"https://github.com/2600hz/kazoo","homepage":"","size":329819,"stargazers_count":308,"watchers_count":308,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":158,"mirror_url":null,"open_issues_count":28,"forks":158,"open_issues":28,"watchers":308,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/1472"},"html":{"href":"https://github.com/2600hz/kazoo/pull/1472"},"issue":{"href":"https://api.github.com/repos/2600hz/kazoo/issues/1472"},"comments":{"href":"https://api.github.com/repos/2600hz/kazoo/issues/1472/comments"},"review_comments":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/1472/comments"},"review_comment":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/1472/commits"},"statuses":{"href":"https://api.github.com/repos/2600hz/kazoo/statuses/621700341986487c6a4bd8cb2ed41cfa004805f7"}}}}