lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb in twilio-ruby-5.39.0

- old
+ new

@@ -92,15 +92,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) + FieldPage.new(@version, response, @solution) end ## # Retrieve a single page of FieldInstance records from the API. @@ -114,28 +112,23 @@ ) FieldPage.new(@version, response, @solution) end ## - # Retrieve a single page of FieldInstance records from the API. - # Request is executed immediately. + # Create the FieldInstance # @param [String] field_type The Field Type of the new field. Can be: a [Built-in # Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the # `unique_name`, or the `sid` of a custom Field Type. # @param [String] unique_name An application-defined string that uniquely # identifies the new resource. This value must be a unique string of no more than # 64 characters. It can be used as an alternative to the `sid` in the URL path to # address the resource. - # @return [FieldInstance] Newly created FieldInstance + # @return [FieldInstance] Created FieldInstance def create(field_type: nil, unique_name: nil) data = Twilio::Values.of({'FieldType' => field_type, 'UniqueName' => unique_name, }) - payload = @version.create( - 'POST', - @uri, - data: data - ) + payload = @version.create('POST', @uri, data: data) FieldInstance.new( @version, payload, assistant_sid: @solution[:assistant_sid], @@ -208,35 +201,29 @@ @solution = {assistant_sid: assistant_sid, task_sid: task_sid, sid: sid, } @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Fields/#{@solution[:sid]}" end ## - # Fetch a FieldInstance + # Fetch the FieldInstance # @return [FieldInstance] Fetched FieldInstance def fetch - params = Twilio::Values.of({}) + payload = @version.fetch('GET', @uri) - payload = @version.fetch( - 'GET', - @uri, - params, - ) - FieldInstance.new( @version, payload, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:task_sid], sid: @solution[:sid], ) end ## - # Deletes the FieldInstance + # Delete the FieldInstance # @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 @@ -362,17 +349,17 @@ def url @properties['url'] end ## - # Fetch a FieldInstance + # Fetch the FieldInstance # @return [FieldInstance] Fetched FieldInstance def fetch context.fetch end ## - # Deletes the FieldInstance + # Delete the FieldInstance # @return [Boolean] true if delete succeeds, false otherwise def delete context.delete end \ No newline at end of file