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_sid.
-
#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
The description.
-
#event_data ⇒ String
The event_data.
-
#event_date ⇒ Time
The event_date.
-
#event_type ⇒ String
The event_type.
-
#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 resource_sid.
-
#resource_type ⇒ String
The resource_type.
-
#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.
Constructor Details
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ EventInstance
Initialize the EventInstance
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 265 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_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'], } # Context @instance_context = nil @params = { 'workspace_sid' => workspace_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The account_sid.
312 313 314 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 312 def account_sid @properties['account_sid'] end |
#actor_sid ⇒ String
Returns The actor_sid.
318 319 320 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 318 def actor_sid @properties['actor_sid'] end |
#actor_type ⇒ String
Returns The actor_type.
324 325 326 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 324 def actor_type @properties['actor_type'] end |
#actor_url ⇒ String
Returns The actor_url.
330 331 332 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 330 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
299 300 301 302 303 304 305 306 307 308 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 299 def context unless @instance_context @instance_context = EventContext.new( @version, @params['workspace_sid'], @params['sid'], ) end @instance_context end |
#description ⇒ String
Returns The description.
336 337 338 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 336 def description @properties['description'] end |
#event_data ⇒ String
Returns The event_data.
342 343 344 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 342 def event_data @properties['event_data'] end |
#event_date ⇒ Time
Returns The event_date.
348 349 350 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 348 def event_date @properties['event_date'] end |
#event_type ⇒ String
Returns The event_type.
354 355 356 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 354 def event_type @properties['event_type'] end |
#fetch ⇒ EventInstance
Fetch a EventInstance
403 404 405 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 403 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
416 417 418 419 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 416 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.EventInstance #{values}>" end |
#resource_sid ⇒ String
Returns The resource_sid.
360 361 362 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 360 def resource_sid @properties['resource_sid'] end |
#resource_type ⇒ String
Returns The resource_type.
366 367 368 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 366 def resource_type @properties['resource_type'] end |
#resource_url ⇒ String
Returns The resource_url.
372 373 374 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 372 def resource_url @properties['resource_url'] end |
#sid ⇒ String
Returns The sid.
378 379 380 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 378 def sid @properties['sid'] end |
#source ⇒ String
Returns The source.
384 385 386 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 384 def source @properties['source'] end |
#source_ip_address ⇒ String
Returns The source_ip_address.
390 391 392 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 390 def source_ip_address @properties['source_ip_address'] end |
#to_s ⇒ Object
Provide a user friendly representation
409 410 411 412 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 409 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.EventInstance #{values}>" end |
#url ⇒ String
Returns The url.
396 397 398 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 396 def url @properties['url'] end |