| Total Complexity | 8 |
| Total Lines | 71 |
| 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 | * @return \Glorand\Drip\Api\Response\ApiResponse |
||
| 16 | * @throws \Glorand\Drip\Exceptions\DripException |
||
| 17 | */ |
||
| 18 | 2 | public function list(int $page = 1, int $perPage = 100): ApiResponse |
|
| 19 | { |
||
| 20 | 2 | if (1 > $perPage || 1000 < $perPage) { |
|
| 21 | 2 | throw new DripException('Invalid per page; maximum 1000'); |
|
| 22 | } |
||
| 23 | |||
| 24 | 1 | return $this->sendGet( |
|
| 25 | 1 | ':account_id:/event_actions', |
|
| 26 | [ |
||
| 27 | 1 | 'page' => $page, |
|
| 28 | 1 | 'per_page' => $perPage, |
|
| 29 | ] |
||
| 30 | ); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Record an event |
||
| 35 | * @see https://developer.drip.com/?shell#events |
||
| 36 | * @param \Glorand\Drip\Models\Event $event |
||
| 37 | * |
||
| 38 | * @return bool |
||
| 39 | */ |
||
| 40 | 1 | public function store(Event $event): bool |
|
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param array $events |
||
| 52 | * |
||
| 53 | * @return bool |
||
| 54 | */ |
||
| 55 | 1 | public function batchStore(array $events) |
|
| 80 | } |
||
| 81 | } |
||
| 82 |