class Twilio::REST::Events::V1::SubscriptionContext::SubscribedEventInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the SubscribedEventInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] subscription_sid
The unique SID identifier of the Subscription. @param [String] type Type of event being subscribed to. @return [SubscribedEventInstance] SubscribedEventInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb 243 def initialize(version, payload, subscription_sid: nil, type: nil) 244 super(version) 245 246 # Marshaled Properties 247 @properties = { 248 'account_sid' => payload['account_sid'], 249 'type' => payload['type'], 250 'schema_version' => payload['schema_version'].to_i, 251 'subscription_sid' => payload['subscription_sid'], 252 'url' => payload['url'], 253 } 254 255 # Context 256 @instance_context = nil 257 @params = {'subscription_sid' => subscription_sid, 'type' => type || @properties['type'], } 258 end
Public Instance Methods
@return [String] Account SID.
# File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb 277 def account_sid 278 @properties['account_sid'] 279 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [SubscribedEventContext] SubscribedEventContext
for this SubscribedEventInstance
# File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb 264 def context 265 unless @instance_context 266 @instance_context = SubscribedEventContext.new( 267 @version, 268 @params['subscription_sid'], 269 @params['type'], 270 ) 271 end 272 @instance_context 273 end
Delete the SubscribedEventInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb 324 def delete 325 context.delete 326 end
Fetch the SubscribedEventInstance
@return [SubscribedEventInstance] Fetched SubscribedEventInstance
# File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb 308 def fetch 309 context.fetch 310 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb 337 def inspect 338 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 339 "<Twilio.Events.V1.SubscribedEventInstance #{values}>" 340 end
@return [String] The schema version that the subscription should use.
# File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb 289 def schema_version 290 @properties['schema_version'] 291 end
@return [String] Subscription SID.
# File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb 295 def subscription_sid 296 @properties['subscription_sid'] 297 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb 330 def to_s 331 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 332 "<Twilio.Events.V1.SubscribedEventInstance #{values}>" 333 end
@return [String] Type of event being subscribed to.
# File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb 283 def type 284 @properties['type'] 285 end
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 317 def update(schema_version: :unset) 318 context.update(schema_version: schema_version, ) 319 end
@return [String] The URL of this resource.
# File lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb 301 def url 302 @properties['url'] 303 end