Class: Twilio::REST::Wireless::V1::SimContext::DataSessionInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the DataSessionInstance

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 DataSession resource.

  • sid (String)

    The SID of the Call resource to fetch.



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 261

def initialize(version, payload , sim_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'sim_sid' => payload['sim_sid'],
        'account_sid' => payload['account_sid'],
        'radio_link' => payload['radio_link'],
        'operator_mcc' => payload['operator_mcc'],
        'operator_mnc' => payload['operator_mnc'],
        'operator_country' => payload['operator_country'],
        'operator_name' => payload['operator_name'],
        'cell_id' => payload['cell_id'],
        'cell_location_estimate' => payload['cell_location_estimate'],
        'packets_uploaded' => payload['packets_uploaded'] == nil ? payload['packets_uploaded'] : payload['packets_uploaded'].to_i,
        'packets_downloaded' => payload['packets_downloaded'] == nil ? payload['packets_downloaded'] : payload['packets_downloaded'].to_i,
        'last_updated' => Twilio.deserialize_iso8601_datetime(payload['last_updated']),
        'start' => Twilio.deserialize_iso8601_datetime(payload['start']),
        '_end' => Twilio.deserialize_iso8601_datetime(payload['_end']),
        'imei' => payload['imei'],
    }
end

Instance Method Details

#_endTime

Returns The date that the record ended, given as GMT in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.

Returns:



373
374
375
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 373

def _end
    @properties['_end']
end

#account_sidString

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

Returns:



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

def 
    @properties['account_sid']
end

#cell_idString

Returns The unique ID of the cellular tower that the device was attached to at the moment when the Data Session was last updated.

Returns:

  • (String)

    The unique ID of the cellular tower that the device was attached to at the moment when the Data Session was last updated.



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

def cell_id
    @properties['cell_id']
end

#cell_location_estimateHash

Returns An object that describes the estimated location in latitude and longitude where the device’s Data Session took place. The location is derived from the ‘cell_id` when the Data Session was last updated. See [Cell Location Estimate Object](www.twilio.com/docs/iot/wireless/api/datasession-resource#cell-location-estimate-object).

Returns:



343
344
345
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 343

def cell_location_estimate
    @properties['cell_location_estimate']
end

#imeiString

Returns The ‘international mobile equipment identity’ is the unique ID of the device using the SIM to connect. An IMEI is a 15-digit string: 14 digits for the device identifier plus a check digit calculated using the Luhn formula.

Returns:

  • (String)

    The ‘international mobile equipment identity’ is the unique ID of the device using the SIM to connect. An IMEI is a 15-digit string: 14 digits for the device identifier plus a check digit calculated using the Luhn formula.



379
380
381
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 379

def imei
    @properties['imei']
end

#inspectObject

Provide a detailed, user friendly representation



391
392
393
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 391

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

#last_updatedTime

Returns The date that the resource was last updated, given as GMT in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.

Returns:



361
362
363
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 361

def last_updated
    @properties['last_updated']
end

#operator_countryString

Returns The three letter country code representing where the device’s Data Session took place. This is determined by looking up the ‘operator_mcc`.

Returns:

  • (String)

    The three letter country code representing where the device’s Data Session took place. This is determined by looking up the ‘operator_mcc`.



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

def operator_country
    @properties['operator_country']
end

#operator_mccString

Returns The ‘mobile country code’ is the unique ID of the home country where the Data Session took place. See: [MCC/MNC lookup](mcc-mnc.com/).

Returns:

  • (String)

    The ‘mobile country code’ is the unique ID of the home country where the Data Session took place. See: [MCC/MNC lookup](mcc-mnc.com/).



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

def operator_mcc
    @properties['operator_mcc']
end

#operator_mncString

Returns The ‘mobile network code’ is the unique ID specific to the mobile operator network where the Data Session took place.

Returns:

  • (String)

    The ‘mobile network code’ is the unique ID specific to the mobile operator network where the Data Session took place.



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

def operator_mnc
    @properties['operator_mnc']
end

#operator_nameString

Returns The friendly name of the mobile operator network that the [SIM](www.twilio.com/docs/iot/wireless/api/sim-resource)-connected device is attached to. This is determined by looking up the ‘operator_mnc`.

Returns:



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

def operator_name
    @properties['operator_name']
end

#packets_downloadedString

Returns The number of packets downloaded by the device between the ‘start` time and when the Data Session was last updated.

Returns:

  • (String)

    The number of packets downloaded by the device between the ‘start` time and when the Data Session was last updated.



355
356
357
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 355

def packets_downloaded
    @properties['packets_downloaded']
end

#packets_uploadedString

Returns The number of packets uploaded by the device between the ‘start` time and when the Data Session was last updated.

Returns:

  • (String)

    The number of packets uploaded by the device between the ‘start` time and when the Data Session was last updated.



349
350
351
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 349

def packets_uploaded
    @properties['packets_uploaded']
end

Returns The generation of wireless technology that the device was using.

Returns:

  • (String)

    The generation of wireless technology that the device was using.



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

def radio_link
    @properties['radio_link']
end

#sidString

Returns The unique string that we created to identify the DataSession resource.

Returns:

  • (String)

    The unique string that we created to identify the DataSession resource.



289
290
291
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 289

def sid
    @properties['sid']
end

#sim_sidString

Returns The SID of the [Sim resource](www.twilio.com/docs/iot/wireless/api/sim-resource) that the Data Session is for.

Returns:



295
296
297
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 295

def sim_sid
    @properties['sim_sid']
end

#startTime

Returns The date that the Data Session started, given as GMT in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.

Returns:



367
368
369
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 367

def start
    @properties['start']
end

#to_sObject

Provide a user friendly representation



385
386
387
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 385

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