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
The SID of the Account that created the resource.
-
#actor_sid ⇒ String
The SID of the actor that caused the event, if available.
-
#actor_type ⇒ String
The type of actor that caused 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
A JSON string that represents an object with additional data about the event.
-
#event_date ⇒ Time
The ISO 8601 date and time in GMT when the event was recorded.
-
#event_type ⇒ String
The event's type.
-
#fetch ⇒ EventInstance
Fetch the EventInstance.
-
#initialize(version, payload, sid: nil) ⇒ EventInstance
constructor
Initialize the EventInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The absolute URLs of related resources.
-
#resource_sid ⇒ String
The SID of the resource that was affected.
-
#resource_type ⇒ String
The type of resource that was affected.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#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 absolute URL of the resource that was affected.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ EventInstance
Initialize the EventInstance
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 255 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 The SID of the Account that created the resource.
294 295 296 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 294 def account_sid @properties['account_sid'] end |
#actor_sid ⇒ String
Returns The SID of the actor that caused the event, if available.
300 301 302 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 300 def actor_sid @properties['actor_sid'] end |
#actor_type ⇒ String
Returns The type of actor that caused the event.
306 307 308 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 306 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
285 286 287 288 289 290 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 285 def context unless @instance_context @instance_context = EventContext.new(@version, @params['sid'], ) end @instance_context end |
#description ⇒ String
Returns A description of the event.
312 313 314 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 312 def description @properties['description'] end |
#event_data ⇒ Hash
Returns A JSON string that represents an object with additional data about the event.
318 319 320 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 318 def event_data @properties['event_data'] end |
#event_date ⇒ Time
Returns The ISO 8601 date and time in GMT when the event was recorded.
324 325 326 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 324 def event_date @properties['event_date'] end |
#event_type ⇒ String
Returns The event's type.
330 331 332 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 330 def event_type @properties['event_type'] end |
#fetch ⇒ EventInstance
Fetch the EventInstance
379 380 381 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 379 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
392 393 394 395 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 392 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Monitor.V1.EventInstance #{values}>" end |
#links ⇒ String
Returns The absolute URLs of related resources.
372 373 374 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 372 def links @properties['links'] end |
#resource_sid ⇒ String
Returns The SID of the resource that was affected.
336 337 338 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 336 def resource_sid @properties['resource_sid'] end |
#resource_type ⇒ String
Returns The type of resource that was affected.
342 343 344 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 342 def resource_type @properties['resource_type'] end |
#sid ⇒ String
Returns The unique string that identifies the resource.
348 349 350 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 348 def sid @properties['sid'] end |
#source ⇒ String
Returns The originating system or interface that caused the event.
354 355 356 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 354 def source @properties['source'] end |
#source_ip_address ⇒ String
Returns The IP address of the source.
360 361 362 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 360 def source_ip_address @properties['source_ip_address'] end |
#to_s ⇒ Object
Provide a user friendly representation
385 386 387 388 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 385 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Monitor.V1.EventInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the resource that was affected.
366 367 368 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 366 def url @properties['url'] end |