Merge branch 'master' of github.com:Art-of-WiFi/UniFi-API-client

merge #133
This commit is contained in:
malle-pietje
2021-10-23 10:34:46 +02:00
2 changed files with 23 additions and 0 deletions

View File

@@ -170,6 +170,7 @@ more details on the functions/methods and their respective parameters.
- disable_ap()
- edit_apgroup() (supported with controller versions 6.0.X and higher)
- edit_client_fixedip()
- edit_client_name()
- edit_firewallgroup()
- edit_usergroup()
- extend_guest_validity()

View File

@@ -1101,6 +1101,28 @@ class Client
return $this->fetch_results('/api/s/' . $this->site . '/rest/user/' . trim($client_id), $payload);
}
/**
* Update client name (using REST)
*
* @param string $client_id _id value for the client
* @param bool $name of the client
* @return array|false returns an array containing a single object with attributes of the updated client on success
*/
public function edit_client_name($client_id, $name)
{
if (empty($name)) {
return false;
}
$this->curl_method = 'PUT';
$payload = [
'_id' => $client_id,
'name' => $name,
];
return $this->fetch_results('/api/s/' . $this->site . '/rest/user/' . trim($client_id), $payload);
}
/**
* Fetch user groups
*