class Twilio::REST::Events::V1::EventTypeInstance

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

Public Class Methods

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

Initialize the EventTypeInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] type A string that uniquely identifies this Event Type. @return [EventTypeInstance] EventTypeInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/events/v1/event_type.rb
202 def initialize(version, payload, type: nil)
203   super(version)
204 
205   # Marshaled Properties
206   @properties = {
207       'type' => payload['type'],
208       'schema_id' => payload['schema_id'],
209       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
210       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
211       'description' => payload['description'],
212       'url' => payload['url'],
213       'links' => payload['links'],
214   }
215 
216   # Context
217   @instance_context = nil
218   @params = {'type' => type || @properties['type'], }
219 end

Public Instance Methods

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 [EventTypeContext] EventTypeContext for this EventTypeInstance

    # File lib/twilio-ruby/rest/events/v1/event_type.rb
225 def context
226   unless @instance_context
227     @instance_context = EventTypeContext.new(@version, @params['type'], )
228   end
229   @instance_context
230 end
date_created() click to toggle source

@return [Time] The date this Event Type was created.

    # File lib/twilio-ruby/rest/events/v1/event_type.rb
246 def date_created
247   @properties['date_created']
248 end
date_updated() click to toggle source

@return [Time] The date this Event Type was updated.

    # File lib/twilio-ruby/rest/events/v1/event_type.rb
252 def date_updated
253   @properties['date_updated']
254 end
description() click to toggle source

@return [String] Event Type description.

    # File lib/twilio-ruby/rest/events/v1/event_type.rb
258 def description
259   @properties['description']
260 end
fetch() click to toggle source

Fetch the EventTypeInstance @return [EventTypeInstance] Fetched EventTypeInstance

    # File lib/twilio-ruby/rest/events/v1/event_type.rb
277 def fetch
278   context.fetch
279 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/events/v1/event_type.rb
290 def inspect
291   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
292   "<Twilio.Events.V1.EventTypeInstance #{values}>"
293 end
schema_id() click to toggle source

@return [String] The Schema identifier for this Event Type.

    # File lib/twilio-ruby/rest/events/v1/event_type.rb
240 def schema_id
241   @properties['schema_id']
242 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/events/v1/event_type.rb
283 def to_s
284   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
285   "<Twilio.Events.V1.EventTypeInstance #{values}>"
286 end
type() click to toggle source

@return [String] The Event Type identifier.

    # File lib/twilio-ruby/rest/events/v1/event_type.rb
234 def type
235   @properties['type']
236 end
url() click to toggle source

@return [String] The URL of this resource.

    # File lib/twilio-ruby/rest/events/v1/event_type.rb
264 def url
265   @properties['url']
266 end