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](www.twilio.com/docs/iam/api/account) that created the Event 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, specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#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, such as a TaskSid, ReservationSid, or a WorkerSid.
-
#resource_type ⇒ String
The type of object the event is most relevant to, such as a Task, Reservation, or a Worker).
-
#resource_url ⇒ String
The URL of the resource the event is most relevant to.
-
#sid ⇒ String
The unique string that we created to identify the Event 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
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 476 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'], '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 || @properties['workspace_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Event resource.
519 520 521 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 519 def account_sid @properties['account_sid'] end |
#actor_sid ⇒ String
Returns The SID of the resource that triggered the event.
525 526 527 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 525 def actor_sid @properties['actor_sid'] end |
#actor_type ⇒ String
Returns The type of resource that triggered the event.
531 532 533 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 531 def actor_type @properties['actor_type'] end |
#actor_url ⇒ String
Returns The absolute URL of the resource that triggered the event.
537 538 539 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 537 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
510 511 512 513 514 515 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 510 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.
543 544 545 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 543 def description @properties['description'] end |
#event_data ⇒ Hash
Returns Data about the event. For more information, see [Event types](www.twilio.com/docs/taskrouter/api/event#event-types).
549 550 551 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 549 def event_data @properties['event_data'] end |
#event_date ⇒ Time
Returns The time the event was sent, specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
555 556 557 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 555 def event_date @properties['event_date'] end |
#event_date_ms ⇒ String
Returns The time the event was sent in milliseconds.
561 562 563 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 561 def event_date_ms @properties['event_date_ms'] end |
#event_type ⇒ String
Returns The identifier for the event.
567 568 569 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 567 def event_type @properties['event_type'] end |
#fetch ⇒ EventInstance
Fetch the EventInstance
622 623 624 625 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 622 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
636 637 638 639 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 636 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 the event is most relevant to, such as a TaskSid, ReservationSid, or a WorkerSid.
573 574 575 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 573 def resource_sid @properties['resource_sid'] end |
#resource_type ⇒ String
Returns The type of object the event is most relevant to, such as a Task, Reservation, or a Worker).
579 580 581 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 579 def resource_type @properties['resource_type'] end |
#resource_url ⇒ String
Returns The URL of the resource the event is most relevant to.
585 586 587 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 585 def resource_url @properties['resource_url'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Event resource.
591 592 593 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 591 def sid @properties['sid'] end |
#source ⇒ String
Returns Where the Event originated.
597 598 599 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 597 def source @properties['source'] end |
#source_ip_address ⇒ String
Returns The IP from which the Event originated.
603 604 605 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 603 def source_ip_address @properties['source_ip_address'] end |
#to_s ⇒ Object
Provide a user friendly representation
629 630 631 632 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 629 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.EventInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the Event resource.
609 610 611 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 609 def url @properties['url'] end |
#workspace_sid ⇒ String
Returns The SID of the Workspace that contains the Event.
615 616 617 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 615 def workspace_sid @properties['workspace_sid'] end |