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
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#account_sid ⇒ String
The account_sid.
-
#commands_costs ⇒ Hash
The commands_costs.
-
#commands_usage ⇒ Hash
The commands_usage.
-
#context ⇒ UsageContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#data_costs ⇒ Hash
The data_costs.
-
#data_usage ⇒ Hash
The data_usage.
-
#fetch(end_: :unset, start: :unset) ⇒ UsageInstance
Fetch a UsageInstance.
-
#initialize(version, payload, sim_sid: nil) ⇒ UsageInstance
constructor
Initialize the UsageInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#period ⇒ Hash
The period.
-
#sim_sid ⇒ String
The sim_sid.
-
#sim_unique_name ⇒ String
The sim_unique_name.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, sim_sid: nil) ⇒ UsageInstance
Initialize the UsageInstance
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 130 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, } end |
Instance Method Details
#account_sid ⇒ String
Returns The account_sid.
181 182 183 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 181 def account_sid @properties['account_sid'] end |
#commands_costs ⇒ Hash
Returns The commands_costs.
199 200 201 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 199 def commands_costs @properties['commands_costs'] end |
#commands_usage ⇒ Hash
Returns The commands_usage.
193 194 195 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 193 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
157 158 159 160 161 162 163 164 165 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 157 def context unless @instance_context @instance_context = UsageContext.new( @version, @params['sim_sid'], ) end @instance_context end |
#data_costs ⇒ Hash
Returns The data_costs.
211 212 213 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 211 def data_costs @properties['data_costs'] end |
#data_usage ⇒ Hash
Returns The data_usage.
205 206 207 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 205 def data_usage @properties['data_usage'] end |
#fetch(end_: :unset, start: :unset) ⇒ UsageInstance
Fetch a UsageInstance
226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 226 def fetch(end_: :unset, start: :unset) context.fetch( end_: end_, start: start, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
242 243 244 245 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 242 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Wireless.UsageInstance #{values}>" end |
#period ⇒ Hash
Returns The period.
187 188 189 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 187 def period @properties['period'] end |
#sim_sid ⇒ String
Returns The sim_sid.
169 170 171 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 169 def sim_sid @properties['sim_sid'] end |
#sim_unique_name ⇒ String
Returns The sim_unique_name.
175 176 177 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 175 def sim_unique_name @properties['sim_unique_name'] end |
#to_s ⇒ Object
Provide a user friendly representation
235 236 237 238 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 235 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Wireless.UsageInstance #{values}>" end |
#url ⇒ String
Returns The url.
217 218 219 |
# File 'lib/twilio-ruby/rest/preview/wireless/sim/usage.rb', line 217 def url @properties['url'] end |