class Twilio::REST::Events::V1::SubscriptionContext::SubscribedEventContext

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Public Class Methods

new(version, subscription_sid, type) click to toggle source

Initialize the SubscribedEventContext @param [Version] version Version that contains the resource @param [String] subscription_sid The unique SID identifier of the Subscription. @param [String] type Type of event being subscribed to. @return [SubscribedEventContext] SubscribedEventContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb
171 def initialize(version, subscription_sid, type)
172   super(version)
173 
174   # Path Solution
175   @solution = {subscription_sid: subscription_sid, type: type, }
176   @uri = "/Subscriptions/#{@solution[:subscription_sid]}/SubscribedEvents/#{@solution[:type]}"
177 end

Public Instance Methods

delete() click to toggle source

Delete the SubscribedEventInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb
214 def delete
215    @version.delete('DELETE', @uri)
216 end
fetch() click to toggle source

Fetch the SubscribedEventInstance @return [SubscribedEventInstance] Fetched SubscribedEventInstance

    # File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb
182 def fetch
183   payload = @version.fetch('GET', @uri)
184 
185   SubscribedEventInstance.new(
186       @version,
187       payload,
188       subscription_sid: @solution[:subscription_sid],
189       type: @solution[:type],
190   )
191 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb
227 def inspect
228   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
229   "#<Twilio.Events.V1.SubscribedEventContext #{context}>"
230 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb
220 def to_s
221   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
222   "#<Twilio.Events.V1.SubscribedEventContext #{context}>"
223 end
update(schema_version: :unset) click to toggle source

Update the SubscribedEventInstance @param [String] schema_version The schema version that the subscription should

use.

@return [SubscribedEventInstance] Updated SubscribedEventInstance

    # File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb
198 def update(schema_version: :unset)
199   data = Twilio::Values.of({'SchemaVersion' => schema_version, })
200 
201   payload = @version.update('POST', @uri, data: data)
202 
203   SubscribedEventInstance.new(
204       @version,
205       payload,
206       subscription_sid: @solution[:subscription_sid],
207       type: @solution[:type],
208   )
209 end