Class: Verizon::UserDeviceExperienceHistory

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/user_device_experience_history.rb

Overview

UserDeviceExperienceHistory Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(billingaccountid: SKIP, createdon: SKIP, date: SKIP, devicesbad: SKIP, devicesfair: SKIP, devicesgood: SKIP, devicestotal: SKIP, foreignid: SKIP, id: SKIP, lastupdated: SKIP, version: SKIP, versionid: SKIP) ⇒ UserDeviceExperienceHistory

Returns a new instance of UserDeviceExperienceHistory.



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/verizon/models/user_device_experience_history.rb', line 108

def initialize(billingaccountid: SKIP, createdon: SKIP, date: SKIP,
               devicesbad: SKIP, devicesfair: SKIP, devicesgood: SKIP,
               devicestotal: SKIP, foreignid: SKIP, id: SKIP,
               lastupdated: SKIP, version: SKIP, versionid: SKIP)
  @billingaccountid = billingaccountid unless billingaccountid == SKIP
  @createdon = createdon unless createdon == SKIP
  @date = date unless date == SKIP
  @devicesbad = devicesbad unless devicesbad == SKIP
  @devicesfair = devicesfair unless devicesfair == SKIP
  @devicesgood = devicesgood unless devicesgood == SKIP
  @devicestotal = devicestotal unless devicestotal == SKIP
  @foreignid = foreignid unless foreignid == SKIP
  @id = id unless id == SKIP
  @lastupdated = lastupdated unless lastupdated == SKIP
  @version = version unless version == SKIP
  @versionid = versionid unless versionid == SKIP
end

Instance Attribute Details

#billingaccountidString

The billing account ID. This is the same value as the Account ID

Returns:

  • (String)


15
16
17
# File 'lib/verizon/models/user_device_experience_history.rb', line 15

def billingaccountid
  @billingaccountid
end

#createdonDateTime

Timestamp of the record

Returns:

  • (DateTime)


19
20
21
# File 'lib/verizon/models/user_device_experience_history.rb', line 19

def createdon
  @createdon
end

#dateDateTime

Timestamp of the record

Returns:

  • (DateTime)


23
24
25
# File 'lib/verizon/models/user_device_experience_history.rb', line 23

def date
  @date
end

#devicesbadInteger

This is a score based on combination of network coverage and network outage affecting the device’s ability to connect to the network. This is a count of devices that have failed

Returns:

  • (Integer)


29
30
31
# File 'lib/verizon/models/user_device_experience_history.rb', line 29

def devicesbad
  @devicesbad
end

#devicesfairInteger

This is a score based on combination of network coverage and network outage affecting the device’s ability to connect to the network. This is a count of devices that are impaired

Returns:

  • (Integer)


35
36
37
# File 'lib/verizon/models/user_device_experience_history.rb', line 35

def devicesfair
  @devicesfair
end

#devicesgoodInteger

This is a score based on combination of network coverage and network outage affecting the device’s ability to connect to the network. This is a count of devices that have no issues

Returns:

  • (Integer)


41
42
43
# File 'lib/verizon/models/user_device_experience_history.rb', line 41

def devicesgood
  @devicesgood
end

#devicestotalInteger

A count of all devices

Returns:

  • (Integer)


45
46
47
# File 'lib/verizon/models/user_device_experience_history.rb', line 45

def devicestotal
  @devicestotal
end

#foreignidString

UUID of the ECPD account the user belongs to

Returns:

  • (String)


49
50
51
# File 'lib/verizon/models/user_device_experience_history.rb', line 49

def foreignid
  @foreignid
end

#idString

UUID of the user record, assigned at creation

Returns:

  • (String)


53
54
55
# File 'lib/verizon/models/user_device_experience_history.rb', line 53

def id
  @id
end

#lastupdatedDateTime

Timestamp of the record

Returns:

  • (DateTime)


57
58
59
# File 'lib/verizon/models/user_device_experience_history.rb', line 57

def lastupdated
  @lastupdated
end

#versionString

The resource version

Returns:

  • (String)


61
62
63
# File 'lib/verizon/models/user_device_experience_history.rb', line 61

def version
  @version
end

#versionidString

The UUID of the resource version

Returns:

  • (String)


65
66
67
# File 'lib/verizon/models/user_device_experience_history.rb', line 65

