Class: Twilio::REST::Conversations::V1::ConfigurationContext::WebhookContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Conversations::V1::ConfigurationContext::WebhookContext
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
Instance Method Summary collapse
-
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance.
-
#initialize(version) ⇒ WebhookContext
constructor
Initialize the WebhookContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset) ⇒ WebhookInstance
Update the WebhookInstance.
Constructor Details
#initialize(version) ⇒ WebhookContext
Initialize the WebhookContext
50 51 52 53 54 55 56 57 58 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 50 def initialize(version) super(version) # Path Solution @solution = { } @uri = "/Configuration/Webhooks" end |
Instance Method Details
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 62 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 |
#inspect ⇒ Object
Provide a detailed, user friendly representation
124 125 126 127 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 124 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.WebhookContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
117 118 119 120 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 117 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.WebhookContext #{context}>" end |
#update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset) ⇒ WebhookInstance
Update the WebhookInstance
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 85 def update( method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset ) data = Twilio::Values.of({ 'Method' => method, 'Filters' => Twilio.serialize_list(filters) { |e| e }, 'PreWebhookUrl' => pre_webhook_url, 'PostWebhookUrl' => post_webhook_url, 'Target' => target, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) WebhookInstance.new( @version, payload, ) end |