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.
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 126 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
158 159 160 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 158 def to_s '#<Twilio.Notify.V1.NotificationList>' end |