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

- old
+ new

@@ -22,23 +22,18 @@ @solution = {} @uri = "/ConnectionPolicies" end ## - # Retrieve a single page of ConnectionPolicyInstance records from the API. - # Request is executed immediately. + # Create the ConnectionPolicyInstance # @param [String] friendly_name A descriptive string that you create to describe # the resource. It is not unique and can be up to 255 characters long. - # @return [ConnectionPolicyInstance] Newly created ConnectionPolicyInstance + # @return [ConnectionPolicyInstance] Created ConnectionPolicyInstance def create(friendly_name: :unset) data = Twilio::Values.of({'FriendlyName' => friendly_name, }) - payload = @version.create( - 'POST', - @uri, - data: data - ) + payload = @version.create('POST', @uri, data: data) ConnectionPolicyInstance.new(@version, payload, ) end ## @@ -100,15 +95,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) + ConnectionPolicyPage.new(@version, response, @solution) end ## # Retrieve a single page of ConnectionPolicyInstance records from the API. @@ -176,21 +169,15 @@ # Dependents @targets = nil end ## - # Fetch a ConnectionPolicyInstance + # Fetch the ConnectionPolicyInstance # @return [ConnectionPolicyInstance] Fetched ConnectionPolicyInstance def fetch - params = Twilio::Values.of({}) + payload = @version.fetch('GET', @uri) - payload = @version.fetch( - 'GET', - @uri, - params, - ) - ConnectionPolicyInstance.new(@version, payload, sid: @solution[:sid], ) end ## # Update the ConnectionPolicyInstance @@ -198,24 +185,20 @@ # the resource. It is not unique and can be up to 255 characters long. # @return [ConnectionPolicyInstance] Updated ConnectionPolicyInstance 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) ConnectionPolicyInstance.new(@version, payload, sid: @solution[:sid], ) end ## - # Deletes the ConnectionPolicyInstance + # Delete the ConnectionPolicyInstance # @return [Boolean] true if delete succeeds, false otherwise def delete - @version.delete('delete', @uri) + @version.delete('DELETE', @uri) end ## # Access the targets # @return [ConnectionPolicyTargetList] @@ -328,11 +311,11 @@ def links @properties['links'] end ## - # Fetch a ConnectionPolicyInstance + # Fetch the ConnectionPolicyInstance # @return [ConnectionPolicyInstance] Fetched ConnectionPolicyInstance def fetch context.fetch end @@ -344,10 +327,10 @@ def update(friendly_name: :unset) context.update(friendly_name: friendly_name, ) end ## - # Deletes the ConnectionPolicyInstance + # Delete the ConnectionPolicyInstance # @return [Boolean] true if delete succeeds, false otherwise def delete context.delete end \ No newline at end of file