class Twilio::REST::Events::V1::SubscriptionInstance

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the SubscriptionInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid A 34 character string that uniquely identifies this

Subscription.

@return [SubscriptionInstance] SubscriptionInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/events/v1/subscription.rb
269 def initialize(version, payload, sid: nil)
270   super(version)
271 
272   # Marshaled Properties
273   @properties = {
274       'account_sid' => payload['account_sid'],
275       'sid' => payload['sid'],
276       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
277       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
278       'description' => payload['description'],
279       'sink_sid' => payload['sink_sid'],
280       'url' => payload['url'],
281       'links' => payload['links'],
282   }
283 
284   # Context
285   @instance_context = nil
286   @params = {'sid' => sid || @properties['sid'], }
287 end

Public Instance Methods

account_sid() click to toggle source

@return [String] Account SID.

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
302 def account_sid
303   @properties['account_sid']
304 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [SubscriptionContext] SubscriptionContext for this SubscriptionInstance

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
293 def context
294   unless @instance_context
295     @instance_context = SubscriptionContext.new(@version, @params['sid'], )
296   end
297   @instance_context
298 end
date_created() click to toggle source

@return [Time] The date this Subscription was created

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
314 def date_created
315   @properties['date_created']
316 end
date_updated() click to toggle source

@return [Time] The date this Subscription was updated

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
320 def date_updated
321   @properties['date_updated']
322 end
delete() click to toggle source

Delete the SubscriptionInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
369 def delete
370   context.delete
371 end
description() click to toggle source

@return [String] Subscription description

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
326 def description
327   @properties['description']
328 end
fetch() click to toggle source

Fetch the SubscriptionInstance @return [SubscriptionInstance] Fetched SubscriptionInstance

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
351 def fetch
352   context.fetch
353 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
389 def inspect
390   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
391   "<Twilio.Events.V1.SubscriptionInstance #{values}>"
392 end
sid() click to toggle source

@return [String] A string that uniquely identifies this Subscription.

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
308 def sid
309   @properties['sid']
310 end
sink_sid() click to toggle source

@return [String] Sink SID.

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
332 def sink_sid
333   @properties['sink_sid']
334 end
subscribed_events() click to toggle source

Access the subscribed_events @return [subscribed_events] subscribed_events

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
376 def subscribed_events
377   context.subscribed_events
378 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
382 def to_s
383   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
384   "<Twilio.Events.V1.SubscriptionInstance #{values}>"
385 end
update(description: :unset, sink_sid: :unset) click to toggle source

Update the SubscriptionInstance @param [String] description A human readable description for the Subscription. @param [String] sink_sid The SID of the sink that events selected by this

subscription should be sent to. Sink must be active for the subscription to be
created.

@return [SubscriptionInstance] Updated SubscriptionInstance

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
362 def update(description: :unset, sink_sid: :unset)
363   context.update(description: description, sink_sid: sink_sid, )
364 end
url() click to toggle source

@return [String] The URL of this resource.

    # File lib/twilio-ruby/rest/events/v1/subscription.rb
338 def url
339   @properties['url']
340 end