def versionid
  @versionid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/verizon/models/user_device_experience_history.rb', line 127

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  billingaccountid =
    hash.key?('billingaccountid') ? hash['billingaccountid'] : SKIP
  createdon = if hash.key?('createdon')
                (DateTimeHelper.from_rfc3339(hash['createdon']) if hash['createdon'])
              else
                SKIP
              end
  date = if hash.key?('date')
           (DateTimeHelper.from_rfc3339(hash['date']) if hash['date'])
         else
           SKIP
         end
  devicesbad = hash.key?('devicesbad') ? hash['devicesbad'] : SKIP
  devicesfair = hash.key?('devicesfair') ? hash['devicesfair'] : SKIP
  devicesgood = hash.key?('devicesgood') ? hash['devicesgood'] : SKIP
  devicestotal = hash.key?('devicestotal') ? hash['devicestotal'] : SKIP
  foreignid = hash.key?('foreignid') ? hash['foreignid'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  lastupdated = if hash.key?('lastupdated')
                  (DateTimeHelper.from_rfc3339(hash['lastupdated']) if hash['lastupdated'])
                else
                  SKIP
                end
  version = hash.key?('version') ? hash['version'] : SKIP
  versionid = hash.key?('versionid') ? hash['versionid'] : SKIP

  # Create object from extracted values.
  UserDeviceExperienceHistory.new(billingaccountid: billingaccountid,
                                  createdon: createdon,
                                  date: date,
                                  devicesbad: devicesbad,
                                  devicesfair: devicesfair,
                                  devicesgood: devicesgood,
                                  devicestotal: devicestotal,
                                  foreignid: foreignid,
                                  id: id,
                                  lastupdated: lastupdated,
                                  version: version,
                                  versionid: versionid)
end

.namesObject

A mapping from model property names to API property names.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/verizon/models/user_device_experience_history.rb', line 68

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['billingaccountid'] = 'billingaccountid'
  @_hash['createdon'] = 'createdon'
  @_hash['date'] = 'date'
  @_hash['devicesbad'] = 'devicesbad'
  @_hash['devicesfair'] = 'devicesfair'
  @_hash['devicesgood'] = 'devicesgood'
  @_hash['devicestotal'] = 'devicestotal'
  @_hash['foreignid'] = 'foreignid'
  @_hash['id'] = 'id'
  @_hash['lastupdated'] = 'lastupdated'
  @_hash['version'] = 'version'
  @_hash['versionid'] = 'versionid'
  @_hash
end

.nullablesObject

An array for nullable fields



104
105
106
# File 'lib/verizon/models/user_device_experience_history.rb', line 104

def self.nullables
  []
end

.optionalsObject

An array for optional fields



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/verizon/models/user_device_experience_history.rb', line 86

def self.optionals
  %w[
    billingaccountid
    createdon
    date
    devicesbad
    devicesfair
    devicesgood
    devicestotal
    foreignid
    id
    lastupdated
    version
    versionid
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



194
195
196
197
198
199
200
201
202
# File 'lib/verizon/models/user_device_experience_history.rb', line 194

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} billingaccountid: #{@billingaccountid.inspect}, createdon:"\
  " #{@createdon.inspect}, date: #{@date.inspect}, devicesbad: #{@devicesbad.inspect},"\
  " devicesfair: #{@devicesfair.inspect}, devicesgood: #{@devicesgood.inspect}, devicestotal:"\
  " #{@devicestotal.inspect}, foreignid: #{@foreignid.inspect}, id: #{@id.inspect},"\
  " lastupdated: #{@lastupdated.inspect}, version: #{@version.inspect}, versionid:"\
  " #{@versionid.inspect}>"
end

#to_custom_createdonObject



172
173
174
# File 'lib/verizon/models/user_device_experience_history.rb', line 172

def to_custom_createdon
  DateTimeHelper.to_rfc3339(createdon)
end

#to_custom_dateObject



176
177
178
# File 'lib/verizon/models/user_device_experience_history.rb', line 176

def to_custom_date
  DateTimeHelper.to_rfc3339(date)
end

#to_custom_lastupdatedObject



180
181
182
# File 'lib/verizon/models/user_device_experience_history.rb', line 180

def to_custom_lastupdated
  DateTimeHelper.to_rfc3339(lastupdated)
end

#to_sObject

Provides a human-readable string representation of the object.



185
186
187
188
189
190
191
# File 'lib/verizon/models/user_device_experience_history.rb', line 185

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} billingaccountid: #{@billingaccountid}, createdon: #{@createdon}, date:"\
  " #{@date}, devicesbad: #{@devicesbad}, devicesfair: #{@devicesfair}, devicesgood:"\
  " #{@devicesgood}, devicestotal: #{@devicestotal}, foreignid: #{@foreignid}, id: #{@id},"\
  " lastupdated: #{@lastupdated}, version: #{@version}, versionid: #{@versionid}>"
end