in src/Endpoints/Security.php [243:262]
public function changePassword(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['body'], $params);
if (isset($params['username'])) {
$url = '/_security/user/' . $this->encode($params['username']) . '/_password';
$method = 'PUT';
} else {
$url = '/_security/user/_password';
$method = 'PUT';
}
$url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['username'], $request, 'security.change_password');
return $this->client->sendRequest($request);
}