Total Complexity | 8 |
Total Lines | 73 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | class Events extends Api |
||
10 | { |
||
11 | /** |
||
12 | * @param int $page |
||
13 | * @param int $perPage |
||
14 | * |
||
15 | * @throws DripException |
||
16 | * |
||
17 | * @return Response\ApiResponse |
||
18 | */ |
||
19 | 2 | public function list(int $page = 1, int $perPage = 100): ApiResponse |
|
20 | { |
||
21 | 2 | if (1 > $perPage || 1000 < $perPage) { |
|
22 | 2 | throw new DripException('Invalid per page; maximum 1000'); |
|
23 | } |
||
24 | |||
25 | 1 | return $this->sendGet( |
|
26 | 1 | ':account_id:/event_actions', |
|
27 | [ |
||
28 | 1 | 'page' => $page, |
|
29 | 1 | 'per_page' => $perPage, |
|
30 | ] |
||
31 | ); |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Record an event |
||
36 | * @see https://developer.drip.com/?shell#events |
||
37 | * |
||
38 | * @param Event $event |
||
39 | * |
||
40 | * @return bool |
||
41 | */ |
||
42 | 1 | public function store(Event $event): bool |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * @param array $events |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | 1 | public function batchStore(array $events) |
|
84 |