MachineToMachineInstance.php 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * This code was generated by
  4. * \ / _ _ _| _ _
  5. * | (_)\/(_)(_|\/| |(/_ v1.0.0
  6. * / /
  7. */
  8. namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
  9. use Twilio\Exceptions\TwilioException;
  10. use Twilio\InstanceResource;
  11. use Twilio\Values;
  12. use Twilio\Version;
  13. /**
  14. * @property string friendlyName
  15. * @property string phoneNumber
  16. * @property string lata
  17. * @property string locality
  18. * @property string rateCenter
  19. * @property string latitude
  20. * @property string longitude
  21. * @property string region
  22. * @property string postalCode
  23. * @property string isoCountry
  24. * @property string addressRequirements
  25. * @property boolean beta
  26. * @property string capabilities
  27. */
  28. class MachineToMachineInstance extends InstanceResource {
  29. /**
  30. * Initialize the MachineToMachineInstance
  31. *
  32. * @param \Twilio\Version $version Version that contains the resource
  33. * @param mixed[] $payload The response payload
  34. * @param string $accountSid The 34 character string that uniquely identifies
  35. * your account.
  36. * @param string $countryCode The ISO Country code to lookup phone numbers for.
  37. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineInstance
  38. */
  39. public function __construct(Version $version, array $payload, $accountSid, $countryCode) {
  40. parent::__construct($version);
  41. // Marshaled Properties
  42. $this->properties = array(
  43. 'friendlyName' => Values::array_get($payload, 'friendly_name'),
  44. 'phoneNumber' => Values::array_get($payload, 'phone_number'),
  45. 'lata' => Values::array_get($payload, 'lata'),
  46. 'locality' => Values::array_get($payload, 'locality'),
  47. 'rateCenter' => Values::array_get($payload, 'rate_center'),
  48. 'latitude' => Values::array_get($payload, 'latitude'),
  49. 'longitude' => Values::array_get($payload, 'longitude'),
  50. 'region' => Values::array_get($payload, 'region'),
  51. 'postalCode' => Values::array_get($payload, 'postal_code'),
  52. 'isoCountry' => Values::array_get($payload, 'iso_country'),
  53. 'addressRequirements' => Values::array_get($payload, 'address_requirements'),
  54. 'beta' => Values::array_get($payload, 'beta'),
  55. 'capabilities' => Values::array_get($payload, 'capabilities'),
  56. );
  57. $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, );
  58. }
  59. /**
  60. * Magic getter to access properties
  61. *
  62. * @param string $name Property to access
  63. * @return mixed The requested property
  64. * @throws TwilioException For unknown properties
  65. */
  66. public function __get($name) {
  67. if (array_key_exists($name, $this->properties)) {
  68. return $this->properties[$name];
  69. }
  70. if (property_exists($this, '_' . $name)) {
  71. $method = 'get' . ucfirst($name);
  72. return $this->$method();
  73. }
  74. throw new TwilioException('Unknown property: ' . $name);
  75. }
  76. /**
  77. * Provide a friendly representation
  78. *
  79. * @return string Machine friendly representation
  80. */
  81. public function __toString() {
  82. return '[Twilio.Api.V2010.MachineToMachineInstance]';
  83. }
  84. }