Class: Twilio::REST::Conversations::V1::ConfigurationContext::WebhookInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ConfigurationContext::WebhookInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the [Account](www.twilio.com/docs/iam/api/account) responsible for this conversation.
-
#context ⇒ WebhookContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance.
-
#filters ⇒ Array<String>
The list of webhook event triggers that are enabled for this Service: ‘onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`.
-
#initialize(version, payload) ⇒ WebhookInstance
constructor
Initialize the WebhookInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #method ⇒ Method
-
#post_webhook_url ⇒ String
The absolute url the post-event webhook request should be sent to.
-
#pre_webhook_url ⇒ String
The absolute url the pre-event webhook request should be sent to.
- #target ⇒ Target
-
#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.
-
#url ⇒ String
An absolute API resource API resource URL for this webhook.
Constructor Details
#initialize(version, payload) ⇒ WebhookInstance
Initialize the WebhookInstance
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 160 def initialize(version, payload ) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'method' => payload['method'], 'filters' => payload['filters'], 'pre_webhook_url' => payload['pre_webhook_url'], 'post_webhook_url' => payload['post_webhook_url'], 'target' => payload['target'], 'url' => payload['url'], } # Context @instance_context = nil @params = { } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the [Account](www.twilio.com/docs/iam/api/account) responsible for this conversation.
192 193 194 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 192 def account_sid @properties['account_sid'] end |
#context ⇒ WebhookContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
183 184 185 186 187 188 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 183 def context unless @instance_context @instance_context = WebhookContext.new(@version ) end @instance_context end |
#fetch ⇒ WebhookInstance
Fetch the WebhookInstance
235 236 237 238 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 235 def fetch context.fetch end |
#filters ⇒ Array<String>
Returns The list of webhook event triggers that are enabled for this Service: ‘onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`.
204 205 206 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 204 def filters @properties['filters'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
274 275 276 277 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 274 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.WebhookInstance #{values}>" end |
#method ⇒ Method
198 199 200 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 198 def method @properties['method'] end |
#post_webhook_url ⇒ String
Returns The absolute url the post-event webhook request should be sent to.
216 217 218 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 216 def post_webhook_url @properties['post_webhook_url'] end |
#pre_webhook_url ⇒ String
Returns The absolute url the pre-event webhook request should be sent to.
210 211 212 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 210 def pre_webhook_url @properties['pre_webhook_url'] end |
#target ⇒ Target
222 223 224 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 222 def target @properties['target'] end |
#to_s ⇒ Object
Provide a user friendly representation
267 268 269 270 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 267 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.WebhookInstance #{values}>" end |
#update(method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset) ⇒ WebhookInstance
Update the WebhookInstance
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 248 def update( method: :unset, filters: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, target: :unset ) context.update( method: method, filters: filters, pre_webhook_url: pre_webhook_url, post_webhook_url: post_webhook_url, target: target, ) end |
#url ⇒ String
Returns An absolute API resource API resource URL for this webhook.
228 229 230 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb', line 228 def url @properties['url'] end |