{"action":"created","comment":{"url":"https://api.github.com/repos/googleapis/gax-nodejs/pulls/comments/85177135","pull_request_review_id":5907590,"id":85177135,"diff_hunk":"@@ -0,0 +1,161 @@\n+/**\n+ * Copyright 2016, Google Inc.\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are\n+ * met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * Redistributions in binary form must reproduce the above\n+ * copyright notice, this list of conditions and the following disclaimer\n+ * in the documentation and/or other materials provided with the\n+ * distribution.\n+ *     * Neither the name of Google Inc. nor the names of its\n+ * contributors may be used to endorse or promote products derived from\n+ * this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+'use strict';\n+\n+var through2 = require('through2');\n+var NormalApiCaller = require('./api_callable').NormalApiCaller;\n+var ReadableStream = require('readable-stream');\n+\n+/**\n+ * Creates an API caller that returns a stream to performs page-streaming.\n+ *\n+ * @private\n+ * @constructor\n+ * @param {PageDescriptor} pageDescriptor - indicates the structure\n+ *   of page streaming to be performed.\n+ */\n+function PageStreamable(pageDescriptor) {\n+  this.pageDescriptor = pageDescriptor;\n+}\n+\n+PageStreamable.prototype.createActualCallback = function(callback) {\n+  return function fetchNextPageToken(err, response) {\n+    if (err) {\n+      callback(err);\n+    }\n+    var pageToken = response[this.pageDescriptor.responsePageTokenField];\n+    callback(err, response, pageToken);\n+  }.bind(this);\n+};\n+\n+PageStreamable.prototype.init = function(settings, callback) {\n+  if (callback) {\n+    settings.flattenPages = false;\n+    callback = this.createActualCallback(callback);\n+  }\n+  if (!settings.flattenPages) {\n+    return NormalApiCaller.prototype.init.call(this, settings, callback);\n+  }\n+  return through2.obj();\n+};\n+\n+PageStreamable.prototype.streaming = function(stream) {\n+  this.apiCall(this.argument, this.streamingCallback.bind(this));","path":"lib/page_streaming.js","position":71,"original_position":71,"commit_id":"b9ff924db9420e2f6c61dcb1eaf9d6b438cb448f","original_commit_id":"b9ff924db9420e2f6c61dcb1eaf9d6b438cb448f","user":{"login":"landrito","id":8572251,"avatar_url":"https://avatars.githubusercontent.com/u/8572251?v=3","gravatar_id":"","url":"https://api.github.com/users/landrito","html_url":"https://github.com/landrito","followers_url":"https://api.github.com/users/landrito/followers","following_url":"https://api.github.com/users/landrito/following{/other_user}","gists_url":"https://api.github.com/users/landrito/gists{/gist_id}","starred_url":"https://api.github.com/users/landrito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landrito/subscriptions","organizations_url":"https://api.github.com/users/landrito/orgs","repos_url":"https://api.github.com/users/landrito/repos","events_url":"https://api.github.com/users/landrito/events{/privacy}","received_events_url":"https://api.github.com/users/landrito/received_events","type":"User","site_admin":false},"body":"`this.apiCall` is not set. I think it used to be set in `PageStreamable.prototype.call`.","created_at":"2016-10-26T17:32:57Z","updated_at":"2016-10-26T17:32:57Z","html_url":"https://github.com/googleapis/gax-nodejs/pull/58#discussion_r85177135","pull_request_url":"https://api.github.com/repos/googleapis/gax-nodejs/pulls/58","_links":{"self":{"href":"https://api.github.com/repos/googleapis/gax-nodejs/pulls/comments/85177135"},"html":{"href":"https://github.com/googleapis/gax-nodejs/pull/58#discussion_r85177135"},"pull_request":{"href":"https://api.github.com/repos/googleapis/gax-nodejs/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/googleapis/gax-nodejs/pulls/58","id":90273368,"html_url":"https://github.com/googleapis/gax-nodejs/pull/58","diff_url":"https://github.com/googleapis/gax-nodejs/pull/58.diff","patch_url":"https://github.com/googleapis/gax-nodejs/pull/58.patch","issue_url":"https://api.github.com/repos/googleapis/gax-nodejs/issues/58","number":58,"state":"open","locked":false,"title":"Introduce the basic support of gRPC-streaming.","user":{"login":"jmuk","id":816093,"avatar_url":"https://avatars.githubusercontent.com/u/816093?v=3","gravatar_id":"","url":"https://api.github.com/users/jmuk","html_url":"https://github.com/jmuk","followers_url":"https://api.github.com/users/jmuk/followers","following_url":"https://api.github.com/users/jmuk/following{/other_user}","gists_url":"https://api.github.com/users/jmuk/gists{/gist_id}","starred_url":"https://api.github.com/users/jmuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmuk/subscriptions","organizations_url":"https://api.github.com/users/jmuk/orgs","repos_url":"https://api.github.com/users/jmuk/repos","events_url":"https://api.github.com/users/jmuk/events{/privacy}","received_events_url":"https://api.github.com/users/jmuk/received_events","type":"User","site_admin":false},"body":"updates googleapis/toolkit#343","created_at":"2016-10-20T20:18:24Z","updated_at":"2016-10-26T18:04:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80bece035cedec4d28cae07cdf60d144bc3e77d8","assignee":{"login":"landrito","id":8572251,"avatar_url":"https://avatars.githubusercontent.com/u/8572251?v=3","gravatar_id":"","url":"https://api.github.com/users/landrito","html_url":"https://github.com/landrito","followers_url":"https://api.github.com/users/landrito/followers","following_url":"https://api.github.com/users/landrito/following{/other_user}","gists_url":"https://api.github.com/users/landrito/gists{/gist_id}","starred_url":"https://api.github.com/users/landrito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landrito/subscriptions","organizations_url":"https://api.github.com/users/landrito/orgs","repos_url":"https://api.github.com/users/landrito/repos","events_url":"https://api.github.com/users/landrito/events{/privacy}","received_events_url":"https://api.github.com/users/landrito/received_events","type":"User","site_admin":false},"assignees":[{"login":"landrito","id":8572251,"avatar_url":"https://avatars.githubusercontent.com/u/8572251?v=3","gravatar_id":"","url":"https://api.github.com/users/landrito","html_url":"https://github.com/landrito","followers_url":"https://api.github.com/users/landrito/followers","following_url":"https://api.github.com/users/landrito/following{/other_user}","gists_url":"https://api.github.com/users/landrito/gists{/gist_id}","starred_url":"https://api.github.com/users/landrito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landrito/subscriptions","organizations_url":"https://api.github.com/users/landrito/orgs","repos_url":"https://api.github.com/users/landrito/repos","events_url":"https://api.github.com/users/landrito/events{/privacy}","received_events_url":"https://api.github.com/users/landrito/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/googleapis/gax-nodejs/pulls/58/commits","review_comments_url":"https://api.github.com/repos/googleapis/gax-nodejs/pulls/58/comments","review_comment_url":"https://api.github.com/repos/googleapis/gax-nodejs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/gax-nodejs/issues/58/comments","statuses_url":"https://api.github.com/repos/googleapis/gax-nodejs/statuses/b9ff924db9420e2f6c61dcb1eaf9d6b438cb448f","head":{"label":"jmuk:streaming","ref":"streaming","sha":"b9ff924db9420e2f6c61dcb1eaf9d6b438cb448f","user":{"login":"jmuk","id":816093,"avatar_url":"https://avatars.githubusercontent.com/u/816093?v=3","gravatar_id":"","url":"https://api.github.com/users/jmuk","html_url":"https://github.com/jmuk","followers_url":"https://api.github.com/users/jmuk/followers","following_url":"https://api.github.com/users/jmuk/following{/other_user}","gists_url":"https://api.github.com/users/jmuk/gists{/gist_id}","starred_url":"https://api.github.com/users/jmuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmuk/subscriptions","organizations_url":"https://api.github.com/users/jmuk/orgs","repos_url":"https://api.github.com/users/jmuk/repos","events_url":"https://api.github.com/users/jmuk/events{/privacy}","received_events_url":"https://api.github.com/users/jmuk/received_events","type":"User","site_admin":false},"repo":{"id":58502661,"name":"gax-nodejs","full_name":"jmuk/gax-nodejs","owner":{"login":"jmuk","id":816093,"avatar_url":"https://avatars.githubusercontent.com/u/816093?v=3","gravatar_id":"","url":"https://api.github.com/users/jmuk","html_url":"https://github.com/jmuk","followers_url":"https://api.github.com/users/jmuk/followers","following_url":"https://api.github.com/users/jmuk/following{/other_user}","gists_url":"https://api.github.com/users/jmuk/gists{/gist_id}","starred_url":"https://api.github.com/users/jmuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmuk/subscriptions","organizations_url":"https://api.github.com/users/jmuk/orgs","repos_url":"https://api.github.com/users/jmuk/repos","events_url":"https://api.github.com/users/jmuk/events{/privacy}","received_events_url":"https://api.github.com/users/jmuk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmuk/gax-nodejs","description":"Google API Extensions for Node.js","fork":true,"url":"https://api.github.com/repos/jmuk/gax-nodejs","forks_url":"https://api.github.com/repos/jmuk/gax-nodejs/forks","keys_url":"https://api.github.com/repos/jmuk/gax-nodejs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmuk/gax-nodejs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmuk/gax-nodejs/teams","hooks_url":"https://api.github.com/repos/jmuk/gax-nodejs/hooks","issue_events_url":"https://api.github.com/repos/jmuk/gax-nodejs/issues/events{/number}","events_url":"https://api.github.com/repos/jmuk/gax-nodejs/events","assignees_url":"https://api.github.com/repos/jmuk/gax-nodejs/assignees{/user}","branches_url":"https://api.github.com/repos/jmuk/gax-nodejs/branches{/branch}","tags_url":"https://api.github.com/repos/jmuk/gax-nodejs/tags","blobs_url":"https://api.github.com/repos/jmuk/gax-nodejs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmuk/gax-nodejs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmuk/gax-nodejs/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmuk/gax-nodejs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmuk/gax-nodejs/statuses/{sha}","languages_url":"https://api.github.com/repos/jmuk/gax-nodejs/languages","stargazers_url":"https://api.github.com/repos/jmuk/gax-nodejs/stargazers","contributors_url":"https://api.github.com/repos/jmuk/gax-nodejs/contributors","subscribers_url":"https://api.github.com/repos/jmuk/gax-nodejs/subscribers","subscription_url":"https://api.github.com/repos/jmuk/gax-nodejs/subscription","commits_url":"https://api.github.com/repos/jmuk/gax-nodejs/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmuk/gax-nodejs/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmuk/gax-nodejs/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmuk/gax-nodejs/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmuk/gax-nodejs/contents/{+path}","compare_url":"https://api.github.com/repos/jmuk/gax-nodejs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmuk/gax-nodejs/merges","archive_url":"https://api.github.com/repos/jmuk/gax-nodejs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmuk/gax-nodejs/downloads","issues_url":"https://api.github.com/repos/jmuk/gax-nodejs/issues{/number}","pulls_url":"https://api.github.com/repos/jmuk/gax-nodejs/pulls{/number}","milestones_url":"https://api.github.com/repos/jmuk/gax-nodejs/milestones{/number}","notifications_url":"https://api.github.com/repos/jmuk/gax-nodejs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmuk/gax-nodejs/labels{/name}","releases_url":"https://api.github.com/repos/jmuk/gax-nodejs/releases{/id}","deployments_url":"https://api.github.com/repos/jmuk/gax-nodejs/deployments","created_at":"2016-05-11T00:43:32Z","updated_at":"2016-05-11T00:43:33Z","pushed_at":"2016-10-25T23:37:03Z","git_url":"git://github.com/jmuk/gax-nodejs.git","ssh_url":"git@github.com:jmuk/gax-nodejs.git","clone_url":"https://github.com/jmuk/gax-nodejs.git","svn_url":"https://github.com/jmuk/gax-nodejs","homepage":null,"size":175,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"googleapis:master","ref":"master","sha":"84036bafef320e677c5ab87c8c955c95bb6719d3","user":{"login":"googleapis","id":16785467,"avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=3","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":57252113,"name":"gax-nodejs","full_name":"googleapis/gax-nodejs","owner":{"login":"googleapis","id":16785467,"avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=3","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/googleapis/gax-nodejs","description":"Google API Extensions for Node.js","fork":false,"url":"https://api.github.com/repos/googleapis/gax-nodejs","forks_url":"https://api.github.com/repos/googleapis/gax-nodejs/forks","keys_url":"https://api.github.com/repos/googleapis/gax-nodejs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/gax-nodejs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/gax-nodejs/teams","hooks_url":"https://api.github.com/repos/googleapis/gax-nodejs/hooks","issue_events_url":"https://api.github.com/repos/googleapis/gax-nodejs/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/gax-nodejs/events","assignees_url":"https://api.github.com/repos/googleapis/gax-nodejs/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/gax-nodejs/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/gax-nodejs/tags","blobs_url":"https://api.github.com/repos/googleapis/gax-nodejs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/gax-nodejs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/gax-nodejs/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/gax-nodejs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/gax-nodejs/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/gax-nodejs/languages","stargazers_url":"https://api.github.com/repos/googleapis/gax-nodejs/stargazers","contributors_url":"https://api.github.com/repos/googleapis/gax-nodejs/contributors","subscribers_url":"https://api.github.com/repos/googleapis/gax-nodejs/subscribers","subscription_url":"https://api.github.com/repos/googleapis/gax-nodejs/subscription","commits_url":"https://api.github.com/repos/googleapis/gax-nodejs/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/gax-nodejs/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/gax-nodejs/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/gax-nodejs/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/gax-nodejs/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/gax-nodejs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/gax-nodejs/merges","archive_url":"https://api.github.com/repos/googleapis/gax-nodejs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/gax-nodejs/downloads","issues_url":"https://api.github.com/repos/googleapis/gax-nodejs/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/gax-nodejs/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/gax-nodejs/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/gax-nodejs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/gax-nodejs/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/gax-nodejs/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/gax-nodejs/deployments","created_at":"2016-04-27T22:08:40Z","updated_at":"2016-09-28T05:00:33Z","pushed_at":"2016-10-25T23:37:04Z","git_url":"git://github.com/googleapis/gax-nodejs.git","ssh_url":"git@github.com:googleapis/gax-nodejs.git","clone_url":"https://github.com/googleapis/gax-nodejs.git","svn_url":"https://github.com/googleapis/gax-nodejs","homepage":null,"size":666,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":10,"forks":4,"open_issues":10,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/gax-nodejs/pulls/58"},"html":{"href":"https://github.com/googleapis/gax-nodejs/pull/58"},"issue":{"href":"https://api.github.com/repos/googleapis/gax-nodejs/issues/58"},"comments":{"href":"https://api.github.com/repos/googleapis/gax-nodejs/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/gax-nodejs/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/gax-nodejs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/gax-nodejs/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/gax-nodejs/statuses/b9ff924db9420e2f6c61dcb1eaf9d6b438cb448f"}}}}
{"actor":{"display_login":"landrito"}}