lib/twilio-ruby/rest/api/v2010/account/key.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/api/v2010/account/key.rb in twilio-ruby-5.39.0

- old
+ new

@@ -85,15 +85,13 @@ params = Twilio::Values.of({ 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, }) - response = @version.page( - 'GET', - @uri, - params - ) + + response = @version.page('GET', @uri, params) + KeyPage.new(@version, response, @solution) end ## # Retrieve a single page of KeyInstance records from the API. @@ -161,21 +159,15 @@ @solution = {account_sid: account_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/Keys/#{@solution[:sid]}.json" end ## - # Fetch a KeyInstance + # Fetch the KeyInstance # @return [KeyInstance] Fetched KeyInstance def fetch - params = Twilio::Values.of({}) + payload = @version.fetch('GET', @uri) - payload = @version.fetch( - 'GET', - @uri, - params, - ) - KeyInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end ## # Update the KeyInstance @@ -183,24 +175,20 @@ # the resource. It can be up to 64 characters long. # @return [KeyInstance] Updated KeyInstance def update(friendly_name: :unset) data = Twilio::Values.of({'FriendlyName' => friendly_name, }) - payload = @version.update( - 'POST', - @uri, - data: data, - ) + payload = @version.update('POST', @uri, data: data) KeyInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end ## - # Deletes the KeyInstance + # Delete the KeyInstance # @return [Boolean] true if delete succeeds, false otherwise def delete - @version.delete('delete', @uri) + @version.delete('DELETE', @uri) end ## # Provide a user friendly representation def to_s @@ -276,11 +264,11 @@ def date_updated @properties['date_updated'] end ## - # Fetch a KeyInstance + # Fetch the KeyInstance # @return [KeyInstance] Fetched KeyInstance def fetch context.fetch end @@ -292,10 +280,10 @@ def update(friendly_name: :unset) context.update(friendly_name: friendly_name, ) end ## - # Deletes the KeyInstance + # Delete the KeyInstance # @return [Boolean] true if delete succeeds, false otherwise def delete context.delete end \ No newline at end of file