class Twilio::REST::Notify::V1::ServiceContext::NotificationInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the NotificationInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] service_sid
The SID of the
{Service}[https://www.twilio.com/docs/notify/api/service-resource] the resource is associated with.
@return [NotificationInstance] NotificationInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 205 def initialize(version, payload, service_sid: nil) 206 super(version) 207 208 # Marshaled Properties 209 @properties = { 210 'sid' => payload['sid'], 211 'account_sid' => payload['account_sid'], 212 'service_sid' => payload['service_sid'], 213 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 214 'identities' => payload['identities'], 215 'tags' => payload['tags'], 216 'segments' => payload['segments'], 217 'priority' => payload['priority'], 218 'ttl' => payload['ttl'].to_i, 219 'title' => payload['title'], 220 'body' => payload['body'], 221 'sound' => payload['sound'], 222 'action' => payload['action'], 223 'data' => payload['data'], 224 'apn' => payload['apn'], 225 'gcm' => payload['gcm'], 226 'fcm' => payload['fcm'], 227 'sms' => payload['sms'], 228 'facebook_messenger' => payload['facebook_messenger'], 229 'alexa' => payload['alexa'], 230 } 231 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 241 def account_sid 242 @properties['account_sid'] 243 end
@return [String] The actions to display for the notification
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 307 def action 308 @properties['action'] 309 end
@return [Hash] Deprecated
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 349 def alexa 350 @properties['alexa'] 351 end
@return [Hash] The APNS-specific payload that overrides corresponding attributes in a generic payload for APNS Bindings
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 319 def apn 320 @properties['apn'] 321 end
@return [String] The notification body text
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 295 def body 296 @properties['body'] 297 end
@return [Hash] The custom key-value pairs of the notification's payload
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 313 def data 314 @properties['data'] 315 end
@return [Time] The RFC 2822 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 253 def date_created 254 @properties['date_created'] 255 end
@return [Hash] Deprecated
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 343 def facebook_messenger 344 @properties['facebook_messenger'] 345 end
@return [Hash] The FCM-specific payload that overrides corresponding attributes in generic payload for FCM Bindings
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 331 def fcm 332 @properties['fcm'] 333 end
@return [Hash] The GCM-specific payload that overrides corresponding attributes in generic payload for GCM Bindings
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 325 def gcm 326 @properties['gcm'] 327 end
@return [Array] The list of identity values of the Users to notify
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 259 def identities 260 @properties['identities'] 261 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 361 def inspect 362 "<Twilio.Notify.V1.NotificationInstance>" 363 end
@return [notification.Priority] The priority of the notification
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 277 def priority 278 @properties['priority'] 279 end
@return [Array] The list of Segments to notify
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 271 def segments 272 @properties['segments'] 273 end
@return [String] The SID of the Service that the resource is associated with
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 247 def service_sid 248 @properties['service_sid'] 249 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 235 def sid 236 @properties['sid'] 237 end
@return [Hash] The SMS-specific payload that overrides corresponding attributes in generic payload for SMS Bindings
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 337 def sms 338 @properties['sms'] 339 end
@return [String] The name of the sound to be played for the notification
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 301 def sound 302 @properties['sound'] 303 end
@return [String] The notification title
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 289 def title 290 @properties['title'] 291 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 355 def to_s 356 "<Twilio.Notify.V1.NotificationInstance>" 357 end
@return [String] How long, in seconds, the notification is valid
# File lib/twilio-ruby/rest/notify/v1/service/notification.rb 283 def ttl 284 @properties['ttl'] 285 end