-
Notifications
You must be signed in to change notification settings - Fork 1
/
AdminEndpoint.php
105 lines (82 loc) · 3.24 KB
/
AdminEndpoint.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
namespace Rikudou\LemmyApi\Endpoint;
use DateTimeInterface;
use Rikudou\LemmyApi\Attribute\Since;
use Rikudou\LemmyApi\Response\GetUnreadRegistrationApplicationCountResponse;
use Rikudou\LemmyApi\Response\Model\Comment;
use Rikudou\LemmyApi\Response\Model\Community;
use Rikudou\LemmyApi\Response\Model\CustomEmoji;
use Rikudou\LemmyApi\Response\Model\Person;
use Rikudou\LemmyApi\Response\Model\Post;
use Rikudou\LemmyApi\Response\Model\PrivateMessageReport;
use Rikudou\LemmyApi\Response\Model\RegistrationApplication;
use Rikudou\LemmyApi\Response\View\PersonView;
use Rikudou\LemmyApi\Response\View\PrivateMessageReportView;
use Rikudou\LemmyApi\Response\View\RegistrationApplicationView;
interface AdminEndpoint
{
public function banUser(
Person|int $user,
?DateTimeInterface $expires = null,
?string $reason = null,
?bool $removeData = null,
): bool;
public function unbanUser(
Person|int $user,
?DateTimeInterface $expires = null,
?string $reason = null,
?bool $removeData = null,
): bool;
/**
* @return array<PersonView>
*/
public function getBannedUsers(): array;
public function addAdmin(Person|int $user): bool;
public function leaveAdmin(): bool;
/**
* @return array<RegistrationApplicationView>
*/
public function listRegistrationApplications(?int $limit = null, ?int $page = null, ?bool $unreadOnly = null): array;
public function approveRegistrationApplication(RegistrationApplication|int $application): bool;
public function rejectRegistrationApplication(RegistrationApplication|int $application, ?string $denyReason = null): bool;
/**
* @param array<string> $keywords
*/
public function createCustomEmoji(
string $imageUrl,
string $shortcode,
string $altText,
string $category,
array $keywords,
): CustomEmoji;
public function deleteCustomEmoji(CustomEmoji|int $customEmoji): bool;
/**
* @param array<string> $keywords
*/
public function editCustomEmoji(
CustomEmoji|int $customEmoji,
string $imageUrl,
string $altText,
string $category,
array $keywords,
): bool;
public function getUnreadRegistrationApplicationCount(): GetUnreadRegistrationApplicationCountResponse;
public function purgeComment(Comment|int $comment, ?string $reason = null): bool;
public function purgeCommunity(Community|int $community, ?string $reason = null): bool;
public function purgeUser(Person|int $user, ?string $reason = null): bool;
public function purgePost(Post|int $post, ?string $reason = null): bool;
public function resolvePrivateMessageReport(PrivateMessageReport|int $report): bool;
public function unresolvePrivateMessageReport(PrivateMessageReport|int $report): bool;
/**
* @return array<PrivateMessageReportView>
*/
public function listPrivateMessageReports(
?int $limit = null,
?int $page = null,
?bool $unresolvedOnly = null,
): array;
#[Since('0.19.0')]
public function hideCommunity(Community|int $community, ?string $reason = null): bool;
#[Since('0.19.0')]
public function unhideCommunity(Community|int $community): bool;
}