Class: OpenapiClient::DeviceNetworks
- Inherits:
-
Object
- Object
- OpenapiClient::DeviceNetworks
- Defined in:
- lib/openapi_client/models/device_networks.rb
Overview
Network information.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#bssid ⇒ Object
The Wi-Fi networks Basic Service Set Identifier (BSSID).
-
#carrier_name ⇒ Object
The network carrier name.
-
#cell_id ⇒ Object
The Cell ID (CID) is identifier for a specific Base Transceiver Station (BTS) within a specific Location Area Code (LAC).
-
#ip ⇒ Object
The IPv4 or IPv6 address of the device if the network assigned one.
-
#location_area_code ⇒ Object
The Location Area Code (LAC) is a 16-bit identifier for a region that is covered by a set of network antennas.
-
#mac ⇒ Object
The MAC address of the device that is connected to the Wi-Fi network.
-
#mobile_country_code ⇒ Object
The Mobile Country Code (MCC) as described in the ITUs E.212 specification.
-
#mobile_network_code ⇒ Object
The Mobile Network Code (MNC) as described in the ITUs E.212 specification.
-
#network_type ⇒ Object
Defines the type of network associated with the device.
-
#phone_number ⇒ Object
The devices primary phone number.
-
#ssid ⇒ Object
The Wi-Fi networks Service Set Identifier (SSID).
-
#standard ⇒ Object
An identifier of the network standard used.
-
#subscription_identification_number ⇒ Object
The Mobile Subscription Identification Number code (MSIN) as described in the ITUs E.212 specification.
-
#user_defined ⇒ Object
A JSON object that can carry any additional information about the network that might be helpful for fraud detection.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ DeviceNetworks
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ DeviceNetworks
Initializes the object
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/openapi_client/models/device_networks.rb', line 124 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'networkType') self.network_type = attributes[:'networkType'] end if attributes.has_key?(:'ip') self.ip = attributes[:'ip'] end if attributes.has_key?(:'phoneNumber') self.phone_number = attributes[:'phoneNumber'] end if attributes.has_key?(:'carrierName') self.carrier_name = attributes[:'carrierName'] end if attributes.has_key?(:'mobileCountryCode') self.mobile_country_code = attributes[:'mobileCountryCode'] end if attributes.has_key?(:'mobileNetworkCode') self.mobile_network_code = attributes[:'mobileNetworkCode'] end if attributes.has_key?(:'subscriptionIdentificationNumber') self.subscription_identification_number = attributes[:'subscriptionIdentificationNumber'] end if attributes.has_key?(:'locationAreaCode') self.location_area_code = attributes[:'locationAreaCode'] end if attributes.has_key?(:'cellId') self.cell_id = attributes[:'cellId'] end if attributes.has_key?(:'standard') self.standard = attributes[:'standard'] end if attributes.has_key?(:'mac') self.mac = attributes[:'mac'] end if attributes.has_key?(:'ssid') self.ssid = attributes[:'ssid'] end if attributes.has_key?(:'bssid') self.bssid = attributes[:'bssid'] end if attributes.has_key?(:'userDefined') self.user_defined = attributes[:'userDefined'] end end |
Instance Attribute Details
#bssid ⇒ Object
The Wi-Fi networks Basic Service Set Identifier (BSSID).
55 56 57 |
# File 'lib/openapi_client/models/device_networks.rb', line 55 def bssid @bssid end |
#carrier_name ⇒ Object
The network carrier name.
28 29 30 |
# File 'lib/openapi_client/models/device_networks.rb', line 28 def carrier_name @carrier_name end |
#cell_id ⇒ Object
The Cell ID (CID) is identifier for a specific Base Transceiver Station (BTS) within a specific Location Area Code (LAC).
43 44 45 |
# File 'lib/openapi_client/models/device_networks.rb', line 43 def cell_id @cell_id end |
#ip ⇒ Object
The IPv4 or IPv6 address of the device if the network assigned one.
22 23 24 |
# File 'lib/openapi_client/models/device_networks.rb', line 22 def ip @ip end |
#location_area_code ⇒ Object
The Location Area Code (LAC) is a 16-bit identifier for a region that is covered by a set of network antennas.
40 41 42 |
# File 'lib/openapi_client/models/device_networks.rb', line 40 def location_area_code @location_area_code end |
#mac ⇒ Object
The MAC address of the device that is connected to the Wi-Fi network.
49 50 51 |
# File 'lib/openapi_client/models/device_networks.rb', line 49 def mac @mac end |
#mobile_country_code ⇒ Object
The Mobile Country Code (MCC) as described in the ITUs E.212 specification.
31 32 33 |
# File 'lib/openapi_client/models/device_networks.rb', line 31 def mobile_country_code @mobile_country_code end |
#mobile_network_code ⇒ Object
The Mobile Network Code (MNC) as described in the ITUs E.212 specification.
34 35 36 |
# File 'lib/openapi_client/models/device_networks.rb', line 34 def mobile_network_code @mobile_network_code end |
#network_type ⇒ Object
Defines the type of network associated with the device.
19 20 21 |
# File 'lib/openapi_client/models/device_networks.rb', line 19 def network_type @network_type end |
#phone_number ⇒ Object
The devices primary phone number. This value should be supplied directly without any transformation (e.g. removal of spaces, hyphens or parentheses). If this data is available in segregated fields, it should be concatenated using a blank space (" ") as a separator.
25 26 27 |
# File 'lib/openapi_client/models/device_networks.rb', line 25 def phone_number @phone_number end |
#ssid ⇒ Object
The Wi-Fi networks Service Set Identifier (SSID).
52 53 54 |
# File 'lib/openapi_client/models/device_networks.rb', line 52 def ssid @ssid end |
#standard ⇒ Object
An identifier of the network standard used.
46 47 48 |
# File 'lib/openapi_client/models/device_networks.rb', line 46 def standard @standard end |
#subscription_identification_number ⇒ Object
The Mobile Subscription Identification Number code (MSIN) as described in the ITUs E.212 specification.
37 38 39 |
# File 'lib/openapi_client/models/device_networks.rb', line 37 def subscription_identification_number @subscription_identification_number end |
#user_defined ⇒ Object
A JSON object that can carry any additional information about the network that might be helpful for fraud detection.
58 59 60 |
# File 'lib/openapi_client/models/device_networks.rb', line 58 def user_defined @user_defined end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/openapi_client/models/device_networks.rb', line 83 def self.attribute_map { :'network_type' => :'networkType', :'ip' => :'ip', :'phone_number' => :'phoneNumber', :'carrier_name' => :'carrierName', :'mobile_country_code' => :'mobileCountryCode', :'mobile_network_code' => :'mobileNetworkCode', :'subscription_identification_number' => :'subscriptionIdentificationNumber', :'location_area_code' => :'locationAreaCode', :'cell_id' => :'cellId', :'standard' => :'standard', :'mac' => :'mac', :'ssid' => :'ssid', :'bssid' => :'bssid', :'user_defined' => :'userDefined' } end |
.openapi_types ⇒ Object
Attribute type mapping.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/openapi_client/models/device_networks.rb', line 103 def self.openapi_types { :'network_type' => :'String', :'ip' => :'String', :'phone_number' => :'String', :'carrier_name' => :'String', :'mobile_country_code' => :'String', :'mobile_network_code' => :'String', :'subscription_identification_number' => :'String', :'location_area_code' => :'String', :'cell_id' => :'String', :'standard' => :'String', :'mac' => :'String', :'ssid' => :'String', :'bssid' => :'String', :'user_defined' => :'Object' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/openapi_client/models/device_networks.rb', line 219 def ==(o) return true if self.equal?(o) self.class == o.class && network_type == o.network_type && ip == o.ip && phone_number == o.phone_number && carrier_name == o.carrier_name && mobile_country_code == o.mobile_country_code && mobile_network_code == o.mobile_network_code && subscription_identification_number == o.subscription_identification_number && location_area_code == o.location_area_code && cell_id == o.cell_id && standard == o.standard && mac == o.mac && ssid == o.ssid && bssid == o.bssid && user_defined == o.user_defined end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 |
# File 'lib/openapi_client/models/device_networks.rb', line 274 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = OpenapiClient.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/openapi_client/models/device_networks.rb', line 340 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/openapi_client/models/device_networks.rb', line 253 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
240 241 242 |
# File 'lib/openapi_client/models/device_networks.rb', line 240 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
246 247 248 |
# File 'lib/openapi_client/models/device_networks.rb', line 246 def hash [network_type, ip, phone_number, carrier_name, mobile_country_code, mobile_network_code, subscription_identification_number, location_area_code, cell_id, standard, mac, ssid, bssid, user_defined].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
189 190 191 192 193 194 195 196 |
# File 'lib/openapi_client/models/device_networks.rb', line 189 def list_invalid_properties invalid_properties = Array.new if @network_type.nil? invalid_properties.push('invalid value for "network_type", network_type cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
320 321 322 |
# File 'lib/openapi_client/models/device_networks.rb', line 320 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
326 327 328 329 330 331 332 333 334 |
# File 'lib/openapi_client/models/device_networks.rb', line 326 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
314 315 316 |
# File 'lib/openapi_client/models/device_networks.rb', line 314 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
200 201 202 203 204 205 |
# File 'lib/openapi_client/models/device_networks.rb', line 200 def valid? return false if @network_type.nil? network_type_validator = EnumAttributeValidator.new('String', ['network/mobile', 'network/wifi']) return false unless network_type_validator.valid?(@network_type) true end |