Class: Twilio::REST::Wireless::V1::SimContext::DataSessionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Wireless::V1::SimContext::DataSessionInstance
- Defined in:
- lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb
Instance Method Summary collapse
-
#_end ⇒ Time
The date that the record ended, given as GMT in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the DataSession resource.
-
#cell_id ⇒ String
The unique ID of the cellular tower that the device was attached to at the moment when the Data Session was last updated.
-
#cell_location_estimate ⇒ Hash
An object that describes the estimated location in latitude and longitude where the device’s Data Session took place.
-
#imei ⇒ String
The ‘international mobile equipment identity’ is the unique ID of the device using the SIM to connect.
-
#initialize(version, payload, sim_sid: nil) ⇒ DataSessionInstance
constructor
Initialize the DataSessionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#last_updated ⇒ Time
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.
-
#operator_country ⇒ String
The three letter country code representing where the device’s Data Session took place.
-
#operator_mcc ⇒ String
The ‘mobile country code’ is the unique ID of the home country where the Data Session took place.
-
#operator_mnc ⇒ String
The ‘mobile network code’ is the unique ID specific to the mobile operator network where the Data Session took place.
-
#operator_name ⇒ String
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.
-
#packets_downloaded ⇒ String
The number of packets downloaded by the device between the ‘start` time and when the Data Session was last updated.
-
#packets_uploaded ⇒ String
The number of packets uploaded by the device between the ‘start` time and when the Data Session was last updated.
-
#radio_link ⇒ String
The generation of wireless technology that the device was using.
-
#sid ⇒ String
The unique string that we created to identify the DataSession resource.
-
#sim_sid ⇒ String
The SID of the [Sim resource](www.twilio.com/docs/iot/wireless/api/sim-resource) that the Data Session is for.
-
#start ⇒ Time
The date that the Data Session started, given as GMT in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, payload, sim_sid: nil) ⇒ DataSessionInstance
Initialize the DataSessionInstance
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'] == 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
#_end ⇒ Time
Returns The date that the record ended, given as GMT in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.
280 281 282 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 280 def _end @properties['_end'] end |
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the DataSession resource.
208 209 210 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 208 def account_sid @properties['account_sid'] end |
#cell_id ⇒ String
Returns The unique ID of the cellular tower that the device was attached to at the moment when the Data Session was last updated.
244 245 246 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 244 def cell_id @properties['cell_id'] end |
#cell_location_estimate ⇒ Hash
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).
250 251 252 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 250 def cell_location_estimate @properties['cell_location_estimate'] end |
#imei ⇒ String
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.
286 287 288 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 286 def imei @properties['imei'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
298 299 300 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 298 def inspect "<Twilio.Wireless.V1.DataSessionInstance>" end |
#last_updated ⇒ Time
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.
268 269 270 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 268 def last_updated @properties['last_updated'] end |
#operator_country ⇒ String
Returns The three letter country code representing where the device’s Data Session took place. This is determined by looking up the ‘operator_mcc`.
232 233 234 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 232 def operator_country @properties['operator_country'] end |
#operator_mcc ⇒ String
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/).
220 221 222 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 220 def operator_mcc @properties['operator_mcc'] end |
#operator_mnc ⇒ String
Returns The ‘mobile network code’ is the unique ID specific to the mobile operator network where the Data Session took place.
226 227 228 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 226 def operator_mnc @properties['operator_mnc'] end |
#operator_name ⇒ String
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`.
238 239 240 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 238 def operator_name @properties['operator_name'] end |
#packets_downloaded ⇒ String
Returns The number of packets downloaded by the device between the ‘start` time and when the Data Session was last updated.
262 263 264 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 262 def packets_downloaded @properties['packets_downloaded'] end |
#packets_uploaded ⇒ String
Returns The number of packets uploaded by the device between the ‘start` time and when the Data Session was last updated.
256 257 258 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 256 def packets_uploaded @properties['packets_uploaded'] end |
#radio_link ⇒ String
Returns The generation of wireless technology that the device was using.
214 215 216 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 214 def radio_link @properties['radio_link'] end |
#sid ⇒ String
Returns The unique string that we created to identify the DataSession resource.
196 197 198 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 196 def sid @properties['sid'] end |
#sim_sid ⇒ String
Returns The SID of the [Sim resource](www.twilio.com/docs/iot/wireless/api/sim-resource) that the Data Session is for.
202 203 204 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 202 def sim_sid @properties['sim_sid'] end |
#start ⇒ Time
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.
274 275 276 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 274 def start @properties['start'] end |
#to_s ⇒ Object
Provide a user friendly representation
292 293 294 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb', line 292 def to_s "<Twilio.Wireless.V1.DataSessionInstance>" end |