Api.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  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. protected $_v2010 = null;
  60. /**
  61. * Construct the Api Domain
  62. *
  63. * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with
  64. * Twilio
  65. * @return \Twilio\Rest\Api Domain for Api
  66. */
  67. public function __construct(Client $client) {
  68. parent::__construct($client);
  69. $this->baseUrl = 'https://api.twilio.com';
  70. }
  71. /**
  72. * @return \Twilio\Rest\Api\V2010 Version v2010 of api
  73. */
  74. protected function getV2010() {
  75. if (!$this->_v2010) {
  76. $this->_v2010 = new V2010($this);
  77. }
  78. return $this->_v2010;
  79. }
  80. /**
  81. * Magic getter to lazy load version
  82. *
  83. * @param string $name Version to return
  84. * @return \Twilio\Version The requested version
  85. * @throws \Twilio\Exceptions\TwilioException For unknown versions
  86. */
  87. public function __get($name) {
  88. $method = 'get' . ucfirst($name);
  89. if (method_exists($this, $method)) {
  90. return $this->$method();
  91. }
  92. throw new TwilioException('Unknown version ' . $name);
  93. }
  94. /**
  95. * Magic caller to get resource contexts
  96. *
  97. * @param string $name Resource to return
  98. * @param array $arguments Context parameters
  99. * @return \Twilio\InstanceContext The requested resource context
  100. * @throws \Twilio\Exceptions\TwilioException For unknown resource
  101. */
  102. public function __call($name, $arguments) {
  103. $method = 'context' . ucfirst($name);
  104. if (method_exists($this, $method)) {
  105. return call_user_func_array(array($this, $method), $arguments);
  106. }
  107. throw new TwilioException('Unknown context ' . $name);
  108. }
  109. /**
  110. * @return \Twilio\Rest\Api\V2010\AccountContext Account provided as the
  111. * authenticating account
  112. */
  113. protected function getAccount() {
  114. return $this->v2010->account;
  115. }
  116. /**
  117. * @return \Twilio\Rest\Api\V2010\AccountList
  118. */
  119. protected function getAccounts() {
  120. return $this->v2010->accounts;
  121. }
  122. /**
  123. * @param string $sid Fetch by unique Account Sid
  124. * @return \Twilio\Rest\Api\V2010\AccountContext
  125. */
  126. protected function contextAccounts($sid) {
  127. return $this->v2010->accounts($sid);
  128. }
  129. /**
  130. * @return \Twilio\Rest\Api\V2010\Account\AddressList
  131. */
  132. protected function getAddresses() {
  133. return $this->v2010->account->addresses;
  134. }
  135. /**
  136. * @param string $sid The sid
  137. * @return \Twilio\Rest\Api\V2010\Account\AddressContext
  138. */
  139. protected function contextAddresses($sid) {
  140. return $this->v2010->account->addresses($sid);
  141. }
  142. /**
  143. * @return \Twilio\Rest\Api\V2010\Account\ApplicationList
  144. */
  145. protected function getApplications() {
  146. return $this->v2010->account->applications;
  147. }
  148. /**
  149. * @param string $sid Fetch by unique Application Sid
  150. * @return \Twilio\Rest\Api\V2010\Account\ApplicationContext
  151. */
  152. protected function contextApplications($sid) {
  153. return $this->v2010->account->applications($sid);
  154. }
  155. /**
  156. * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList
  157. */
  158. protected function getAuthorizedConnectApps() {
  159. return $this->v2010->account->authorizedConnectApps;
  160. }
  161. /**
  162. * @param string $connectAppSid The connect_app_sid
  163. * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext
  164. */
  165. protected function contextAuthorizedConnectApps($connectAppSid) {
  166. return $this->v2010->account->authorizedConnectApps($connectAppSid);
  167. }
  168. /**
  169. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList
  170. */
  171. protected function getAvailablePhoneNumbers() {
  172. return $this->v2010->account->availablePhoneNumbers;
  173. }
  174. /**
  175. * @param string $countryCode The country_code
  176. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext
  177. */
  178. protected function contextAvailablePhoneNumbers($countryCode) {
  179. return $this->v2010->account->availablePhoneNumbers($countryCode);
  180. }
  181. /**
  182. * @return \Twilio\Rest\Api\V2010\Account\CallList
  183. */
  184. protected function getCalls() {
  185. return $this->v2010->account->calls;
  186. }
  187. /**
  188. * @param string $sid Call Sid that uniquely identifies the Call to fetch
  189. * @return \Twilio\Rest\Api\V2010\Account\CallContext
  190. */
  191. protected function contextCalls($sid) {
  192. return $this->v2010->account->calls($sid);
  193. }
  194. /**
  195. * @return \Twilio\Rest\Api\V2010\Account\ConferenceList
  196. */
  197. protected function getConferences() {
  198. return $this->v2010->account->conferences;
  199. }
  200. /**
  201. * @param string $sid Fetch by unique conference Sid
  202. * @return \Twilio\Rest\Api\V2010\Account\ConferenceContext
  203. */
  204. protected function contextConferences($sid) {
  205. return $this->v2010->account->conferences($sid);
  206. }
  207. /**
  208. * @return \Twilio\Rest\Api\V2010\Account\ConnectAppList
  209. */
  210. protected function getConnectApps() {
  211. return $this->v2010->account->connectApps;
  212. }
  213. /**
  214. * @param string $sid Fetch by unique connect-app Sid
  215. * @return \Twilio\Rest\Api\V2010\Account\ConnectAppContext
  216. */
  217. protected function contextConnectApps($sid) {
  218. return $this->v2010->account->connectApps($sid);
  219. }
  220. /**
  221. * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList
  222. */
  223. protected function getIncomingPhoneNumbers() {
  224. return $this->v2010->account->incomingPhoneNumbers;
  225. }
  226. /**
  227. * @param string $sid Fetch by unique incoming-phone-number Sid
  228. * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext
  229. */
  230. protected function contextIncomingPhoneNumbers($sid) {
  231. return $this->v2010->account->incomingPhoneNumbers($sid);
  232. }
  233. /**
  234. * @return \Twilio\Rest\Api\V2010\Account\KeyList
  235. */
  236. protected function getKeys() {
  237. return $this->v2010->account->keys;
  238. }
  239. /**
  240. * @param string $sid The sid
  241. * @return \Twilio\Rest\Api\V2010\Account\KeyContext
  242. */
  243. protected function contextKeys($sid) {
  244. return $this->v2010->account->keys($sid);
  245. }
  246. /**
  247. * @return \Twilio\Rest\Api\V2010\Account\MessageList
  248. */
  249. protected function getMessages() {
  250. return $this->v2010->account->messages;
  251. }
  252. /**
  253. * @param string $sid Fetch by unique message Sid
  254. * @return \Twilio\Rest\Api\V2010\Account\MessageContext
  255. */
  256. protected function contextMessages($sid) {
  257. return $this->v2010->account->messages($sid);
  258. }
  259. /**
  260. * @return \Twilio\Rest\Api\V2010\Account\NewKeyList
  261. */
  262. protected function getNewKeys() {
  263. return $this->v2010->account->newKeys;
  264. }
  265. /**
  266. * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList
  267. */
  268. protected function getNewSigningKeys() {
  269. return $this->v2010->account->newSigningKeys;
  270. }
  271. /**
  272. * @return \Twilio\Rest\Api\V2010\Account\NotificationList
  273. */
  274. protected function getNotifications() {
  275. return $this->v2010->account->notifications;
  276. }
  277. /**
  278. * @param string $sid Fetch by unique notification Sid
  279. * @return \Twilio\Rest\Api\V2010\Account\NotificationContext
  280. */
  281. protected function contextNotifications($sid) {
  282. return $this->v2010->account->notifications($sid);
  283. }
  284. /**
  285. * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList
  286. */
  287. protected function getOutgoingCallerIds() {
  288. return $this->v2010->account->outgoingCallerIds;
  289. }
  290. /**
  291. * @param string $sid Fetch by unique outgoing-caller-id Sid
  292. * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext
  293. */
  294. protected function contextOutgoingCallerIds($sid) {
  295. return $this->v2010->account->outgoingCallerIds($sid);
  296. }
  297. /**
  298. * @return \Twilio\Rest\Api\V2010\Account\QueueList
  299. */
  300. protected function getQueues() {
  301. return $this->v2010->account->queues;
  302. }
  303. /**
  304. * @param string $sid Fetch by unique queue Sid
  305. * @return \Twilio\Rest\Api\V2010\Account\QueueContext
  306. */
  307. protected function contextQueues($sid) {
  308. return $this->v2010->account->queues($sid);
  309. }
  310. /**
  311. * @return \Twilio\Rest\Api\V2010\Account\RecordingList
  312. */
  313. protected function getRecordings() {
  314. return $this->v2010->account->recordings;
  315. }
  316. /**
  317. * @param string $sid Fetch by unique recording Sid
  318. * @return \Twilio\Rest\Api\V2010\Account\RecordingContext
  319. */
  320. protected function contextRecordings($sid) {
  321. return $this->v2010->account->recordings($sid);
  322. }
  323. /**
  324. * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList
  325. */
  326. protected function getSigningKeys() {
  327. return $this->v2010->account->signingKeys;
  328. }
  329. /**
  330. * @param string $sid The sid
  331. * @return \Twilio\Rest\Api\V2010\Account\SigningKeyContext
  332. */
  333. protected function contextSigningKeys($sid) {
  334. return $this->v2010->account->signingKeys($sid);
  335. }
  336. /**
  337. * @return \Twilio\Rest\Api\V2010\Account\SipList
  338. */
  339. protected function getSip() {
  340. return $this->v2010->account->sip;
  341. }
  342. /**
  343. * @return \Twilio\Rest\Api\V2010\Account\ShortCodeList
  344. */
  345. protected function getShortCodes() {
  346. return $this->v2010->account->shortCodes;
  347. }
  348. /**
  349. * @param string $sid Fetch by unique short-code Sid
  350. * @return \Twilio\Rest\Api\V2010\Account\ShortCodeContext
  351. */
  352. protected function contextShortCodes($sid) {
  353. return $this->v2010->account->shortCodes($sid);
  354. }
  355. /**
  356. * @return \Twilio\Rest\Api\V2010\Account\TokenList
  357. */
  358. protected function getTokens() {
  359. return $this->v2010->account->tokens;
  360. }
  361. /**
  362. * @return \Twilio\Rest\Api\V2010\Account\TranscriptionList
  363. */
  364. protected function getTranscriptions() {
  365. return $this->v2010->account->transcriptions;
  366. }
  367. /**
  368. * @param string $sid Fetch by unique transcription Sid
  369. * @return \Twilio\Rest\Api\V2010\Account\TranscriptionContext
  370. */
  371. protected function contextTranscriptions($sid) {
  372. return $this->v2010->account->transcriptions($sid);
  373. }
  374. /**
  375. * @return \Twilio\Rest\Api\V2010\Account\UsageList
  376. */
  377. protected function getUsage() {
  378. return $this->v2010->account->usage;
  379. }
  380. /**
  381. * @return \Twilio\Rest\Api\V2010\Account\ValidationRequestList
  382. */
  383. protected function getValidationRequests() {
  384. return $this->v2010->account->validationRequests;
  385. }
  386. /**
  387. * Provide a friendly representation
  388. *
  389. * @return string Machine friendly representation
  390. */
  391. public function __toString() {
  392. return '[Twilio.Api]';
  393. }
  394. }