{"action":"created","comment":{"url":"https://api.github.com/repos/ga4gh/server/pulls/comments/24187090","id":24187090,"diff_hunk":"@@ -38,31 +145,53 @@ def runRequest(self, request, url, protocolClass, listAttr):\n         \"\"\"\n         notDone = True\n         while notDone:\n-            jsonString = request.toJSONString()\n-            headers = {\"Content-type\": \"application/json\"}\n-            # make sure we correctly join with/out trailing slashes\n-            fullUrl = posixpath.join(self._urlPrefix, url)\n-            # TODO Can we get requests to output debugging information when\n-            # debugLevel > 0?\n-            authUrl = self._addAuth(fullUrl)\n-            response = requests.post(\n-                authUrl, jsonString, headers=headers, verify=False)\n-            response.raise_for_status()\n-            jsonString = response.text\n-            self._bytesRead += len(jsonString)\n-            if self._debugLevel > 1:\n-                # TODO use a logging output and integrate with HTTP client more\n-                # nicely.\n-                print(\"json response:\")\n-                pp = json.dumps(\n-                    json.loads(jsonString), sort_keys=True, indent=4)\n-                print(pp)\n-            resp = protocolClass.fromJSONString(jsonString)\n-            # TODO handle HTTP errors from requests and display.\n-            for extract in getattr(resp, listAttr):\n-                yield extract\n-            request.pageToken = resp.nextPageToken\n-            notDone = resp.nextPageToken is not None\n+            # do the request\n+            response = self._doRequest(requestContainer)\n+\n+            # deserialize json response\n+            responseObject = self._deserializeResponse(\n+                response, requestContainer.protocolClass)\n+\n+            # yield the results\n+            if requestContainer.listAttr is None:\n+                yield responseObject\n+            else:\n+                obj = getattr(responseObject, requestContainer.listAttr)\n+                for extract in obj:\n+                    yield extract\n+\n+            # update the pageToken and notDone\n+            notDone = self._updateNotDone(responseObject, requestContainer)\n+\n+    def getReferenceSet(self, id_):\n+        \"\"\"\n+        Returns a referenceSet from the server\n+        \"\"\"\n+        requestContainer = self.RunRequestContainer(\n+            url=\"referencesets/{id}\",\n+            protocolClass=protocol.GAReferenceSet,\n+            requestMethod='get', id_=id_)\n+        return self.runRequestSingle(requestContainer)","path":"ga4gh/client.py","position":188,"original_position":188,"commit_id":"88d98941b7fb85521fd0fbb46ff86fb6ff7fe5bc","original_commit_id":"88d98941b7fb85521fd0fbb46ff86fb6ff7fe5bc","user":{"login":"dcolligan","id":7422120,"avatar_url":"https://avatars.githubusercontent.com/u/7422120?v=3","gravatar_id":"","url":"https://api.github.com/users/dcolligan","html_url":"https://github.com/dcolligan","followers_url":"https://api.github.com/users/dcolligan/followers","following_url":"https://api.github.com/users/dcolligan/following{/other_user}","gists_url":"https://api.github.com/users/dcolligan/gists{/gist_id}","starred_url":"https://api.github.com/users/dcolligan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcolligan/subscriptions","organizations_url":"https://api.github.com/users/dcolligan/orgs","repos_url":"https://api.github.com/users/dcolligan/repos","events_url":"https://api.github.com/users/dcolligan/events{/privacy}","received_events_url":"https://api.github.com/users/dcolligan/received_events","type":"User","site_admin":false},"body":"The point of the RunRequestContainer was to decouple the cli methods from the client methods by providing an object that any cli method could create and any client method could use.  I'm not sure tightly coupling them again would be a good idea.","created_at":"2015-02-05T18:43:39Z","updated_at":"2015-02-05T18:43:39Z","html_url":"https://github.com/ga4gh/server/pull/108#discussion_r24187090","pull_request_url":"https://api.github.com/repos/ga4gh/server/pulls/108","_links":{"self":{"href":"https://api.github.com/repos/ga4gh/server/pulls/comments/24187090"},"html":{"href":"https://github.com/ga4gh/server/pull/108#discussion_r24187090"},"pull_request":{"href":"https://api.github.com/repos/ga4gh/server/pulls/108"}}},"pull_request":{"url":"https://api.github.com/repos/ga4gh/server/pulls/108","id":28375644,"html_url":"https://github.com/ga4gh/server/pull/108","diff_url":"https://github.com/ga4gh/server/pull/108.diff","patch_url":"https://github.com/ga4gh/server/pull/108.patch","issue_url":"https://api.github.com/repos/ga4gh/server/issues/108","number":108,"state":"open","locked":false,"title":"76 client endpoints 2","user":{"login":"dcolligan","id":7422120,"avatar_url":"https://avatars.githubusercontent.com/u/7422120?v=3","gravatar_id":"","url":"https://api.github.com/users/dcolligan","html_url":"https://github.com/dcolligan","followers_url":"https://api.github.com/users/dcolligan/followers","following_url":"https://api.github.com/users/dcolligan/following{/other_user}","gists_url":"https://api.github.com/users/dcolligan/gists{/gist_id}","starred_url":"https://api.github.com/users/dcolligan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcolligan/subscriptions","organizations_url":"https://api.github.com/users/dcolligan/orgs","repos_url":"https://api.github.com/users/dcolligan/repos","events_url":"https://api.github.com/users/dcolligan/events{/privacy}","received_events_url":"https://api.github.com/users/dcolligan/received_events","type":"User","site_admin":false},"body":"The remaining client endpoints.\r\n\r\nThere were a lot more design decisions to be made here vs the last client endpoint PR.  Feedback appreciated.\r\n\r\nWill close #76 ","created_at":"2015-01-30T16:54:22Z","updated_at":"2015-02-05T18:43:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0300acf256a78a255002c16f0e59bf186524949f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ga4gh/server/pulls/108/commits","review_comments_url":"https://api.github.com/repos/ga4gh/server/pulls/108/comments","review_comment_url":"https://api.github.com/repos/ga4gh/server/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ga4gh/server/issues/108/comments","statuses_url":"https://api.github.com/repos/ga4gh/server/statuses/88d98941b7fb85521fd0fbb46ff86fb6ff7fe5bc","head":{"label":"dcolligan:76_client_endpoints_2","ref":"76_client_endpoints_2","sha":"88d98941b7fb85521fd0fbb46ff86fb6ff7fe5bc","user":{"login":"dcolligan","id":7422120,"avatar_url":"https://avatars.githubusercontent.com/u/7422120?v=3","gravatar_id":"","url":"https://api.github.com/users/dcolligan","html_url":"https://github.com/dcolligan","followers_url":"https://api.github.com/users/dcolligan/followers","following_url":"https://api.github.com/users/dcolligan/following{/other_user}","gists_url":"https://api.github.com/users/dcolligan/gists{/gist_id}","starred_url":"https://api.github.com/users/dcolligan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcolligan/subscriptions","organizations_url":"https://api.github.com/users/dcolligan/orgs","repos_url":"https://api.github.com/users/dcolligan/repos","events_url":"https://api.github.com/users/dcolligan/events{/privacy}","received_events_url":"https://api.github.com/users/dcolligan/received_events","type":"User","site_admin":false},"repo":{"id":29265238,"name":"server","full_name":"dcolligan/server","owner":{"login":"dcolligan","id":7422120,"avatar_url":"https://avatars.githubusercontent.com/u/7422120?v=3","gravatar_id":"","url":"https://api.github.com/users/dcolligan","html_url":"https://github.com/dcolligan","followers_url":"https://api.github.com/users/dcolligan/followers","following_url":"https://api.github.com/users/dcolligan/following{/other_user}","gists_url":"https://api.github.com/users/dcolligan/gists{/gist_id}","starred_url":"https://api.github.com/users/dcolligan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcolligan/subscriptions","organizations_url":"https://api.github.com/users/dcolligan/orgs","repos_url":"https://api.github.com/users/dcolligan/repos","events_url":"https://api.github.com/users/dcolligan/events{/privacy}","received_events_url":"https://api.github.com/users/dcolligan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dcolligan/server","description":"A reference implementation of the APIs defined in the schemas repository.","fork":true,"url":"https://api.github.com/repos/dcolligan/server","forks_url":"https://api.github.com/repos/dcolligan/server/forks","keys_url":"https://api.github.com/repos/dcolligan/server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcolligan/server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcolligan/server/teams","hooks_url":"https://api.github.com/repos/dcolligan/server/hooks","issue_events_url":"https://api.github.com/repos/dcolligan/server/issues/events{/number}","events_url":"https://api.github.com/repos/dcolligan/server/events","assignees_url":"https://api.github.com/repos/dcolligan/server/assignees{/user}","branches_url":"https://api.github.com/repos/dcolligan/server/branches{/branch}","tags_url":"https://api.github.com/repos/dcolligan/server/tags","blobs_url":"https://api.github.com/repos/dcolligan/server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcolligan/server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcolligan/server/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcolligan/server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcolligan/server/statuses/{sha}","languages_url":"https://api.github.com/repos/dcolligan/server/languages","stargazers_url":"https://api.github.com/repos/dcolligan/server/stargazers","contributors_url":"https://api.github.com/repos/dcolligan/server/contributors","subscribers_url":"https://api.github.com/repos/dcolligan/server/subscribers","subscription_url":"https://api.github.com/repos/dcolligan/server/subscription","commits_url":"https://api.github.com/repos/dcolligan/server/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcolligan/server/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcolligan/server/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcolligan/server/issues/comments/{number}","contents_url":"https://api.github.com/repos/dcolligan/server/contents/{+path}","compare_url":"https://api.github.com/repos/dcolligan/server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcolligan/server/merges","archive_url":"https://api.github.com/repos/dcolligan/server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcolligan/server/downloads","issues_url":"https://api.github.com/repos/dcolligan/server/issues{/number}","pulls_url":"https://api.github.com/repos/dcolligan/server/pulls{/number}","milestones_url":"https://api.github.com/repos/dcolligan/server/milestones{/number}","notifications_url":"https://api.github.com/repos/dcolligan/server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcolligan/server/labels{/name}","releases_url":"https://api.github.com/repos/dcolligan/server/releases{/id}","created_at":"2015-01-14T20:53:47Z","updated_at":"2015-02-05T13:06:18Z","pushed_at":"2015-02-05T16:21:42Z","git_url":"git://github.com/dcolligan/server.git","ssh_url":"git@github.com:dcolligan/server.git","clone_url":"https://github.com/dcolligan/server.git","svn_url":"https://github.com/dcolligan/server","homepage":null,"size":726,"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":"ga4gh:master","ref":"master","sha":"2c25685862b2c8e9aae066109743b90712661f70","user":{"login":"ga4gh","id":6921777,"avatar_url":"https://avatars.githubusercontent.com/u/6921777?v=3","gravatar_id":"","url":"https://api.github.com/users/ga4gh","html_url":"https://github.com/ga4gh","followers_url":"https://api.github.com/users/ga4gh/followers","following_url":"https://api.github.com/users/ga4gh/following{/other_user}","gists_url":"https://api.github.com/users/ga4gh/gists{/gist_id}","starred_url":"https://api.github.com/users/ga4gh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga4gh/subscriptions","organizations_url":"https://api.github.com/users/ga4gh/orgs","repos_url":"https://api.github.com/users/ga4gh/repos","events_url":"https://api.github.com/users/ga4gh/events{/privacy}","received_events_url":"https://api.github.com/users/ga4gh/received_events","type":"Organization","site_admin":false},"repo":{"id":22882621,"name":"server","full_name":"ga4gh/server","owner":{"login":"ga4gh","id":6921777,"avatar_url":"https://avatars.githubusercontent.com/u/6921777?v=3","gravatar_id":"","url":"https://api.github.com/users/ga4gh","html_url":"https://github.com/ga4gh","followers_url":"https://api.github.com/users/ga4gh/followers","following_url":"https://api.github.com/users/ga4gh/following{/other_user}","gists_url":"https://api.github.com/users/ga4gh/gists{/gist_id}","starred_url":"https://api.github.com/users/ga4gh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga4gh/subscriptions","organizations_url":"https://api.github.com/users/ga4gh/orgs","repos_url":"https://api.github.com/users/ga4gh/repos","events_url":"https://api.github.com/users/ga4gh/events{/privacy}","received_events_url":"https://api.github.com/users/ga4gh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ga4gh/server","description":"A reference implementation of the APIs defined in the schemas repository.","fork":false,"url":"https://api.github.com/repos/ga4gh/server","forks_url":"https://api.github.com/repos/ga4gh/server/forks","keys_url":"https://api.github.com/repos/ga4gh/server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ga4gh/server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ga4gh/server/teams","hooks_url":"https://api.github.com/repos/ga4gh/server/hooks","issue_events_url":"https://api.github.com/repos/ga4gh/server/issues/events{/number}","events_url":"https://api.github.com/repos/ga4gh/server/events","assignees_url":"https://api.github.com/repos/ga4gh/server/assignees{/user}","branches_url":"https://api.github.com/repos/ga4gh/server/branches{/branch}","tags_url":"https://api.github.com/repos/ga4gh/server/tags","blobs_url":"https://api.github.com/repos/ga4gh/server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ga4gh/server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ga4gh/server/git/refs{/sha}","trees_url":"https://api.github.com/repos/ga4gh/server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ga4gh/server/statuses/{sha}","languages_url":"https://api.github.com/repos/ga4gh/server/languages","stargazers_url":"https://api.github.com/repos/ga4gh/server/stargazers","contributors_url":"https://api.github.com/repos/ga4gh/server/contributors","subscribers_url":"https://api.github.com/repos/ga4gh/server/subscribers","subscription_url":"https://api.github.com/repos/ga4gh/server/subscription","commits_url":"https://api.github.com/repos/ga4gh/server/commits{/sha}","git_commits_url":"https://api.github.com/repos/ga4gh/server/git/commits{/sha}","comments_url":"https://api.github.com/repos/ga4gh/server/comments{/number}","issue_comment_url":"https://api.github.com/repos/ga4gh/server/issues/comments/{number}","contents_url":"https://api.github.com/repos/ga4gh/server/contents/{+path}","compare_url":"https://api.github.com/repos/ga4gh/server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ga4gh/server/merges","archive_url":"https://api.github.com/repos/ga4gh/server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ga4gh/server/downloads","issues_url":"https://api.github.com/repos/ga4gh/server/issues{/number}","pulls_url":"https://api.github.com/repos/ga4gh/server/pulls{/number}","milestones_url":"https://api.github.com/repos/ga4gh/server/milestones{/number}","notifications_url":"https://api.github.com/repos/ga4gh/server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ga4gh/server/labels{/name}","releases_url":"https://api.github.com/repos/ga4gh/server/releases{/id}","created_at":"2014-08-12T15:31:49Z","updated_at":"2015-02-05T09:10:02Z","pushed_at":"2015-02-05T09:10:01Z","git_url":"git://github.com/ga4gh/server.git","ssh_url":"git@github.com:ga4gh/server.git","clone_url":"https://github.com/ga4gh/server.git","svn_url":"https://github.com/ga4gh/server","homepage":null,"size":1444,"stargazers_count":21,"watchers_count":21,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":42,"forks":21,"open_issues":42,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ga4gh/server/pulls/108"},"html":{"href":"https://github.com/ga4gh/server/pull/108"},"issue":{"href":"https://api.github.com/repos/ga4gh/server/issues/108"},"comments":{"href":"https://api.github.com/repos/ga4gh/server/issues/108/comments"},"review_comments":{"href":"https://api.github.com/repos/ga4gh/server/pulls/108/comments"},"review_comment":{"href":"https://api.github.com/repos/ga4gh/server/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ga4gh/server/pulls/108/commits"},"statuses":{"href":"https://api.github.com/repos/ga4gh/server/statuses/88d98941b7fb85521fd0fbb46ff86fb6ff7fe5bc"}}}}