VoiceStats.php
1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace Zendesk\API;
/**
* The VoiceStats class exposes methods as outlined in http://developer.zendesk.com/documentation/rest_api/voice.html
* @package Zendesk\API
*/
class VoiceStats extends ClientAbstract
{
/**
* List all stats
*
* @param array $params
*
* @throws MissingParametersException
* @throws ResponseException
* @throws \Exception
*
* @return mixed
*/
public function findAll(array $params = array())
{
if (!$this->hasAnyKey($params, array('current_queue_activity', 'historical_queue_activity', 'agents_activity'))
) {
throw new MissingParametersException(__METHOD__,
array('current_queue_activity', 'historical_queue_activity', 'agents_activity'));
}
$endPoint = Http::prepare(
(isset($params['current_queue_activity']) ? 'channels/voice/stats/current_queue_activity.json' :
(isset($params['historical_queue_activity']) ? 'channels/voice/stats/historical_queue_activity.json' :
(isset($params['agents_activity']) ? 'channels/voice/stats/agents_activity.json' : ''))), null,
$params
);
$response = Http::send($this->client, $endPoint);
if ((!is_object($response)) || ($this->client->getDebug()->lastResponseCode != 200)) {
throw new ResponseException(__METHOD__);
}
$this->client->setSideload(null);
return $response;
}
}