{"action":"created","comment":{"url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/comments/189711004","pull_request_review_id":121942880,"id":189711004,"diff_hunk":"@@ -43,49 +44,59 @@ public NodeJSMethodViewGenerator(DynamicLangApiMethodTransformer transformer) {\n       GapicInterfaceContext context, boolean packageHasMultipleServices) {\n     ImmutableList.Builder<OptionalArrayMethodView> apiMethodsAndSamples = ImmutableList.builder();\n \n-    for (MethodModel method : context.getSupportedMethods()) {\n-      GapicMethodContext methodContext = context.asDynamicMethodContext(method);\n-      OptionalArrayMethodView methodView;\n-      if (methodContext.getMethodConfig().isPageStreaming()) {\n-        methodView =\n-            clientMethodTransformer.generatePagedStreamingMethod(\n-                methodContext,\n-                packageHasMultipleServices,\n-                Arrays.asList(CallingForm.RequestAsyncPaged, CallingForm.RequestAsyncPagedAll));\n-      } else if (methodContext.getMethodConfig().isLongRunningOperation()) {\n-        methodView =\n-            clientMethodTransformer.generateLongRunningMethod(\n-                methodContext,\n-                packageHasMultipleServices,\n-                Arrays.asList(CallingForm.LongRunningPromise, CallingForm.LongRunningEventEmitter));\n-      } else {\n-        List<CallingForm> callingForms;\n-        GrpcStreamingType streamingType = methodContext.getMethodConfig().getGrpcStreamingType();\n-        switch (streamingType) {\n-          case BidiStreaming:\n-            callingForms = Arrays.asList(CallingForm.RequestStreamingBidi);\n-            break;\n-          case ClientStreaming:\n-            callingForms = Arrays.asList(CallingForm.RequestStreamingClient);\n-            break;\n-          case ServerStreaming:\n-            callingForms = Arrays.asList(CallingForm.RequestStreamingServer);\n-            break;\n-          case NonStreaming:\n-            callingForms = Arrays.asList(CallingForm.Request);\n-            break;\n-          default:\n-            throw new IllegalArgumentException(\n-                \"unhandled grpcStreamingType: \" + streamingType.toString());\n-        }\n-        methodView =\n-            clientMethodTransformer.generateRequestMethod(\n-                methodContext, packageHasMultipleServices, callingForms);\n-      }\n+    return context\n+        .getSupportedMethods()\n+        .stream()\n+        .map(\n+            methodModel ->\n+                generateOneApiMethod(\n+                    context.asDynamicMethodContext(methodModel), null, packageHasMultipleServices))\n+        .collect((Collectors.toList()));","path":"src/main/java/com/google/api/codegen/transformer/nodejs/NodeJSMethodViewGenerator.java","position":67,"original_position":67,"commit_id":"e59d94ff82c6a21d777ed0dda922ecf7be44a266","original_commit_id":"e59d94ff82c6a21d777ed0dda922ecf7be44a266","user":{"login":"pongad","id":1617025,"avatar_url":"https://avatars1.githubusercontent.com/u/1617025?v=4","gravatar_id":"","url":"https://api.github.com/users/pongad","html_url":"https://github.com/pongad","followers_url":"https://api.github.com/users/pongad/followers","following_url":"https://api.github.com/users/pongad/following{/other_user}","gists_url":"https://api.github.com/users/pongad/gists{/gist_id}","starred_url":"https://api.github.com/users/pongad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pongad/subscriptions","organizations_url":"https://api.github.com/users/pongad/orgs","repos_url":"https://api.github.com/users/pongad/repos","events_url":"https://api.github.com/users/pongad/events{/privacy}","received_events_url":"https://api.github.com/users/pongad/received_events","type":"User","site_admin":false},"body":"Unnecessary parens?","created_at":"2018-05-21T20:54:35Z","updated_at":"2018-05-21T20:57:05Z","html_url":"https://github.com/googleapis/gapic-generator/pull/2009#discussion_r189711004","pull_request_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2009","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/comments/189711004"},"html":{"href":"https://github.com/googleapis/gapic-generator/pull/2009#discussion_r189711004"},"pull_request":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2009"}}},"pull_request":{"url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2009","id":189154086,"html_url":"https://github.com/googleapis/gapic-generator/pull/2009","diff_url":"https://github.com/googleapis/gapic-generator/pull/2009.diff","patch_url":"https://github.com/googleapis/gapic-generator/pull/2009.patch","issue_url":"https://api.github.com/repos/googleapis/gapic-generator/issues/2009","number":2009,"state":"open","locked":false,"title":"Provide sample_code_init_fields to samples via sample_value_sets; apply to NodeJS","user":{"login":"vchudnov-g","id":5422149,"avatar_url":"https://avatars3.githubusercontent.com/u/5422149?v=4","gravatar_id":"","url":"https://api.github.com/users/vchudnov-g","html_url":"https://github.com/vchudnov-g","followers_url":"https://api.github.com/users/vchudnov-g/followers","following_url":"https://api.github.com/users/vchudnov-g/following{/other_user}","gists_url":"https://api.github.com/users/vchudnov-g/gists{/gist_id}","starred_url":"https://api.github.com/users/vchudnov-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vchudnov-g/subscriptions","organizations_url":"https://api.github.com/users/vchudnov-g/orgs","repos_url":"https://api.github.com/users/vchudnov-g/repos","events_url":"https://api.github.com/users/vchudnov-g/events{/privacy}","received_events_url":"https://api.github.com/users/vchudnov-g/received_events","type":"User","site_admin":false},"body":"For backward compatibility, `sample_init_fields` remains the source of\r\ntruth for `IN_CODE` samples for the moment. `sample_init_fields` is\r\nnow copied to the in-code sample view model so that as languages adopt\r\nsamplegen, those language's templates can stop depending on\r\n`method.initCode`. Once all languages have done this mgration, we can\r\nremove `method.initCode`\r\n\r\n- Do the copying from `sample_init_fields` in `SampleTransformer`\r\n- Make NodeJSPackageMetadataTransformer and\r\n  NodeJSGapicSurfaceTestTransformer use NodeJSMethodViewGenerator\r\n- Make the NodeJS in-code samples use the sample-configured init fields","created_at":"2018-05-18T23:12:39Z","updated_at":"2018-05-21T20:57:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3899f00ac8f5a056ec10db5d7c9ac8dad411fee6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2009/commits","review_comments_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2009/comments","review_comment_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/gapic-generator/issues/2009/comments","statuses_url":"https://api.github.com/repos/googleapis/gapic-generator/statuses/e59d94ff82c6a21d777ed0dda922ecf7be44a266","head":{"label":"vchudnov-g:samplegen_incode_init_pr","ref":"samplegen_incode_init_pr","sha":"e59d94ff82c6a21d777ed0dda922ecf7be44a266","user":{"login":"vchudnov-g","id":5422149,"avatar_url":"https://avatars3.githubusercontent.com/u/5422149?v=4","gravatar_id":"","url":"https://api.github.com/users/vchudnov-g","html_url":"https://github.com/vchudnov-g","followers_url":"https://api.github.com/users/vchudnov-g/followers","following_url":"https://api.github.com/users/vchudnov-g/following{/other_user}","gists_url":"https://api.github.com/users/vchudnov-g/gists{/gist_id}","starred_url":"https://api.github.com/users/vchudnov-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vchudnov-g/subscriptions","organizations_url":"https://api.github.com/users/vchudnov-g/orgs","repos_url":"https://api.github.com/users/vchudnov-g/repos","events_url":"https://api.github.com/users/vchudnov-g/events{/privacy}","received_events_url":"https://api.github.com/users/vchudnov-g/received_events","type":"User","site_admin":false},"repo":{"id":61909368,"name":"toolkit","full_name":"vchudnov-g/toolkit","owner":{"login":"vchudnov-g","id":5422149,"avatar_url":"https://avatars3.githubusercontent.com/u/5422149?v=4","gravatar_id":"","url":"https://api.github.com/users/vchudnov-g","html_url":"https://github.com/vchudnov-g","followers_url":"https://api.github.com/users/vchudnov-g/followers","following_url":"https://api.github.com/users/vchudnov-g/following{/other_user}","gists_url":"https://api.github.com/users/vchudnov-g/gists{/gist_id}","starred_url":"https://api.github.com/users/vchudnov-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vchudnov-g/subscriptions","organizations_url":"https://api.github.com/users/vchudnov-g/orgs","repos_url":"https://api.github.com/users/vchudnov-g/repos","events_url":"https://api.github.com/users/vchudnov-g/events{/privacy}","received_events_url":"https://api.github.com/users/vchudnov-g/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vchudnov-g/toolkit","description":null,"fork":true,"url":"https://api.github.com/repos/vchudnov-g/toolkit","forks_url":"https://api.github.com/repos/vchudnov-g/toolkit/forks","keys_url":"https://api.github.com/repos/vchudnov-g/toolkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vchudnov-g/toolkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vchudnov-g/toolkit/teams","hooks_url":"https://api.github.com/repos/vchudnov-g/toolkit/hooks","issue_events_url":"https://api.github.com/repos/vchudnov-g/toolkit/issues/events{/number}","events_url":"https://api.github.com/repos/vchudnov-g/toolkit/events","assignees_url":"https://api.github.com/repos/vchudnov-g/toolkit/assignees{/user}","branches_url":"https://api.github.com/repos/vchudnov-g/toolkit/branches{/branch}","tags_url":"https://api.github.com/repos/vchudnov-g/toolkit/tags","blobs_url":"https://api.github.com/repos/vchudnov-g/toolkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vchudnov-g/toolkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vchudnov-g/toolkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/vchudnov-g/toolkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vchudnov-g/toolkit/statuses/{sha}","languages_url":"https://api.github.com/repos/vchudnov-g/toolkit/languages","stargazers_url":"https://api.github.com/repos/vchudnov-g/toolkit/stargazers","contributors_url":"https://api.github.com/repos/vchudnov-g/toolkit/contributors","subscribers_url":"https://api.github.com/repos/vchudnov-g/toolkit/subscribers","subscription_url":"https://api.github.com/repos/vchudnov-g/toolkit/subscription","commits_url":"https://api.github.com/repos/vchudnov-g/toolkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/vchudnov-g/toolkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/vchudnov-g/toolkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/vchudnov-g/toolkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/vchudnov-g/toolkit/contents/{+path}","compare_url":"https://api.github.com/repos/vchudnov-g/toolkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vchudnov-g/toolkit/merges","archive_url":"https://api.github.com/repos/vchudnov-g/toolkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vchudnov-g/toolkit/downloads","issues_url":"https://api.github.com/repos/vchudnov-g/toolkit/issues{/number}","pulls_url":"https://api.github.com/repos/vchudnov-g/toolkit/pulls{/number}","milestones_url":"https://api.github.com/repos/vchudnov-g/toolkit/milestones{/number}","notifications_url":"https://api.github.com/repos/vchudnov-g/toolkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vchudnov-g/toolkit/labels{/name}","releases_url":"https://api.github.com/repos/vchudnov-g/toolkit/releases{/id}","deployments_url":"https://api.github.com/repos/vchudnov-g/toolkit/deployments","created_at":"2016-06-24T20:03:07Z","updated_at":"2018-04-19T20:09:38Z","pushed_at":"2018-05-21T17:29:37Z","git_url":"git://github.com/vchudnov-g/toolkit.git","ssh_url":"git@github.com:vchudnov-g/toolkit.git","clone_url":"https://github.com/vchudnov-g/toolkit.git","svn_url":"https://github.com/vchudnov-g/toolkit","homepage":null,"size":21357,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"googleapis:master","ref":"master","sha":"265c0520ca1ebc1d3d03f037a288f618e7913254","user":{"login":"googleapis","id":16785467,"avatar_url":"https://avatars3.githubusercontent.com/u/16785467?v=4","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":56533838,"name":"gapic-generator","full_name":"googleapis/gapic-generator","owner":{"login":"googleapis","id":16785467,"avatar_url":"https://avatars3.githubusercontent.com/u/16785467?v=4","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/gapic-generator","description":"Tools for generating API client libraries from API Service Configuration descriptions.","fork":false,"url":"https://api.github.com/repos/googleapis/gapic-generator","forks_url":"https://api.github.com/repos/googleapis/gapic-generator/forks","keys_url":"https://api.github.com/repos/googleapis/gapic-generator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/gapic-generator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/gapic-generator/teams","hooks_url":"https://api.github.com/repos/googleapis/gapic-generator/hooks","issue_events_url":"https://api.github.com/repos/googleapis/gapic-generator/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/gapic-generator/events","assignees_url":"https://api.github.com/repos/googleapis/gapic-generator/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/gapic-generator/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/gapic-generator/tags","blobs_url":"https://api.github.com/repos/googleapis/gapic-generator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/gapic-generator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/gapic-generator/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/gapic-generator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/gapic-generator/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/gapic-generator/languages","stargazers_url":"https://api.github.com/repos/googleapis/gapic-generator/stargazers","contributors_url":"https://api.github.com/repos/googleapis/gapic-generator/contributors","subscribers_url":"https://api.github.com/repos/googleapis/gapic-generator/subscribers","subscription_url":"https://api.github.com/repos/googleapis/gapic-generator/subscription","commits_url":"https://api.github.com/repos/googleapis/gapic-generator/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/gapic-generator/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/gapic-generator/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/gapic-generator/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/gapic-generator/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/gapic-generator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/gapic-generator/merges","archive_url":"https://api.github.com/repos/googleapis/gapic-generator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/gapic-generator/downloads","issues_url":"https://api.github.com/repos/googleapis/gapic-generator/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/gapic-generator/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/gapic-generator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/gapic-generator/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/gapic-generator/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/gapic-generator/deployments","created_at":"2016-04-18T18:58:04Z","updated_at":"2018-05-21T14:26:27Z","pushed_at":"2018-05-21T17:29:38Z","git_url":"git://github.com/googleapis/gapic-generator.git","ssh_url":"git@github.com:googleapis/gapic-generator.git","clone_url":"https://github.com/googleapis/gapic-generator.git","svn_url":"https://github.com/googleapis/gapic-generator","homepage":"","size":21235,"stargazers_count":42,"watchers_count":42,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":51,"mirror_url":null,"archived":false,"open_issues_count":141,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":51,"open_issues":141,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2009"},"html":{"href":"https://github.com/googleapis/gapic-generator/pull/2009"},"issue":{"href":"https://api.github.com/repos/googleapis/gapic-generator/issues/2009"},"comments":{"href":"https://api.github.com/repos/googleapis/gapic-generator/issues/2009/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2009/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2009/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/gapic-generator/statuses/e59d94ff82c6a21d777ed0dda922ecf7be44a266"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pongad"}}