1 | <?php |
||
22 | class TimeEntry extends AbstractResource |
||
23 | { |
||
24 | |||
25 | use ViewTrait, UpdateTrait, DeleteTrait; |
||
26 | |||
27 | /** |
||
28 | * The time entries resource endpoint |
||
29 | * |
||
30 | * @var string |
||
31 | * @internal |
||
32 | */ |
||
33 | protected $endpoint = '/time_entries'; |
||
34 | |||
35 | /** |
||
36 | * The tickets resource endpoint |
||
37 | * |
||
38 | * @var string |
||
39 | * @internal |
||
40 | */ |
||
41 | private $ticketsEndpoint = '/tickets'; |
||
42 | |||
43 | /** |
||
44 | * Creates the forums endpoint |
||
45 | * |
||
46 | * @param string $id |
||
47 | * @return string |
||
48 | * @internal |
||
49 | */ |
||
50 | protected function ticketsEndpoint($id = null) |
||
54 | |||
55 | /** |
||
56 | * |
||
57 | * Create a time entry for a ticket |
||
58 | * |
||
59 | * @api |
||
60 | * @param int $id |
||
61 | * @param array $data |
||
62 | * @return array|null |
||
63 | * @throws \Freshdesk\Exceptions\AccessDeniedException |
||
64 | * @throws \Freshdesk\Exceptions\ApiException |
||
65 | * @throws \Freshdesk\Exceptions\AuthenticationException |
||
66 | * @throws \Freshdesk\Exceptions\ConflictingStateException |
||
67 | * @throws \Freshdesk\Exceptions\NotFoundException |
||
68 | * @throws \Freshdesk\Exceptions\RateLimitExceededException |
||
69 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException |
||
70 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException |
||
71 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException |
||
72 | * @throws \Freshdesk\Exceptions\ValidationException |
||
73 | */ |
||
74 | public function create($id, array $data) |
||
78 | |||
79 | /** |
||
80 | * |
||
81 | * List time entries for a ticket |
||
82 | * |
||
83 | * @api |
||
84 | * @param int $id |
||
85 | * @param array|null $query |
||
86 | * @return array|null |
||
87 | * @throws \Freshdesk\Exceptions\AccessDeniedException |
||
88 | * @throws \Freshdesk\Exceptions\ApiException |
||
89 | * @throws \Freshdesk\Exceptions\AuthenticationException |
||
90 | * @throws \Freshdesk\Exceptions\ConflictingStateException |
||
91 | * @throws \Freshdesk\Exceptions\NotFoundException |
||
92 | * @throws \Freshdesk\Exceptions\RateLimitExceededException |
||
93 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException |
||
94 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException |
||
95 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException |
||
96 | * @throws \Freshdesk\Exceptions\ValidationException |
||
97 | */ |
||
98 | public function all($id, array $query = null) |
||
102 | |||
103 | /** |
||
104 | * |
||
105 | * Start / stop the timer |
||
106 | * |
||
107 | * @api |
||
108 | * @param int $id |
||
109 | * @return array|null |
||
110 | * @throws \Freshdesk\Exceptions\AccessDeniedException |
||
111 | * @throws \Freshdesk\Exceptions\ApiException |
||
112 | * @throws \Freshdesk\Exceptions\AuthenticationException |
||
113 | * @throws \Freshdesk\Exceptions\ConflictingStateException |
||
114 | * @throws \Freshdesk\Exceptions\NotFoundException |
||
115 | * @throws \Freshdesk\Exceptions\RateLimitExceededException |
||
116 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException |
||
117 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException |
||
118 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException |
||
119 | * @throws \Freshdesk\Exceptions\ValidationException |
||
120 | */ |
||
121 | public function toggle($id) |
||
125 | |||
126 | } |
||
127 |