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