Skip to content

Commit

Permalink
add webhook resource (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
mihajlstje authored Sep 7, 2024
1 parent 2dc5428 commit 2598da2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@
use Leventcz\Parasut\Resources\Transaction;
use Leventcz\Parasut\Resources\WareHouse;
use Leventcz\Parasut\Resources\SalesOffer;
use Leventcz\Parasut\Resources\Webhook;

readonly class Client
{
/**
* @param HttpClientInterface $httpClient
*/
public function __construct(private HttpClientInterface $httpClient)
{
}
public function __construct(private HttpClientInterface $httpClient) {}

/**
* @return SalesInvoice
Expand Down Expand Up @@ -212,4 +211,12 @@ public function salesOffer(): SalesOffer
{
return new SalesOffer($this->httpClient);
}

/**
* @return Webhook
*/
public function webhook(): Webhook
{
return new Webhook($this->httpClient);
}
}
23 changes: 23 additions & 0 deletions src/Resources/Webhook.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

namespace Leventcz\Parasut\Resources;

use Leventcz\Parasut\Resources\Concerns\CreatesResource;
use Leventcz\Parasut\Resources\Concerns\DeletesResource;
use Leventcz\Parasut\Resources\Concerns\EditsResource;
use Leventcz\Parasut\Resources\Concerns\IndexesResources;

class Webhook extends ApiResource
{
use IndexesResources;
use CreatesResource;
use EditsResource;
use DeletesResource;

/**
* @var string
*/
protected string $resource = 'webhooks';
}

0 comments on commit 2598da2

Please sign in to comment.