Class: Twilio::REST::Notify::V1::ServiceContext::NotificationInstance

Inherits:
InstanceResource
  • Object
show all
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

Constructor Details

#initialize(version, payload, service_sid: nil) ⇒ NotificationInstance

Initialize the NotificationInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • service_sid (String) (defaults to: nil)

    The service_sid



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_sidString

Returns The account_sid.

Returns:

  • (String)

    The account_sid



239
240
241
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 239

def 
  @properties['account_sid']
end

#actionString

Returns Specifies the actions to be displayed for the notification.

Returns:

  • (String)

    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

#alexaHash

Returns The alexa.

Returns:

  • (Hash)

    The alexa



347
348
349
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 347

def alexa
  @properties['alexa']
end

#apnHash

Returns APNS specific payload that overrides corresponding attributes in a generic payload for Bindings with the apn BindingType.

Returns:

  • (Hash)

    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

#bodyString

Returns Indicates the notification body text.

Returns:

  • (String)

    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

#dataHash

Returns This parameter specifies the custom key-value pairs of the notification’s payload.

Returns:

  • (Hash)

    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_createdTime

Returns The date_created.

Returns:

  • (Time)

    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_messengerHash

Returns Messenger specific payload that overrides corresponding attributes in generic payload for Bindings with facebook-messenger BindingType.

Returns:

  • (Hash)

    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

#fcmHash

Returns FCM specific payload that overrides corresponding attributes in generic payload for Bindings with fcm BindingType.

Returns:

  • (Hash)

    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

#gcmHash

Returns GCM specific payload that overrides corresponding attributes in generic payload for Bindings with gcm BindingType.

Returns:

  • (Hash)

    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

#identitiesString

Returns List of Identities.

Returns:

  • (String)

    List of Identities.



257
258
259
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 257

def identities
  @properties['identities']
end

#inspectObject

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

#prioritynotification.Priority

Returns Two priorities defined: low and high.

Returns:

  • (notification.Priority)

    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

#segmentsString

Returns The segments.

Returns:

  • (String)

    The segments



269
270
271
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 269

def segments
  @properties['segments']
end

#service_sidString

Returns The service_sid.

Returns:

  • (String)

    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

#sidString

Returns The sid.

Returns:

  • (String)

    The sid



233
234
235
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 233

def sid
  @properties['sid']
end

#smsHash

Returns SMS specific payload that overrides corresponding attributes in generic payload for Bindings with sms BindingType.

Returns:

  • (Hash)

    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

#soundString

Returns Indicates a sound to be played.

Returns:

  • (String)

    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

#tagsString

Returns List of Tags.

Returns:

  • (String)

    List of Tags



263
264
265
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 263

def tags
  @properties['tags']
end

#titleString

Returns Indicates the notification title.

Returns:

  • (String)

    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_sObject

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

#ttlString

Returns This parameter specifies how long the notification is valid.

Returns:

  • (String)

    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