Skip to content

Commit 7d3cea7

Browse files
committed
Organization::addWebHook
1 parent dc3ccfb commit 7d3cea7

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

src/CommandBus/Command/Organization/AddWebHookCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ final class AddWebHookCommand
3535
private $active;
3636

3737
/**
38-
* @param string $repository
38+
* @param string $organization
3939
* @param string $name
4040
* @param array $config
4141
* @param array $events
4242
* @param bool $active
4343
*/
44-
public function __construct(string $repository, string $name, array $config, array $events, bool $active)
44+
public function __construct(string $organization, string $name, array $config, array $events, bool $active)
4545
{
46-
$this->organization = $repository;
46+
$this->organization = $organization;
4747
$this->name = $name;
4848
$this->config = $config;
4949
$this->events = $events;

src/Resource/Async/Organization.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace ApiClients\Client\Github\Resource\Async;
44

5+
use ApiClients\Client\Github\CommandBus\Command\Organization\AddWebHookCommand;
56
use ApiClients\Client\Github\CommandBus\Command\RefreshCommand;
67
use ApiClients\Client\Github\CommandBus\Command\User\OrganizationsCommand;
78
use ApiClients\Client\Github\CommandBus\Command\User\RepositoriesCommand;
@@ -42,6 +43,23 @@ public function organizations(): ObservableInterface
4243
));
4344
}
4445

46+
public function addWebHook(
47+
string $name,
48+
array $config,
49+
array $events,
50+
bool $active
51+
): PromiseInterface {
52+
return $this->handleCommand(
53+
new AddWebHookCommand(
54+
$this->login(),
55+
$name,
56+
$config,
57+
$events,
58+
$active
59+
)
60+
);
61+
}
62+
4563
public function webHooks(): ObservableInterface
4664
{
4765
return unwrapObservableFromPromise($this->handleCommand(

0 commit comments

Comments
 (0)