diff options
Diffstat (limited to 'Twilio/Rest/Notify/V1/Service/NotificationInstance.php')
-rw-r--r-- | Twilio/Rest/Notify/V1/Service/NotificationInstance.php | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/Twilio/Rest/Notify/V1/Service/NotificationInstance.php b/Twilio/Rest/Notify/V1/Service/NotificationInstance.php new file mode 100644 index 0000000..060a508 --- /dev/null +++ b/Twilio/Rest/Notify/V1/Service/NotificationInstance.php @@ -0,0 +1,102 @@ +<?php + +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +namespace Twilio\Rest\Notify\V1\Service; + +use Twilio\Deserialize; +use Twilio\Exceptions\TwilioException; +use Twilio\InstanceResource; +use Twilio\Version; + +/** + * @property string sid + * @property string accountSid + * @property string serviceSid + * @property \DateTime dateCreated + * @property string identities + * @property string tags + * @property string priority + * @property string ttl + * @property string title + * @property string body + * @property string sound + * @property string action + * @property string data + * @property string apn + * @property string gcm + * @property string sms + * @property string facebookMessenger + */ +class NotificationInstance extends InstanceResource { + /** + * Initialize the NotificationInstance + * + * @param \Twilio\Version $version Version that contains the resource + * @param mixed[] $payload The response payload + * @param string $serviceSid The service_sid + * @return \Twilio\Rest\Notify\V1\Service\NotificationInstance + */ + public function __construct(Version $version, array $payload, $serviceSid) { + parent::__construct($version); + + // Marshaled Properties + $this->properties = array( + 'sid' => $payload['sid'], + 'accountSid' => $payload['account_sid'], + 'serviceSid' => $payload['service_sid'], + 'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']), + 'identities' => $payload['identities'], + 'tags' => $payload['tags'], + 'priority' => $payload['priority'], + 'ttl' => $payload['ttl'], + 'title' => $payload['title'], + 'body' => $payload['body'], + 'sound' => $payload['sound'], + 'action' => $payload['action'], + 'data' => $payload['data'], + 'apn' => $payload['apn'], + 'gcm' => $payload['gcm'], + 'sms' => $payload['sms'], + 'facebookMessenger' => $payload['facebook_messenger'], + ); + + $this->solution = array( + 'serviceSid' => $serviceSid, + ); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get($name) { + if (array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (property_exists($this, '_' . $name)) { + $method = 'get' . ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString() { + return '[Twilio.Notify.V1.NotificationInstance]'; + } +}
\ No newline at end of file |