{"action":"created","comment":{"url":"https://api.github.com/repos/Yelp/swagger-py/pulls/comments/27314936","id":27314936,"diff_hunk":"@@ -1,37 +1,59 @@\n-#!/usr/bin/env python\n # -*- coding: utf-8 -*-\n \n #\n-# Copyright (c) 2014, Yelp, Inc.\n+# Copyright (c) 2015, Yelp, Inc.\n #\n \n-\"\"\"Asynchronous HTTP client abstractions.\n-\"\"\"\n-\n import logging\n \n import fido\n from yelp_uri import urllib_utf8\n \n-from bravado import http_client\n-from bravado.multipart_response import create_multipart_content\n+from bravado.mapping.http_client import APP_FORM, HttpClient\n+from bravado.mapping.http_future import HttpFuture\n from bravado.mapping.param import stringify_body as param_stringify_body\n+from bravado.mapping.response import ResponseLike\n+from bravado.multipart_response import create_multipart_content\n \n log = logging.getLogger(__name__)\n \n \n-class AsynchronousHttpClient(http_client.HttpClient):\n-    \"\"\"Asynchronous HTTP client implementation.\n+class FidoResponseAdapter(ResponseLike):\n+    \"\"\"Wraps a fido.fido.Response object to provider a uniform interface\n+    to the response innards.\n+\n+    :type requests_lib_response: :class:`fido.fido.Response`\n+    \"\"\"\n+    def __init__(self, requests_lib_response):\n+        self._delegate = requests_lib_response\n+\n+    @property\n+    def status_code(self):\n+        return self._delegate.code\n+\n+    @property\n+    def text(self):\n+        return self._delegate.body\n+\n+    def json(self, **_):\n+        return self._delegate.json()\n+\n+\n+class FidoClient(HttpClient):\n+    \"\"\"Fido HTTP client implementation.\n     \"\"\"\n \n-    def start_request(self, request_params):\n+    def request(self, request_params, response_callback=None):\n         \"\"\"Sets up the request params as per Twisted Agent needs.\n         Sets up crochet and triggers the API request in background\n \n         :param request_params: request parameters for API call\n         :type request_params: dict\n+        :param response_callback: Function to be called after\n+        receiving the response\n+        :type response_callback: method\n \n-        :return: crochet EventualResult\n+        :return: :class: `bravado.mapping.http_future.HttpFuture`","path":"bravado/fido_client.py","position":67,"original_position":67,"commit_id":"884ad3dc4e73acc4e1df7fa41f3a498467c87b45","original_commit_id":"884ad3dc4e73acc4e1df7fa41f3a498467c87b45","user":{"login":"analogue","id":26757,"avatar_url":"https://avatars.githubusercontent.com/u/26757?v=3","gravatar_id":"","url":"https://api.github.com/users/analogue","html_url":"https://github.com/analogue","followers_url":"https://api.github.com/users/analogue/followers","following_url":"https://api.github.com/users/analogue/following{/other_user}","gists_url":"https://api.github.com/users/analogue/gists{/gist_id}","starred_url":"https://api.github.com/users/analogue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/analogue/subscriptions","organizations_url":"https://api.github.com/users/analogue/orgs","repos_url":"https://api.github.com/users/analogue/repos","events_url":"https://api.github.com/users/analogue/events{/privacy}","received_events_url":"https://api.github.com/users/analogue/received_events","type":"User","site_admin":false},"body":":rtype:","created_at":"2015-03-27T17:38:59Z","updated_at":"2015-03-27T17:38:59Z","html_url":"https://github.com/Yelp/swagger-py/pull/127#discussion_r27314936","pull_request_url":"https://api.github.com/repos/Yelp/swagger-py/pulls/127","_links":{"self":{"href":"https://api.github.com/repos/Yelp/swagger-py/pulls/comments/27314936"},"html":{"href":"https://github.com/Yelp/swagger-py/pull/127#discussion_r27314936"},"pull_request":{"href":"https://api.github.com/repos/Yelp/swagger-py/pulls/127"}}},"pull_request":{"url":"https://api.github.com/repos/Yelp/swagger-py/pulls/127","id":31699603,"html_url":"https://github.com/Yelp/swagger-py/pull/127","diff_url":"https://github.com/Yelp/swagger-py/pull/127.diff","patch_url":"https://github.com/Yelp/swagger-py/pull/127.patch","issue_url":"https://api.github.com/repos/Yelp/swagger-py/issues/127","number":127,"state":"open","locked":false,"title":"Refactore HttpClient and HttpFuture","user":{"login":"prat0318","id":1528697,"avatar_url":"https://avatars.githubusercontent.com/u/1528697?v=3","gravatar_id":"","url":"https://api.github.com/users/prat0318","html_url":"https://github.com/prat0318","followers_url":"https://api.github.com/users/prat0318/followers","following_url":"https://api.github.com/users/prat0318/following{/other_user}","gists_url":"https://api.github.com/users/prat0318/gists{/gist_id}","starred_url":"https://api.github.com/users/prat0318/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prat0318/subscriptions","organizations_url":"https://api.github.com/users/prat0318/orgs","repos_url":"https://api.github.com/users/prat0318/repos","events_url":"https://api.github.com/users/prat0318/events{/privacy}","received_events_url":"https://api.github.com/users/prat0318/received_events","type":"User","site_admin":false},"body":"- Fixes #120 (Most of the implementation taken from comments of #117)\r\n- Interface `HttpClient` and `HttpFuture` are place in `bravado.mapping`\r\n- Implementations are kept in `bravado/`\r\n- Removed `SynchronousEventual` and `handle_respone` tests\r\n\r\nPending: \r\n- I have yet to write more unit tests to it, but did not want the PR to get more bulkier.\r\n- More functional tests.","created_at":"2015-03-23T01:23:56Z","updated_at":"2015-03-27T17:38:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1f1c8267bc33d9ca741ec25e906fcf5c60fc251","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Yelp/swagger-py/pulls/127/commits","review_comments_url":"https://api.github.com/repos/Yelp/swagger-py/pulls/127/comments","review_comment_url":"https://api.github.com/repos/Yelp/swagger-py/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yelp/swagger-py/issues/127/comments","statuses_url":"https://api.github.com/repos/Yelp/swagger-py/statuses/884ad3dc4e73acc4e1df7fa41f3a498467c87b45","head":{"label":"prat0318:swagger2.0","ref":"swagger2.0","sha":"884ad3dc4e73acc4e1df7fa41f3a498467c87b45","user":{"login":"prat0318","id":1528697,"avatar_url":"https://avatars.githubusercontent.com/u/1528697?v=3","gravatar_id":"","url":"https://api.github.com/users/prat0318","html_url":"https://github.com/prat0318","followers_url":"https://api.github.com/users/prat0318/followers","following_url":"https://api.github.com/users/prat0318/following{/other_user}","gists_url":"https://api.github.com/users/prat0318/gists{/gist_id}","starred_url":"https://api.github.com/users/prat0318/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prat0318/subscriptions","organizations_url":"https://api.github.com/users/prat0318/orgs","repos_url":"https://api.github.com/users/prat0318/repos","events_url":"https://api.github.com/users/prat0318/events{/privacy}","received_events_url":"https://api.github.com/users/prat0318/received_events","type":"User","site_admin":false},"repo":{"id":29019430,"name":"swagger-py","full_name":"prat0318/swagger-py","owner":{"login":"prat0318","id":1528697,"avatar_url":"https://avatars.githubusercontent.com/u/1528697?v=3","gravatar_id":"","url":"https://api.github.com/users/prat0318","html_url":"https://github.com/prat0318","followers_url":"https://api.github.com/users/prat0318/followers","following_url":"https://api.github.com/users/prat0318/following{/other_user}","gists_url":"https://api.github.com/users/prat0318/gists{/gist_id}","starred_url":"https://api.github.com/users/prat0318/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prat0318/subscriptions","organizations_url":"https://api.github.com/users/prat0318/orgs","repos_url":"https://api.github.com/users/prat0318/repos","events_url":"https://api.github.com/users/prat0318/events{/privacy}","received_events_url":"https://api.github.com/users/prat0318/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/prat0318/swagger-py","description":"Generic client library for Python2.6 - adopts SwaggerVersion 1.2","fork":true,"url":"https://api.github.com/repos/prat0318/swagger-py","forks_url":"https://api.github.com/repos/prat0318/swagger-py/forks","keys_url":"https://api.github.com/repos/prat0318/swagger-py/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prat0318/swagger-py/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prat0318/swagger-py/teams","hooks_url":"https://api.github.com/repos/prat0318/swagger-py/hooks","issue_events_url":"https://api.github.com/repos/prat0318/swagger-py/issues/events{/number}","events_url":"https://api.github.com/repos/prat0318/swagger-py/events","assignees_url":"https://api.github.com/repos/prat0318/swagger-py/assignees{/user}","branches_url":"https://api.github.com/repos/prat0318/swagger-py/branches{/branch}","tags_url":"https://api.github.com/repos/prat0318/swagger-py/tags","blobs_url":"https://api.github.com/repos/prat0318/swagger-py/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prat0318/swagger-py/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prat0318/swagger-py/git/refs{/sha}","trees_url":"https://api.github.com/repos/prat0318/swagger-py/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prat0318/swagger-py/statuses/{sha}","languages_url":"https://api.github.com/repos/prat0318/swagger-py/languages","stargazers_url":"https://api.github.com/repos/prat0318/swagger-py/stargazers","contributors_url":"https://api.github.com/repos/prat0318/swagger-py/contributors","subscribers_url":"https://api.github.com/repos/prat0318/swagger-py/subscribers","subscription_url":"https://api.github.com/repos/prat0318/swagger-py/subscription","commits_url":"https://api.github.com/repos/prat0318/swagger-py/commits{/sha}","git_commits_url":"https://api.github.com/repos/prat0318/swagger-py/git/commits{/sha}","comments_url":"https://api.github.com/repos/prat0318/swagger-py/comments{/number}","issue_comment_url":"https://api.github.com/repos/prat0318/swagger-py/issues/comments{/number}","contents_url":"https://api.github.com/repos/prat0318/swagger-py/contents/{+path}","compare_url":"https://api.github.com/repos/prat0318/swagger-py/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prat0318/swagger-py/merges","archive_url":"https://api.github.com/repos/prat0318/swagger-py/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prat0318/swagger-py/downloads","issues_url":"https://api.github.com/repos/prat0318/swagger-py/issues{/number}","pulls_url":"https://api.github.com/repos/prat0318/swagger-py/pulls{/number}","milestones_url":"https://api.github.com/repos/prat0318/swagger-py/milestones{/number}","notifications_url":"https://api.github.com/repos/prat0318/swagger-py/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prat0318/swagger-py/labels{/name}","releases_url":"https://api.github.com/repos/prat0318/swagger-py/releases{/id}","created_at":"2015-01-09T14:23:23Z","updated_at":"2015-03-16T20:20:28Z","pushed_at":"2015-03-26T23:27:56Z","git_url":"git://github.com/prat0318/swagger-py.git","ssh_url":"git@github.com:prat0318/swagger-py.git","clone_url":"https://github.com/prat0318/swagger-py.git","svn_url":"https://github.com/prat0318/swagger-py","homepage":"","size":1062,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"Yelp:swagger2.0","ref":"swagger2.0","sha":"3ea71320f074446f92d8b21cf0d219390438aa47","user":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":20313056,"name":"swagger-py","full_name":"Yelp/swagger-py","owner":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/swagger-py","description":"Generic client library for Python2.6 - adopts SwaggerVersion 1.2","fork":false,"url":"https://api.github.com/repos/Yelp/swagger-py","forks_url":"https://api.github.com/repos/Yelp/swagger-py/forks","keys_url":"https://api.github.com/repos/Yelp/swagger-py/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/swagger-py/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/swagger-py/teams","hooks_url":"https://api.github.com/repos/Yelp/swagger-py/hooks","issue_events_url":"https://api.github.com/repos/Yelp/swagger-py/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/swagger-py/events","assignees_url":"https://api.github.com/repos/Yelp/swagger-py/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/swagger-py/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/swagger-py/tags","blobs_url":"https://api.github.com/repos/Yelp/swagger-py/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/swagger-py/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/swagger-py/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/swagger-py/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/swagger-py/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/swagger-py/languages","stargazers_url":"https://api.github.com/repos/Yelp/swagger-py/stargazers","contributors_url":"https://api.github.com/repos/Yelp/swagger-py/contributors","subscribers_url":"https://api.github.com/repos/Yelp/swagger-py/subscribers","subscription_url":"https://api.github.com/repos/Yelp/swagger-py/subscription","commits_url":"https://api.github.com/repos/Yelp/swagger-py/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/swagger-py/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/swagger-py/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/swagger-py/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/swagger-py/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/swagger-py/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/swagger-py/merges","archive_url":"https://api.github.com/repos/Yelp/swagger-py/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/swagger-py/downloads","issues_url":"https://api.github.com/repos/Yelp/swagger-py/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/swagger-py/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/swagger-py/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/swagger-py/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/swagger-py/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/swagger-py/releases{/id}","created_at":"2014-05-30T01:03:02Z","updated_at":"2015-03-24T21:43:52Z","pushed_at":"2015-03-26T23:27:56Z","git_url":"git://github.com/Yelp/swagger-py.git","ssh_url":"git@github.com:Yelp/swagger-py.git","clone_url":"https://github.com/Yelp/swagger-py.git","svn_url":"https://github.com/Yelp/swagger-py","homepage":"","size":2289,"stargazers_count":18,"watchers_count":18,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":21,"forks":12,"open_issues":21,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Yelp/swagger-py/pulls/127"},"html":{"href":"https://github.com/Yelp/swagger-py/pull/127"},"issue":{"href":"https://api.github.com/repos/Yelp/swagger-py/issues/127"},"comments":{"href":"https://api.github.com/repos/Yelp/swagger-py/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/Yelp/swagger-py/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/Yelp/swagger-py/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yelp/swagger-py/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/Yelp/swagger-py/statuses/884ad3dc4e73acc4e1df7fa41f3a498467c87b45"}}}}