Class: Twilio::REST::Wireless::V1::SimContext::UsageRecordInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sim_sid: nil) ⇒ UsageRecordInstance

Initialize the UsageRecordInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • sim_sid (String) (defaults to: nil)

    The unique id of the [SIM](www.twilio.com/docs/api/wireless/rest-api/sim) resource that this Usage Record is for.



187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 187

def initialize(version, payload, sim_sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sim_sid' => payload['sim_sid'],
      'account_sid' => payload['account_sid'],
      'period' => payload['period'],
      'commands' => payload['commands'],
      'data' => payload['data'],
  }
end

Instance Method Details

#account_sidString

Returns The unique id of the Account that the SIM belongs to.

Returns:

  • (String)

    The unique id of the Account that the SIM belongs to.



208
209
210
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 208

def 
  @properties['account_sid']
end

#commandsHash

Returns An object representing the Commands usage for the SIM over the period.

Returns:

  • (Hash)

    An object representing the Commands usage for the SIM over the period.



220
221
222
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 220

def commands
  @properties['commands']
end

#dataHash

Returns An object representing the Data usage for the SIM over the period.

Returns:

  • (Hash)

    An object representing the Data usage for the SIM over the period.



226
227
228
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 226

def data
  @properties['data']
end

#inspectObject

Provide a detailed, user friendly representation



238
239
240
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 238

def inspect
  "<Twilio.Wireless.V1.UsageRecordInstance>"
end

#periodHash

Returns The time period for which usage is reported.

Returns:

  • (Hash)

    The time period for which usage is reported.



214
215
216
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 214

def period
  @properties['period']
end

#sim_sidString

Returns The unique id of the SIM resource that this Usage Record is for.

Returns:

  • (String)

    The unique id of the SIM resource that this Usage Record is for.



202
203
204
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 202

def sim_sid
  @properties['sim_sid']
end

#to_sObject

Provide a user friendly representation



232
233
234
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 232

def to_s
  "<Twilio.Wireless.V1.UsageRecordInstance>"
end