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
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#action ⇒ String
The actions to display for the notification.
-
#alexa ⇒ Hash
Deprecated.
-
#apn ⇒ Hash
The APNS-specific payload that overrides corresponding attributes in a generic payload for APNS Bindings.
-
#body ⇒ String
The notification body text.
-
#data ⇒ Hash
The custom key-value pairs of the notification’s payload.
-
#date_created ⇒ Time
The RFC 2822 date and time in GMT when the resource was created.
-
#facebook_messenger ⇒ Hash
Deprecated.
-
#fcm ⇒ Hash
The FCM-specific payload that overrides corresponding attributes in generic payload for FCM Bindings.
-
#gcm ⇒ Hash
The GCM-specific payload that overrides corresponding attributes in generic payload for GCM Bindings.
-
#identities ⇒ String
The list of identity values 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 ⇒ notification.Priority
The priority of the notification.
-
#segments ⇒ String
The list of Segments to notify.
-
#service_sid ⇒ String
The SID of the Service that the resource is associated with.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#sms ⇒ Hash
The SMS-specific payload that overrides corresponding attributes in generic payload for SMS Bindings.
-
#sound ⇒ String
The name of the sound to be played for the notification.
-
#tags ⇒ 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
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 197 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'].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
Returns The SID of the Account that created the resource.
233 234 235 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 233 def account_sid @properties['account_sid'] end |
#action ⇒ String
Returns The actions to display for the notification.
299 300 301 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 299 def action @properties['action'] end |
#alexa ⇒ Hash
Returns Deprecated.
341 342 343 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 341 def alexa @properties['alexa'] end |
#apn ⇒ Hash
Returns The APNS-specific payload that overrides corresponding attributes in a generic payload for APNS Bindings.
311 312 313 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 311 def apn @properties['apn'] end |
#body ⇒ String
Returns The notification body text.
287 288 289 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 287 def body @properties['body'] end |
#data ⇒ Hash
Returns The custom key-value pairs of the notification’s payload.
305 306 307 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 305 def data @properties['data'] end |
#date_created ⇒ Time
Returns The RFC 2822 date and time in GMT when the resource was created.
245 246 247 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 245 def date_created @properties['date_created'] end |
#facebook_messenger ⇒ Hash
Returns Deprecated.
335 336 337 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 335 def facebook_messenger @properties['facebook_messenger'] end |
#fcm ⇒ Hash
Returns The FCM-specific payload that overrides corresponding attributes in generic payload for FCM Bindings.
323 324 325 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 323 def fcm @properties['fcm'] end |
#gcm ⇒ Hash
Returns The GCM-specific payload that overrides corresponding attributes in generic payload for GCM Bindings.
317 318 319 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 317 def gcm @properties['gcm'] end |
#identities ⇒ String
Returns The list of identity values of the Users to notify.
251 252 253 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 251 def identities @properties['identities'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
353 354 355 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 353 def inspect "<Twilio.Notify.V1.NotificationInstance>" end |
#priority ⇒ notification.Priority
Returns The priority of the notification.
269 270 271 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 269 def priority @properties['priority'] end |
#segments ⇒ String
Returns The list of Segments to notify.
263 264 265 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 263 def segments @properties['segments'] end |
#service_sid ⇒ String
Returns The SID of the Service that the resource is associated with.
239 240 241 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 239 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The unique string that identifies the resource.
227 228 229 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 227 def sid @properties['sid'] end |
#sms ⇒ Hash
Returns The SMS-specific payload that overrides corresponding attributes in generic payload for SMS Bindings.
329 330 331 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 329 def sms @properties['sms'] end |
#sound ⇒ String
Returns The name of the sound to be played for the notification.
293 294 295 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 293 def sound @properties['sound'] end |
#tags ⇒ String
Returns The tags that select the Bindings to notify.
257 258 259 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 257 def @properties['tags'] end |
#title ⇒ String
Returns The notification title.
281 282 283 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 281 def title @properties['title'] end |
#to_s ⇒ Object
Provide a user friendly representation
347 348 349 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 347 def to_s "<Twilio.Notify.V1.NotificationInstance>" end |
#ttl ⇒ String
Returns How long, in seconds, the notification is valid.
275 276 277 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 275 def ttl @properties['ttl'] end |