index) !== true) { throw new RuntimeException( 'index is required for index' ); } $index = $this->index; $id = $this->id ?? null; if (isset($id)) { return "/$index/_doc/$id"; } return "/$index/_doc"; } public function getParamWhitelist(): array { return [ 'wait_for_active_shards', 'op_type', 'refresh', 'routing', 'timeout', 'version', 'version_type', 'if_seq_no', 'if_primary_term', 'pipeline', 'require_alias' ]; } public function getMethod(): string { return 'POST'; } public function setBody($body): Index { if (isset($body) !== true) { return $this; } $this->body = $body; return $this; } }