lib/twilio-ruby/rest/preview/sync/service/sync_map.rb in twilio-ruby-5.0.0.rc21 vs lib/twilio-ruby/rest/preview/sync/service/sync_map.rb in twilio-ruby-5.0.0.rc22

- old
+ new

@@ -28,22 +28,22 @@ ## # Retrieve a single page of SyncMapInstance records from the API. # Request is executed immediately. # @param [String] unique_name The unique_name # @return [SyncMapInstance] Newly created SyncMapInstance - def create(unique_name: nil) - data = { + def create(unique_name: :unset) + data = Twilio::Values.of({ 'UniqueName' => unique_name, - } + }) payload = @version.create( 'POST', @uri, data: data ) - return SyncMapInstance.new( + SyncMapInstance.new( @version, payload, service_sid: @solution[:service_sid], ) end @@ -114,25 +114,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 SyncMapInstance - 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 SyncMapPage.new(@version, response, @solution) + SyncMapPage.new(@version, response, @solution) end ## + # Retrieve a single page of SyncMapInstance records from the API. + # Request is executed immediately. + # @param [String] target_url API-generated URL for the requested results page + # @return [Page] Page of SyncMapInstance + def get_page(target_url) + response = @version.domain.request( + 'GET', + target_url + ) + SyncMapPage.new(@version, response, @solution) + end + + ## # Provide a user friendly representation def to_s '#<Twilio.Preview.Sync.SyncMapList>' end end @@ -155,11 +168,11 @@ ## # Build an instance of SyncMapInstance # @param [Hash] payload Payload response from the API # @return [SyncMapInstance] SyncMapInstance def get_instance(payload) - return SyncMapInstance.new( + SyncMapInstance.new( @version, payload, service_sid: @solution[:service_sid], ) end @@ -195,19 +208,19 @@ ## # Fetch a SyncMapInstance # @return [SyncMapInstance] Fetched SyncMapInstance def fetch - params = {} + params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) - return SyncMapInstance.new( + SyncMapInstance.new( @version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) @@ -215,10 +228,10 @@ ## # Deletes the SyncMapInstance # @return [Boolean] true if delete succeeds, true otherwise def delete - return @version.delete('delete', @uri) + @version.delete('delete', @uri) end ## # Access the sync_map_items # @return [SyncMapItemList] SyncMapItemList \ No newline at end of file