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