Class: Twilio::REST::Webhooks::V1::TestList::TestRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/twilio-ruby/rest/webhooks/v1/test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ TestRequest

Returns a new instance of TestRequest.



56
57
58
59
60
# File 'lib/twilio-ruby/rest/webhooks/v1/test.rb', line 56

def initialize(payload)
        @url = payload["url"]
        @setting_id = payload["setting_id"]
        @method = payload["method"]
end

Instance Attribute Details

#method ⇒ Object

Parameters:

  • : (url) —

    [String] Target webhook URL to test

  • : (setting_id) —

    [String] Setting to use for test configuration

  • : (method) —

    [String] HTTP method to use when sending the test webhook request



55
56
57
# File 'lib/twilio-ruby/rest/webhooks/v1/test.rb', line 55

def method
  @method
end

#setting_id ⇒ Object

Parameters:

  • : (url) —

    [String] Target webhook URL to test

  • : (setting_id) —

    [String] Setting to use for test configuration

  • : (method) —

    [String] HTTP method to use when sending the test webhook request



55
56
57
# File 'lib/twilio-ruby/rest/webhooks/v1/test.rb', line 55

def setting_id
  @setting_id
end

#url ⇒ Object

Parameters:

  • : (url) —

    [String] Target webhook URL to test

  • : (setting_id) —

    [String] Setting to use for test configuration

  • : (method) —

    [String] HTTP method to use when sending the test webhook request



55
56
57
# File 'lib/twilio-ruby/rest/webhooks/v1/test.rb', line 55

def url
  @url
end

Instance Method Details

#to_json(options = {}) ⇒ Object



61
62
63
64
65
66
67
# File 'lib/twilio-ruby/rest/webhooks/v1/test.rb', line 61

def to_json(options = {})
{
        "url": @url,
        "settingId": @setting_id,
        "method": @method,
}.to_json(options)
end