for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Resova\Endpoints;
use Resova\Client;
use Resova\Models\Webhook;
use Resova\Models\WebhookDelete;
use Resova\Models\WebhookList;
class Webhooks extends Client
{
/**
* @var string
*/
protected $namespace = __CLASS__;
* @param int $webhook_id The webhook id
*
* @return $this
public function __invoke(int $webhook_id): self
$this->webhook_id = $webhook_id;
webhook_id
return $this;
}
* List all webhooks
* Returns a list of your promotions. The promotions are returned sorted by creation date, with the most recent promotion appearing first.
public function all(): self
// Set HTTP params
$this->type = 'get';
$this->endpoint = '/webhooks';
$this->response = WebhookList::class;
response
* Create a webhook
* @param Webhook $webhook
public function create(Webhook $webhook): self
$webhook->setRequired([
'endpoint',
'events',
]);
$this->type = 'post';
$this->params = $webhook;
$this->response = Webhook::class;
* Update a webhook
public function update(Webhook $webhook): self
$this->type = 'put';
$this->endpoint = '/webhooks/' . $this->webhook_id;
* Delete a webhook
public function delete(): self
$this->type = 'delete';
$this->response = WebhookDelete::class;