Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::EventInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Taskrouter::V1::WorkspaceContext::EventInstance
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#actor_sid ⇒ String
The SID of the resource that triggered the event.
-
#actor_type ⇒ String
The type of resource that triggered the event.
-
#actor_url ⇒ String
The absolute URL of the resource that triggered the event.
-
#context ⇒ EventContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#description ⇒ String
A description of the event.
-
#event_data ⇒ Hash
Data about the event.
-
#event_date ⇒ Time
The time the event was sent.
-
#event_date_ms ⇒ String
The time the event was sent in milliseconds.
-
#event_type ⇒ String
The identifier for the event.
-
#fetch ⇒ EventInstance
Fetch the EventInstance.
-
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ EventInstance
constructor
Initialize the EventInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#resource_sid ⇒ String
The SID of the object the event is most relevant to.
-
#resource_type ⇒ String
The type of object the event is most relevant to.
-
#resource_url ⇒ String
The URL of the resource the event is most relevant to.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#source ⇒ String
Where the Event originated.
-
#source_ip_address ⇒ String
The IP from which the Event originated.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the Event resource.
-
#workspace_sid ⇒ String
The SID of the Workspace that contains the Event.
Constructor Details
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ EventInstance
Initialize the EventInstance
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 304 def initialize(version, payload, workspace_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'actor_sid' => payload['actor_sid'], 'actor_type' => payload['actor_type'], 'actor_url' => payload['actor_url'], 'description' => payload['description'], 'event_data' => payload['event_data'], 'event_date' => Twilio.deserialize_iso8601_datetime(payload['event_date']), 'event_date_ms' => payload['event_date_ms'] == nil ? payload['event_date_ms'] : payload['event_date_ms'].to_i, 'event_type' => payload['event_type'], 'resource_sid' => payload['resource_sid'], 'resource_type' => payload['resource_type'], 'resource_url' => payload['resource_url'], 'sid' => payload['sid'], 'source' => payload['source'], 'source_ip_address' => payload['source_ip_address'], 'url' => payload['url'], 'workspace_sid' => payload['workspace_sid'], } # Context @instance_context = nil @params = {'workspace_sid' => workspace_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
346 347 348 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 346 def account_sid @properties['account_sid'] end |
#actor_sid ⇒ String
352 353 354 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 352 def actor_sid @properties['actor_sid'] end |
#actor_type ⇒ String
358 359 360 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 358 def actor_type @properties['actor_type'] end |
#actor_url ⇒ String
364 365 366 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 364 def actor_url @properties['actor_url'] end |
#context ⇒ EventContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
337 338 339 340 341 342 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 337 def context unless @instance_context @instance_context = EventContext.new(@version, @params['workspace_sid'], @params['sid'], ) end @instance_context end |
#description ⇒ String
370 371 372 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 370 def description @properties['description'] end |
#event_data ⇒ Hash
376 377 378 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 376 def event_data @properties['event_data'] end |
#event_date ⇒ Time
382 383 384 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 382 def event_date @properties['event_date'] end |
#event_date_ms ⇒ String
388 389 390 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 388 def event_date_ms @properties['event_date_ms'] end |
#event_type ⇒ String
394 395 396 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 394 def event_type @properties['event_type'] end |
#fetch ⇒ EventInstance
Fetch the EventInstance
449 450 451 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 449 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
462 463 464 465 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 462 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.EventInstance #{values}>" end |
#resource_sid ⇒ String
400 401 402 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 400 def resource_sid @properties['resource_sid'] end |
#resource_type ⇒ String
406 407 408 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 406 def resource_type @properties['resource_type'] end |
#resource_url ⇒ String
412 413 414 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 412 def resource_url @properties['resource_url'] end |
#sid ⇒ String
418 419 420 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 418 def sid @properties['sid'] end |
#source ⇒ String
424 425 426 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 424 def source @properties['source'] end |
#source_ip_address ⇒ String
430 431 432 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 430 def source_ip_address @properties['source_ip_address'] end |
#to_s ⇒ Object
Provide a user friendly representation
455 456 457 458 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 455 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.EventInstance #{values}>" end |
#url ⇒ String
436 437 438 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 436 def url @properties['url'] end |
#workspace_sid ⇒ String
442 443 444 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 442 def workspace_sid @properties['workspace_sid'] end |