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 ⇒ Array[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 ⇒ Array[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 ⇒ 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
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 205 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
241 242 243 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 241 def account_sid @properties['account_sid'] end |
#action ⇒ String
307 308 309 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 307 def action @properties['action'] end |
#alexa ⇒ Hash
349 350 351 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 349 def alexa @properties['alexa'] end |
#apn ⇒ Hash
319 320 321 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 319 def apn @properties['apn'] end |
#body ⇒ String
295 296 297 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 295 def body @properties['body'] end |
#data ⇒ Hash
313 314 315 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 313 def data @properties['data'] end |
#date_created ⇒ Time
253 254 255 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 253 def date_created @properties['date_created'] end |
#facebook_messenger ⇒ Hash
343 344 345 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 343 def facebook_messenger @properties['facebook_messenger'] end |
#fcm ⇒ Hash
331 332 333 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 331 def fcm @properties['fcm'] end |
#gcm ⇒ Hash
325 326 327 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 325 def gcm @properties['gcm'] end |
#identities ⇒ Array[String]
259 260 261 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 259 def identities @properties['identities'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
361 362 363 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 361 def inspect "<Twilio.Notify.V1.NotificationInstance>" end |
#priority ⇒ notification.Priority
277 278 279 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 277 def priority @properties['priority'] end |
#segments ⇒ Array[String]
271 272 273 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 271 def segments @properties['segments'] end |
#service_sid ⇒ String
247 248 249 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 247 def service_sid @properties['service_sid'] end |
#sid ⇒ String
235 236 237 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 235 def sid @properties['sid'] end |
#sms ⇒ Hash
337 338 339 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 337 def sms @properties['sms'] end |
#sound ⇒ String
301 302 303 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 301 def sound @properties['sound'] end |
#tags ⇒ Array[String]
265 266 267 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 265 def @properties['tags'] end |
#title ⇒ String
289 290 291 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 289 def title @properties['title'] end |
#to_s ⇒ Object
Provide a user friendly representation
355 356 357 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 355 def to_s "<Twilio.Notify.V1.NotificationInstance>" end |
#ttl ⇒ String
283 284 285 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 283 def ttl @properties['ttl'] end |