Class: Twilio::REST::Chat::V2::ServiceContext::ChannelContext::WebhookContext
- Inherits:
 - 
      InstanceContext
      
        
- Object
 - InstanceContext
 - Twilio::REST::Chat::V2::ServiceContext::ChannelContext::WebhookContext
 
 
- Defined in:
 - lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb
 
Instance Method Summary collapse
- 
  
    
      #delete  ⇒ Boolean 
    
    
  
  
  
  
  
  
  
  
  
    
Deletes the WebhookInstance.
 - 
  
    
      #fetch  ⇒ WebhookInstance 
    
    
  
  
  
  
  
  
  
  
  
    
Fetch a WebhookInstance.
 - 
  
    
      #initialize(version, service_sid, channel_sid, sid)  ⇒ WebhookContext 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
Initialize the WebhookContext.
 - 
  
    
      #inspect  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Provide a detailed, user friendly representation.
 - 
  
    
      #to_s  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Provide a user friendly representation.
 - 
  
    
      #update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset, configuration_retry_count: :unset)  ⇒ WebhookInstance 
    
    
  
  
  
  
  
  
  
  
  
    
Update the WebhookInstance.
 
Constructor Details
#initialize(version, service_sid, channel_sid, sid) ⇒ WebhookContext
Initialize the WebhookContext
      220 221 222 223 224 225 226  | 
    
      # File 'lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb', line 220 def initialize(version, service_sid, channel_sid, sid) super(version) # Path Solution @solution = {service_sid: service_sid, channel_sid: channel_sid, sid: sid, } @uri = "/Services/#{@solution[:service_sid]}/Channels/#{@solution[:channel_sid]}/Webhooks/#{@solution[:sid]}" end  | 
  
Instance Method Details
#delete ⇒ Boolean
Deletes the WebhookInstance
      299 300 301  | 
    
      # File 'lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb', line 299 def delete @version.delete('delete', @uri) end  | 
  
#fetch ⇒ WebhookInstance
Fetch a WebhookInstance
      231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247  | 
    
      # File 'lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb', line 231 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) WebhookInstance.new( @version, payload, service_sid: @solution[:service_sid], channel_sid: @solution[:channel_sid], sid: @solution[:sid], ) end  | 
  
#inspect ⇒ Object
Provide a detailed, user friendly representation
      312 313 314 315  | 
    
      # File 'lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb', line 312 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Chat.V2.WebhookContext #{context}>" end  | 
  
#to_s ⇒ Object
Provide a user friendly representation
      305 306 307 308  | 
    
      # File 'lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb', line 305 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Chat.V2.WebhookContext #{context}>" end  | 
  
#update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset, configuration_retry_count: :unset) ⇒ WebhookInstance
Update the WebhookInstance
      271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294  | 
    
      # File 'lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb', line 271 def update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset, configuration_retry_count: :unset) data = Twilio::Values.of({ 'Configuration.Url' => configuration_url, 'Configuration.Method' => configuration_method, 'Configuration.Filters' => Twilio.serialize_list(configuration_filters) { |e| e }, 'Configuration.Triggers' => Twilio.serialize_list(configuration_triggers) { |e| e }, 'Configuration.FlowSid' => configuration_flow_sid, 'Configuration.RetryCount' => configuration_retry_count, }) payload = @version.update( 'POST', @uri, data: data, ) WebhookInstance.new( @version, payload, service_sid: @solution[:service_sid], channel_sid: @solution[:channel_sid], sid: @solution[:sid], ) end  |