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

  • account_sid (String)

    The SID of the Account that created this UsageRecord resource.

  • sid (String)

    The SID of the Call resource to fetch.



285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 285

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 SID of the Account that created the UsageRecord resource.

Returns:

  • (String)

    The SID of the Account that created the UsageRecord resource.



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

def 
    @properties['account_sid']
end

#commandsHash

Returns An object that describes the SIM's usage of Commands during the specified period. See Commands Usage Object.

Returns:

  • (Hash)

    An object that describes the SIM's usage of Commands during the specified period. See Commands Usage Object.



320
321
322
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 320

def commands
    @properties['commands']
end

#dataHash

Returns An object that describes the SIM's data usage during the specified period. See Data Usage Object.

Returns:

  • (Hash)

    An object that describes the SIM's data usage during the specified period. See Data Usage Object.



326
327
328
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 326

def data
    @properties['data']
end

#inspectObject

Provide a detailed, user friendly representation



338
339
340
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 338

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

#periodHash

Returns The time period for which the usage is reported. Contains start and end datetime values given as GMT in ISO 8601 format.

Returns:

  • (Hash)

    The time period for which the usage is reported. Contains start and end datetime values given as GMT in ISO 8601 format.



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

def period
    @properties['period']
end

#sim_sidString

Returns The SID of the Sim resource that this Usage Record is for.

Returns:

  • (String)

    The SID of the Sim resource that this Usage Record is for.



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

def sim_sid
    @properties['sim_sid']
end

#to_sObject

Provide a user friendly representation



332
333
334
# File 'lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb', line 332

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