Class: Twilio::REST::Monitor::V1::EventInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Monitor::V1::EventInstance
- Defined in:
- lib/twilio-ruby/rest/monitor/v1/event.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
A 34 character string identifying the Account for which this Event was recorded.
-
#actor_sid ⇒ String
If available, a 34 character string identifying the actor that caused this event.
-
#actor_type ⇒ String
The type of actor that caused this event.
-
#context ⇒ EventContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#description ⇒ String
A human-readable description of the event.
-
#event_data ⇒ Hash
A freeform json object encoding additional data about the event.
-
#event_date ⇒ Time
The date-time the event was recorded.
-
#event_type ⇒ String
The event’s type, as a string.
-
#fetch ⇒ EventInstance
Fetch a EventInstance.
-
#initialize(version, payload, sid: nil) ⇒ EventInstance
constructor
Initialize the EventInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#resource_sid ⇒ String
A 34 character string identifying the resource that was affected.
-
#resource_type ⇒ String
The type of resource that was affected.
-
#sid ⇒ String
A 34 character string that uniquely identifies this event.
-
#source ⇒ String
The originating system or interface that caused the event.
-
#source_ip_address ⇒ String
The IP address of the source.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ EventInstance
Initialize the EventInstance
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 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 266 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'actor_sid' => payload['actor_sid'], 'actor_type' => payload['actor_type'], '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'], 'sid' => payload['sid'], 'source' => payload['source'], 'source_ip_address' => payload['source_ip_address'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns A 34 character string identifying the Account for which this Event was recorded.
305 306 307 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 305 def account_sid @properties['account_sid'] end |
#actor_sid ⇒ String
Returns If available, a 34 character string identifying the actor that caused this event. May be null.
311 312 313 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 311 def actor_sid @properties['actor_sid'] end |
#actor_type ⇒ String
Returns The type of actor that caused this event.
317 318 319 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 317 def actor_type @properties['actor_type'] 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
296 297 298 299 300 301 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 296 def context unless @instance_context @instance_context = EventContext.new(@version, @params['sid'], ) end @instance_context end |
#description ⇒ String
Returns A human-readable description of the event. May be null.
323 324 325 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 323 def description @properties['description'] end |
#event_data ⇒ Hash
Returns A freeform json object encoding additional data about the event.
329 330 331 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 329 def event_data @properties['event_data'] end |
#event_date ⇒ Time
Returns The date-time the event was recorded.
335 336 337 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 335 def event_date @properties['event_date'] end |
#event_type ⇒ String
Returns The event’s type, as a string.
341 342 343 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 341 def event_type @properties['event_type'] end |
#fetch ⇒ EventInstance
Fetch a EventInstance
390 391 392 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 390 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
403 404 405 406 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 403 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Monitor.V1.EventInstance #{values}>" end |
#links ⇒ String
Returns The links.
383 384 385 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 383 def links @properties['links'] end |
#resource_sid ⇒ String
Returns A 34 character string identifying the resource that was affected.
347 348 349 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 347 def resource_sid @properties['resource_sid'] end |
#resource_type ⇒ String
Returns The type of resource that was affected.
353 354 355 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 353 def resource_type @properties['resource_type'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this event.
359 360 361 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 359 def sid @properties['sid'] end |
#source ⇒ String
Returns The originating system or interface that caused the event. web for events caused by user action in the Twilio Console. api for events caused through a request to the REST API. twilio for events caused by an automated or internal Twilio system.
365 366 367 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 365 def source @properties['source'] end |
#source_ip_address ⇒ String
Returns The IP address of the source.
371 372 373 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 371 def source_ip_address @properties['source_ip_address'] end |
#to_s ⇒ Object
Provide a user friendly representation
396 397 398 399 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 396 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Monitor.V1.EventInstance #{values}>" end |
#url ⇒ String
Returns The url.
377 378 379 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 377 def url @properties['url'] end |