Class: Twilio::REST::Events::V1::SubscriptionContext::SubscribedEventInstance

Inherits:
InstanceResource
  • Object
show all
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

Constructor Details

#initialize(version, payload, subscription_sid: nil) ⇒ SubscribedEventInstance

Initialize the SubscribedEventInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • subscription_sid (String) (defaults to: nil)

    The unique SID identifier of the Subscription.



157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 157

def initialize(version, payload, subscription_sid: 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'],
  }
end

Instance Method Details

#account_sidString

Returns Account SID.

Returns:

  • (String)

    Account SID.



172
173
174
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 172

def 
  @properties['account_sid']
end

#inspectObject

Provide a detailed, user friendly representation



208
209
210
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 208

def inspect
  "<Twilio.Events.V1.SubscribedEventInstance>"
end

#subscription_sidString

Returns Subscription SID.

Returns:

  • (String)

    Subscription SID.



190
191
192
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 190

def subscription_sid
  @properties['subscription_sid']
end

#to_sObject

Provide a user friendly representation



202
203
204
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 202

def to_s
  "<Twilio.Events.V1.SubscribedEventInstance>"
end

#typeString

Returns Type of event being subscribed to.

Returns:

  • (String)

    Type of event being subscribed to.



178
179
180
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 178

def type
  @properties['type']
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



196
197
198
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 196

def url
  @properties['url']
end

#versionString

Returns The schema version that the subscription should use.

Returns:

  • (String)

    The schema version that the subscription should use.



184
185
186
# File 'lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb', line 184

def version
  @properties['version']
end