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 account_sid.
-
#action ⇒ String
Specifies the actions to be displayed for the notification.
-
#alexa ⇒ Hash
The alexa.
-
#apn ⇒ Hash
APNS specific payload that overrides corresponding attributes in a generic payload for Bindings with the apn BindingType.
-
#body ⇒ String
Indicates the notification body text.
-
#data ⇒ Hash
This parameter specifies the custom key-value pairs of the notification’s payload.
-
#date_created ⇒ Time
The date_created.
-
#facebook_messenger ⇒ Hash
Messenger specific payload that overrides corresponding attributes in generic payload for Bindings with facebook-messenger BindingType.
-
#fcm ⇒ Hash
FCM specific payload that overrides corresponding attributes in generic payload for Bindings with fcm BindingType.
-
#gcm ⇒ Hash
GCM specific payload that overrides corresponding attributes in generic payload for Bindings with gcm BindingType.
-
#identities ⇒ String
List of Identities.
-
#initialize(version, payload, service_sid: nil) ⇒ NotificationInstance
constructor
Initialize the NotificationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#priority ⇒ notification.Priority
Two priorities defined: low and high.
-
#segments ⇒ String
The segments.
-
#service_sid ⇒ String
The service_sid.
-
#sid ⇒ String
The sid.
-
#sms ⇒ Hash
SMS specific payload that overrides corresponding attributes in generic payload for Bindings with sms BindingType.
-
#sound ⇒ String
Indicates a sound to be played.
-
#tags ⇒ String
List of Tags.
-
#title ⇒ String
Indicates the notification title.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#ttl ⇒ String
This parameter specifies how long the notification is valid.
Constructor Details
#initialize(version, payload, service_sid: nil) ⇒ NotificationInstance
Initialize the NotificationInstance
203 204 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 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 203 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 account_sid.
239 240 241 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 239 def account_sid @properties['account_sid'] end |
#action ⇒ String
Returns Specifies the actions to be displayed for the notification.
305 306 307 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 305 def action @properties['action'] end |
#alexa ⇒ Hash
Returns The alexa.
347 348 349 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 347 def alexa @properties['alexa'] end |
#apn ⇒ Hash
Returns APNS specific payload that overrides corresponding attributes in a generic payload for Bindings with the apn BindingType.
317 318 319 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 317 def apn @properties['apn'] end |
#body ⇒ String
Returns Indicates the notification body text.
293 294 295 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 293 def body @properties['body'] end |
#data ⇒ Hash
Returns This parameter specifies the custom key-value pairs of the notification’s payload.
311 312 313 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 311 def data @properties['data'] end |
#date_created ⇒ Time
Returns The date_created.
251 252 253 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 251 def date_created @properties['date_created'] end |
#facebook_messenger ⇒ Hash
Returns Messenger specific payload that overrides corresponding attributes in generic payload for Bindings with facebook-messenger BindingType.
341 342 343 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 341 def facebook_messenger @properties['facebook_messenger'] end |
#fcm ⇒ Hash
Returns FCM specific payload that overrides corresponding attributes in generic payload for Bindings with fcm BindingType.
329 330 331 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 329 def fcm @properties['fcm'] end |
#gcm ⇒ Hash
Returns GCM specific payload that overrides corresponding attributes in generic payload for Bindings with gcm BindingType.
323 324 325 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 323 def gcm @properties['gcm'] end |
#identities ⇒ String
Returns List of Identities.
257 258 259 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 257 def identities @properties['identities'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
359 360 361 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 359 def inspect "<Twilio.Notify.V1.NotificationInstance>" end |
#priority ⇒ notification.Priority
Returns Two priorities defined: low and high.
275 276 277 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 275 def priority @properties['priority'] end |
#segments ⇒ String
Returns The segments.
269 270 271 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 269 def segments @properties['segments'] end |
#service_sid ⇒ String
Returns The service_sid.
245 246 247 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 245 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The sid.
233 234 235 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 233 def sid @properties['sid'] end |
#sms ⇒ Hash
Returns SMS specific payload that overrides corresponding attributes in generic payload for Bindings with sms BindingType.
335 336 337 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 335 def sms @properties['sms'] end |
#sound ⇒ String
Returns Indicates a sound to be played.
299 300 301 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 299 def sound @properties['sound'] end |
#tags ⇒ String
Returns List of Tags.
263 264 265 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 263 def @properties['tags'] end |
#title ⇒ String
Returns Indicates the notification title.
287 288 289 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 287 def title @properties['title'] end |
#to_s ⇒ Object
Provide a user friendly representation
353 354 355 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 353 def to_s "<Twilio.Notify.V1.NotificationInstance>" end |
#ttl ⇒ String
Returns This parameter specifies how long the notification is valid.
281 282 283 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 281 def ttl @properties['ttl'] end |