Class: MParticle::DeviceInformation
- Inherits:
-
Object
- Object
- MParticle::DeviceInformation
- Defined in:
- lib/mparticle/models/device_information.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#android_advertising_id ⇒ Object
Returns the value of attribute android_advertising_id.
-
#android_uuid ⇒ Object
Returns the value of attribute android_uuid.
-
#bluetooth_enabled ⇒ Object
Returns the value of attribute bluetooth_enabled.
-
#bluetooth_version ⇒ Object
Returns the value of attribute bluetooth_version.
-
#brand ⇒ Object
Returns the value of attribute brand.
-
#build_identifier ⇒ Object
Returns the value of attribute build_identifier.
-
#cpu_architecture ⇒ Object
Returns the value of attribute cpu_architecture.
-
#device ⇒ Object
Returns the value of attribute device.
-
#device_country ⇒ Object
Returns the value of attribute device_country.
-
#device_manufacturer ⇒ Object
Returns the value of attribute device_manufacturer.
-
#device_model ⇒ Object
Returns the value of attribute device_model.
-
#has_nfc ⇒ Object
Returns the value of attribute has_nfc.
-
#http_header_user_agent ⇒ Object
Returns the value of attribute http_header_user_agent.
-
#ios_advertising_id ⇒ Object
Returns the value of attribute ios_advertising_id.
-
#ios_idfv ⇒ Object
Returns the value of attribute ios_idfv.
-
#is_tablet ⇒ Object
Returns the value of attribute is_tablet.
-
#locale_country ⇒ Object
Returns the value of attribute locale_country.
-
#locale_language ⇒ Object
Returns the value of attribute locale_language.
-
#network_carrier ⇒ Object
Returns the value of attribute network_carrier.
-
#network_code ⇒ Object
Returns the value of attribute network_code.
-
#network_country ⇒ Object
Returns the value of attribute network_country.
-
#network_mobile_country_code ⇒ Object
Returns the value of attribute network_mobile_country_code.
-
#os_version ⇒ Object
Returns the value of attribute os_version.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#product ⇒ Object
Returns the value of attribute product.
-
#push_notification_sound_enabled ⇒ Object
Returns the value of attribute push_notification_sound_enabled.
-
#push_notification_vibrate_enabled ⇒ Object
Returns the value of attribute push_notification_vibrate_enabled.
-
#push_token ⇒ Object
Returns the value of attribute push_token.
-
#radio_access_technology ⇒ Object
Returns the value of attribute radio_access_technology.
-
#screen_dpi ⇒ Object
Returns the value of attribute screen_dpi.
-
#screen_height ⇒ Object
Returns the value of attribute screen_height.
-
#screen_width ⇒ Object
Returns the value of attribute screen_width.
-
#supports_telephony ⇒ Object
Returns the value of attribute supports_telephony.
-
#timezone_offset ⇒ Object
Returns the value of attribute timezone_offset.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_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 = {}) ⇒ DeviceInformation
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 = {}) ⇒ DeviceInformation
Initializes the object
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 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 311 312 313 314 315 316 317 318 319 320 |
# File 'lib/mparticle/models/device_information.rb', line 178 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?(:'brand') self.brand = attributes[:'brand'] end if attributes.has_key?(:'product') self.product = attributes[:'product'] end if attributes.has_key?(:'device') self.device = attributes[:'device'] end if attributes.has_key?(:'android_uuid') self.android_uuid = attributes[:'android_uuid'] end if attributes.has_key?(:'device_manufacturer') self.device_manufacturer = attributes[:'device_manufacturer'] end if attributes.has_key?(:'platform') self.platform = attributes[:'platform'] end if attributes.has_key?(:'os_version') self.os_version = attributes[:'os_version'] end if attributes.has_key?(:'device_model') self.device_model = attributes[:'device_model'] end if attributes.has_key?(:'screen_height') self.screen_height = attributes[:'screen_height'] end if attributes.has_key?(:'screen_width') self.screen_width = attributes[:'screen_width'] end if attributes.has_key?(:'screen_dpi') self.screen_dpi = attributes[:'screen_dpi'] end if attributes.has_key?(:'device_country') self.device_country = attributes[:'device_country'] end if attributes.has_key?(:'locale_language') self.locale_language = attributes[:'locale_language'] end if attributes.has_key?(:'locale_country') self.locale_country = attributes[:'locale_country'] end if attributes.has_key?(:'network_country') self.network_country = attributes[:'network_country'] end if attributes.has_key?(:'network_carrier') self.network_carrier = attributes[:'network_carrier'] end if attributes.has_key?(:'network_code') self.network_code = attributes[:'network_code'] end if attributes.has_key?(:'network_mobile_country_code') self.network_mobile_country_code = attributes[:'network_mobile_country_code'] end if attributes.has_key?(:'timezone_offset') self.timezone_offset = attributes[:'timezone_offset'] end if attributes.has_key?(:'build_identifier') self.build_identifier = attributes[:'build_identifier'] end if attributes.has_key?(:'http_header_user_agent') self.http_header_user_agent = attributes[:'http_header_user_agent'] end if attributes.has_key?(:'ios_advertising_id') self.ios_advertising_id = attributes[:'ios_advertising_id'] end if attributes.has_key?(:'push_token') self.push_token = attributes[:'push_token'] end if attributes.has_key?(:'cpu_architecture') self.cpu_architecture = attributes[:'cpu_architecture'] end if attributes.has_key?(:'is_tablet') self.is_tablet = attributes[:'is_tablet'] end if attributes.has_key?(:'push_notification_sound_enabled') self.push_notification_sound_enabled = attributes[:'push_notification_sound_enabled'] end if attributes.has_key?(:'push_notification_vibrate_enabled') self.push_notification_vibrate_enabled = attributes[:'push_notification_vibrate_enabled'] end if attributes.has_key?(:'radio_access_technology') self.radio_access_technology = attributes[:'radio_access_technology'] end if attributes.has_key?(:'supports_telephony') self.supports_telephony = attributes[:'supports_telephony'] end if attributes.has_key?(:'has_nfc') self.has_nfc = attributes[:'has_nfc'] end if attributes.has_key?(:'bluetooth_enabled') self.bluetooth_enabled = attributes[:'bluetooth_enabled'] end if attributes.has_key?(:'bluetooth_version') self.bluetooth_version = attributes[:'bluetooth_version'] end if attributes.has_key?(:'ios_idfv') self.ios_idfv = attributes[:'ios_idfv'] end if attributes.has_key?(:'android_advertising_id') self.android_advertising_id = attributes[:'android_advertising_id'] end end |
Instance Attribute Details
#android_advertising_id ⇒ Object
Returns the value of attribute android_advertising_id.
72 73 74 |
# File 'lib/mparticle/models/device_information.rb', line 72 def android_advertising_id @android_advertising_id end |
#android_uuid ⇒ Object
Returns the value of attribute android_uuid.
12 13 14 |
# File 'lib/mparticle/models/device_information.rb', line 12 def android_uuid @android_uuid end |
#bluetooth_enabled ⇒ Object
Returns the value of attribute bluetooth_enabled.
66 67 68 |
# File 'lib/mparticle/models/device_information.rb', line 66 def bluetooth_enabled @bluetooth_enabled end |
#bluetooth_version ⇒ Object
Returns the value of attribute bluetooth_version.
68 69 70 |
# File 'lib/mparticle/models/device_information.rb', line 68 def bluetooth_version @bluetooth_version end |
#brand ⇒ Object
Returns the value of attribute brand.
6 7 8 |
# File 'lib/mparticle/models/device_information.rb', line 6 def brand @brand end |
#build_identifier ⇒ Object
Returns the value of attribute build_identifier.
44 45 46 |
# File 'lib/mparticle/models/device_information.rb', line 44 def build_identifier @build_identifier end |
#cpu_architecture ⇒ Object
Returns the value of attribute cpu_architecture.
52 53 54 |
# File 'lib/mparticle/models/device_information.rb', line 52 def cpu_architecture @cpu_architecture end |
#device ⇒ Object
Returns the value of attribute device.
10 11 12 |
# File 'lib/mparticle/models/device_information.rb', line 10 def device @device end |
#device_country ⇒ Object
Returns the value of attribute device_country.
28 29 30 |
# File 'lib/mparticle/models/device_information.rb', line 28 def device_country @device_country end |
#device_manufacturer ⇒ Object
Returns the value of attribute device_manufacturer.
14 15 16 |
# File 'lib/mparticle/models/device_information.rb', line 14 def device_manufacturer @device_manufacturer end |
#device_model ⇒ Object
Returns the value of attribute device_model.
20 21 22 |
# File 'lib/mparticle/models/device_information.rb', line 20 def device_model @device_model end |
#has_nfc ⇒ Object
Returns the value of attribute has_nfc.
64 65 66 |
# File 'lib/mparticle/models/device_information.rb', line 64 def has_nfc @has_nfc end |
#http_header_user_agent ⇒ Object
Returns the value of attribute http_header_user_agent.
46 47 48 |
# File 'lib/mparticle/models/device_information.rb', line 46 def http_header_user_agent @http_header_user_agent end |
#ios_advertising_id ⇒ Object
Returns the value of attribute ios_advertising_id.
48 49 50 |
# File 'lib/mparticle/models/device_information.rb', line 48 def ios_advertising_id @ios_advertising_id end |
#ios_idfv ⇒ Object
Returns the value of attribute ios_idfv.
70 71 72 |
# File 'lib/mparticle/models/device_information.rb', line 70 def ios_idfv @ios_idfv end |
#is_tablet ⇒ Object
Returns the value of attribute is_tablet.
54 55 56 |
# File 'lib/mparticle/models/device_information.rb', line 54 def is_tablet @is_tablet end |
#locale_country ⇒ Object
Returns the value of attribute locale_country.
32 33 34 |
# File 'lib/mparticle/models/device_information.rb', line 32 def locale_country @locale_country end |
#locale_language ⇒ Object
Returns the value of attribute locale_language.
30 31 32 |
# File 'lib/mparticle/models/device_information.rb', line 30 def locale_language @locale_language end |
#network_carrier ⇒ Object
Returns the value of attribute network_carrier.
36 37 38 |
# File 'lib/mparticle/models/device_information.rb', line 36 def network_carrier @network_carrier end |
#network_code ⇒ Object
Returns the value of attribute network_code.
38 39 40 |
# File 'lib/mparticle/models/device_information.rb', line 38 def network_code @network_code end |
#network_country ⇒ Object
Returns the value of attribute network_country.
34 35 36 |
# File 'lib/mparticle/models/device_information.rb', line 34 def network_country @network_country end |
#network_mobile_country_code ⇒ Object
Returns the value of attribute network_mobile_country_code.
40 41 42 |
# File 'lib/mparticle/models/device_information.rb', line 40 def network_mobile_country_code @network_mobile_country_code end |
#os_version ⇒ Object
Returns the value of attribute os_version.
18 19 20 |
# File 'lib/mparticle/models/device_information.rb', line 18 def os_version @os_version end |
#platform ⇒ Object
Returns the value of attribute platform.
16 17 18 |
# File 'lib/mparticle/models/device_information.rb', line 16 def platform @platform end |
#product ⇒ Object
Returns the value of attribute product.
8 9 10 |
# File 'lib/mparticle/models/device_information.rb', line 8 def product @product end |
#push_notification_sound_enabled ⇒ Object
Returns the value of attribute push_notification_sound_enabled.
56 57 58 |
# File 'lib/mparticle/models/device_information.rb', line 56 def push_notification_sound_enabled @push_notification_sound_enabled end |
#push_notification_vibrate_enabled ⇒ Object
Returns the value of attribute push_notification_vibrate_enabled.
58 59 60 |
# File 'lib/mparticle/models/device_information.rb', line 58 def push_notification_vibrate_enabled @push_notification_vibrate_enabled end |
#push_token ⇒ Object
Returns the value of attribute push_token.
50 51 52 |
# File 'lib/mparticle/models/device_information.rb', line 50 def push_token @push_token end |
#radio_access_technology ⇒ Object
Returns the value of attribute radio_access_technology.
60 61 62 |
# File 'lib/mparticle/models/device_information.rb', line 60 def radio_access_technology @radio_access_technology end |
#screen_dpi ⇒ Object
Returns the value of attribute screen_dpi.
26 27 28 |
# File 'lib/mparticle/models/device_information.rb', line 26 def screen_dpi @screen_dpi end |
#screen_height ⇒ Object
Returns the value of attribute screen_height.
22 23 24 |
# File 'lib/mparticle/models/device_information.rb', line 22 def screen_height @screen_height end |
#screen_width ⇒ Object
Returns the value of attribute screen_width.
24 25 26 |
# File 'lib/mparticle/models/device_information.rb', line 24 def screen_width @screen_width end |
#supports_telephony ⇒ Object
Returns the value of attribute supports_telephony.
62 63 64 |
# File 'lib/mparticle/models/device_information.rb', line 62 def supports_telephony @supports_telephony end |
#timezone_offset ⇒ Object
Returns the value of attribute timezone_offset.
42 43 44 |
# File 'lib/mparticle/models/device_information.rb', line 42 def timezone_offset @timezone_offset end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/mparticle/models/device_information.rb', line 97 def self.attribute_map { :'brand' => :'brand', :'product' => :'product', :'device' => :'device', :'android_uuid' => :'android_uuid', :'device_manufacturer' => :'device_manufacturer', :'platform' => :'platform', :'os_version' => :'os_version', :'device_model' => :'device_model', :'screen_height' => :'screen_height', :'screen_width' => :'screen_width', :'screen_dpi' => :'screen_dpi', :'device_country' => :'device_country', :'locale_language' => :'locale_language', :'locale_country' => :'locale_country', :'network_country' => :'network_country', :'network_carrier' => :'network_carrier', :'network_code' => :'network_code', :'network_mobile_country_code' => :'network_mobile_country_code', :'timezone_offset' => :'timezone_offset', :'build_identifier' => :'build_identifier', :'http_header_user_agent' => :'http_header_user_agent', :'ios_advertising_id' => :'ios_advertising_id', :'push_token' => :'push_token', :'cpu_architecture' => :'cpu_architecture', :'is_tablet' => :'is_tablet', :'push_notification_sound_enabled' => :'push_notification_sound_enabled', :'push_notification_vibrate_enabled' => :'push_notification_vibrate_enabled', :'radio_access_technology' => :'radio_access_technology', :'supports_telephony' => :'supports_telephony', :'has_nfc' => :'has_nfc', :'bluetooth_enabled' => :'bluetooth_enabled', :'bluetooth_version' => :'bluetooth_version', :'ios_idfv' => :'ios_idfv', :'android_advertising_id' => :'android_advertising_id' } end |
.swagger_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/mparticle/models/device_information.rb', line 137 def self.swagger_types { :'brand' => :'String', :'product' => :'String', :'device' => :'String', :'android_uuid' => :'String', :'device_manufacturer' => :'String', :'platform' => :'String', :'os_version' => :'String', :'device_model' => :'String', :'screen_height' => :'Integer', :'screen_width' => :'Integer', :'screen_dpi' => :'Integer', :'device_country' => :'String', :'locale_language' => :'String', :'locale_country' => :'String', :'network_country' => :'String', :'network_carrier' => :'String', :'network_code' => :'String', :'network_mobile_country_code' => :'String', :'timezone_offset' => :'Integer', :'build_identifier' => :'String', :'http_header_user_agent' => :'String', :'ios_advertising_id' => :'String', :'push_token' => :'String', :'cpu_architecture' => :'String', :'is_tablet' => :'BOOLEAN', :'push_notification_sound_enabled' => :'BOOLEAN', :'push_notification_vibrate_enabled' => :'BOOLEAN', :'radio_access_technology' => :'String', :'supports_telephony' => :'BOOLEAN', :'has_nfc' => :'BOOLEAN', :'bluetooth_enabled' => :'BOOLEAN', :'bluetooth_version' => :'String', :'ios_idfv' => :'String', :'android_advertising_id' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/mparticle/models/device_information.rb', line 349 def ==(o) return true if self.equal?(o) self.class == o.class && brand == o.brand && product == o.product && device == o.device && android_uuid == o.android_uuid && device_manufacturer == o.device_manufacturer && platform == o.platform && os_version == o.os_version && device_model == o.device_model && screen_height == o.screen_height && screen_width == o.screen_width && screen_dpi == o.screen_dpi && device_country == o.device_country && locale_language == o.locale_language && locale_country == o.locale_country && network_country == o.network_country && network_carrier == o.network_carrier && network_code == o.network_code && network_mobile_country_code == o.network_mobile_country_code && timezone_offset == o.timezone_offset && build_identifier == o.build_identifier && http_header_user_agent == o.http_header_user_agent && ios_advertising_id == o.ios_advertising_id && push_token == o.push_token && cpu_architecture == o.cpu_architecture && is_tablet == o.is_tablet && push_notification_sound_enabled == o.push_notification_sound_enabled && push_notification_vibrate_enabled == o.push_notification_vibrate_enabled && radio_access_technology == o.radio_access_technology && supports_telephony == o.supports_telephony && has_nfc == o.has_nfc && bluetooth_enabled == o.bluetooth_enabled && bluetooth_version == o.bluetooth_version && ios_idfv == o.ios_idfv && android_advertising_id == o.android_advertising_id end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 |
# File 'lib/mparticle/models/device_information.rb', line 424 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 = MParticle.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
490 491 492 493 494 495 496 497 498 499 500 501 502 |
# File 'lib/mparticle/models/device_information.rb', line 490 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
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/mparticle/models/device_information.rb', line 403 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_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
390 391 392 |
# File 'lib/mparticle/models/device_information.rb', line 390 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
396 397 398 |
# File 'lib/mparticle/models/device_information.rb', line 396 def hash [brand, product, device, android_uuid, device_manufacturer, platform, os_version, device_model, screen_height, screen_width, screen_dpi, device_country, locale_language, locale_country, network_country, network_carrier, network_code, network_mobile_country_code, timezone_offset, build_identifier, http_header_user_agent, ios_advertising_id, push_token, cpu_architecture, is_tablet, push_notification_sound_enabled, push_notification_vibrate_enabled, radio_access_technology, supports_telephony, has_nfc, bluetooth_enabled, bluetooth_version, ios_idfv, android_advertising_id].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
324 325 326 327 |
# File 'lib/mparticle/models/device_information.rb', line 324 def list_invalid_properties invalid_properties = Array.new return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
470 471 472 |
# File 'lib/mparticle/models/device_information.rb', line 470 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
476 477 478 479 480 481 482 483 484 |
# File 'lib/mparticle/models/device_information.rb', line 476 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
464 465 466 |
# File 'lib/mparticle/models/device_information.rb', line 464 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
331 332 333 334 335 |
# File 'lib/mparticle/models/device_information.rb', line 331 def valid? platform_validator = EnumAttributeValidator.new('String', ["Unknown", "iOS", "Android", "tvOS"]) return false unless platform_validator.valid?(@platform) return true end |