{"action":"created","comment":{"url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/comments/182276810","pull_request_review_id":113041448,"id":182276810,"diff_hunk":"@@ -53,22 +65,35 @@\n @end\n \n @snippet syncMethodSampleCode(apiMethod)\n-  {@initCode(apiMethod.initCode)}\n+  {@syncMethodSampleCode(apiMethod, apiMethod.initCode)}\n+@end\n+\n+@snippet syncMethodSampleCode(apiMethod, initCode)\n+  {@initCode(initCode)}\n   @if apiMethod.hasReturnValue\n     {@apiMethod.responseTypeName} response = {@sampleSyncMethodCall(apiMethod)};\n   @else\n     {@sampleSyncMethodCall(apiMethod)};\n   @end\n @end\n \n+# TODO(vchudnov-g): Deprecate this override","path":"src/main/resources/com/google/api/codegen/java/method_sample.snip","position":null,"original_position":60,"commit_id":"4c26fe898b88b93a3bfe5bef0eb686cf358400a3","original_commit_id":"4ea33ac601b69e32d466c0278cd3a518b7cf403c","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":"Yes. And fair enough.\r\nRemoved the now unused overloads.","created_at":"2018-04-18T00:07:57Z","updated_at":"2018-04-18T00:07:57Z","html_url":"https://github.com/googleapis/gapic-generator/pull/1874#discussion_r182276810","pull_request_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/1874","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/comments/182276810"},"html":{"href":"https://github.com/googleapis/gapic-generator/pull/1874#discussion_r182276810"},"pull_request":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/1874"}},"in_reply_to_id":182215223},"pull_request":{"url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/1874","id":175123683,"html_url":"https://github.com/googleapis/gapic-generator/pull/1874","diff_url":"https://github.com/googleapis/gapic-generator/pull/1874.diff","patch_url":"https://github.com/googleapis/gapic-generator/pull/1874.patch","issue_url":"https://api.github.com/repos/googleapis/gapic-generator/issues/1874","number":1874,"state":"open","locked":false,"title":"Generate stub standalone sample files in Java and Python","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":"With these changes, **stubs** of Java and Python standalone samples are generated for\r\nmethods whose GAPIC configs are configured to do so via the method's\r\n`sample_value_sets` and `samples` fields. Note that these changes are backwards-compatible: since currently released APIs do not have samples configured, no sample files are generated for those. The stubs currently in place use the existing in-code samples, which are not standalone.\r\n\r\nI am also passing  the structured `initCode` for each sample to the standalone sample file templates. I was going to do this separately, but since it led to changes in the structure I had in earlier iterations of this PR, which was still under review, I am including it here.\r\n\r\nI touch the path generator for other languages to account for a\r\nmodified interface. Let's not worry yet about the generated location of the\r\nsamples for those. At any rate, for all languages artman can be\r\nconfigured to move the samples to the right final directory for the user.\r\n\r\nHigh-level overview:\r\n\r\n   - Main data structures:\r\n     - Since API methods in general contain samples (in-code samples in the library surface itself, standalone samples in the standalone sample files), `{StaticLang,OptionalArray}MethodView` both now contain a getter `samples()` which returns a `List<MethodSampleView>`\r\n     - `MethodSampleView` contains the view model for the method-level specific sample output, including the relevant `InitCodeView` (and `ApiMethodView.initCode` will be deprecated in favor of the new sample config)\r\n     - `StaticLangSampleClassView` and `DynamicLangXSampleView` contain the top-level view model for the sample classes/files that show the usage of a particular method in the library surface.\r\n\r\n   - High level flow\r\n     - Configuration options get read into `SampleSpec`, now a part of `MethodConfig`\r\n     - Transformation flow:\r\n        `<Lang>Gapic{Surface,Samples}Transformer`: Entry point for generating the top level client or sample artifacts. Generates `StaticLang{Api,SampleClass}View`/`DynamicLangX{Api,Sample}View`\r\n         -> `<Lang>MethodViewGenerator`: Logic for determining which method type (and eventually which calling forms) to select\r\n         -> `{Static,Dynamic}LangApiMethodTransformer`: Generating the `ApiMethodView`s, including samples\r\n         -> `SampleTransformer`: Generating the `MethodSampleView`s appropriate to the artifact being produced\r\n\r\n   - Rendering entry points for samples are now `<LANG>/standalone_sample.snip`","created_at":"2018-03-15T01:00:38Z","updated_at":"2018-04-18T00:07:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0a1c7243c4f1a4b06a4186b93e40e2b41d32663","assignee":{"login":"anthmgoogle","id":6653712,"avatar_url":"https://avatars0.githubusercontent.com/u/6653712?v=4","gravatar_id":"","url":"https://api.github.com/users/anthmgoogle","html_url":"https://github.com/anthmgoogle","followers_url":"https://api.github.com/users/anthmgoogle/followers","following_url":"https://api.github.com/users/anthmgoogle/following{/other_user}","gists_url":"https://api.github.com/users/anthmgoogle/gists{/gist_id}","starred_url":"https://api.github.com/users/anthmgoogle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthmgoogle/subscriptions","organizations_url":"https://api.github.com/users/anthmgoogle/orgs","repos_url":"https://api.github.com/users/anthmgoogle/repos","events_url":"https://api.github.com/users/anthmgoogle/events{/privacy}","received_events_url":"https://api.github.com/users/anthmgoogle/received_events","type":"User","site_admin":false},"assignees":[{"login":"anthmgoogle","id":6653712,"avatar_url":"https://avatars0.githubusercontent.com/u/6653712?v=4","gravatar_id":"","url":"https://api.github.com/users/anthmgoogle","html_url":"https://github.com/anthmgoogle","followers_url":"https://api.github.com/users/anthmgoogle/followers","following_url":"https://api.github.com/users/anthmgoogle/following{/other_user}","gists_url":"https://api.github.com/users/anthmgoogle/gists{/gist_id}","starred_url":"https://api.github.com/users/anthmgoogle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthmgoogle/subscriptions","organizations_url":"https://api.github.com/users/anthmgoogle/orgs","repos_url":"https://api.github.com/users/anthmgoogle/repos","events_url":"https://api.github.com/users/anthmgoogle/events{/privacy}","received_events_url":"https://api.github.com/users/anthmgoogle/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"lukesneeringer","id":4346,"avatar_url":"https://avatars0.githubusercontent.com/u/4346?v=4","gravatar_id":"","url":"https://api.github.com/users/lukesneeringer","html_url":"https://github.com/lukesneeringer","followers_url":"https://api.github.com/users/lukesneeringer/followers","following_url":"https://api.github.com/users/lukesneeringer/following{/other_user}","gists_url":"https://api.github.com/users/lukesneeringer/gists{/gist_id}","starred_url":"https://api.github.com/users/lukesneeringer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukesneeringer/subscriptions","organizations_url":"https://api.github.com/users/lukesneeringer/orgs","repos_url":"https://api.github.com/users/lukesneeringer/repos","events_url":"https://api.github.com/users/lukesneeringer/events{/privacy}","received_events_url":"https://api.github.com/users/lukesneeringer/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/1874/commits","review_comments_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/1874/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/1874/comments","statuses_url":"https://api.github.com/repos/googleapis/gapic-generator/statuses/4c26fe898b88b93a3bfe5bef0eb686cf358400a3","head":{"label":"vchudnov-g:pr_samplegen_java_empty","ref":"pr_samplegen_java_empty","sha":"4c26fe898b88b93a3bfe5bef0eb686cf358400a3","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-13T16:19:15Z","pushed_at":"2018-04-18T00:06:51Z","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":20711,"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":"0ad85c495b411a11f1725eb42d0ab239721acf28","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-04-17T16:27:32Z","pushed_at":"2018-04-18T00:06:52Z","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":20557,"stargazers_count":41,"watchers_count":41,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"archived":false,"open_issues_count":146,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":49,"open_issues":146,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/1874"},"html":{"href":"https://github.com/googleapis/gapic-generator/pull/1874"},"issue":{"href":"https://api.github.com/repos/googleapis/gapic-generator/issues/1874"},"comments":{"href":"https://api.github.com/repos/googleapis/gapic-generator/issues/1874/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/1874/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/1874/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/gapic-generator/statuses/4c26fe898b88b93a3bfe5bef0eb686cf358400a3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vchudnov-g"}}