lib/twilio-ruby/rest/assistants/v1/tool.rb in twilio-ruby-7.3.1 vs lib/twilio-ruby/rest/assistants/v1/tool.rb in twilio-ruby-7.3.2

- old
+ new

@@ -344,10 +344,25 @@ @version.delete('DELETE', @uri, headers: headers) end ## + # Fetch the ToolInstance + # @return [ToolInstance] Fetched ToolInstance + def fetch + + headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) + + payload = @version.fetch('GET', @uri, headers: headers) + ToolInstance.new( + @version, + payload, + id: @solution[:id], + ) + end + + ## # Update the ToolInstance # @param [AssistantsV1ServiceUpdateToolRequest] assistants_v1_service_update_tool_request # @return [ToolInstance] Updated ToolInstance def update(assistants_v1_service_update_tool_request: :unset ) @@ -427,12 +442,14 @@ 'id' => payload['id'], 'meta' => payload['meta'], 'name' => payload['name'], 'requires_auth' => payload['requires_auth'], 'type' => payload['type'], + 'url' => payload['url'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), + 'policies' => payload['policies'], } # Context @instance_context = nil @params = { 'id' => id || @properties['id'] , } @@ -496,10 +513,16 @@ def type @properties['type'] end ## + # @return [String] The url of the tool resource. + def url + @properties['url'] + end + + ## # @return [Time] The date and time in GMT when the Tool was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. def date_created @properties['date_created'] end @@ -508,14 +531,28 @@ def date_updated @properties['date_updated'] end ## + # @return [Array<AssistantsV1ServicePolicy>] The Policies associated with the tool. + def policies + @properties['policies'] + end + + ## # Delete the ToolInstance # @return [Boolean] True if delete succeeds, false otherwise def delete context.delete + end + + ## + # Fetch the ToolInstance + # @return [ToolInstance] Fetched ToolInstance + def fetch + + context.fetch end ## # Update the ToolInstance # @param [AssistantsV1ServiceUpdateToolRequest] assistants_v1_service_update_tool_request