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
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, delivery_callback_url: :unset, identity: :unset, tag: :unset) ⇒ NotificationInstance
Create the NotificationInstance.
-
#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
28 29 30 31 32 33 34 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 28 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, delivery_callback_url: :unset, identity: :unset, tag: :unset) ⇒ NotificationInstance
Create the NotificationInstance
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 56 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, delivery_callback_url: :unset, identity: :unset, tag: :unset ) data = Twilio::Values.of({ '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 }, 'DeliveryCallbackUrl' => delivery_callback_url, 'Identity' => Twilio.serialize_list(identity) { |e| e }, 'Tag' => Twilio.serialize_list(tag) { |e| e }, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.create('POST', @uri, data: data, headers: headers) NotificationInstance.new( @version, payload, service_sid: @solution[:service_sid], ) end |
#to_s ⇒ Object
Provide a user friendly representation
116 117 118 |
# File 'lib/twilio-ruby/rest/notify/v1/service/notification.rb', line 116 def to_s '#<Twilio.Notify.V1.NotificationList>' end |