Pricing.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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\Pricing\V1;
  12. /**
  13. * @property \Twilio\Rest\Pricing\V1 v1
  14. * @property \Twilio\Rest\Pricing\V1\MessagingList messaging
  15. * @property \Twilio\Rest\Pricing\V1\PhoneNumberList phoneNumbers
  16. * @property \Twilio\Rest\Pricing\V1\VoiceList voice
  17. */
  18. class Pricing extends Domain {
  19. protected $_v1 = null;
  20. /**
  21. * Construct the Pricing Domain
  22. *
  23. * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with
  24. * Twilio
  25. * @return \Twilio\Rest\Pricing Domain for Pricing
  26. */
  27. public function __construct(Client $client) {
  28. parent::__construct($client);
  29. $this->baseUrl = 'https://pricing.twilio.com';
  30. }
  31. /**
  32. * @return \Twilio\Rest\Pricing\V1 Version v1 of pricing
  33. */
  34. protected function getV1() {
  35. if (!$this->_v1) {
  36. $this->_v1 = new V1($this);
  37. }
  38. return $this->_v1;
  39. }
  40. /**
  41. * Magic getter to lazy load version
  42. *
  43. * @param string $name Version to return
  44. * @return \Twilio\Version The requested version
  45. * @throws \Twilio\Exceptions\TwilioException For unknown versions
  46. */
  47. public function __get($name) {
  48. $method = 'get' . ucfirst($name);
  49. if (method_exists($this, $method)) {
  50. return $this->$method();
  51. }
  52. throw new TwilioException('Unknown version ' . $name);
  53. }
  54. /**
  55. * Magic caller to get resource contexts
  56. *
  57. * @param string $name Resource to return
  58. * @param array $arguments Context parameters
  59. * @return \Twilio\InstanceContext The requested resource context
  60. * @throws \Twilio\Exceptions\TwilioException For unknown resource
  61. */
  62. public function __call($name, $arguments) {
  63. $method = 'context' . ucfirst($name);
  64. if (method_exists($this, $method)) {
  65. return call_user_func_array(array($this, $method), $arguments);
  66. }
  67. throw new TwilioException('Unknown context ' . $name);
  68. }
  69. /**
  70. * @return \Twilio\Rest\Pricing\V1\MessagingList
  71. */
  72. protected function getMessaging() {
  73. return $this->v1->messaging;
  74. }
  75. /**
  76. * @return \Twilio\Rest\Pricing\V1\PhoneNumberList
  77. */
  78. protected function getPhoneNumbers() {
  79. return $this->v1->phoneNumbers;
  80. }
  81. /**
  82. * @return \Twilio\Rest\Pricing\V1\VoiceList
  83. */
  84. protected function getVoice() {
  85. return $this->v1->voice;
  86. }
  87. /**
  88. * Provide a friendly representation
  89. *
  90. * @return string Machine friendly representation
  91. */
  92. public function __toString() {
  93. return '[Twilio.Pricing]';
  94. }
  95. }