lib/twilio-ruby/rest/fax/v1/fax.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/fax/v1/fax.rb in twilio-ruby-5.39.0

- old
+ new

@@ -131,15 +131,13 @@ 'DateCreatedAfter' => Twilio.serialize_iso8601_datetime(date_created_after), 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, }) - response = @version.page( - 'GET', - @uri, - params - ) + + response = @version.page('GET', @uri, params) + FaxPage.new(@version, response, @solution) end ## # Retrieve a single page of FaxInstance records from the API. @@ -153,12 +151,11 @@ ) FaxPage.new(@version, response, @solution) end ## - # Retrieve a single page of FaxInstance records from the API. - # Request is executed immediately. + # Create the FaxInstance # @param [String] to The phone number to receive the fax in # [E.164](https://www.twilio.com/docs/glossary/what-e164) format or the # recipient's SIP URI. # @param [String] media_url The URL of the PDF that contains the fax. See our # [security](https://www.twilio.com/docs/usage/security) page for information on @@ -184,11 +181,11 @@ # @param [Boolean] store_media Whether to store a copy of the sent media on our # servers for later retrieval. Can be: `true` or `false` and the default is # `true`. # @param [String] ttl How long in minutes from when the fax is initiated that we # should try to send the fax. - # @return [FaxInstance] Newly created FaxInstance + # @return [FaxInstance] Created FaxInstance def create(to: nil, media_url: nil, quality: :unset, status_callback: :unset, from: :unset, sip_auth_username: :unset, sip_auth_password: :unset, store_media: :unset, ttl: :unset) data = Twilio::Values.of({ 'To' => to, 'MediaUrl' => media_url, 'Quality' => quality, @@ -198,15 +195,11 @@ 'SipAuthPassword' => sip_auth_password, 'StoreMedia' => store_media, 'Ttl' => ttl, }) - payload = @version.create( - 'POST', - @uri, - data: data - ) + payload = @version.create('POST', @uri, data: data) FaxInstance.new(@version, payload, ) end ## @@ -266,21 +259,15 @@ # Dependents @media = nil end ## - # Fetch a FaxInstance + # Fetch the FaxInstance # @return [FaxInstance] Fetched FaxInstance def fetch - params = Twilio::Values.of({}) + payload = @version.fetch('GET', @uri) - payload = @version.fetch( - 'GET', - @uri, - params, - ) - FaxInstance.new(@version, payload, sid: @solution[:sid], ) end ## # Update the FaxInstance @@ -290,24 +277,20 @@ # started. # @return [FaxInstance] Updated FaxInstance def update(status: :unset) data = Twilio::Values.of({'Status' => status, }) - payload = @version.update( - 'POST', - @uri, - data: data, - ) + payload = @version.update('POST', @uri, data: data) FaxInstance.new(@version, payload, sid: @solution[:sid], ) end ## - # Deletes the FaxInstance + # Delete the FaxInstance # @return [Boolean] true if delete succeeds, false otherwise def delete - @version.delete('delete', @uri) + @version.delete('DELETE', @uri) end ## # Access the media # @return [FaxMediaList] @@ -499,11 +482,11 @@ def url @properties['url'] end ## - # Fetch a FaxInstance + # Fetch the FaxInstance # @return [FaxInstance] Fetched FaxInstance def fetch context.fetch end @@ -517,10 +500,10 @@ def update(status: :unset) context.update(status: status, ) end ## - # Deletes the FaxInstance + # Delete the FaxInstance # @return [Boolean] true if delete succeeds, false otherwise def delete context.delete end \ No newline at end of file