Class: Twilio::REST::Numbers::V1::WebhookList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Numbers::V1::WebhookList
- Defined in:
- lib/twilio-ruby/rest/numbers/v1/webhook.rb
Instance Method Summary collapse
-
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance.
-
#fetch_with_metadata ⇒ WebhookInstance
Fetch the WebhookInstanceMetadata.
-
#initialize(version) ⇒ WebhookList
constructor
Initialize the WebhookList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version) ⇒ WebhookList
Initialize the WebhookList
26 27 28 29 30 31 32 33 |
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 26 def initialize(version) super(version) # Path Solution @solution = { } @uri = "/Porting/Configuration/Webhook" end |
Instance Method Details
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 37 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) WebhookInstance.new( @version, payload, ) end |
#fetch_with_metadata ⇒ WebhookInstance
Fetch the WebhookInstanceMetadata
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 55 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) webhook_instance = WebhookInstance.new( @version, response.body, ) WebhookInstanceMetadata.new( @version, webhook_instance, response.headers, response.status_code ) end |
#to_s ⇒ Object
Provide a user friendly representation
80 81 82 |
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 80 def to_s '#<Twilio.Numbers.V1.WebhookList>' end |