{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/197100405","pull_request_review_id":130775517,"id":197100405,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzEwMDQwNQ==","diff_hunk":"@@ -19,22 +19,93 @@\n \n package org.elasticsearch.action.ingest;\n \n+import org.elasticsearch.ElasticsearchException;\n import org.elasticsearch.action.ActionResponse;\n+import org.elasticsearch.common.ParseField;\n import org.elasticsearch.common.io.stream.StreamInput;\n import org.elasticsearch.common.io.stream.StreamOutput;\n+import org.elasticsearch.common.xcontent.ConstructingObjectParser;\n import org.elasticsearch.common.xcontent.ToXContentObject;\n import org.elasticsearch.common.xcontent.XContentBuilder;\n+import org.elasticsearch.common.xcontent.XContentParser;\n+import org.elasticsearch.common.xcontent.XContentParser.Token;\n \n import java.io.IOException;\n import java.util.ArrayList;\n import java.util.Collections;\n import java.util.List;\n \n+import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg;\n+import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken;\n+\n public class SimulatePipelineResponse extends ActionResponse implements ToXContentObject {\n     private String pipelineId;\n     private boolean verbose;\n     private List<SimulateDocumentResult> results;\n \n+    @SuppressWarnings(\"unchecked\")\n+    public static final ConstructingObjectParser<SimulatePipelineResponse, Void> PARSER =\n+        new ConstructingObjectParser<>(\n+            \"simulate_pipeline_response\",\n+            true,\n+            a -> {\n+                List<SimulateDocumentResult> results = (List<SimulateDocumentResult>)a[0];\n+                boolean verbose = false;\n+                if (results.size() > 0) {\n+                    if (results.get(0) instanceof SimulateDocumentVerboseResult) {\n+                        verbose = true;\n+                    }\n+                }\n+                return new SimulatePipelineResponse(null, verbose, results);\n+            }\n+        );\n+    static {\n+        PARSER.declareObjectArray(\n+            constructorArg(),\n+            (parser, context) -> {\n+                Token token = parser.currentToken();\n+                ensureExpectedToken(Token.START_OBJECT, token, parser::getTokenLocation);\n+                SimulateDocumentResult result = null;\n+                while ((token = parser.nextToken()) != Token.END_OBJECT) {\n+                    ensureExpectedToken(token, Token.FIELD_NAME, parser::getTokenLocation);\n+                    String fieldName = parser.currentName();\n+                    token = parser.nextToken();\n+                    if (token == Token.START_ARRAY) {\n+                        switch (fieldName) {\n+                            case SimulateDocumentVerboseResult.PROCESSOR_RESULT_FIELD:","path":"server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineResponse.java","position":57,"original_position":57,"commit_id":"755de507ed09a5e31eda981acf98b106b0d5235e","original_commit_id":"755de507ed09a5e31eda981acf98b106b0d5235e","user":{"login":"javanna","id":832460,"node_id":"MDQ6VXNlcjgzMjQ2MA==","avatar_url":"https://avatars1.githubusercontent.com/u/832460?v=4","gravatar_id":"","url":"https://api.github.com/users/javanna","html_url":"https://github.com/javanna","followers_url":"https://api.github.com/users/javanna/followers","following_url":"https://api.github.com/users/javanna/following{/other_user}","gists_url":"https://api.github.com/users/javanna/gists{/gist_id}","starred_url":"https://api.github.com/users/javanna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javanna/subscriptions","organizations_url":"https://api.github.com/users/javanna/orgs","repos_url":"https://api.github.com/users/javanna/repos","events_url":"https://api.github.com/users/javanna/events{/privacy}","received_events_url":"https://api.github.com/users/javanna/received_events","type":"User","site_admin":false},"body":"yes that is what I meant, thank you!","created_at":"2018-06-21T11:34:20Z","updated_at":"2018-06-21T11:34:20Z","html_url":"https://github.com/elastic/elasticsearch/pull/31158#discussion_r197100405","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31158","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/197100405"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/31158#discussion_r197100405"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/31158"}},"in_reply_to_id":197066763},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31158","id":193143342,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMTQzMzQy","html_url":"https://github.com/elastic/elasticsearch/pull/31158","diff_url":"https://github.com/elastic/elasticsearch/pull/31158.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/31158.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/31158","number":31158,"state":"open","locked":false,"title":"REST high-level client: add simulate pipeline API","user":{"login":"sohaibiftikhar","id":5103613,"node_id":"MDQ6VXNlcjUxMDM2MTM=","avatar_url":"https://avatars3.githubusercontent.com/u/5103613?v=4","gravatar_id":"","url":"https://api.github.com/users/sohaibiftikhar","html_url":"https://github.com/sohaibiftikhar","followers_url":"https://api.github.com/users/sohaibiftikhar/followers","following_url":"https://api.github.com/users/sohaibiftikhar/following{/other_user}","gists_url":"https://api.github.com/users/sohaibiftikhar/gists{/gist_id}","starred_url":"https://api.github.com/users/sohaibiftikhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sohaibiftikhar/subscriptions","organizations_url":"https://api.github.com/users/sohaibiftikhar/orgs","repos_url":"https://api.github.com/users/sohaibiftikhar/repos","events_url":"https://api.github.com/users/sohaibiftikhar/events{/privacy}","received_events_url":"https://api.github.com/users/sohaibiftikhar/received_events","type":"User","site_admin":false},"body":"relates to #27205 \r\n","created_at":"2018-06-06T21:17:40Z","updated_at":"2018-06-21T11:34:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"89fa445578591467431ec8585319d2cfab7e4cdf","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":493198109,"node_id":"MDU6TGFiZWw0OTMxOTgxMDk=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Core/Java%20High%20Level%20REST%20Client","name":":Core/Java High Level REST Client","color":"0e8a16","default":false},{"id":23174,"node_id":"MDU6TGFiZWwyMzE3NA==","url":"https://api.github.com/repos/elastic/elasticsearch/labels/%3Eenhancement","name":">enhancement","color":"4a4ea8","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31158/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31158/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/31158/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/755de507ed09a5e31eda981acf98b106b0d5235e","head":{"label":"sohaibiftikhar:simulate_pipeline","ref":"simulate_pipeline","sha":"755de507ed09a5e31eda981acf98b106b0d5235e","user":{"login":"sohaibiftikhar","id":5103613,"node_id":"MDQ6VXNlcjUxMDM2MTM=","avatar_url":"https://avatars3.githubusercontent.com/u/5103613?v=4","gravatar_id":"","url":"https://api.github.com/users/sohaibiftikhar","html_url":"https://github.com/sohaibiftikhar","followers_url":"https://api.github.com/users/sohaibiftikhar/followers","following_url":"https://api.github.com/users/sohaibiftikhar/following{/other_user}","gists_url":"https://api.github.com/users/sohaibiftikhar/gists{/gist_id}","starred_url":"https://api.github.com/users/sohaibiftikhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sohaibiftikhar/subscriptions","organizations_url":"https://api.github.com/users/sohaibiftikhar/orgs","repos_url":"https://api.github.com/users/sohaibiftikhar/repos","events_url":"https://api.github.com/users/sohaibiftikhar/events{/privacy}","received_events_url":"https://api.github.com/users/sohaibiftikhar/received_events","type":"User","site_admin":false},"repo":{"id":123439305,"node_id":"MDEwOlJlcG9zaXRvcnkxMjM0MzkzMDU=","name":"elasticsearch","full_name":"sohaibiftikhar/elasticsearch","owner":{"login":"sohaibiftikhar","id":5103613,"node_id":"MDQ6VXNlcjUxMDM2MTM=","avatar_url":"https://avatars3.githubusercontent.com/u/5103613?v=4","gravatar_id":"","url":"https://api.github.com/users/sohaibiftikhar","html_url":"https://github.com/sohaibiftikhar","followers_url":"https://api.github.com/users/sohaibiftikhar/followers","following_url":"https://api.github.com/users/sohaibiftikhar/following{/other_user}","gists_url":"https://api.github.com/users/sohaibiftikhar/gists{/gist_id}","starred_url":"https://api.github.com/users/sohaibiftikhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sohaibiftikhar/subscriptions","organizations_url":"https://api.github.com/users/sohaibiftikhar/orgs","repos_url":"https://api.github.com/users/sohaibiftikhar/repos","events_url":"https://api.github.com/users/sohaibiftikhar/events{/privacy}","received_events_url":"https://api.github.com/users/sohaibiftikhar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sohaibiftikhar/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch","forks_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/forks","keys_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/teams","hooks_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/events","assignees_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/tags","blobs_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/subscription","commits_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/merges","archive_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/downloads","issues_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/sohaibiftikhar/elasticsearch/deployments","created_at":"2018-03-01T13:35:08Z","updated_at":"2018-06-20T12:07:02Z","pushed_at":"2018-06-20T22:56:10Z","git_url":"git://github.com/sohaibiftikhar/elasticsearch.git","ssh_url":"git@github.com:sohaibiftikhar/elasticsearch.git","clone_url":"https://github.com/sohaibiftikhar/elasticsearch.git","svn_url":"https://github.com/sohaibiftikhar/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":458135,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"e67aa96c81f309ebedc1d529e255b48069b262d1","user":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"node_id":"MDEwOlJlcG9zaXRvcnk1MDc3NzU=","name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/elasticsearch/deployments","created_at":"2010-02-08T13:20:56Z","updated_at":"2018-06-21T11:33:28Z","pushed_at":"2018-06-21T11:31:29Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":492117,"stargazers_count":31883,"watchers_count":31883,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10963,"mirror_url":null,"archived":false,"open_issues_count":1482,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":10963,"open_issues":1482,"watchers":31883,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/31158"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/31158"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/31158"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/31158/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/31158/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/31158/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/755de507ed09a5e31eda981acf98b106b0d5235e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"javanna"}}