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
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account.
-
#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.
-
#schema_version ⇒ String
The schema version that the Subscription should use.
-
#subscription_sid ⇒ String
The unique SID identifier of the Subscription.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ String
Type of event being subscribed to.
-
#update(schema_version: :unset) ⇒ SubscribedEventInstance
Update the SubscribedEventInstance.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, subscription_sid: nil, type: nil) ⇒ SubscribedEventInstance
Initialize the SubscribedEventInstance
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 536 def initialize(version, payload , subscription_sid: nil, type: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'type' => payload['type'], 'schema_version' => payload['schema_version'] == nil ? payload['schema_version'] : payload['schema_version'].to_i, 'subscription_sid' => payload['subscription_sid'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'subscription_sid' => subscription_sid || @properties['subscription_sid'] ,'type' => type || @properties['type'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID identifier of the Account.
567 568 569 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 567 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
558 559 560 561 562 563 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 558 def context unless @instance_context @instance_context = SubscribedEventContext.new(@version , @params['subscription_sid'], @params['type']) end @instance_context end |
#delete ⇒ Boolean
Delete the SubscribedEventInstance
598 599 600 601 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 598 def delete context.delete end |
#fetch ⇒ SubscribedEventInstance
Fetch the SubscribedEventInstance
606 607 608 609 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 606 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
633 634 635 636 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 633 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SubscribedEventInstance #{values}>" end |
#schema_version ⇒ String
Returns The schema version that the Subscription should use.
579 580 581 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 579 def schema_version @properties['schema_version'] end |
#subscription_sid ⇒ String
Returns The unique SID identifier of the Subscription.
585 586 587 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 585 def subscription_sid @properties['subscription_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
626 627 628 629 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 626 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.
573 574 575 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 573 def type @properties['type'] end |
#update(schema_version: :unset) ⇒ SubscribedEventInstance
Update the SubscribedEventInstance
615 616 617 618 619 620 621 622 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 615 def update( schema_version: :unset ) context.update( schema_version: schema_version, ) end |
#url ⇒ String
Returns The URL of this resource.
591 592 593 |
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 591 def url @properties['url'] end |