index ?? null; $type = $this->type ?? null; if (isset($type)) { @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); } if (isset($index) && isset($type)) { return "/$index/$type/_mapping"; } if (isset($index)) { return "/$index/_mapping"; } if (isset($type)) { return "/_mappings/$type"; } throw new RuntimeException('Missing parameter for the endpoint indices.put_mapping'); } public function getParamWhitelist(): array { return [ 'include_type_name', 'timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'write_index_only' ]; } public function getMethod(): string { return 'PUT'; } public function setBody($body): PutMapping { if (isset($body) !== true) { return $this; } $this->body = $body; return $this; } }