@@ 22-56 (lines=35) @@ | ||
19 | * |
|
20 | * @package Api\Resources |
|
21 | */ |
|
22 | class Agent extends AbstractResource |
|
23 | { |
|
24 | ||
25 | use AllTrait, CreateTrait, ViewTrait; |
|
26 | ||
27 | /** |
|
28 | * The resource endpoint |
|
29 | * @internal |
|
30 | * @var string |
|
31 | */ |
|
32 | protected $endpoint = '/agents'; |
|
33 | ||
34 | /** |
|
35 | * |
|
36 | * Get the currently authenticated agent |
|
37 | * |
|
38 | * @api |
|
39 | * @param array|null $query |
|
40 | * @return array|null |
|
41 | * @throws \Freshdesk\Exceptions\AccessDeniedException |
|
42 | * @throws \Freshdesk\Exceptions\ApiException |
|
43 | * @throws \Freshdesk\Exceptions\AuthenticationException |
|
44 | * @throws \Freshdesk\Exceptions\ConflictingStateException |
|
45 | * @throws \Freshdesk\Exceptions\NotFoundException |
|
46 | * @throws \Freshdesk\Exceptions\RateLimitExceededException |
|
47 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException |
|
48 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException |
|
49 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException |
|
50 | * @throws \Freshdesk\Exceptions\ValidationException |
|
51 | */ |
|
52 | public function current(array $query = null) |
|
53 | { |
|
54 | return $this->api()->request('GET', $this->endpoint('me'), null, $query); |
|
55 | } |
|
56 | } |
|
57 |
@@ 24-57 (lines=34) @@ | ||
21 | * |
|
22 | * @package Api\Resources |
|
23 | */ |
|
24 | class Company extends AbstractResource |
|
25 | { |
|
26 | ||
27 | use AllTrait, CreateTrait, ViewTrait, UpdateTrait, DeleteTrait; |
|
28 | ||
29 | /** |
|
30 | * The resource endpoint |
|
31 | * |
|
32 | * @internal |
|
33 | * @var string |
|
34 | */ |
|
35 | protected $endpoint = '/companies'; |
|
36 | ||
37 | /** |
|
38 | * List resource fields |
|
39 | * |
|
40 | * @api |
|
41 | * @param array|null $query |
|
42 | * @return mixed|null |
|
43 | * @throws \Freshdesk\Exceptions\AccessDeniedException |
|
44 | * @throws \Freshdesk\Exceptions\ApiException |
|
45 | * @throws \Freshdesk\Exceptions\AuthenticationException |
|
46 | * @throws \Freshdesk\Exceptions\ConflictingStateException |
|
47 | * @throws \Freshdesk\Exceptions\NotFoundException |
|
48 | * @throws \Freshdesk\Exceptions\RateLimitExceededException |
|
49 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException |
|
50 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException |
|
51 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException |
|
52 | * @throws \Freshdesk\Exceptions\ValidationException |
|
53 | */ |
|
54 | public function fields(array $query = null) |
|
55 | { |
|
56 | return $this->api()->request('GET', '/company_fields', null, $query); |
|
57 | } |
|
58 | } |
|
59 |