lib/twilio-ruby/rest/proxy/v1/service/session.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/proxy/v1/service/session.rb in twilio-ruby-5.39.0

- old
+ new

@@ -88,15 +88,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) + SessionPage.new(@version, response, @solution) end ## # Retrieve a single page of SessionInstance records from the API. @@ -110,12 +108,11 @@ ) SessionPage.new(@version, response, @solution) end ## - # Retrieve a single page of SessionInstance records from the API. - # Request is executed immediately. + # Create the SessionInstance # @param [String] unique_name An application-defined string that uniquely # identifies the resource. This value must be 191 characters or fewer in length # and be unique. **This value should not have PII.** # @param [Time] date_expiry The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) # date when the Session should expire. If this is value is present, it overrides @@ -128,26 +125,22 @@ # @param [session.Status] status The initial status of the Session. Can be: # `open`, `in-progress`, `closed`, `failed`, or `unknown`. The default is `open` # on create. # @param [Hash] participants The Participant objects to include in the new # session. - # @return [SessionInstance] Newly created SessionInstance + # @return [SessionInstance] Created SessionInstance def create(unique_name: :unset, date_expiry: :unset, ttl: :unset, mode: :unset, status: :unset, participants: :unset) data = Twilio::Values.of({ 'UniqueName' => unique_name, 'DateExpiry' => Twilio.serialize_iso8601_datetime(date_expiry), 'Ttl' => ttl, 'Mode' => mode, 'Status' => status, 'Participants' => Twilio.serialize_list(participants) { |e| Twilio.serialize_object(e) }, }) - payload = @version.create( - 'POST', - @uri, - data: data - ) + payload = @version.create('POST', @uri, data: data) SessionInstance.new(@version, payload, service_sid: @solution[:service_sid], ) end ## @@ -211,29 +204,23 @@ @interactions = nil @participants = nil end ## - # Fetch a SessionInstance + # Fetch the SessionInstance # @return [SessionInstance] Fetched SessionInstance def fetch - params = Twilio::Values.of({}) + payload = @version.fetch('GET', @uri) - payload = @version.fetch( - 'GET', - @uri, - params, - ) - SessionInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) end ## - # Deletes the SessionInstance + # Delete the SessionInstance # @return [Boolean] true if delete succeeds, false otherwise def delete - @version.delete('delete', @uri) + @version.delete('DELETE', @uri) end ## # Update the SessionInstance # @param [Time] date_expiry The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) @@ -249,15 +236,11 @@ 'DateExpiry' => Twilio.serialize_iso8601_datetime(date_expiry), 'Ttl' => ttl, 'Status' => status, }) - payload = @version.update( - 'POST', - @uri, - data: data, - ) + payload = @version.update('POST', @uri, data: data) SessionInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) end ## @@ -466,17 +449,17 @@ def links @properties['links'] end ## - # Fetch a SessionInstance + # Fetch the SessionInstance # @return [SessionInstance] Fetched SessionInstance def fetch context.fetch end ## - # Deletes the SessionInstance + # Delete the SessionInstance # @return [Boolean] true if delete succeeds, false otherwise def delete context.delete end \ No newline at end of file