Class: Twilio::REST::Autopilot::V1::AssistantContext::WebhookContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Autopilot::V1::AssistantContext::WebhookContext
- Defined in:
- lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the WebhookInstance.
-
#fetch ⇒ WebhookInstance
Fetch a WebhookInstance.
-
#initialize(version, assistant_sid, sid) ⇒ WebhookContext
constructor
Initialize the WebhookContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(unique_name: :unset, events: :unset, webhook_url: :unset, webhook_method: :unset) ⇒ WebhookInstance
Update the WebhookInstance.
Constructor Details
#initialize(version, assistant_sid, sid) ⇒ WebhookContext
Initialize the WebhookContext
194 195 196 197 198 199 200 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb', line 194 def initialize(version, assistant_sid, sid) super(version) # Path Solution @solution = {assistant_sid: assistant_sid, sid: sid, } @uri = "/Assistants/#{@solution[:assistant_sid]}/Webhooks/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Deletes the WebhookInstance
259 260 261 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb', line 259 def delete @version.delete('delete', @uri) end |
#fetch ⇒ WebhookInstance
Fetch a WebhookInstance
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb', line 205 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) WebhookInstance.new( @version, payload, assistant_sid: @solution[:assistant_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
272 273 274 275 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb', line 272 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Autopilot.V1.WebhookContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
265 266 267 268 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb', line 265 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Autopilot.V1.WebhookContext #{context}>" end |
#update(unique_name: :unset, events: :unset, webhook_url: :unset, webhook_method: :unset) ⇒ WebhookInstance
Update the WebhookInstance
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb', line 234 def update(unique_name: :unset, events: :unset, webhook_url: :unset, webhook_method: :unset) data = Twilio::Values.of({ 'UniqueName' => unique_name, 'Events' => events, 'WebhookUrl' => webhook_url, 'WebhookMethod' => webhook_method, }) payload = @version.update( 'POST', @uri, data: data, ) WebhookInstance.new( @version, payload, assistant_sid: @solution[:assistant_sid], sid: @solution[:sid], ) end |