Class: Twilio::REST::Wireless::V1

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/wireless/v1.rb,
lib/twilio-ruby/rest/wireless/v1/sim.rb,
lib/twilio-ruby/rest/wireless/v1/command.rb,
lib/twilio-ruby/rest/wireless/v1/rate_plan.rb,
lib/twilio-ruby/rest/wireless/v1/usage_record.rb,
lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb,
lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb

Defined Under Namespace

Classes: CommandContext, CommandInstance, CommandList, CommandPage, RatePlanContext, RatePlanInstance, RatePlanList, RatePlanPage, SimContext, SimInstance, SimList, SimPage, UsageRecordInstance, UsageRecordList, UsageRecordPage

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 Wireless


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

def initialize(domain)
  super
  @version = 'v1'
  @usage_records = nil
  @commands = nil
  @rate_plans = nil
  @sims = nil
end

Instance Method Details

#commands(sid = :unset) ⇒ Twilio::REST::Wireless::V1::CommandContext, Twilio::REST::Wireless::V1::CommandList

Parameters:

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

    The SID of the Command resource to fetch.

Returns:


34
35
36
37
38
39
40
41
42
43
# File 'lib/twilio-ruby/rest/wireless/v1.rb', line 34

def commands(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @commands ||= CommandList.new self
  else
      CommandContext.new(self, sid)
  end
end

#rate_plans(sid = :unset) ⇒ Twilio::REST::Wireless::V1::RatePlanContext, Twilio::REST::Wireless::V1::RatePlanList

Parameters:

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

    The SID of the RatePlan resource to fetch.

Returns:


49
50
51
52
53
54
55
56
57
58
# File 'lib/twilio-ruby/rest/wireless/v1.rb', line 49

def rate_plans(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @rate_plans ||= RatePlanList.new self
  else
      RatePlanContext.new(self, sid)
  end
end

#sims(sid = :unset) ⇒ Twilio::REST::Wireless::V1::SimContext, Twilio::REST::Wireless::V1::SimList

Parameters:

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

    The SID or the `unique_name` of the Sim resource to fetch.

Returns:


64
65
66
67
68
69
70
71
72
73
# File 'lib/twilio-ruby/rest/wireless/v1.rb', line 64

def sims(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @sims ||= SimList.new self
  else
      SimContext.new(self, sid)
  end
end

#to_sObject

Provide a user friendly representation


77
78
79
# File 'lib/twilio-ruby/rest/wireless/v1.rb', line 77

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

#usage_recordsTwilio::REST::Wireless::V1::UsageRecordContext

Returns:

  • (Twilio::REST::Wireless::V1::UsageRecordContext)

26
27
28
# File 'lib/twilio-ruby/rest/wireless/v1.rb', line 26

def usage_records
  @usage_records ||= UsageRecordList.new self
end