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

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

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

  • account_sid (String)

    The SID of the Account that created this UsageRecord resource.

  • sid (String)

    The SID of the Call resource to fetch.



220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 220

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'],
        'data_download' => payload['data_download'],
        'data_total' => payload['data_total'],
        'data_total_billed' => payload['data_total_billed'],
        'billed_unit' => payload['billed_unit'],
    }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that incurred the usage.

Returns:



242
243
244
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 242

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`). This can be null when data_toal_billed is 0 and we do not yet have billing information for the corresponding data usage. Refer to [Data Usage Processing](www.twilio.com/docs/iot/supersim/api/usage-record-resource#data-usage-processing) for more details.

Returns:



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

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.



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

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.



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

def data_total
    @properties['data_total']
end

#data_total_billedFloat

Returns Total amount in the ‘billed_unit` that was charged for the data uploaded or downloaded. Will return 0 for usage prior to February 1, 2022. Value may be 0 despite `data_total` being greater than 0 if the data usage is still being processed by Twilio’s billing system. Refer to [Data Usage Processing](www.twilio.com/docs/iot/supersim/api/usage-record-resource#data-usage-processing) for more details.

Returns:

  • (Float)

    Total amount in the ‘billed_unit` that was charged for the data uploaded or downloaded. Will return 0 for usage prior to February 1, 2022. Value may be 0 despite `data_total` being greater than 0 if the data usage is still being processed by Twilio’s billing system. Refer to [Data Usage Processing](www.twilio.com/docs/iot/supersim/api/usage-record-resource#data-usage-processing) for more details.



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

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.



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

def data_upload
    @properties['data_upload']
end

#fleet_sidString

Returns SID of the Fleet resource the usage occurred on. Value will only be present when either a value for the ‘Fleet` query parameter is provided or when UsageRecords are grouped by `fleet`. Otherwise, the value will be `null`.

Returns:

  • (String)

    SID of the Fleet resource the usage occurred on. Value will only be present when either a value for the ‘Fleet` query parameter is provided or when UsageRecords are grouped by `fleet`. Otherwise, the value will be `null`.



260
261
262
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 260

def fleet_sid
    @properties['fleet_sid']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#iso_countryString

Returns Alpha-2 ISO Country Code that the usage occurred in. Value will only be present when either a value for the ‘IsoCountry` query parameter is provided or when UsageRecords are grouped by `isoCountry`. Otherwise, the value will be `null`.

Returns:

  • (String)

    Alpha-2 ISO Country Code that the usage occurred in. Value will only be present when either a value for the ‘IsoCountry` query parameter is provided or when UsageRecords are grouped by `isoCountry`. Otherwise, the value will be `null`.



266
267
268
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 266

def iso_country
    @properties['iso_country']
end

#network_sidString

Returns SID of the Network resource the usage occurred on. Value will only be present when either a value for the ‘Network` query parameter is provided or when UsageRecords are grouped by `network`. Otherwise, the value will be `null`.

Returns:

  • (String)

    SID of the Network resource the usage occurred on. Value will only be present when either a value for the ‘Network` query parameter is provided or when UsageRecords are grouped by `network`. Otherwise, the value will be `null`.



254
255
256
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 254

def network_sid
    @properties['network_sid']
end

#periodHash

Returns The time period for which the usage is reported. The period is represented as a pair of ‘start_time` and `end_time` timestamps specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:

  • (Hash)

    The time period for which the usage is reported. The period is represented as a pair of ‘start_time` and `end_time` timestamps specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.



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

def period
    @properties['period']
end

#sim_sidString

Returns SID of a Sim resource to which the UsageRecord belongs. Value will only be present when either a value for the ‘Sim` query parameter is provided or when UsageRecords are grouped by `sim`. Otherwise, the value will be `null`.

Returns:

  • (String)

    SID of a Sim resource to which the UsageRecord belongs. Value will only be present when either a value for the ‘Sim` query parameter is provided or when UsageRecords are grouped by `sim`. Otherwise, the value will be `null`.



248
249
250
# File 'lib/twilio-ruby/rest/supersim/v1/usage_record.rb', line 248

def sim_sid
    @properties['sim_sid']
end

#to_sObject

Provide a user friendly representation



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

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