{"action":"created","comment":{"url":"https://api.github.com/repos/finagle/finch/pulls/comments/31392290","id":31392290,"diff_hunk":"@@ -0,0 +1,27 @@\n+package io.finch\n+package client\n+\n+import com.twitter.finagle.httpx.{HeaderMap, Response}\n+import com.twitter.io.Buf\n+\n+sealed trait Resource[A] { \n+  val headers: HeaderMap\n+  val content: A\n+  def as[B](implicit ev: A => Buf, d: DecodeResource[B]): Resource[B] = ","path":"client/src/main/scala/io/finch/client/resources.scala","position":10,"original_position":10,"commit_id":"8808171aba76f2bd01de8e45bfd3c1856c8fcde5","original_commit_id":"8808171aba76f2bd01de8e45bfd3c1856c8fcde5","user":{"login":"travisbrown","id":316049,"avatar_url":"https://avatars.githubusercontent.com/u/316049?v=3","gravatar_id":"","url":"https://api.github.com/users/travisbrown","html_url":"https://github.com/travisbrown","followers_url":"https://api.github.com/users/travisbrown/followers","following_url":"https://api.github.com/users/travisbrown/following{/other_user}","gists_url":"https://api.github.com/users/travisbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/travisbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisbrown/subscriptions","organizations_url":"https://api.github.com/users/travisbrown/orgs","repos_url":"https://api.github.com/users/travisbrown/repos","events_url":"https://api.github.com/users/travisbrown/events{/privacy}","received_events_url":"https://api.github.com/users/travisbrown/received_events","type":"User","site_admin":false},"body":"Maybe I don't understand the intended usage yet, but implicit functions make me nervous. Would it be possible to provide this as a `def toBuf(a: A): Buf` on the trait?","created_at":"2015-05-31T17:10:45Z","updated_at":"2015-05-31T17:10:45Z","html_url":"https://github.com/finagle/finch/pull/277#discussion_r31392290","pull_request_url":"https://api.github.com/repos/finagle/finch/pulls/277","_links":{"self":{"href":"https://api.github.com/repos/finagle/finch/pulls/comments/31392290"},"html":{"href":"https://github.com/finagle/finch/pull/277#discussion_r31392290"},"pull_request":{"href":"https://api.github.com/repos/finagle/finch/pulls/277"}}},"pull_request":{"url":"https://api.github.com/repos/finagle/finch/pulls/277","id":36584136,"html_url":"https://github.com/finagle/finch/pull/277","diff_url":"https://github.com/finagle/finch/pull/277.diff","patch_url":"https://github.com/finagle/finch/pull/277.patch","issue_url":"https://api.github.com/repos/finagle/finch/issues/277","number":277,"state":"open","locked":false,"title":"Finch client Spike - Do Not Merge","user":{"login":"penland365","id":1630235,"avatar_url":"https://avatars.githubusercontent.com/u/1630235?v=3","gravatar_id":"","url":"https://api.github.com/users/penland365","html_url":"https://github.com/penland365","followers_url":"https://api.github.com/users/penland365/followers","following_url":"https://api.github.com/users/penland365/following{/other_user}","gists_url":"https://api.github.com/users/penland365/gists{/gist_id}","starred_url":"https://api.github.com/users/penland365/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penland365/subscriptions","organizations_url":"https://api.github.com/users/penland365/orgs","repos_url":"https://api.github.com/users/penland365/repos","events_url":"https://api.github.com/users/penland365/events{/privacy}","received_events_url":"https://api.github.com/users/penland365/received_events","type":"User","site_admin":false},"body":"This is a quick spike around what I think a `finch-client` could look like, at least for my typical use cases.  It's heavily biased towards a `RESTFul` style.  A small syntax showing useage is in the `README` for the package.  Quick synopsis:\r\n\r\n1. Create a Finch request w/ a host and an endpoint (finagle.Path)\r\n2. Make the actual Http request w/ an Http `Verb` => `Get(finchRequest)`\r\n3. `Verb` returns a `String Xor Resource` from `Cats` to handle failures better ( super shallow w/ this right now )\r\n4. A `Resource` is simply and HttpResponse Status like `Ok` parameterized on the response content type => `Ok(twitter.io.Buf)` or a `Ok(String)` or `Ok(argonaut.Json)`\r\n5. Right now I've got two implicit DecodeResource TypeClasses for `String` and `json.Argonaut`.\r\n\r\nThoughts on this style?  Love it?  Hate it?  It needs a lot of work, but this is much closer to what I envision that my partial baked gist I put in gitter and then yanked out on Friday.","created_at":"2015-05-31T15:40:12Z","updated_at":"2015-05-31T17:10:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad34b0236de7d4a876d35331ee19d0ce4ba79102","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/finagle/finch/pulls/277/commits","review_comments_url":"https://api.github.com/repos/finagle/finch/pulls/277/comments","review_comment_url":"https://api.github.com/repos/finagle/finch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/finagle/finch/issues/277/comments","statuses_url":"https://api.github.com/repos/finagle/finch/statuses/8808171aba76f2bd01de8e45bfd3c1856c8fcde5","head":{"label":"penland365:finch-client","ref":"finch-client","sha":"8808171aba76f2bd01de8e45bfd3c1856c8fcde5","user":{"login":"penland365","id":1630235,"avatar_url":"https://avatars.githubusercontent.com/u/1630235?v=3","gravatar_id":"","url":"https://api.github.com/users/penland365","html_url":"https://github.com/penland365","followers_url":"https://api.github.com/users/penland365/followers","following_url":"https://api.github.com/users/penland365/following{/other_user}","gists_url":"https://api.github.com/users/penland365/gists{/gist_id}","starred_url":"https://api.github.com/users/penland365/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penland365/subscriptions","organizations_url":"https://api.github.com/users/penland365/orgs","repos_url":"https://api.github.com/users/penland365/repos","events_url":"https://api.github.com/users/penland365/events{/privacy}","received_events_url":"https://api.github.com/users/penland365/received_events","type":"User","site_admin":false},"repo":{"id":28876930,"name":"finch","full_name":"penland365/finch","owner":{"login":"penland365","id":1630235,"avatar_url":"https://avatars.githubusercontent.com/u/1630235?v=3","gravatar_id":"","url":"https://api.github.com/users/penland365","html_url":"https://github.com/penland365","followers_url":"https://api.github.com/users/penland365/followers","following_url":"https://api.github.com/users/penland365/following{/other_user}","gists_url":"https://api.github.com/users/penland365/gists{/gist_id}","starred_url":"https://api.github.com/users/penland365/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penland365/subscriptions","organizations_url":"https://api.github.com/users/penland365/orgs","repos_url":"https://api.github.com/users/penland365/repos","events_url":"https://api.github.com/users/penland365/events{/privacy}","received_events_url":"https://api.github.com/users/penland365/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/penland365/finch","description":"Purely Functional REST API atop of Finagle","fork":true,"url":"https://api.github.com/repos/penland365/finch","forks_url":"https://api.github.com/repos/penland365/finch/forks","keys_url":"https://api.github.com/repos/penland365/finch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/penland365/finch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/penland365/finch/teams","hooks_url":"https://api.github.com/repos/penland365/finch/hooks","issue_events_url":"https://api.github.com/repos/penland365/finch/issues/events{/number}","events_url":"https://api.github.com/repos/penland365/finch/events","assignees_url":"https://api.github.com/repos/penland365/finch/assignees{/user}","branches_url":"https://api.github.com/repos/penland365/finch/branches{/branch}","tags_url":"https://api.github.com/repos/penland365/finch/tags","blobs_url":"https://api.github.com/repos/penland365/finch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/penland365/finch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/penland365/finch/git/refs{/sha}","trees_url":"https://api.github.com/repos/penland365/finch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/penland365/finch/statuses/{sha}","languages_url":"https://api.github.com/repos/penland365/finch/languages","stargazers_url":"https://api.github.com/repos/penland365/finch/stargazers","contributors_url":"https://api.github.com/repos/penland365/finch/contributors","subscribers_url":"https://api.github.com/repos/penland365/finch/subscribers","subscription_url":"https://api.github.com/repos/penland365/finch/subscription","commits_url":"https://api.github.com/repos/penland365/finch/commits{/sha}","git_commits_url":"https://api.github.com/repos/penland365/finch/git/commits{/sha}","comments_url":"https://api.github.com/repos/penland365/finch/comments{/number}","issue_comment_url":"https://api.github.com/repos/penland365/finch/issues/comments{/number}","contents_url":"https://api.github.com/repos/penland365/finch/contents/{+path}","compare_url":"https://api.github.com/repos/penland365/finch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/penland365/finch/merges","archive_url":"https://api.github.com/repos/penland365/finch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/penland365/finch/downloads","issues_url":"https://api.github.com/repos/penland365/finch/issues{/number}","pulls_url":"https://api.github.com/repos/penland365/finch/pulls{/number}","milestones_url":"https://api.github.com/repos/penland365/finch/milestones{/number}","notifications_url":"https://api.github.com/repos/penland365/finch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/penland365/finch/labels{/name}","releases_url":"https://api.github.com/repos/penland365/finch/releases{/id}","created_at":"2015-01-06T18:26:21Z","updated_at":"2015-05-04T22:45:25Z","pushed_at":"2015-05-31T15:33:18Z","git_url":"git://github.com/penland365/finch.git","ssh_url":"git@github.com:penland365/finch.git","clone_url":"https://github.com/penland365/finch.git","svn_url":"https://github.com/penland365/finch","homepage":"","size":1418,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"finagle:master","ref":"master","sha":"83116f23f790bccc832f3f803d6da53547fb6344","user":{"login":"finagle","id":7944306,"avatar_url":"https://avatars.githubusercontent.com/u/7944306?v=3","gravatar_id":"","url":"https://api.github.com/users/finagle","html_url":"https://github.com/finagle","followers_url":"https://api.github.com/users/finagle/followers","following_url":"https://api.github.com/users/finagle/following{/other_user}","gists_url":"https://api.github.com/users/finagle/gists{/gist_id}","starred_url":"https://api.github.com/users/finagle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/finagle/subscriptions","organizations_url":"https://api.github.com/users/finagle/orgs","repos_url":"https://api.github.com/users/finagle/repos","events_url":"https://api.github.com/users/finagle/events{/privacy}","received_events_url":"https://api.github.com/users/finagle/received_events","type":"Organization","site_admin":false},"repo":{"id":18798826,"name":"finch","full_name":"finagle/finch","owner":{"login":"finagle","id":7944306,"avatar_url":"https://avatars.githubusercontent.com/u/7944306?v=3","gravatar_id":"","url":"https://api.github.com/users/finagle","html_url":"https://github.com/finagle","followers_url":"https://api.github.com/users/finagle/followers","following_url":"https://api.github.com/users/finagle/following{/other_user}","gists_url":"https://api.github.com/users/finagle/gists{/gist_id}","starred_url":"https://api.github.com/users/finagle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/finagle/subscriptions","organizations_url":"https://api.github.com/users/finagle/orgs","repos_url":"https://api.github.com/users/finagle/repos","events_url":"https://api.github.com/users/finagle/events{/privacy}","received_events_url":"https://api.github.com/users/finagle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/finagle/finch","description":"An idiomatic Scala version of finagle-http","fork":false,"url":"https://api.github.com/repos/finagle/finch","forks_url":"https://api.github.com/repos/finagle/finch/forks","keys_url":"https://api.github.com/repos/finagle/finch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/finagle/finch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/finagle/finch/teams","hooks_url":"https://api.github.com/repos/finagle/finch/hooks","issue_events_url":"https://api.github.com/repos/finagle/finch/issues/events{/number}","events_url":"https://api.github.com/repos/finagle/finch/events","assignees_url":"https://api.github.com/repos/finagle/finch/assignees{/user}","branches_url":"https://api.github.com/repos/finagle/finch/branches{/branch}","tags_url":"https://api.github.com/repos/finagle/finch/tags","blobs_url":"https://api.github.com/repos/finagle/finch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/finagle/finch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/finagle/finch/git/refs{/sha}","trees_url":"https://api.github.com/repos/finagle/finch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/finagle/finch/statuses/{sha}","languages_url":"https://api.github.com/repos/finagle/finch/languages","stargazers_url":"https://api.github.com/repos/finagle/finch/stargazers","contributors_url":"https://api.github.com/repos/finagle/finch/contributors","subscribers_url":"https://api.github.com/repos/finagle/finch/subscribers","subscription_url":"https://api.github.com/repos/finagle/finch/subscription","commits_url":"https://api.github.com/repos/finagle/finch/commits{/sha}","git_commits_url":"https://api.github.com/repos/finagle/finch/git/commits{/sha}","comments_url":"https://api.github.com/repos/finagle/finch/comments{/number}","issue_comment_url":"https://api.github.com/repos/finagle/finch/issues/comments{/number}","contents_url":"https://api.github.com/repos/finagle/finch/contents/{+path}","compare_url":"https://api.github.com/repos/finagle/finch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/finagle/finch/merges","archive_url":"https://api.github.com/repos/finagle/finch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/finagle/finch/downloads","issues_url":"https://api.github.com/repos/finagle/finch/issues{/number}","pulls_url":"https://api.github.com/repos/finagle/finch/pulls{/number}","milestones_url":"https://api.github.com/repos/finagle/finch/milestones{/number}","notifications_url":"https://api.github.com/repos/finagle/finch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/finagle/finch/labels{/name}","releases_url":"https://api.github.com/repos/finagle/finch/releases{/id}","created_at":"2014-04-15T12:17:44Z","updated_at":"2015-05-29T11:39:18Z","pushed_at":"2015-05-31T16:44:56Z","git_url":"git://github.com/finagle/finch.git","ssh_url":"git@github.com:finagle/finch.git","clone_url":"https://github.com/finagle/finch.git","svn_url":"https://github.com/finagle/finch","homepage":"","size":5649,"stargazers_count":325,"watchers_count":325,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":38,"mirror_url":null,"open_issues_count":25,"forks":38,"open_issues":25,"watchers":325,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/finagle/finch/pulls/277"},"html":{"href":"https://github.com/finagle/finch/pull/277"},"issue":{"href":"https://api.github.com/repos/finagle/finch/issues/277"},"comments":{"href":"https://api.github.com/repos/finagle/finch/issues/277/comments"},"review_comments":{"href":"https://api.github.com/repos/finagle/finch/pulls/277/comments"},"review_comment":{"href":"https://api.github.com/repos/finagle/finch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/finagle/finch/pulls/277/commits"},"statuses":{"href":"https://api.github.com/repos/finagle/finch/statuses/8808171aba76f2bd01de8e45bfd3c1856c8fcde5"}}}}