Class: Twilio::REST::Preview::Wireless::SimContext::UsageContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::Wireless::SimContext::UsageContext
- Defined in:
- lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
Instance Method Summary collapse
-
#fetch(end_: :unset, start: :unset) ⇒ UsageInstance
Fetch the UsageInstance.
-
#initialize(version, sim_sid) ⇒ UsageContext
constructor
Initialize the UsageContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sim_sid) ⇒ UsageContext
Initialize the UsageContext
51 52 53 54 55 56 57 58 59 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 51 def initialize(version, sim_sid) super(version) # Path Solution @solution = { sim_sid: sim_sid, } @uri = "/Sims/#{@solution[:sim_sid]}/Usage" end |
Instance Method Details
#fetch(end_: :unset, start: :unset) ⇒ UsageInstance
Fetch the UsageInstance
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 65 def fetch( end_: :unset, start: :unset ) params = Twilio::Values.of({ 'End' => end_, 'Start' => start, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, params: params, headers: headers) UsageInstance.new( @version, payload, sim_sid: @solution[:sim_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
98 99 100 101 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 98 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Wireless.UsageContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
91 92 93 94 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 91 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Wireless.UsageContext #{context}>" end |