Repository navigation
Expand file tree
/
Copy pathOrganization.php
More file actions
69 lines (61 loc) · 2.03 KB
/
Copy pathOrganization.php
File metadata and controls
69 lines (61 loc) · 2.03 KB
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
<?php declare(strict_types=1);
namespace ApiClients\Client\Github\Resource\Async;
use ApiClients\Client\Github\CommandBus\Command\Organization\AddWebHookCommand;
use ApiClients\Client\Github\CommandBus\Command\RefreshCommand;
use ApiClients\Client\Github\CommandBus\Command\User\OrganizationsCommand;
use ApiClients\Client\Github\CommandBus\Command\User\RepositoriesCommand;
use ApiClients\Client\Github\CommandBus\Command\User\RepositoryCommand;
use ApiClients\Client\Github\CommandBus\Command\WebHooksCommand;
use ApiClients\Client\Github\Resource\Organization as BaseOrganization;
use function ApiClients\Tools\Rx\unwrapObservableFromPromise;
use React\Promise\PromiseInterface;
use Rx\ObservableInterface;
class Organization extends BaseOrganization
{
public function refresh(): PromiseInterface
{
return $this->handleCommand(
new RefreshCommand($this)
);
}
public function repository(string $repository): PromiseInterface
{
return $this->handleCommand(
new RepositoryCommand($this->login(), $repository)
);
}
public function repositories(): ObservableInterface
{
return unwrapObservableFromPromise($this->handleCommand(
new RepositoriesCommand($this->login())
));
}
public function organizations(): ObservableInterface
{
return unwrapObservableFromPromise($this->handleCommand(
new OrganizationsCommand($this->login())
));
}
public function addWebHook(
string $name,
array $config,
array $events,
bool $active
): PromiseInterface {
return $this->handleCommand(
new AddWebHookCommand(
$this->login(),
$name,
$config,
$events,
$active
)
);
}
public function webHooks(): ObservableInterface
{
return unwrapObservableFromPromise($this->handleCommand(
new WebHooksCommand($this->login(), 'orgs')
));
}
}