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 preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
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.
-
#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: nil) ⇒ 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
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 227 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
261 262 263 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 261 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
248 249 250 251 252 253 254 255 256 257 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 248 def context unless @instance_context @instance_context = SubscribedEventContext.new( @version, @params['subscription_sid'], @params['type'], ) end @instance_context end |
#delete ⇒ Boolean
Delete the SubscribedEventInstance
300 301 302 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 300 def delete context.delete end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
313 314 315 316 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 313 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SubscribedEventInstance #{values}>" end |
#subscription_sid ⇒ String
279 280 281 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 279 def subscription_sid @properties['subscription_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
306 307 308 309 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 306 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SubscribedEventInstance #{values}>" end |
#type ⇒ String
267 268 269 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 267 def type @properties['type'] end |
#update(version: nil) ⇒ SubscribedEventInstance
Update the SubscribedEventInstance
293 294 295 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 293 def update(version: nil) context.update(version: version, ) end |
#url ⇒ String
285 286 287 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 285 def url @properties['url'] end |
#version ⇒ String
273 274 275 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 273 def version @properties['version'] end |