lib/twilio-ruby/rest/notify/v1/service.rb in twilio-ruby-5.36.0 vs lib/twilio-ruby/rest/notify/v1/service.rb in twilio-ruby-5.37.0

- old
+ new

@@ -58,12 +58,15 @@ # [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. # @param [Boolean] log_enabled Whether to log notifications. Can be: `true` or # `false` and the default is `true`. # @param [String] alexa_skill_id Deprecated. # @param [String] default_alexa_notification_protocol_version Deprecated. + # @param [String] delivery_callback_url URL to send delivery status callback. + # @param [Boolean] delivery_callback_enabled Callback configuration that enables + # delivery callbacks, default false # @return [ServiceInstance] Newly created ServiceInstance - def create(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset) + def create(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset, delivery_callback_url: :unset, delivery_callback_enabled: :unset) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'ApnCredentialSid' => apn_credential_sid, 'GcmCredentialSid' => gcm_credential_sid, 'MessagingServiceSid' => messaging_service_sid, @@ -73,10 +76,12 @@ 'FcmCredentialSid' => fcm_credential_sid, 'DefaultFcmNotificationProtocolVersion' => default_fcm_notification_protocol_version, 'LogEnabled' => log_enabled, 'AlexaSkillId' => alexa_skill_id, 'DefaultAlexaNotificationProtocolVersion' => default_alexa_notification_protocol_version, + 'DeliveryCallbackUrl' => delivery_callback_url, + 'DeliveryCallbackEnabled' => delivery_callback_enabled, }) payload = @version.create( 'POST', @uri, @@ -397,10 +402,12 @@ 'log_enabled' => payload['log_enabled'], 'url' => payload['url'], 'links' => payload['links'], 'alexa_skill_id' => payload['alexa_skill_id'], 'default_alexa_notification_protocol_version' => payload['default_alexa_notification_protocol_version'], + 'delivery_callback_url' => payload['delivery_callback_url'], + 'delivery_callback_enabled' => payload['delivery_callback_enabled'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } @@ -521,9 +528,21 @@ ## # @return [String] Deprecated def default_alexa_notification_protocol_version @properties['default_alexa_notification_protocol_version'] + end + + ## + # @return [String] Webhook URL + def delivery_callback_url + @properties['delivery_callback_url'] + end + + ## + # @return [Boolean] Enable delivery callbacks + def delivery_callback_enabled + @properties['delivery_callback_enabled'] end ## # Deletes the ServiceInstance # @return [Boolean] true if delete succeeds, false otherwise \ No newline at end of file