From 901ecc393ba85a869513822d28d2bb08cac6444e Mon Sep 17 00:00:00 2001 From: Webklex Date: Sun, 2 Jun 2019 16:38:35 +0200 Subject: [PATCH 1/4] Create Webhooks.php --- src/Resources/Webhooks.php | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/Resources/Webhooks.php diff --git a/src/Resources/Webhooks.php b/src/Resources/Webhooks.php new file mode 100644 index 0000000..96eb41e --- /dev/null +++ b/src/Resources/Webhooks.php @@ -0,0 +1,58 @@ +getName()}"); + } + + /** + * Update an entity by ID. + * @param $id + * @param array $values + * + * @return \Devio\Pipedrive\Http\Response|void + * @throws PipedriveException + */ + public function update($id, array $values) + { + throw new PipedriveException("The method deleteBulk() is not available for the resource {$this->getName()}"); + } + +} From 9f91c4f77a20326a49edb38397896dda2252b565 Mon Sep 17 00:00:00 2001 From: Webklex Date: Sun, 2 Jun 2019 16:39:17 +0200 Subject: [PATCH 2/4] Update Pipedrive.php --- src/Pipedrive.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Pipedrive.php b/src/Pipedrive.php index 6d2b9a5..de37b56 100644 --- a/src/Pipedrive.php +++ b/src/Pipedrive.php @@ -35,6 +35,7 @@ use Devio\Pipedrive\Resources\UserConnections; use Devio\Pipedrive\Resources\Users; use Devio\Pipedrive\Resources\UserSettings; +use Devio\Pipedrive\Resources\Webhooks; use Illuminate\Support\Str; use Devio\Pipedrive\Http\Request; use Devio\Pipedrive\Http\PipedriveClient; @@ -73,6 +74,7 @@ * @method UserConnections userConnections() * @method Users users() * @method UserSettings userSettings() + * @method Webhooks webhooks() */ class Pipedrive { From 93afb505ce357b7a122747d82425dfb46ab7a499 Mon Sep 17 00:00:00 2001 From: Webklex Date: Sun, 2 Jun 2019 17:33:40 +0200 Subject: [PATCH 3/4] Typos fixed --- src/Resources/Webhooks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Resources/Webhooks.php b/src/Resources/Webhooks.php index 96eb41e..d616b7e 100644 --- a/src/Resources/Webhooks.php +++ b/src/Resources/Webhooks.php @@ -39,7 +39,7 @@ class Webhooks extends Resource */ public function find($id) { - throw new PipedriveException("The method deleteBulk() is not available for the resource {$this->getName()}"); + throw new PipedriveException("The method find() is not available for the resource {$this->getName()}"); } /** @@ -52,7 +52,7 @@ public function find($id) */ public function update($id, array $values) { - throw new PipedriveException("The method deleteBulk() is not available for the resource {$this->getName()}"); + throw new PipedriveException("The method update() is not available for the resource {$this->getName()}"); } } From d35917cd6303d5e734c6489ab5ad3d9d0b3223b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Israel=20Ortu=C3=B1o?= Date: Thu, 6 Jun 2019 17:20:32 +0200 Subject: [PATCH 4/4] Fix enabled methods --- src/Resources/Webhooks.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Resources/Webhooks.php b/src/Resources/Webhooks.php index d616b7e..f70c784 100644 --- a/src/Resources/Webhooks.php +++ b/src/Resources/Webhooks.php @@ -21,7 +21,7 @@ class Webhooks extends Resource * * @var array */ - protected $enabled = ['*']; + protected $enabled = ['add', 'delete', 'find']; /** * List of abstract methods disabled. @@ -54,5 +54,4 @@ public function update($id, array $values) { throw new PipedriveException("The method update() is not available for the resource {$this->getName()}"); } - }