-
Notifications
You must be signed in to change notification settings - Fork 1
/
CommunityEndpoint.php
71 lines (61 loc) · 1.92 KB
/
CommunityEndpoint.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
<?php
namespace Rikudou\LemmyApi\Endpoint;
use Rikudou\LemmyApi\Attribute\Since;
use Rikudou\LemmyApi\Enum\CommunityVisibility;
use Rikudou\LemmyApi\Enum\Language;
use Rikudou\LemmyApi\Enum\ListingType;
use Rikudou\LemmyApi\Enum\SortType;
use Rikudou\LemmyApi\Response\Model\Community;
use Rikudou\LemmyApi\Response\Model\Site;
use Rikudou\LemmyApi\Response\View\CommunityView;
interface CommunityEndpoint
{
public function get(int|string $nameOrId): CommunityView;
/**
* @return array<Language>
*/
public function getLanguages(int|string|Community $community): array;
public function getCommunityInstance(int|string|Community $community): ?Site;
/**
* @param array<Language>|null $languages
*/
public function create(
string $name,
string $displayName,
?string $banner = null,
?string $description = null,
?array $languages = null,
?string $icon = null,
?bool $nsfw = null,
?bool $postingRestrictedToMods = null,
#[Since('0.19.4')]
?CommunityVisibility $visibility = null,
): Community;
public function delete(Community|int $community): bool;
public function undelete(Community|int $community): bool;
/**
* @param array<Language>|null $languages
*/
public function update(
Community|int $community,
?string $banner = null,
?string $description = null,
?array $languages = null,
?string $icon = null,
?bool $nsfw = null,
?bool $postingRestrictedToMods = null,
?string $displayName = null,
#[Since('0.19.4')]
?CommunityVisibility $visibility = null,
): Community;
/**
* @return array<CommunityView>
*/
public function list(
?int $limit = null,
?int $page = null,
?SortType $sort = null,
?ListingType $listingType = null,
?bool $showNsfw = null,
): array;
}