PageRenderTime 26ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/twilio-php-master/Twilio/Rest/Api.php

https://bitbucket.org/OverSite/capstone-demo
PHP | 498 lines | 213 code | 55 blank | 230 comment | 3 complexity | ffcb2ba6f36ea73eb82c7d822d1be49d MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, MIT, LGPL-2.1, Apache-2.0
  1. <?php
  2. /**
  3. * This code was generated by
  4. * \ / _ _ _| _ _
  5. * | (_)\/(_)(_|\/| |(/_ v1.0.0
  6. * / /
  7. */
  8. namespace Twilio\Rest;
  9. use Twilio\Domain;
  10. use Twilio\Exceptions\TwilioException;
  11. use Twilio\Rest\Api\V2010;
  12. /**
  13. * @property \Twilio\Rest\Api\V2010 v2010
  14. * @property \Twilio\Rest\Api\V2010\AccountList accounts
  15. * @property \Twilio\Rest\Api\V2010\AccountContext account
  16. * @property \Twilio\Rest\Api\V2010\Account\AddressList addresses
  17. * @property \Twilio\Rest\Api\V2010\Account\ApplicationList applications
  18. * @property \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList authorizedConnectApps
  19. * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList availablePhoneNumbers
  20. * @property \Twilio\Rest\Api\V2010\Account\CallList calls
  21. * @property \Twilio\Rest\Api\V2010\Account\ConferenceList conferences
  22. * @property \Twilio\Rest\Api\V2010\Account\ConnectAppList connectApps
  23. * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList incomingPhoneNumbers
  24. * @property \Twilio\Rest\Api\V2010\Account\KeyList keys
  25. * @property \Twilio\Rest\Api\V2010\Account\MessageList messages
  26. * @property \Twilio\Rest\Api\V2010\Account\NewKeyList newKeys
  27. * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList newSigningKeys
  28. * @property \Twilio\Rest\Api\V2010\Account\NotificationList notifications
  29. * @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList outgoingCallerIds
  30. * @property \Twilio\Rest\Api\V2010\Account\QueueList queues
  31. * @property \Twilio\Rest\Api\V2010\Account\RecordingList recordings
  32. * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList signingKeys
  33. * @property \Twilio\Rest\Api\V2010\Account\SipList sip
  34. * @property \Twilio\Rest\Api\V2010\Account\ShortCodeList shortCodes
  35. * @property \Twilio\Rest\Api\V2010\Account\TokenList tokens
  36. * @property \Twilio\Rest\Api\V2010\Account\TranscriptionList transcriptions
  37. * @property \Twilio\Rest\Api\V2010\Account\UsageList usage
  38. * @property \Twilio\Rest\Api\V2010\Account\ValidationRequestList validationRequests
  39. * @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid)
  40. * @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid)
  41. * @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid)
  42. * @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode)
  43. * @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid)
  44. * @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid)
  45. * @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid)
  46. * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid)
  47. * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid)
  48. * @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid)
  49. * @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid)
  50. * @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid)
  51. * @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid)
  52. * @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid)
  53. * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid)
  54. * @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid)
  55. * @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid)
  56. * @method \Twilio\Rest\Api\V2010\AccountContext accounts(string $sid)
  57. */
  58. class Api extends Domain
  59. {
  60. protected $_v2010 = null;
  61. /**
  62. * Construct the Api Domain
  63. *
  64. * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with
  65. * Twilio
  66. * @return \Twilio\Rest\Api Domain for Api
  67. */
  68. public function __construct(Client $client)
  69. {
  70. parent::__construct($client);
  71. $this->baseUrl = 'https://api.twilio.com';
  72. }
  73. /**
  74. * @return \Twilio\Rest\Api\V2010 Version v2010 of api
  75. */
  76. protected function getV2010()
  77. {
  78. if (!$this->_v2010) {
  79. $this->_v2010 = new V2010($this);
  80. }
  81. return $this->_v2010;
  82. }
  83. /**
  84. * Magic getter to lazy load version
  85. *
  86. * @param string $name Version to return
  87. * @return \Twilio\Version The requested version
  88. * @throws \Twilio\Exceptions\TwilioException For unknown versions
  89. */
  90. public function __get($name)
  91. {
  92. $method = 'get' . ucfirst($name);
  93. if (method_exists($this, $method)) {
  94. return $this->$method();
  95. }
  96. throw new TwilioException('Unknown version ' . $name);
  97. }
  98. /**
  99. * Magic caller to get resource contexts
  100. *
  101. * @param string $name Resource to return
  102. * @param array $arguments Context parameters
  103. * @return \Twilio\InstanceContext The requested resource context
  104. * @throws \Twilio\Exceptions\TwilioException For unknown resource
  105. */
  106. public function __call($name, $arguments)
  107. {
  108. $method = 'context' . ucfirst($name);
  109. if (method_exists($this, $method)) {
  110. return call_user_func_array(array($this, $method), $arguments);
  111. }
  112. throw new TwilioException('Unknown context ' . $name);
  113. }
  114. /**
  115. * @return \Twilio\Rest\Api\V2010\AccountContext Account provided as the
  116. * authenticating account
  117. */
  118. protected function getAccount()
  119. {
  120. return $this->v2010->account;
  121. }
  122. /**
  123. * @return \Twilio\Rest\Api\V2010\AccountList
  124. */
  125. protected function getAccounts()
  126. {
  127. return $this->v2010->accounts;
  128. }
  129. /**
  130. * @param string $sid Fetch by unique Account Sid
  131. * @return \Twilio\Rest\Api\V2010\AccountContext
  132. */
  133. protected function contextAccounts($sid)
  134. {
  135. return $this->v2010->accounts($sid);
  136. }
  137. /**
  138. * @return \Twilio\Rest\Api\V2010\Account\AddressList
  139. */
  140. protected function getAddresses()
  141. {
  142. return $this->v2010->account->addresses;
  143. }
  144. /**
  145. * @param string $sid The sid
  146. * @return \Twilio\Rest\Api\V2010\Account\AddressContext
  147. */
  148. protected function contextAddresses($sid)
  149. {
  150. return $this->v2010->account->addresses($sid);
  151. }
  152. /**
  153. * @return \Twilio\Rest\Api\V2010\Account\ApplicationList
  154. */
  155. protected function getApplications()
  156. {
  157. return $this->v2010->account->applications;
  158. }
  159. /**
  160. * @param string $sid Fetch by unique Application Sid
  161. * @return \Twilio\Rest\Api\V2010\Account\ApplicationContext
  162. */
  163. protected function contextApplications($sid)
  164. {
  165. return $this->v2010->account->applications($sid);
  166. }
  167. /**
  168. * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList
  169. */
  170. protected function getAuthorizedConnectApps()
  171. {
  172. return $this->v2010->account->authorizedConnectApps;
  173. }
  174. /**
  175. * @param string $connectAppSid The connect_app_sid
  176. * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext
  177. */
  178. protected function contextAuthorizedConnectApps($connectAppSid)
  179. {
  180. return $this->v2010->account->authorizedConnectApps($connectAppSid);
  181. }
  182. /**
  183. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList
  184. */
  185. protected function getAvailablePhoneNumbers()
  186. {
  187. return $this->v2010->account->availablePhoneNumbers;
  188. }
  189. /**
  190. * @param string $countryCode The country_code
  191. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext
  192. */
  193. protected function contextAvailablePhoneNumbers($countryCode)
  194. {
  195. return $this->v2010->account->availablePhoneNumbers($countryCode);
  196. }
  197. /**
  198. * @return \Twilio\Rest\Api\V2010\Account\CallList
  199. */
  200. protected function getCalls()
  201. {
  202. return $this->v2010->account->calls;
  203. }
  204. /**
  205. * @param string $sid Call Sid that uniquely identifies the Call to fetch
  206. * @return \Twilio\Rest\Api\V2010\Account\CallContext
  207. */
  208. protected function contextCalls($sid)
  209. {
  210. return $this->v2010->account->calls($sid);
  211. }
  212. /**
  213. * @return \Twilio\Rest\Api\V2010\Account\ConferenceList
  214. */
  215. protected function getConferences()
  216. {
  217. return $this->v2010->account->conferences;
  218. }
  219. /**
  220. * @param string $sid Fetch by unique conference Sid
  221. * @return \Twilio\Rest\Api\V2010\Account\ConferenceContext
  222. */
  223. protected function contextConferences($sid)
  224. {
  225. return $this->v2010->account->conferences($sid);
  226. }
  227. /**
  228. * @return \Twilio\Rest\Api\V2010\Account\ConnectAppList
  229. */
  230. protected function getConnectApps()
  231. {
  232. return $this->v2010->account->connectApps;
  233. }
  234. /**
  235. * @param string $sid Fetch by unique connect-app Sid
  236. * @return \Twilio\Rest\Api\V2010\Account\ConnectAppContext
  237. */
  238. protected function contextConnectApps($sid)
  239. {
  240. return $this->v2010->account->connectApps($sid);
  241. }
  242. /**
  243. * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList
  244. */
  245. protected function getIncomingPhoneNumbers()
  246. {
  247. return $this->v2010->account->incomingPhoneNumbers;
  248. }
  249. /**
  250. * @param string $sid Fetch by unique incoming-phone-number Sid
  251. * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext
  252. */
  253. protected function contextIncomingPhoneNumbers($sid)
  254. {
  255. return $this->v2010->account->incomingPhoneNumbers($sid);
  256. }
  257. /**
  258. * @return \Twilio\Rest\Api\V2010\Account\KeyList
  259. */
  260. protected function getKeys()
  261. {
  262. return $this->v2010->account->keys;
  263. }
  264. /**
  265. * @param string $sid The sid
  266. * @return \Twilio\Rest\Api\V2010\Account\KeyContext
  267. */
  268. protected function contextKeys($sid)
  269. {
  270. return $this->v2010->account->keys($sid);
  271. }
  272. /**
  273. * @return \Twilio\Rest\Api\V2010\Account\MessageList
  274. */
  275. protected function getMessages()
  276. {
  277. return $this->v2010->account->messages;
  278. }
  279. /**
  280. * @param string $sid Fetch by unique message Sid
  281. * @return \Twilio\Rest\Api\V2010\Account\MessageContext
  282. */
  283. protected function contextMessages($sid)
  284. {
  285. return $this->v2010->account->messages($sid);
  286. }
  287. /**
  288. * @return \Twilio\Rest\Api\V2010\Account\NewKeyList
  289. */
  290. protected function getNewKeys()
  291. {
  292. return $this->v2010->account->newKeys;
  293. }
  294. /**
  295. * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList
  296. */
  297. protected function getNewSigningKeys()
  298. {
  299. return $this->v2010->account->newSigningKeys;
  300. }
  301. /**
  302. * @return \Twilio\Rest\Api\V2010\Account\NotificationList
  303. */
  304. protected function getNotifications()
  305. {
  306. return $this->v2010->account->notifications;
  307. }
  308. /**
  309. * @param string $sid Fetch by unique notification Sid
  310. * @return \Twilio\Rest\Api\V2010\Account\NotificationContext
  311. */
  312. protected function contextNotifications($sid)
  313. {
  314. return $this->v2010->account->notifications($sid);
  315. }
  316. /**
  317. * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList
  318. */
  319. protected function getOutgoingCallerIds()
  320. {
  321. return $this->v2010->account->outgoingCallerIds;
  322. }
  323. /**
  324. * @param string $sid Fetch by unique outgoing-caller-id Sid
  325. * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext
  326. */
  327. protected function contextOutgoingCallerIds($sid)
  328. {
  329. return $this->v2010->account->outgoingCallerIds($sid);
  330. }
  331. /**
  332. * @return \Twilio\Rest\Api\V2010\Account\QueueList
  333. */
  334. protected function getQueues()
  335. {
  336. return $this->v2010->account->queues;
  337. }
  338. /**
  339. * @param string $sid Fetch by unique queue Sid
  340. * @return \Twilio\Rest\Api\V2010\Account\QueueContext
  341. */
  342. protected function contextQueues($sid)
  343. {
  344. return $this->v2010->account->queues($sid);
  345. }
  346. /**
  347. * @return \Twilio\Rest\Api\V2010\Account\RecordingList
  348. */
  349. protected function getRecordings()
  350. {
  351. return $this->v2010->account->recordings;
  352. }
  353. /**
  354. * @param string $sid Fetch by unique recording Sid
  355. * @return \Twilio\Rest\Api\V2010\Account\RecordingContext
  356. */
  357. protected function contextRecordings($sid)
  358. {
  359. return $this->v2010->account->recordings($sid);
  360. }
  361. /**
  362. * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList
  363. */
  364. protected function getSigningKeys()
  365. {
  366. return $this->v2010->account->signingKeys;
  367. }
  368. /**
  369. * @param string $sid The sid
  370. * @return \Twilio\Rest\Api\V2010\Account\SigningKeyContext
  371. */
  372. protected function contextSigningKeys($sid)
  373. {
  374. return $this->v2010->account->signingKeys($sid);
  375. }
  376. /**
  377. * @return \Twilio\Rest\Api\V2010\Account\SipList
  378. */
  379. protected function getSip()
  380. {
  381. return $this->v2010->account->sip;
  382. }
  383. /**
  384. * @return \Twilio\Rest\Api\V2010\Account\ShortCodeList
  385. */
  386. protected function getShortCodes()
  387. {
  388. return $this->v2010->account->shortCodes;
  389. }
  390. /**
  391. * @param string $sid Fetch by unique short-code Sid
  392. * @return \Twilio\Rest\Api\V2010\Account\ShortCodeContext
  393. */
  394. protected function contextShortCodes($sid)
  395. {
  396. return $this->v2010->account->shortCodes($sid);
  397. }
  398. /**
  399. * @return \Twilio\Rest\Api\V2010\Account\TokenList
  400. */
  401. protected function getTokens()
  402. {
  403. return $this->v2010->account->tokens;
  404. }
  405. /**
  406. * @return \Twilio\Rest\Api\V2010\Account\TranscriptionList
  407. */
  408. protected function getTranscriptions()
  409. {
  410. return $this->v2010->account->transcriptions;
  411. }
  412. /**
  413. * @param string $sid Fetch by unique transcription Sid
  414. * @return \Twilio\Rest\Api\V2010\Account\TranscriptionContext
  415. */
  416. protected function contextTranscriptions($sid)
  417. {
  418. return $this->v2010->account->transcriptions($sid);
  419. }
  420. /**
  421. * @return \Twilio\Rest\Api\V2010\Account\UsageList
  422. */
  423. protected function getUsage()
  424. {
  425. return $this->v2010->account->usage;
  426. }
  427. /**
  428. * @return \Twilio\Rest\Api\V2010\Account\ValidationRequestList
  429. */
  430. protected function getValidationRequests()
  431. {
  432. return $this->v2010->account->validationRequests;
  433. }
  434. /**
  435. * Provide a friendly representation
  436. *
  437. * @return string Machine friendly representation
  438. */
  439. public function __toString()
  440. {
  441. return '[Twilio.Api]';
  442. }
  443. }