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

  • sim_sid (String) (defaults to: nil)

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



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 169

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'].to_i,
      '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

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



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

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



243
244
245
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 243

def cell_id
  @properties['cell_id']
end

#cell_location_estimateHash

Returns An object with the estimated location where the device’s Data Session took place.

Returns:

  • (Hash)

    An object with the estimated location where the device’s Data Session took place



249
250
251
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 249

def cell_location_estimate
  @properties['cell_location_estimate']
end

#end_Time

Returns The date that the record ended, given as GMT in ISO 8601 format.

Returns:

  • (Time)

    The date that the record ended, given as GMT in ISO 8601 format



279
280
281
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 279

def end_
  @properties['end_']
end

#imeiString

Returns The unique ID of the device using the SIM to connect.

Returns:

  • (String)

    The unique ID of the device using the SIM to connect



285
286
287
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 285

def imei
  @properties['imei']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#last_updatedTime

Returns The date that the resource was last updated, given as GMT in ISO 8601 format.

Returns:

  • (Time)

    The date that the resource was last updated, given as GMT in ISO 8601 format



267
268
269
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 267

def last_updated
  @properties['last_updated']
end

#operator_countryString

Returns The three letter country code representing where the device’s Data Session took place.

Returns:

  • (String)

    The three letter country code representing where the device’s Data Session took place



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

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.

Returns:

  • (String)

    The ‘mobile country code’ is the unique ID of the home country where the Data Session took place



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

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



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

def operator_mnc
  @properties['operator_mnc']
end

#operator_nameString

Returns The friendly name of the mobile operator network that the SIM-connected device is attached to.

Returns:

  • (String)

    The friendly name of the mobile operator network that the SIM-connected device is attached to



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

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



261
262
263
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 261

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



255
256
257
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 255

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



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

def radio_link
  @properties['radio_link']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource



195
196
197
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 195

def sid
  @properties['sid']
end

#sim_sidString

Returns The SID of the Sim resource that the Data Session is for.

Returns:

  • (String)

    The SID of the Sim resource that the Data Session is for



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

def sim_sid
  @properties['sim_sid']
end

#startTime

Returns The date that the Data Session started, given as GMT in ISO 8601 format.

Returns:

  • (Time)

    The date that the Data Session started, given as GMT in ISO 8601 format



273
274
275
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 273

def start
  @properties['start']
end

#to_sObject

Provide a user friendly representation



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

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