1 | <?php |
||
28 | class Contact extends AbstractResource |
||
29 | { |
||
30 | /** |
||
31 | * The resource endpoint |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $endpoint = '/contacts'; |
||
36 | |||
37 | /** |
||
38 | * |
||
39 | * Create a contact |
||
40 | * |
||
41 | * @param array|null $data |
||
42 | * @return mixed|null |
||
43 | * @throws ApiException |
||
44 | * @throws ConflictingStateException |
||
45 | * @throws RateLimitExceededException |
||
46 | * @throws UnsupportedContentTypeException |
||
47 | */ |
||
48 | public function create(array $data) |
||
52 | |||
53 | /** |
||
54 | * |
||
55 | * Get a list of contacts |
||
56 | * |
||
57 | * @param array|null $query |
||
58 | * @return mixed|null |
||
59 | * @throws ApiException |
||
60 | * @throws ConflictingStateException |
||
61 | * @throws RateLimitExceededException |
||
62 | * @throws UnsupportedContentTypeException |
||
63 | */ |
||
64 | public function all(array $query = null) |
||
68 | |||
69 | /** |
||
70 | * |
||
71 | * Get a contact by id |
||
72 | * |
||
73 | * @param int $id |
||
74 | * @param array|null $query |
||
75 | * @return array|null |
||
76 | * @throws AccessDeniedException |
||
77 | * @throws ApiException |
||
78 | * @throws ConflictingStateException |
||
79 | * @throws MethodNotAllowedException |
||
80 | * @throws NotFoundException |
||
81 | * @throws RateLimitExceededException |
||
82 | * @throws UnsupportedAcceptHeaderException |
||
83 | * @throws UnsupportedContentTypeException |
||
84 | * @throws ValidationException |
||
85 | */ |
||
86 | public function view($id, array $query = null) |
||
90 | |||
91 | /** |
||
92 | * Update a contact |
||
93 | * |
||
94 | * @param $id |
||
95 | * @param array|null $data |
||
96 | * @return mixed|null |
||
97 | * @throws ApiException |
||
98 | * @throws ConflictingStateException |
||
99 | * @throws RateLimitExceededException |
||
100 | * @throws UnsupportedContentTypeException |
||
101 | */ |
||
102 | public function update($id, array $data = null) |
||
106 | |||
107 | /** |
||
108 | * Delete a contact |
||
109 | * |
||
110 | * @param $id |
||
111 | * @return mixed|null |
||
112 | * @throws ApiException |
||
113 | * @throws ConflictingStateException |
||
114 | * @throws RateLimitExceededException |
||
115 | * @throws UnsupportedContentTypeException |
||
116 | */ |
||
117 | public function delete($id) |
||
121 | |||
122 | /** |
||
123 | * List contact fields |
||
124 | * |
||
125 | * @param array|null $query |
||
126 | * @return mixed|null |
||
127 | * @throws AccessDeniedException |
||
128 | * @throws ApiException |
||
129 | * @throws ConflictingStateException |
||
130 | * @throws AuthenticationException |
||
131 | * @throws NotFoundException |
||
132 | */ |
||
133 | public function fields(array $query = null) |
||
137 | |||
138 | /** |
||
139 | * Convert a contact into an agent |
||
140 | * |
||
141 | * @param array|null $query |
||
142 | * @return mixed|null |
||
143 | * @throws AccessDeniedException |
||
144 | * @throws ApiException |
||
145 | * @throws ConflictingStateException |
||
146 | * @throws AuthenticationException |
||
147 | * @throws NotFoundException |
||
148 | */ |
||
149 | public function makeAgent($id, array $query = null) |
||
155 | } |