id) !== true) { throw new RuntimeException( 'id is required for create' ); } $id = $this->id; if (isset($this->index) !== true) { throw new RuntimeException( 'index is required for create' ); } $index = $this->index; $type = $this->type ?? null; if (isset($type)) { @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); } if (isset($type)) { return "/$index/$type/$id/_create"; } return "/$index/_create/$id"; } public function getParamWhitelist(): array { return [ 'wait_for_active_shards', 'refresh', 'routing', 'timeout', 'version', 'version_type', 'pipeline' ]; } public function getMethod(): string { return 'PUT'; } public function setBody($body): Create { if (isset($body) !== true) { return $this; } $this->body = $body; return $this; } }