Class: Twilio::REST::Assistants::V1::AssistantContext::AssistantsToolContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, assistant_id, id) ⇒ AssistantsToolContext

Initialize the AssistantsToolContext

Parameters:

  • version (Version)

    Version that contains the resource

  • assistant_id (String)

    The assistant ID.

  • id (String)

    The tool ID.



139
140
141
142
143
144
145
146
147
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 139

def initialize(version, assistant_id, id)
    super(version)

    # Path Solution
    @solution = { assistant_id: assistant_id, id: id,  }
    @uri = "/Assistants/#{@solution[:assistant_id]}/Tools/#{@solution[:id]}"

    
end

Instance Method Details

#createAssistantsToolInstance

Create the AssistantsToolInstance

Returns:



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 151

def create

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.create('POST', @uri, headers: headers)
    AssistantsToolInstance.new(
        @version,
        payload,
        assistant_id: @solution[:assistant_id],
        id: @solution[:id],
    )
end

#deleteBoolean

Delete the AssistantsToolInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



171
172
173
174
175
176
177
178
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 171

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    @version.delete('DELETE', @uri, headers: headers)
end

#inspectObject

Provide a detailed, user friendly representation



190
191
192
193
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 190

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Assistants.V1.AssistantsToolContext #{context}>"
end

#to_sObject

Provide a user friendly representation



183
184
185
186
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 183

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Assistants.V1.AssistantsToolContext #{context}>"
end