Class: Twilio::REST::Notify::V1::ServiceContext::NotificationList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Notify::V1::ServiceContext::NotificationList
- 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
-
#create(body: :unset, priority: :unset, ttl: :unset, title: :unset, sound: :unset, action: :unset, data: :unset, apn: :unset, gcm: :unset, sms: :unset, facebook_messenger: :unset, fcm: :unset, segment: :unset, alexa: :unset, to_binding: :unset, identity: :unset, tag: :unset) ⇒ NotificationInstance
Retrieve a single page of NotificationInstance records from the API.
-
#initialize(version, service_sid: nil) ⇒ NotificationList
constructor
Initialize the NotificationList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid: nil) ⇒ NotificationList
Initialize the NotificationList
22 23 24 25 26 27 28 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 22 def initialize(version, service_sid: nil) super(version) # Path Solution @solution = {service_sid: service_sid} @uri = "/Services/#{@solution[:service_sid]}/Notifications" end |
Instance Method Details
#create(body: :unset, priority: :unset, ttl: :unset, title: :unset, sound: :unset, action: :unset, data: :unset, apn: :unset, gcm: :unset, sms: :unset, facebook_messenger: :unset, fcm: :unset, segment: :unset, alexa: :unset, to_binding: :unset, identity: :unset, tag: :unset) ⇒ NotificationInstance
Retrieve a single page of NotificationInstance records from the API. Request is executed immediately.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 51 def create(body: :unset, priority: :unset, ttl: :unset, title: :unset, sound: :unset, action: :unset, data: :unset, apn: :unset, gcm: :unset, sms: :unset, facebook_messenger: :unset, fcm: :unset, segment: :unset, alexa: :unset, to_binding: :unset, identity: :unset, tag: :unset) data = Twilio::Values.of({ 'Identity' => Twilio.serialize_list(identity) { |e| e }, 'Tag' => Twilio.serialize_list(tag) { |e| e }, 'Body' => body, 'Priority' => priority, 'Ttl' => ttl, 'Title' => title, 'Sound' => sound, 'Action' => action, 'Data' => Twilio.serialize_object(data), 'Apn' => Twilio.serialize_object(apn), 'Gcm' => Twilio.serialize_object(gcm), 'Sms' => Twilio.serialize_object(sms), 'FacebookMessenger' => Twilio.serialize_object(facebook_messenger), 'Fcm' => Twilio.serialize_object(fcm), 'Segment' => Twilio.serialize_list(segment) { |e| e }, 'Alexa' => Twilio.serialize_object(alexa), 'ToBinding' => Twilio.serialize_list(to_binding) { |e| e }, }) payload = @version.create( 'POST', @uri, data: data ) NotificationInstance.new(@version, payload, service_sid: @solution[:service_sid], ) end |
#to_s ⇒ Object
Provide a user friendly representation
83 84 85 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 83 def to_s '#<Twilio.Notify.V1.NotificationList>' end |