class Twilio::REST::Monitor::V1::EventInstance

Public Class Methods

new(version, payload, sid: nil) click to toggle source

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

Calls superclass method 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

account_sid() click to toggle source

@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
actor_sid() click to toggle source

@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
actor_type() click to toggle source

@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
context() click to toggle source

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
description() click to toggle source

@return [String] A description of the event

    # File lib/twilio-ruby/rest/monitor/v1/event.rb
312 def description
313   @properties['description']
314 end
event_data() click to toggle source

@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
event_date() click to toggle source

@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
event_type() click to toggle source

@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() click to toggle source

Fetch the EventInstance @return [EventInstance] Fetched EventInstance

    # File lib/twilio-ruby/rest/monitor/v1/event.rb
379 def fetch
380   context.fetch
381 end
inspect() click to toggle source

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
resource_sid() click to toggle source

@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
resource_type() click to toggle source

@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
sid() click to toggle source

@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
source() click to toggle source

@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
source_ip_address() click to toggle source

@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
to_s() click to toggle source

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
url() click to toggle source

@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