lib/twilio-ruby/rest/notifications/v1/service/notification.rb in twilio-ruby-5.0.0.rc9 vs lib/twilio-ruby/rest/notifications/v1/service/notification.rb in twilio-ruby-5.0.0.rc10

- old
+ new

@@ -12,11 +12,10 @@ class NotificationList < ListResource ## # Initialize the NotificationList # @param [Version] version Version that contains the resource # @param [String] service_sid The service_sid - # @return [NotificationList] NotificationList def initialize(version, service_sid: nil) super(version) # Path Solution @@ -39,12 +38,11 @@ # @param [String] action The action # @param [String] data The data # @param [String] apn The apn # @param [String] gcm The gcm # @param [String] sms The sms - # @param [String] facebook_messenger The facebook_messenger - + # @param [Hash] facebook_messenger The facebook_messenger # @return [NotificationInstance] Newly created NotificationInstance def create(identity: nil, tag: nil, body: nil, priority: nil, ttl: nil, title: nil, sound: nil, action: nil, data: nil, apn: nil, gcm: nil, sms: nil, facebook_messenger: nil) data = { 'Identity' => identity, 'Tag' => tag, @@ -68,11 +66,11 @@ ) return NotificationInstance.new( @version, payload, - service_sid: @solution['service_sid'], + service_sid: @solution[:service_sid], ) end ## # Provide a user friendly representation @@ -86,11 +84,10 @@ # Initialize the NotificationPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @param [String] service_sid The service_sid - # @return [NotificationPage] NotificationPage def initialize(version, response, solution) super(version, response) # Path Solution @@ -98,17 +95,16 @@ end ## # Build an instance of NotificationInstance # @param [Hash] payload Payload response from the API - # @return [NotificationInstance] NotificationInstance def get_instance(payload) return NotificationInstance.new( @version, payload, - service_sid: @solution['service_sid'], + service_sid: @solution[:service_sid], ) end ## # Provide a user friendly representation @@ -121,11 +117,10 @@ ## # 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 service_sid - # @return [NotificationInstance] NotificationInstance def initialize(version, payload, service_sid: nil) super(version) # Marshaled Properties @@ -143,10 +138,11 @@ 'sound' => payload['sound'], 'action' => payload['action'], 'data' => payload['data'], 'apn' => payload['apn'], 'gcm' => payload['gcm'], + 'sms' => payload['sms'], 'facebook_messenger' => payload['facebook_messenger'], } end def sid @@ -205,9 +201,13 @@ @properties['apn'] end def gcm @properties['gcm'] + end + + def sms + @properties['sms'] end def facebook_messenger @properties['facebook_messenger'] end \ No newline at end of file