-
Notifications
You must be signed in to change notification settings - Fork 216
/
Copy pathUserBlocks.php
86 lines (71 loc) · 2.49 KB
/
UserBlocks.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
declare(strict_types=1);
namespace Auth0\SDK\API\Management;
use Auth0\SDK\Contract\API\Management\UserBlocksInterface;
use Auth0\SDK\Utility\Request\RequestOptions;
use Auth0\SDK\Utility\Toolkit;
use Psr\Http\Message\ResponseInterface;
/**
* Handles requests to the User Blocks endpoint of the v2 Management API.
*
* @see https://auth0.com/docs/api/management/v2#!/User_Blocks
*/
final class UserBlocks extends ManagementEndpoint implements UserBlocksInterface
{
public function delete(
string $id,
?RequestOptions $options = null,
): ResponseInterface {
[$id] = Toolkit::filter([$id])->string()->trim();
Toolkit::assert([
[$id, \Auth0\SDK\Exception\ArgumentException::missing('id')],
])->isString();
return $this->getHttpClient()
->method('delete')->addPath(['user-blocks', $id])
->withOptions($options)
->call();
}
public function deleteByIdentifier(
string $identifier,
?RequestOptions $options = null,
): ResponseInterface {
[$identifier] = Toolkit::filter([$identifier])->string()->trim();
Toolkit::assert([
[$identifier, \Auth0\SDK\Exception\ArgumentException::missing('identifier')],
])->isString();
return $this->getHttpClient()
->method('delete')
->addPath(['user-blocks'])
->withParam('identifier', $identifier)
->withOptions($options)
->call();
}
public function get(
string $id,
?RequestOptions $options = null,
): ResponseInterface {
[$id] = Toolkit::filter([$id])->string()->trim();
Toolkit::assert([
[$id, \Auth0\SDK\Exception\ArgumentException::missing('id')],
])->isString();
return $this->getHttpClient()
->method('get')->addPath(['user-blocks', $id])
->withOptions($options)
->call();
}
public function getByIdentifier(
string $identifier,
?RequestOptions $options = null,
): ResponseInterface {
[$identifier] = Toolkit::filter([$identifier])->string()->trim();
Toolkit::assert([
[$identifier, \Auth0\SDK\Exception\ArgumentException::missing('identifier')],
])->isString();
return $this->getHttpClient()
->method('get')
->addPath(['user-blocks'])
->withParam('identifier', $identifier)
->withOptions($options)
->call();
}
}