Class: Twilio::REST::Events::V1::SubscriptionContext::SubscribedEventInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Events::V1::SubscriptionContext::SubscribedEventInstance
- Defined in:
- lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
Account SID.
-
#context ⇒ SubscribedEventContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#delete ⇒ Boolean
Delete the SubscribedEventInstance.
-
#fetch ⇒ SubscribedEventInstance
Fetch the SubscribedEventInstance.
-
#initialize(version, payload, subscription_sid: nil, type: nil) ⇒ SubscribedEventInstance
constructor
Initialize the SubscribedEventInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#subscription_sid ⇒ String
Subscription SID.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ String
Type of event being subscribed to.
-
#update(version: :unset) ⇒ SubscribedEventInstance
Update the SubscribedEventInstance.
-
#url ⇒ String
The URL of this resource.
-
#version ⇒ String
The schema version that the subscription should use.
Constructor Details
#initialize(version, payload, subscription_sid: nil, type: nil) ⇒ SubscribedEventInstance
Initialize the SubscribedEventInstance
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 241 def initialize(version, payload, subscription_sid: nil, type: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'type' => payload['type'], 'version' => payload['version'].to_i, 'subscription_sid' => payload['subscription_sid'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'subscription_sid' => subscription_sid, 'type' => type || @properties['type'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account SID.
275 276 277 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 275 def account_sid @properties['account_sid'] end |
#context ⇒ SubscribedEventContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
262 263 264 265 266 267 268 269 270 271 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 262 def context unless @instance_context @instance_context = SubscribedEventContext.new( @version, @params['subscription_sid'], @params['type'], ) end @instance_context end |
#delete ⇒ Boolean
Delete the SubscribedEventInstance
321 322 323 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 321 def delete context.delete end |
#fetch ⇒ SubscribedEventInstance
Fetch the SubscribedEventInstance
306 307 308 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 306 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
334 335 336 337 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 334 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SubscribedEventInstance #{values}>" end |
#subscription_sid ⇒ String
Returns Subscription SID.
293 294 295 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 293 def subscription_sid @properties['subscription_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
327 328 329 330 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 327 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SubscribedEventInstance #{values}>" end |
#type ⇒ String
Returns Type of event being subscribed to.
281 282 283 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 281 def type @properties['type'] end |
#update(version: :unset) ⇒ SubscribedEventInstance
Update the SubscribedEventInstance
314 315 316 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 314 def update(version: :unset) context.update(version: version, ) end |
#url ⇒ String
Returns The URL of this resource.
299 300 301 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 299 def url @properties['url'] end |
#version ⇒ String
Returns The schema version that the subscription should use.
287 288 289 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 287 def version @properties['version'] end |