Class: Twilio::REST::Monitor::V1

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/monitor/v1.rb,
lib/twilio-ruby/rest/monitor/v1/alert.rb,
lib/twilio-ruby/rest/monitor/v1/event.rb

Defined Under Namespace

Classes: AlertContext, AlertInstance, AlertList, AlertPage, EventContext, EventInstance, EventList, EventPage

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update

Constructor Details

#initialize(domain) ⇒ V1

Initialize the V1 version of Monitor


15
16
17
18
19
20
# File 'lib/twilio-ruby/rest/monitor/v1.rb', line 15

def initialize(domain)
  super
  @version = 'v1'
  @alerts = nil
  @events = nil
end

Instance Method Details

#alerts(sid = :unset) ⇒ Twilio::REST::Monitor::V1::AlertContext, Twilio::REST::Monitor::V1::AlertList

Parameters:

  • sid (String) (defaults to: :unset)

    The SID of the Alert resource to fetch.

Returns:


26
27
28
29
30
31
32
33
34
35
# File 'lib/twilio-ruby/rest/monitor/v1.rb', line 26

def alerts(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @alerts ||= AlertList.new self
  else
      AlertContext.new(self, sid)
  end
end

#events(sid = :unset) ⇒ Twilio::REST::Monitor::V1::EventContext, Twilio::REST::Monitor::V1::EventList

Parameters:

  • sid (String) (defaults to: :unset)

    The SID of the Event resource to fetch.

Returns:


41
42
43
44
45
46
47
48
49
50
# File 'lib/twilio-ruby/rest/monitor/v1.rb', line 41

def events(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @events ||= EventList.new self
  else
      EventContext.new(self, sid)
  end
end

#to_sObject

Provide a user friendly representation


54
55
56
# File 'lib/twilio-ruby/rest/monitor/v1.rb', line 54

def to_s
  '<Twilio::REST::Monitor::V1>'
end