Class: Twilio::REST::Supersim::V1::UsageRecordInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/supersim/v1/usage_record.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ UsageRecordInstance

Initialize the UsageRecordInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio


252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 252

def initialize(version, payload)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'sim_sid' => payload['sim_sid'],
      'network_sid' => payload['network_sid'],
      'fleet_sid' => payload['fleet_sid'],
      'iso_country' => payload['iso_country'],
      'period' => payload['period'],
      'data_upload' => payload['data_upload'].to_i,
      'data_download' => payload['data_download'].to_i,
      'data_total' => payload['data_total'].to_i,
      'data_total_billed' => payload['data_total_billed'].to_f,
      'billed_unit' => payload['billed_unit'],
  }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that incurred the usage.

Returns:

  • (String)

    The SID of the Account that incurred the usage.


273
274
275
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 273

def 
  @properties['account_sid']
end

#billed_unitString

Returns The currency in which the billed amounts are measured, specified in the 3 letter ISO 4127 format (e.g. `USD`, `EUR`, `JPY`).

Returns:

  • (String)

    The currency in which the billed amounts are measured, specified in the 3 letter ISO 4127 format (e.g. `USD`, `EUR`, `JPY`).


333
334
335
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 333

def billed_unit
  @properties['billed_unit']
end

#data_downloadString

Returns Total data downloaded in bytes, aggregated by the query parameters.

Returns:

  • (String)

    Total data downloaded in bytes, aggregated by the query parameters.


315
316
317
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 315

def data_download
  @properties['data_download']
end

#data_totalString

Returns Total of data_upload and data_download.

Returns:

  • (String)

    Total of data_upload and data_download.


321
322
323
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 321

def data_total
  @properties['data_total']
end

#data_total_billedString

Returns Total amount in the `billed_unit` that was charged for the data uploaded or downloaded.

Returns:

  • (String)

    Total amount in the `billed_unit` that was charged for the data uploaded or downloaded.


327
328
329
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 327

def data_total_billed
  @properties['data_total_billed']
end

#data_uploadString

Returns Total data uploaded in bytes, aggregated by the query parameters.

Returns:

  • (String)

    Total data uploaded in bytes, aggregated by the query parameters.


309
310
311
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 309

def data_upload
  @properties['data_upload']
end

#fleet_sidString

Returns SID of the Fleet resource on which the usage occurred.

Returns:

  • (String)

    SID of the Fleet resource on which the usage occurred.


291
292
293
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 291

def fleet_sid
  @properties['fleet_sid']
end

#inspectObject

Provide a detailed, user friendly representation


345
346
347
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 345

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

#iso_countryString

Returns Alpha-2 ISO Country Code of the country the usage occurred in.

Returns:

  • (String)

    Alpha-2 ISO Country Code of the country the usage occurred in.


297
298
299
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 297

def iso_country
  @properties['iso_country']
end

#network_sidString

Returns SID of the Network resource on which the usage occurred.

Returns:

  • (String)

    SID of the Network resource on which the usage occurred.


285
286
287
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 285

def network_sid
  @properties['network_sid']
end

#periodHash

Returns The time period for which the usage is reported.

Returns:

  • (Hash)

    The time period for which the usage is reported.


303
304
305
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 303

def period
  @properties['period']
end

#sim_sidString

Returns SID of a Sim resource to which the UsageRecord belongs.

Returns:

  • (String)

    SID of a Sim resource to which the UsageRecord belongs.


279
280
281
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 279

def sim_sid
  @properties['sim_sid']
end

#to_sObject

Provide a user friendly representation


339
340
341
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 339

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