Wireless.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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\Wireless\V1;
  12. /**
  13. * @property \Twilio\Rest\Wireless\V1 v1
  14. * @property \Twilio\Rest\Wireless\V1\CommandList commands
  15. * @property \Twilio\Rest\Wireless\V1\RatePlanList ratePlans
  16. * @property \Twilio\Rest\Wireless\V1\SimList sims
  17. * @method \Twilio\Rest\Wireless\V1\CommandContext commands(string $sid)
  18. * @method \Twilio\Rest\Wireless\V1\RatePlanContext ratePlans(string $sid)
  19. * @method \Twilio\Rest\Wireless\V1\SimContext sims(string $sid)
  20. */
  21. class Wireless extends Domain {
  22. protected $_v1 = null;
  23. /**
  24. * Construct the Wireless Domain
  25. *
  26. * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with
  27. * Twilio
  28. * @return \Twilio\Rest\Wireless Domain for Wireless
  29. */
  30. public function __construct(Client $client) {
  31. parent::__construct($client);
  32. $this->baseUrl = 'https://wireless.twilio.com';
  33. }
  34. /**
  35. * @return \Twilio\Rest\Wireless\V1 Version v1 of wireless
  36. */
  37. protected function getV1() {
  38. if (!$this->_v1) {
  39. $this->_v1 = new V1($this);
  40. }
  41. return $this->_v1;
  42. }
  43. /**
  44. * Magic getter to lazy load version
  45. *
  46. * @param string $name Version to return
  47. * @return \Twilio\Version The requested version
  48. * @throws \Twilio\Exceptions\TwilioException For unknown versions
  49. */
  50. public function __get($name) {
  51. $method = 'get' . ucfirst($name);
  52. if (method_exists($this, $method)) {
  53. return $this->$method();
  54. }
  55. throw new TwilioException('Unknown version ' . $name);
  56. }
  57. /**
  58. * Magic caller to get resource contexts
  59. *
  60. * @param string $name Resource to return
  61. * @param array $arguments Context parameters
  62. * @return \Twilio\InstanceContext The requested resource context
  63. * @throws \Twilio\Exceptions\TwilioException For unknown resource
  64. */
  65. public function __call($name, $arguments) {
  66. $method = 'context' . ucfirst($name);
  67. if (method_exists($this, $method)) {
  68. return call_user_func_array(array($this, $method), $arguments);
  69. }
  70. throw new TwilioException('Unknown context ' . $name);
  71. }
  72. /**
  73. * @return \Twilio\Rest\Wireless\V1\CommandList
  74. */
  75. protected function getCommands() {
  76. return $this->v1->commands;
  77. }
  78. /**
  79. * @param string $sid The sid
  80. * @return \Twilio\Rest\Wireless\V1\CommandContext
  81. */
  82. protected function contextCommands($sid) {
  83. return $this->v1->commands($sid);
  84. }
  85. /**
  86. * @return \Twilio\Rest\Wireless\V1\RatePlanList
  87. */
  88. protected function getRatePlans() {
  89. return $this->v1->ratePlans;
  90. }
  91. /**
  92. * @param string $sid The sid
  93. * @return \Twilio\Rest\Wireless\V1\RatePlanContext
  94. */
  95. protected function contextRatePlans($sid) {
  96. return $this->v1->ratePlans($sid);
  97. }
  98. /**
  99. * @return \Twilio\Rest\Wireless\V1\SimList
  100. */
  101. protected function getSims() {
  102. return $this->v1->sims;
  103. }
  104. /**
  105. * @param string $sid The sid
  106. * @return \Twilio\Rest\Wireless\V1\SimContext
  107. */
  108. protected function contextSims($sid) {
  109. return $this->v1->sims($sid);
  110. }
  111. /**
  112. * Provide a friendly representation
  113. *
  114. * @return string Machine friendly representation
  115. */
  116. public function __toString() {
  117. return '[Twilio.Wireless]';
  118. }
  119. }