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
67 68 69 70 71 72 73 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 67 def initialize(version) super(version) # Path Solution @solution = {} @uri = "/Configuration/Webhooks" end |
Instance Method Details
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance
78 79 80 81 82 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 78 def fetch payload = @version.fetch('GET', @uri) WebhookInstance.new(@version, payload, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
121 122 123 124 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 121 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.WebhookContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
114 115 116 117 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 114 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
98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 98 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, }) payload = @version.update('POST', @uri, data: data) WebhookInstance.new(@version, payload, ) end |