1 | <?php |
||
22 | class Account extends Analytics |
||
23 | { |
||
24 | const RESOURCE_REPLACE = '{account_id}'; |
||
25 | const RESOURCE_COLLECTION = 'accounts'; |
||
26 | const RESOURCE = 'accounts/{account_id}'; |
||
27 | const FEATURES = 'accounts/{account_id}/features'; |
||
28 | const APP_LISTS = 'accounts/{account_id}/app_lists'; |
||
29 | const SCOPED_TIMELINE = 'accounts/{account_id}/scoped_timeline'; |
||
30 | const AUTHENTICATED_USER_ACCESS = 'accounts/{account_id}/authenticated_user_access'; |
||
31 | |||
32 | const ENTITY = 'ACCOUNT'; |
||
33 | |||
34 | protected $id; |
||
35 | protected $salt; |
||
36 | protected $name; |
||
37 | protected $timezone; |
||
38 | protected $timezone_switch_at; |
||
39 | protected $created_at; |
||
40 | protected $updated_at; |
||
41 | protected $deleted; |
||
42 | protected $approval_status; |
||
43 | protected $business_id; |
||
44 | protected $business_name; |
||
45 | protected $industry_type; |
||
46 | |||
47 | /** |
||
48 | * @param $metricGroups |
||
49 | * @param array $params |
||
50 | * @param bool $async |
||
51 | * @return mixed |
||
52 | * @throws Errors\BadRequest |
||
53 | * @throws Errors\Forbidden |
||
54 | * @throws Errors\NotAuthorized |
||
55 | * @throws Errors\NotFound |
||
56 | * @throws Errors\RateLimit |
||
57 | * @throws Errors\ServerError |
||
58 | * @throws Errors\ServiceUnavailable |
||
59 | * @throws TwitterAdsException |
||
60 | */ |
||
61 | public function stats($metricGroups, $params = [], $async = false) |
||
66 | |||
67 | /** |
||
68 | * @param array $params |
||
69 | * @return Account |
||
70 | * @throws Errors\BadRequest |
||
71 | * @throws Errors\Forbidden |
||
72 | * @throws Errors\NotAuthorized |
||
73 | * @throws Errors\NotFound |
||
74 | * @throws Errors\RateLimit |
||
75 | * @throws Errors\ServerError |
||
76 | * @throws Errors\ServiceUnavailable |
||
77 | * @throws TwitterAdsException |
||
78 | */ |
||
79 | public function read($params = []) |
||
84 | |||
85 | /** |
||
86 | * Returns a collection of features available to the current account. |
||
87 | * |
||
88 | * @return mixed |
||
89 | * |
||
90 | * @throws TwitterAdsException |
||
91 | */ |
||
92 | public function getFeatures() |
||
101 | |||
102 | /** |
||
103 | * Returns a collection of promotable users available to the current account. |
||
104 | * |
||
105 | * @param string $id |
||
106 | * |
||
107 | * @param array $params |
||
108 | * @return PromotableUser|Cursor |
||
109 | * @throws Errors\BadRequest |
||
110 | * @throws Errors\Forbidden |
||
111 | * @throws Errors\NotAuthorized |
||
112 | * @throws Errors\NotFound |
||
113 | * @throws Errors\RateLimit |
||
114 | * @throws Errors\ServerError |
||
115 | * @throws Errors\ServiceUnavailable |
||
116 | * @throws TwitterAdsException |
||
117 | */ |
||
118 | public function getPromotableUsers($id = '', $params = []) |
||
124 | |||
125 | /** |
||
126 | * Returns a collection of funding instruments available to the current account. |
||
127 | * |
||
128 | * @param string $id |
||
129 | * |
||
130 | * @param array $params |
||
131 | * @return FundingInstrument|Cursor |
||
132 | * @throws Errors\BadRequest |
||
133 | * @throws Errors\Forbidden |
||
134 | * @throws Errors\NotAuthorized |
||
135 | * @throws Errors\NotFound |
||
136 | * @throws Errors\RateLimit |
||
137 | * @throws Errors\ServerError |
||
138 | * @throws Errors\ServiceUnavailable |
||
139 | * @throws TwitterAdsException |
||
140 | */ |
||
141 | public function getFundingInstruments($id = '', $params = []) |
||
147 | |||
148 | /** |
||
149 | * Returns a collection of campaigns available to the current account. |
||
150 | * |
||
151 | * @param string $id |
||
152 | * |
||
153 | * @param array $params |
||
154 | * @return Campaign|Cursor |
||
155 | * @throws Errors\BadRequest |
||
156 | * @throws Errors\Forbidden |
||
157 | * @throws Errors\NotAuthorized |
||
158 | * @throws Errors\NotFound |
||
159 | * @throws Errors\RateLimit |
||
160 | * @throws Errors\ServerError |
||
161 | * @throws Errors\ServiceUnavailable |
||
162 | * @throws TwitterAdsException |
||
163 | */ |
||
164 | public function getCampaigns($id = '', $params = []) |
||
170 | |||
171 | /** |
||
172 | * Returns a collection of line items available to the current account. |
||
173 | * |
||
174 | * @param string $id |
||
175 | * |
||
176 | * @param array $params |
||
177 | * @return LineItem|Cursor |
||
178 | * @throws Errors\BadRequest |
||
179 | * @throws Errors\Forbidden |
||
180 | * @throws Errors\NotAuthorized |
||
181 | * @throws Errors\NotFound |
||
182 | * @throws Errors\RateLimit |
||
183 | * @throws Errors\ServerError |
||
184 | * @throws Errors\ServiceUnavailable |
||
185 | * @throws TwitterAdsException |
||
186 | */ |
||
187 | public function getLineItems($id = '', $params = []) |
||
193 | |||
194 | /** |
||
195 | * Returns a collection of app lists available to the current account. |
||
196 | * |
||
197 | * @param string $id |
||
198 | * |
||
199 | * @param array $params |
||
200 | * @return AppList|Cursor |
||
201 | * @throws Errors\BadRequest |
||
202 | * @throws Errors\Forbidden |
||
203 | * @throws Errors\NotAuthorized |
||
204 | * @throws Errors\NotFound |
||
205 | * @throws Errors\RateLimit |
||
206 | * @throws Errors\ServerError |
||
207 | * @throws Errors\ServiceUnavailable |
||
208 | * @throws TwitterAdsException |
||
209 | */ |
||
210 | public function getAppLists($id = '', $params = []) |
||
216 | |||
217 | /** |
||
218 | * Returns a collection of jobs. Can specify job_ids parameter to filter |
||
219 | * |
||
220 | * @param array $params |
||
221 | * @return Cursor|Resource |
||
222 | * @throws Errors\BadRequest |
||
223 | * @throws Errors\Forbidden |
||
224 | * @throws Errors\NotAuthorized |
||
225 | * @throws Errors\NotFound |
||
226 | * @throws Errors\RateLimit |
||
227 | * @throws Errors\ServerError |
||
228 | * @throws Errors\ServiceUnavailable |
||
229 | * @throws TwitterAdsException |
||
230 | */ |
||
231 | public function getJobs($params = []) |
||
237 | |||
238 | |||
239 | /** |
||
240 | * @param array $params |
||
241 | * @return Cursor|Resource |
||
242 | * @throws Errors\BadRequest |
||
243 | * @throws Errors\Forbidden |
||
244 | * @throws Errors\NotAuthorized |
||
245 | * @throws Errors\NotFound |
||
246 | * @throws Errors\RateLimit |
||
247 | * @throws Errors\ServerError |
||
248 | * @throws Errors\ServiceUnavailable |
||
249 | * @throws TwitterAdsException |
||
250 | */ |
||
251 | public function getTailoredAudiences($params = []) |
||
257 | |||
258 | /** |
||
259 | * Returns a collection of videos available to the current account. |
||
260 | * |
||
261 | * @param string $id |
||
262 | * @param array $params |
||
263 | * @return Cursor|Video |
||
264 | */ |
||
265 | public function getVideos($id = '', $params = []) |
||
271 | |||
272 | /** |
||
273 | * @return string |
||
274 | */ |
||
275 | public function getId() |
||
279 | |||
280 | /** |
||
281 | * @return string |
||
282 | */ |
||
283 | public function getSalt() |
||
287 | |||
288 | /** |
||
289 | * @return mixed |
||
290 | */ |
||
291 | public function getTimezone() |
||
295 | |||
296 | /** |
||
297 | * @return DateTimeImmutable |
||
298 | */ |
||
299 | public function getTimezoneSwitchAt() |
||
303 | |||
304 | /** |
||
305 | * @return DateTimeImmutable |
||
306 | */ |
||
307 | public function getCreatedAt() |
||
311 | |||
312 | /** |
||
313 | * @return DateTimeImmutable |
||
314 | */ |
||
315 | public function getUpdatedAt() |
||
319 | |||
320 | /** |
||
321 | * @return mixed |
||
322 | */ |
||
323 | public function getDeleted() |
||
327 | |||
328 | /** |
||
329 | * @return mixed |
||
330 | */ |
||
331 | public function getApprovalStatus() |
||
335 | |||
336 | /** |
||
337 | * @return string |
||
338 | */ |
||
339 | public function getName() |
||
343 | |||
344 | /** |
||
345 | * @return mixed |
||
346 | */ |
||
347 | public function getBusinessId() |
||
351 | |||
352 | /** |
||
353 | * @return mixed |
||
354 | */ |
||
355 | public function getBusinessName() |
||
359 | |||
360 | /** |
||
361 | * @return mixed |
||
362 | */ |
||
363 | public function getIndustryType() |
||
367 | |||
368 | /** |
||
369 | * @param mixed $industry_type |
||
370 | */ |
||
371 | public function setIndustryType($industry_type) |
||
375 | } |
||
376 |