lib/twilio-ruby/rest/ip_messaging/v1/service.rb in twilio-ruby-5.0.0.rc21 vs lib/twilio-ruby/rest/ip_messaging/v1/service.rb in twilio-ruby-5.0.0.rc22

- old
+ new

@@ -25,21 +25,21 @@ # Retrieve a single page of ServiceInstance records from the API. # Request is executed immediately. # @param [String] friendly_name The friendly_name # @return [ServiceInstance] Newly created ServiceInstance def create(friendly_name: nil) - data = { + data = Twilio::Values.of({ 'FriendlyName' => friendly_name, - } + }) payload = @version.create( 'POST', @uri, data: data ) - return ServiceInstance.new( + ServiceInstance.new( @version, payload, ) end @@ -109,25 +109,38 @@ # Request is executed immediately. # @param [String] page_token PageToken provided by the API # @param [Integer] page_number Page Number, this value is simply for client state # @param [Integer] page_size Number of records to return, defaults to 50 # @return [Page] Page of ServiceInstance - def page(page_token: nil, page_number: nil, page_size: nil) - params = { + def page(page_token: :unset, page_number: :unset, page_size: :unset) + params = Twilio::Values.of({ 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, - } + }) response = @version.page( 'GET', @uri, params ) - return ServicePage.new(@version, response, @solution) + ServicePage.new(@version, response, @solution) end ## + # Retrieve a single page of ServiceInstance records from the API. + # Request is executed immediately. + # @param [String] target_url API-generated URL for the requested results page + # @return [Page] Page of ServiceInstance + def get_page(target_url) + response = @version.domain.request( + 'GET', + target_url + ) + ServicePage.new(@version, response, @solution) + end + + ## # Provide a user friendly representation def to_s '#<Twilio.IpMessaging.V1.ServiceList>' end end @@ -149,11 +162,11 @@ ## # Build an instance of ServiceInstance # @param [Hash] payload Payload response from the API # @return [ServiceInstance] ServiceInstance def get_instance(payload) - return ServiceInstance.new( + ServiceInstance.new( @version, payload, ) end @@ -187,30 +200,30 @@ ## # Fetch a ServiceInstance # @return [ServiceInstance] Fetched ServiceInstance def fetch - params = {} + params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) - return ServiceInstance.new( + ServiceInstance.new( @version, payload, sid: @solution[:sid], ) end ## # Deletes the ServiceInstance # @return [Boolean] true if delete succeeds, true otherwise def delete - return @version.delete('delete', @uri) + @version.delete('delete', @uri) end ## # Update the ServiceInstance # @param [String] friendly_name The friendly_name @@ -330,12 +343,12 @@ # @param [String] webhooks_on_member_removed_format The # webhooks.on_member_removed.format # @param [String] limits_channel_members The limits.channel_members # @param [String] limits_user_channels The limits.user_channels # @return [ServiceInstance] Updated ServiceInstance - def update(friendly_name: nil, default_service_role_sid: nil, default_channel_role_sid: nil, default_channel_creator_role_sid: nil, read_status_enabled: nil, reachability_enabled: nil, typing_indicator_timeout: nil, consumption_report_interval: nil, notifications_new_message_enabled: nil, notifications_new_message_template: nil, notifications_added_to_channel_enabled: nil, notifications_added_to_channel_template: nil, notifications_removed_from_channel_enabled: nil, notifications_removed_from_channel_template: nil, notifications_invited_to_channel_enabled: nil, notifications_invited_to_channel_template: nil, pre_webhook_url: nil, post_webhook_url: nil, webhook_method: nil, webhook_filters: nil, webhooks_on_message_send_url: nil, webhooks_on_message_send_method: nil, webhooks_on_message_send_format: nil, webhooks_on_message_update_url: nil, webhooks_on_message_update_method: nil, webhooks_on_message_update_format: nil, webhooks_on_message_remove_url: nil, webhooks_on_message_remove_method: nil, webhooks_on_message_remove_format: nil, webhooks_on_channel_add_url: nil, webhooks_on_channel_add_method: nil, webhooks_on_channel_add_format: nil, webhooks_on_channel_destroy_url: nil, webhooks_on_channel_destroy_method: nil, webhooks_on_channel_destroy_format: nil, webhooks_on_channel_update_url: nil, webhooks_on_channel_update_method: nil, webhooks_on_channel_update_format: nil, webhooks_on_member_add_url: nil, webhooks_on_member_add_method: nil, webhooks_on_member_add_format: nil, webhooks_on_member_remove_url: nil, webhooks_on_member_remove_method: nil, webhooks_on_member_remove_format: nil, webhooks_on_message_sent_url: nil, webhooks_on_message_sent_method: nil, webhooks_on_message_sent_format: nil, webhooks_on_message_updated_url: nil, webhooks_on_message_updated_method: nil, webhooks_on_message_updated_format: nil, webhooks_on_message_removed_url: nil, webhooks_on_message_removed_method: nil, webhooks_on_message_removed_format: nil, webhooks_on_channel_added_url: nil, webhooks_on_channel_added_method: nil, webhooks_on_channel_added_format: nil, webhooks_on_channel_destroyed_url: nil, webhooks_on_channel_destroyed_method: nil, webhooks_on_channel_destroyed_format: nil, webhooks_on_channel_updated_url: nil, webhooks_on_channel_updated_method: nil, webhooks_on_channel_updated_format: nil, webhooks_on_member_added_url: nil, webhooks_on_member_added_method: nil, webhooks_on_member_added_format: nil, webhooks_on_member_removed_url: nil, webhooks_on_member_removed_method: nil, webhooks_on_member_removed_format: nil, limits_channel_members: nil, limits_user_channels: nil) - data = { + def update(friendly_name: :unset, default_service_role_sid: :unset, default_channel_role_sid: :unset, default_channel_creator_role_sid: :unset, read_status_enabled: :unset, reachability_enabled: :unset, typing_indicator_timeout: :unset, consumption_report_interval: :unset, notifications_new_message_enabled: :unset, notifications_new_message_template: :unset, notifications_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, webhooks_on_message_send_url: :unset, webhooks_on_message_send_method: :unset, webhooks_on_message_send_format: :unset, webhooks_on_message_update_url: :unset, webhooks_on_message_update_method: :unset, webhooks_on_message_update_format: :unset, webhooks_on_message_remove_url: :unset, webhooks_on_message_remove_method: :unset, webhooks_on_message_remove_format: :unset, webhooks_on_channel_add_url: :unset, webhooks_on_channel_add_method: :unset, webhooks_on_channel_add_format: :unset, webhooks_on_channel_destroy_url: :unset, webhooks_on_channel_destroy_method: :unset, webhooks_on_channel_destroy_format: :unset, webhooks_on_channel_update_url: :unset, webhooks_on_channel_update_method: :unset, webhooks_on_channel_update_format: :unset, webhooks_on_member_add_url: :unset, webhooks_on_member_add_method: :unset, webhooks_on_member_add_format: :unset, webhooks_on_member_remove_url: :unset, webhooks_on_member_remove_method: :unset, webhooks_on_member_remove_format: :unset, webhooks_on_message_sent_url: :unset, webhooks_on_message_sent_method: :unset, webhooks_on_message_sent_format: :unset, webhooks_on_message_updated_url: :unset, webhooks_on_message_updated_method: :unset, webhooks_on_message_updated_format: :unset, webhooks_on_message_removed_url: :unset, webhooks_on_message_removed_method: :unset, webhooks_on_message_removed_format: :unset, webhooks_on_channel_added_url: :unset, webhooks_on_channel_added_method: :unset, webhooks_on_channel_added_format: :unset, webhooks_on_channel_destroyed_url: :unset, webhooks_on_channel_destroyed_method: :unset, webhooks_on_channel_destroyed_format: :unset, webhooks_on_channel_updated_url: :unset, webhooks_on_channel_updated_method: :unset, webhooks_on_channel_updated_format: :unset, webhooks_on_member_added_url: :unset, webhooks_on_member_added_method: :unset, webhooks_on_member_added_format: :unset, webhooks_on_member_removed_url: :unset, webhooks_on_member_removed_method: :unset, webhooks_on_member_removed_format: :unset, limits_channel_members: :unset, limits_user_channels: :unset) + data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'DefaultServiceRoleSid' => default_service_role_sid, 'DefaultChannelRoleSid' => default_channel_role_sid, 'DefaultChannelCreatorRoleSid' => default_channel_creator_role_sid, 'ReadStatusEnabled' => read_status_enabled, @@ -402,19 +415,19 @@ 'Webhooks.OnMemberRemoved.Url' => webhooks_on_member_removed_url, 'Webhooks.OnMemberRemoved.Method' => webhooks_on_member_removed_method, 'Webhooks.OnMemberRemoved.Format' => webhooks_on_member_removed_format, 'Limits.ChannelMembers' => limits_channel_members, 'Limits.UserChannels' => limits_user_channels, - } + }) payload = @version.update( 'POST', @uri, data: data, ) - return ServiceInstance.new( + ServiceInstance.new( @version, payload, sid: @solution[:sid], ) end @@ -767,10 +780,10 @@ # @param [String] webhooks_on_member_removed_format The # webhooks.on_member_removed.format # @param [String] limits_channel_members The limits.channel_members # @param [String] limits_user_channels The limits.user_channels # @return [ServiceInstance] Updated ServiceInstance - def update(friendly_name: nil, default_service_role_sid: nil, default_channel_role_sid: nil, default_channel_creator_role_sid: nil, read_status_enabled: nil, reachability_enabled: nil, typing_indicator_timeout: nil, consumption_report_interval: nil, notifications_new_message_enabled: nil, notifications_new_message_template: nil, notifications_added_to_channel_enabled: nil, notifications_added_to_channel_template: nil, notifications_removed_from_channel_enabled: nil, notifications_removed_from_channel_template: nil, notifications_invited_to_channel_enabled: nil, notifications_invited_to_channel_template: nil, pre_webhook_url: nil, post_webhook_url: nil, webhook_method: nil, webhook_filters: nil, webhooks_on_message_send_url: nil, webhooks_on_message_send_method: nil, webhooks_on_message_send_format: nil, webhooks_on_message_update_url: nil, webhooks_on_message_update_method: nil, webhooks_on_message_update_format: nil, webhooks_on_message_remove_url: nil, webhooks_on_message_remove_method: nil, webhooks_on_message_remove_format: nil, webhooks_on_channel_add_url: nil, webhooks_on_channel_add_method: nil, webhooks_on_channel_add_format: nil, webhooks_on_channel_destroy_url: nil, webhooks_on_channel_destroy_method: nil, webhooks_on_channel_destroy_format: nil, webhooks_on_channel_update_url: nil, webhooks_on_channel_update_method: nil, webhooks_on_channel_update_format: nil, webhooks_on_member_add_url: nil, webhooks_on_member_add_method: nil, webhooks_on_member_add_format: nil, webhooks_on_member_remove_url: nil, webhooks_on_member_remove_method: nil, webhooks_on_member_remove_format: nil, webhooks_on_message_sent_url: nil, webhooks_on_message_sent_method: nil, webhooks_on_message_sent_format: nil, webhooks_on_message_updated_url: nil, webhooks_on_message_updated_method: nil, webhooks_on_message_updated_format: nil, webhooks_on_message_removed_url: nil, webhooks_on_message_removed_method: nil, webhooks_on_message_removed_format: nil, webhooks_on_channel_added_url: nil, webhooks_on_channel_added_method: nil, webhooks_on_channel_added_format: nil, webhooks_on_channel_destroyed_url: nil, webhooks_on_channel_destroyed_method: nil, webhooks_on_channel_destroyed_format: nil, webhooks_on_channel_updated_url: nil, webhooks_on_channel_updated_method: nil, webhooks_on_channel_updated_format: nil, webhooks_on_member_added_url: nil, webhooks_on_member_added_method: nil, webhooks_on_member_added_format: nil, webhooks_on_member_removed_url: nil, webhooks_on_member_removed_method: nil, webhooks_on_member_removed_format: nil, limits_channel_members: nil, limits_user_channels: nil) + def update(friendly_name: :unset, default_service_role_sid: :unset, default_channel_role_sid: :unset, default_channel_creator_role_sid: :unset, read_status_enabled: :unset, reachability_enabled: :unset, typing_indicator_timeout: :unset, consumption_report_interval: :unset, notifications_new_message_enabled: :unset, notifications_new_message_template: :unset, notifications_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, webhooks_on_message_send_url: :unset, webhooks_on_message_send_method: :unset, webhooks_on_message_send_format: :unset, webhooks_on_message_update_url: :unset, webhooks_on_message_update_method: :unset, webhooks_on_message_update_format: :unset, webhooks_on_message_remove_url: :unset, webhooks_on_message_remove_method: :unset, webhooks_on_message_remove_format: :unset, webhooks_on_channel_add_url: :unset, webhooks_on_channel_add_method: :unset, webhooks_on_channel_add_format: :unset, webhooks_on_channel_destroy_url: :unset, webhooks_on_channel_destroy_method: :unset, webhooks_on_channel_destroy_format: :unset, webhooks_on_channel_update_url: :unset, webhooks_on_channel_update_method: :unset, webhooks_on_channel_update_format: :unset, webhooks_on_member_add_url: :unset, webhooks_on_member_add_method: :unset, webhooks_on_member_add_format: :unset, webhooks_on_member_remove_url: :unset, webhooks_on_member_remove_method: :unset, webhooks_on_member_remove_format: :unset, webhooks_on_message_sent_url: :unset, webhooks_on_message_sent_method: :unset, webhooks_on_message_sent_format: :unset, webhooks_on_message_updated_url: :unset, webhooks_on_message_updated_method: :unset, webhooks_on_message_updated_format: :unset, webhooks_on_message_removed_url: :unset, webhooks_on_message_removed_method: :unset, webhooks_on_message_removed_format: :unset, webhooks_on_channel_added_url: :unset, webhooks_on_channel_added_method: :unset, webhooks_on_channel_added_format: :unset, webhooks_on_channel_destroyed_url: :unset, webhooks_on_channel_destroyed_method: :unset, webhooks_on_channel_destroyed_format: :unset, webhooks_on_channel_updated_url: :unset, webhooks_on_channel_updated_method: :unset, webhooks_on_channel_updated_format: :unset, webhooks_on_member_added_url: :unset, webhooks_on_member_added_method: :unset, webhooks_on_member_added_format: :unset, webhooks_on_member_removed_url: :unset, webhooks_on_member_removed_method: :unset, webhooks_on_member_removed_format: :unset, limits_channel_members: :unset, limits_user_channels: :unset) context.update( friendly_name: friendly_name, default_service_role_sid: default_service_role_sid, default_channel_role_sid: default_channel_role_sid, default_channel_creator_role_sid: default_channel_creator_role_sid, \ No newline at end of file