1 | <?php |
||
24 | class Ticket extends AbstractResource |
||
25 | { |
||
26 | |||
27 | use AllTrait, CreateTrait, ViewTrait, UpdateTrait, DeleteTrait; |
||
28 | |||
29 | /** |
||
30 | * The resource endpoint |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $endpoint = '/tickets'; |
||
35 | |||
36 | /** |
||
37 | * Restore a ticket |
||
38 | * |
||
39 | * Restores a previously deleted ticket |
||
40 | * |
||
41 | * @api |
||
42 | * @param $id |
||
43 | * @return mixed|null |
||
44 | * @throws \Freshdesk\Exceptions\AccessDeniedException |
||
45 | * @throws \Freshdesk\Exceptions\ApiException |
||
46 | * @throws \Freshdesk\Exceptions\AuthenticationException |
||
47 | * @throws \Freshdesk\Exceptions\ConflictingStateException |
||
48 | * @throws \Freshdesk\Exceptions\NotFoundException |
||
49 | * @throws \Freshdesk\Exceptions\RateLimitExceededException |
||
50 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException |
||
51 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException |
||
52 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException |
||
53 | * @throws \Freshdesk\Exceptions\ValidationException |
||
54 | */ |
||
55 | public function restore($id) |
||
61 | |||
62 | /** |
||
63 | * List ticket fields |
||
64 | * |
||
65 | * The agent whose credentials (API key or username/password) are being used to make this API call should be |
||
66 | * authorised to view the ticket fields |
||
67 | * |
||
68 | * @param array|null $query |
||
69 | * @return mixed|null |
||
70 | * @throws \Freshdesk\Exceptions\AccessDeniedException |
||
71 | * @throws \Freshdesk\Exceptions\ApiException |
||
72 | * @throws \Freshdesk\Exceptions\AuthenticationException |
||
73 | * @throws \Freshdesk\Exceptions\ConflictingStateException |
||
74 | * @throws \Freshdesk\Exceptions\NotFoundException |
||
75 | * @throws \Freshdesk\Exceptions\RateLimitExceededException |
||
76 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException |
||
77 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException |
||
78 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException |
||
79 | * @throws \Freshdesk\Exceptions\ValidationException |
||
80 | */ |
||
81 | public function fields(array $query = null) |
||
85 | |||
86 | /** |
||
87 | * List conversations associated with a ticket |
||
88 | * |
||
89 | * @param int $id The ticket id |
||
90 | * @param array|null $query |
||
91 | * @return mixed|null |
||
92 | * @throws \Freshdesk\Exceptions\AccessDeniedException |
||
93 | * @throws \Freshdesk\Exceptions\ApiException |
||
94 | * @throws \Freshdesk\Exceptions\AuthenticationException |
||
95 | * @throws \Freshdesk\Exceptions\ConflictingStateException |
||
96 | * @throws \Freshdesk\Exceptions\NotFoundException |
||
97 | * @throws \Freshdesk\Exceptions\RateLimitExceededException |
||
98 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException |
||
99 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException |
||
100 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException |
||
101 | * @throws \Freshdesk\Exceptions\ValidationException |
||
102 | */ |
||
103 | public function conversations($id, array $query = null) |
||
109 | |||
110 | /** |
||
111 | * List time entries associated with a ticket |
||
112 | * |
||
113 | * @param int $id The ticket id |
||
114 | * @param array|null $query |
||
115 | * @return mixed|null |
||
116 | * @throws \Freshdesk\Exceptions\AccessDeniedException |
||
117 | * @throws \Freshdesk\Exceptions\ApiException |
||
118 | * @throws \Freshdesk\Exceptions\AuthenticationException |
||
119 | * @throws \Freshdesk\Exceptions\ConflictingStateException |
||
120 | * @throws \Freshdesk\Exceptions\NotFoundException |
||
121 | * @throws \Freshdesk\Exceptions\RateLimitExceededException |
||
122 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException |
||
123 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException |
||
124 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException |
||
125 | * @throws \Freshdesk\Exceptions\ValidationException |
||
126 | */ |
||
127 | public function timeEntries($id, array $query = null) |
||
133 | |||
134 | /** |
||
135 | * Filters by ticket fields |
||
136 | * |
||
137 | * Make sure to pass a valid $filtersQuery string example: "type:question" |
||
138 | * |
||
139 | * @api |
||
140 | * @param string $filtersQuery |
||
141 | * @return array|null |
||
142 | * @throws \Freshdesk\Exceptions\AccessDeniedException |
||
143 | * @throws \Freshdesk\Exceptions\ApiException |
||
144 | * @throws \Freshdesk\Exceptions\AuthenticationException |
||
145 | * @throws \Freshdesk\Exceptions\ConflictingStateException |
||
146 | * @throws \Freshdesk\Exceptions\NotFoundException |
||
147 | * @throws \Freshdesk\Exceptions\RateLimitExceededException |
||
148 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException |
||
149 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException |
||
150 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException |
||
151 | * @throws \Freshdesk\Exceptions\ValidationException |
||
152 | */ |
||
153 | public function search(string $filtersQuery) |
||
161 | } |
||
162 |