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



21
22
23
24
25
26
27
28
# File 'lib/twilio-ruby/rest/wireless/v1.rb', line 21

def initialize(domain)
    super
    @version = 'v1'
    @commands = nil
    @rate_plans = nil
    @sims = nil
    @usage_records = 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:



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

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:



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

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



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

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

#usage_recordsTwilio::REST::Wireless::V1::UsageRecordList



74
75
76
# File 'lib/twilio-ruby/rest/wireless/v1.rb', line 74

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