forked from AntoineLemaire/aircall-php
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98229ce
commit 972eb1e
Showing
7 changed files
with
163 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
namespace Aircall; | ||
|
||
use GuzzleHttp\Exception\GuzzleException; | ||
|
||
/** | ||
* Class AircallIntegrations. | ||
*/ | ||
class AircallIntegrations | ||
{ | ||
const BASE_ENDPOINT = 'integrations'; | ||
|
||
/** @var AircallClient */ | ||
private $client; | ||
|
||
public function __construct(AircallClient $client) | ||
{ | ||
$this->client = $client; | ||
} | ||
|
||
/** | ||
* Retrieve Integration information | ||
* | ||
* @return mixed | ||
* @throws GuzzleException | ||
* | ||
*/ | ||
public function get() | ||
{ | ||
return $this->client->get(self::BASE_ENDPOINT . '/me'); | ||
} | ||
|
||
/** | ||
* Enable Integration | ||
* | ||
* @return mixed | ||
* @throws GuzzleException | ||
* | ||
*/ | ||
public function enable(bool $install = false) | ||
{ | ||
return $this->client->post(self::BASE_ENDPOINT . '/enable', ['install' => $install]); | ||
} | ||
|
||
/** | ||
* Disable Integration | ||
* | ||
* @return mixed | ||
* @throws GuzzleException | ||
* | ||
*/ | ||
public function disable() | ||
{ | ||
return $this->client->post(self::BASE_ENDPOINT . '/disable'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters