Skip to content

Commit

Permalink
Merge pull request #70 from Webklex/master
Browse files Browse the repository at this point in the history
Webhooks support added
  • Loading branch information
IsraelOrtuno authored Jun 6, 2019
2 parents 34ffea7 + d35917c commit e2b37f6
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Pipedrive.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -73,6 +74,7 @@
* @method UserConnections userConnections()
* @method Users users()
* @method UserSettings userSettings()
* @method Webhooks webhooks()
*/
class Pipedrive
{
Expand Down
57 changes: 57 additions & 0 deletions src/Resources/Webhooks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace Devio\Pipedrive\Resources;

use Devio\Pipedrive\Exceptions\PipedriveException;
use Devio\Pipedrive\Http\Request;
use Devio\Pipedrive\Resources\Basics\Entity;
use Devio\Pipedrive\Resources\Basics\Resource;

class Webhooks extends Resource
{
/**
* The API caller object.
*
* @var Request
*/
protected $request;

/**
* List of abstract methods available.
*
* @var array
*/
protected $enabled = ['add', 'delete', 'find'];

/**
* List of abstract methods disabled.
*
* @var array
*/
protected $disabled = [];

/**
* Get the entity details by ID.
*
* @param $id Entity ID to find.
* @return \Devio\Pipedrive\Http\Response|void
* @throws PipedriveException
*/
public function find($id)
{
throw new PipedriveException("The method find() is not available for the resource {$this->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 update() is not available for the resource {$this->getName()}");
}
}

0 comments on commit e2b37f6

Please sign in to comment.