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 account owning this event.
-
#actor_sid ⇒ String
The actor_sid.
-
#actor_type ⇒ String
The actor_type.
-
#actor_url ⇒ String
The actor_url.
-
#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 this specific event.
-
#event_date ⇒ Time
The time this event was sent.
-
#event_date_ms ⇒ String
The time this event was sent in ms.
-
#event_type ⇒ String
An identifier for this event.
-
#fetch ⇒ EventInstance
Fetch a 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 this event is most relevant to.
-
#resource_type ⇒ String
The type of object this event is most relevant to.
-
#resource_url ⇒ String
The resource_url.
-
#sid ⇒ String
The sid.
-
#source ⇒ String
The source.
-
#source_ip_address ⇒ String
The source_ip_address.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
-
#workspace_sid ⇒ String
The workspace_sid.
Constructor Details
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ EventInstance
Initialize the EventInstance
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 297 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'].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
Returns The account owning this event.
339 340 341 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 339 def account_sid @properties['account_sid'] end |
#actor_sid ⇒ String
Returns The actor_sid.
345 346 347 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 345 def actor_sid @properties['actor_sid'] end |
#actor_type ⇒ String
Returns The actor_type.
351 352 353 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 351 def actor_type @properties['actor_type'] end |
#actor_url ⇒ String
Returns The actor_url.
357 358 359 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 357 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
330 331 332 333 334 335 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 330 def context unless @instance_context @instance_context = EventContext.new(@version, @params['workspace_sid'], @params['sid'], ) end @instance_context end |
#description ⇒ String
Returns A description of the event.
363 364 365 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 363 def description @properties['description'] end |
#event_data ⇒ Hash
Returns Data about this specific event.
369 370 371 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 369 def event_data @properties['event_data'] end |
#event_date ⇒ Time
Returns The time this event was sent.
375 376 377 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 375 def event_date @properties['event_date'] end |
#event_date_ms ⇒ String
Returns The time this event was sent in ms.
381 382 383 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 381 def event_date_ms @properties['event_date_ms'] end |
#event_type ⇒ String
Returns An identifier for this event.
387 388 389 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 387 def event_type @properties['event_type'] end |
#fetch ⇒ EventInstance
Fetch a EventInstance
442 443 444 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 442 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
455 456 457 458 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 455 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.EventInstance #{values}>" end |
#resource_sid ⇒ String
Returns The sid of the object this event is most relevant to.
393 394 395 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 393 def resource_sid @properties['resource_sid'] end |
#resource_type ⇒ String
Returns The type of object this event is most relevant to.
399 400 401 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 399 def resource_type @properties['resource_type'] end |
#resource_url ⇒ String
Returns The resource_url.
405 406 407 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 405 def resource_url @properties['resource_url'] end |
#sid ⇒ String
Returns The sid.
411 412 413 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 411 def sid @properties['sid'] end |
#source ⇒ String
Returns The source.
417 418 419 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 417 def source @properties['source'] end |
#source_ip_address ⇒ String
Returns The source_ip_address.
423 424 425 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 423 def source_ip_address @properties['source_ip_address'] end |
#to_s ⇒ Object
Provide a user friendly representation
448 449 450 451 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 448 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.EventInstance #{values}>" end |
#url ⇒ String
Returns The url.
429 430 431 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 429 def url @properties['url'] end |
#workspace_sid ⇒ String
Returns The workspace_sid.
435 436 437 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 435 def workspace_sid @properties['workspace_sid'] end |