-
Notifications
You must be signed in to change notification settings - Fork 215
/
Copy pathTenants.php
44 lines (37 loc) · 1.22 KB
/
Tenants.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
declare(strict_types=1);
namespace Auth0\SDK\API\Management;
use Auth0\SDK\Contract\API\Management\TenantsInterface;
use Auth0\SDK\Utility\Request\RequestOptions;
use Auth0\SDK\Utility\Toolkit;
use Psr\Http\Message\ResponseInterface;
/**
* Handles requests to the Tenants endpoint of the v2 Management API.
*
* @see https://auth0.com/docs/api/management/v2#!/Tenants
*/
final class Tenants extends ManagementEndpoint implements TenantsInterface
{
public function getSettings(
?RequestOptions $options = null,
): ResponseInterface {
return $this->getHttpClient()
->method('get')->addPath(['tenants', 'settings'])
->withOptions($options)
->call();
}
public function updateSettings(
array $body,
?RequestOptions $options = null,
): ResponseInterface {
[$body] = Toolkit::filter([$body])->array()->trim();
Toolkit::assert([
[$body, \Auth0\SDK\Exception\ArgumentException::missing('body')],
])->isArray();
return $this->getHttpClient()
->method('patch')->addPath(['tenants', 'settings'])
->withBody((object) $body)
->withOptions($options)
->call();
}
}