Add Account Creation (#191)

This is used on the tenant API but is currently undocumented on the main
documentation
This commit is contained in:
Phil Young
2021-10-01 01:16:27 +01:00
committed by GitHub
parent d97cf24ee2
commit 7f72427fa1
4 changed files with 89 additions and 1 deletions

View File

@@ -21,6 +21,19 @@ class Accounts implements API
$this->adapter = $adapter;
}
public function addAccount(string $name, string $type = 'standard'): \stdClass
{
$options = [
'name' => $name,
'type' => $type,
];
$account = $this->adapter->post('accounts', $options);
$this->body = json_decode($account->getBody());
return $this->body->result;
}
public function listAccounts(
int $page = 1,
int $perPage = 20,