Class: Twilio::REST::Preview::Wireless::SimContext::UsageInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::Wireless::SimContext::UsageInstance
- Defined in:
- lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
Instance Method Summary collapse
- #account_sid ⇒ String
- #commands_costs ⇒ Hash
- #commands_usage ⇒ Hash
-
#context ⇒ UsageContext
Generate an instance context for the instance, the context is capable of performing various actions.
- #data_costs ⇒ Hash
- #data_usage ⇒ Hash
-
#fetch(end_: :unset, start: :unset) ⇒ UsageInstance
Fetch the UsageInstance.
-
#initialize(version, payload, sim_sid: nil) ⇒ UsageInstance
constructor
Initialize the UsageInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #period ⇒ Hash
- #sim_sid ⇒ String
- #sim_unique_name ⇒ String
-
#to_s ⇒ Object
Provide a user friendly representation.
- #url ⇒ String
Constructor Details
#initialize(version, payload, sim_sid: nil) ⇒ UsageInstance
Initialize the UsageInstance
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 142 def initialize(version, payload , sim_sid: nil) super(version) # Marshaled Properties @properties = { 'sim_sid' => payload['sim_sid'], 'sim_unique_name' => payload['sim_unique_name'], 'account_sid' => payload['account_sid'], 'period' => payload['period'], 'commands_usage' => payload['commands_usage'], 'commands_costs' => payload['commands_costs'], 'data_usage' => payload['data_usage'], 'data_costs' => payload['data_costs'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'sim_sid' => sim_sid || @properties['sim_sid'] , } end |
Instance Method Details
#account_sid ⇒ String
188 189 190 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 188 def account_sid @properties['account_sid'] end |
#commands_costs ⇒ Hash
206 207 208 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 206 def commands_costs @properties['commands_costs'] end |
#commands_usage ⇒ Hash
200 201 202 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 200 def commands_usage @properties['commands_usage'] end |
#context ⇒ UsageContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
167 168 169 170 171 172 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 167 def context unless @instance_context @instance_context = UsageContext.new(@version , @params['sim_sid']) end @instance_context end |
#data_costs ⇒ Hash
218 219 220 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 218 def data_costs @properties['data_costs'] end |
#data_usage ⇒ Hash
212 213 214 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 212 def data_usage @properties['data_usage'] end |
#fetch(end_: :unset, start: :unset) ⇒ UsageInstance
Fetch the UsageInstance
233 234 235 236 237 238 239 240 241 242 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 233 def fetch( end_: :unset, start: :unset ) context.fetch( end_: end_, start: start, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
253 254 255 256 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 253 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Wireless.UsageInstance #{values}>" end |
#period ⇒ Hash
194 195 196 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 194 def period @properties['period'] end |
#sim_sid ⇒ String
176 177 178 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 176 def sim_sid @properties['sim_sid'] end |
#sim_unique_name ⇒ String
182 183 184 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 182 def sim_unique_name @properties['sim_unique_name'] end |
#to_s ⇒ Object
Provide a user friendly representation
246 247 248 249 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 246 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Wireless.UsageInstance #{values}>" end |
#url ⇒ String
224 225 226 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 224 def url @properties['url'] end |