class Twilio::REST::Taskrouter::V1::WorkspaceContext::EventInstance

Public Class Methods

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

Initialize the EventInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] workspace_sid The SID of the Workspace that contains the Event. @param [String] sid The SID of the Event resource to fetch. @return [EventInstance] EventInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
304 def initialize(version, payload, workspace_sid: nil, sid: nil)
305   super(version)
306 
307   # Marshaled Properties
308   @properties = {
309       'account_sid' => payload['account_sid'],
310       'actor_sid' => payload['actor_sid'],
311       'actor_type' => payload['actor_type'],
312       'actor_url' => payload['actor_url'],
313       'description' => payload['description'],
314       'event_data' => payload['event_data'],
315       'event_date' => Twilio.deserialize_iso8601_datetime(payload['event_date']),
316       'event_date_ms' => payload['event_date_ms'].to_i,
317       'event_type' => payload['event_type'],
318       'resource_sid' => payload['resource_sid'],
319       'resource_type' => payload['resource_type'],
320       'resource_url' => payload['resource_url'],
321       'sid' => payload['sid'],
322       'source' => payload['source'],
323       'source_ip_address' => payload['source_ip_address'],
324       'url' => payload['url'],
325       'workspace_sid' => payload['workspace_sid'],
326   }
327 
328   # Context
329   @instance_context = nil
330   @params = {'workspace_sid' => workspace_sid, 'sid' => sid || @properties['sid'], }
331 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
346 def account_sid
347   @properties['account_sid']
348 end
actor_sid() click to toggle source

@return [String] The SID of the resource that triggered the event

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
352 def actor_sid
353   @properties['actor_sid']
354 end
actor_type() click to toggle source

@return [String] The type of resource that triggered the event

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
358 def actor_type
359   @properties['actor_type']
360 end
actor_url() click to toggle source

@return [String] The absolute URL of the resource that triggered the event

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
364 def actor_url
365   @properties['actor_url']
366 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 [EventContext] EventContext for this EventInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
337 def context
338   unless @instance_context
339     @instance_context = EventContext.new(@version, @params['workspace_sid'], @params['sid'], )
340   end
341   @instance_context
342 end
description() click to toggle source

@return [String] A description of the event

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
370 def description
371   @properties['description']
372 end
event_data() click to toggle source

@return [Hash] Data about the event

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
376 def event_data
377   @properties['event_data']
378 end
event_date() click to toggle source

@return [Time] The time the event was sent

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
382 def event_date
383   @properties['event_date']
384 end
event_date_ms() click to toggle source

@return [String] The time the event was sent in milliseconds

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
388 def event_date_ms
389   @properties['event_date_ms']
390 end
event_type() click to toggle source

@return [String] The identifier for the event

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
394 def event_type
395   @properties['event_type']
396 end
fetch() click to toggle source

Fetch the EventInstance @return [EventInstance] Fetched EventInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
449 def fetch
450   context.fetch
451 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
462 def inspect
463   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
464   "<Twilio.Taskrouter.V1.EventInstance #{values}>"
465 end
resource_sid() click to toggle source

@return [String] The SID of the object the event is most relevant to

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
400 def resource_sid
401   @properties['resource_sid']
402 end
resource_type() click to toggle source

@return [String] The type of object the event is most relevant to

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
406 def resource_type
407   @properties['resource_type']
408 end
resource_url() click to toggle source

@return [String] The URL of the resource the event is most relevant to

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
412 def resource_url
413   @properties['resource_url']
414 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
418 def sid
419   @properties['sid']
420 end
source() click to toggle source

@return [String] Where the Event originated

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
424 def source
425   @properties['source']
426 end
source_ip_address() click to toggle source

@return [String] The IP from which the Event originated

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
430 def source_ip_address
431   @properties['source_ip_address']
432 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
455 def to_s
456   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
457   "<Twilio.Taskrouter.V1.EventInstance #{values}>"
458 end
url() click to toggle source

@return [String] The absolute URL of the Event resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
436 def url
437   @properties['url']
438 end
workspace_sid() click to toggle source

@return [String] The SID of the Workspace that contains the Event

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
442 def workspace_sid
443   @properties['workspace_sid']
444 end