Class: Twilio::REST::Notify::V1::ServiceContext::NotificationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Notify::V1::ServiceContext::NotificationInstance
- Defined in:
- lib/twilio-ruby/rest/notify/v1/service/notification.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Notification resource.
-
#action ⇒ String
The actions to display for the notification.
-
#alexa ⇒ Hash
Deprecated.
-
#apn ⇒ Hash
The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings.
-
#body ⇒ String
The notification text.
-
#data ⇒ Hash
The custom key-value pairs of the notification’s payload.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#facebook_messenger ⇒ Hash
Deprecated.
-
#fcm ⇒ Hash
The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings.
-
#gcm ⇒ Hash
The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings.
-
#identities ⇒ Array<String>
The list of
identityvalues of the Users to notify. -
#initialize(version, payload, service_sid: nil) ⇒ NotificationInstance
constructor
Initialize the NotificationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #priority ⇒ Priority
-
#segments ⇒ Array<String>
The list of Segments to notify.
-
#service_sid ⇒ String
The SID of the [Service](www.twilio.com/docs/notify/api/service-resource) the resource is associated with.
-
#sid ⇒ String
The unique string that we created to identify the Notification resource.
-
#sms ⇒ Hash
The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings.
-
#sound ⇒ String
The name of the sound to be played for the notification.
-
#tags ⇒ Array<String>
The tags that select the Bindings to notify.
-
#title ⇒ String
The notification title.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#ttl ⇒ String
How long, in seconds, the notification is valid.
Constructor Details
#initialize(version, payload, service_sid: nil) ⇒ NotificationInstance
Initialize the NotificationInstance
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 304 def initialize(version, payload , service_sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'identities' => payload['identities'], 'tags' => payload['tags'], 'segments' => payload['segments'], 'priority' => payload['priority'], 'ttl' => payload['ttl'] == nil ? payload['ttl'] : payload['ttl'].to_i, 'title' => payload['title'], 'body' => payload['body'], 'sound' => payload['sound'], 'action' => payload['action'], 'data' => payload['data'], 'apn' => payload['apn'], 'gcm' => payload['gcm'], 'fcm' => payload['fcm'], 'sms' => payload['sms'], 'facebook_messenger' => payload['facebook_messenger'], 'alexa' => payload['alexa'], } end |
Instance Method Details
#account_sid ⇒ String
342 343 344 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 342 def account_sid @properties['account_sid'] end |
#action ⇒ String
408 409 410 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 408 def action @properties['action'] end |
#alexa ⇒ Hash
450 451 452 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 450 def alexa @properties['alexa'] end |
#apn ⇒ Hash
420 421 422 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 420 def apn @properties['apn'] end |
#body ⇒ String
396 397 398 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 396 def body @properties['body'] end |
#data ⇒ Hash
414 415 416 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 414 def data @properties['data'] end |
#date_created ⇒ Time
354 355 356 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 354 def date_created @properties['date_created'] end |
#facebook_messenger ⇒ Hash
444 445 446 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 444 def facebook_messenger @properties['facebook_messenger'] end |
#fcm ⇒ Hash
432 433 434 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 432 def fcm @properties['fcm'] end |
#gcm ⇒ Hash
426 427 428 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 426 def gcm @properties['gcm'] end |
#identities ⇒ Array<String>
360 361 362 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 360 def identities @properties['identities'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
462 463 464 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 462 def inspect "<Twilio.Notify.V1.NotificationInstance>" end |
#priority ⇒ Priority
378 379 380 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 378 def priority @properties['priority'] end |
#segments ⇒ Array<String>
372 373 374 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 372 def segments @properties['segments'] end |
#service_sid ⇒ String
348 349 350 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 348 def service_sid @properties['service_sid'] end |
#sid ⇒ String
336 337 338 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 336 def sid @properties['sid'] end |
#sms ⇒ Hash
438 439 440 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 438 def sms @properties['sms'] end |
#sound ⇒ String
402 403 404 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 402 def sound @properties['sound'] end |
#tags ⇒ Array<String>
366 367 368 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 366 def @properties['tags'] end |
#title ⇒ String
390 391 392 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 390 def title @properties['title'] end |
#to_s ⇒ Object
Provide a user friendly representation
456 457 458 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 456 def to_s "<Twilio.Notify.V1.NotificationInstance>" end |
#ttl ⇒ String
384 385 386 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 384 def ttl @properties['ttl'] end |