Class: Verizon::UserNetworkExperienceHistory

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

Overview

UserNetworkExperienceHistory 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, hours: SKIP, id: SKIP, lastupdated: SKIP, minutes: SKIP, version: SKIP, versionid: SKIP) ⇒ UserNetworkExperienceHistory

Returns a new instance of UserNetworkExperienceHistory.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/verizon/models/user_network_experience_history.rb', line 120

def initialize(billingaccountid: SKIP, createdon: SKIP, date: SKIP,
               devicesbad: SKIP, devicesfair: SKIP, devicesgood: SKIP,
               devicestotal: SKIP, foreignid: SKIP, hours: SKIP, id: SKIP,
               lastupdated: SKIP, minutes: 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
  @hours = hours unless hours == SKIP
  @id = id unless id == SKIP
  @lastupdated = lastupdated unless lastupdated == SKIP
  @minutes = minutes unless minutes == 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_network_experience_history.rb', line 15

def billingaccountid
  @billingaccountid
end

#createdonDateTime

Timestamp of the record

Returns:

  • (DateTime)


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

def createdon
  @createdon
end

#dateDateTime

Timestamp of the record

Returns:

  • (DateTime)


23
24
25
# File 'lib/verizon/models/user_network_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_network_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_network_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_network_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_network_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_network_experience_history.rb', line 49

def foreignid
  @foreignid
end

#hoursInteger

UUID of the ECPD account the user belongs to

Returns:

  • (Integer)


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

def hours
  @hours
end

#idString

UUID of the user record, assigned at creation

Returns:

  • (String)


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

def id
  @id
end

#lastupdatedDateTime

Timestamp of the record

Returns:

  • (DateTime)


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

def lastupdated
  @lastupdated
end

#minutesInteger

Timestamp of the record

Returns:

  • (Integer)


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

def minutes
  @minutes
end

#versionString

The resource version

Returns:

  • (String)


69
70
71
# File 'lib/verizon/models/user_network_experience_history.rb', line 69

def version
  @version
end

#versionidString

The UUID of the resource version

Returns:

  • (String)


73
74
75
# File 'lib/verizon/models/user_network_experience_history.rb', line 73

def versionid
  @versionid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
186
187
188
189
# File 'lib/verizon/models/user_network_experience_history.rb', line 142

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
  hours = hash.key?('hours') ? hash['hours'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  lastupdated = if hash.key?('lastupdated')
                  (DateTimeHelper.from_rfc3339(hash['lastupdated']) if hash['lastupdated'])
                else
                  SKIP
                end
  minutes = hash.key?('minutes') ? hash['minutes'] : SKIP
  version = hash.key?('version') ? hash['version'] : SKIP
  versionid = hash.key?('versionid') ? hash['versionid'] : SKIP

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

.namesObject

A mapping from model property names to API property names.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/verizon/models/user_network_experience_history.rb', line 76

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['hours'] = 'hours'
  @_hash['id'] = 'id'
  @_hash['lastupdated'] = 'lastupdated'
  @_hash['minutes'] = 'minutes'
  @_hash['version'] = 'version'
  @_hash['versionid'] = 'versionid'
  @_hash
end

.nullablesObject

An array for nullable fields



116
117
118
# File 'lib/verizon/models/user_network_experience_history.rb', line 116

def self.nullables
  []
end

.optionalsObject

An array for optional fields



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/verizon/models/user_network_experience_history.rb', line 96

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



214
215
216
217
218
219
220
221
222
# File 'lib/verizon/models/user_network_experience_history.rb', line 214

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}, hours: #{@hours.inspect}, id:"\
  " #{@id.inspect}, lastupdated: #{@lastupdated.inspect}, minutes: #{@minutes.inspect},"\
  " version: #{@version.inspect}, versionid: #{@versionid.inspect}>"
end

#to_custom_createdonObject



191
192
193
# File 'lib/verizon/models/user_network_experience_history.rb', line 191

def to_custom_createdon
  DateTimeHelper.to_rfc3339(createdon)
end

#to_custom_dateObject



195
196
197
# File 'lib/verizon/models/user_network_experience_history.rb', line 195

def to_custom_date
  DateTimeHelper.to_rfc3339(date)
end

#to_custom_lastupdatedObject



199
200
201
# File 'lib/verizon/models/user_network_experience_history.rb', line 199

def to_custom_lastupdated
  DateTimeHelper.to_rfc3339(lastupdated)
end

#to_sObject

Provides a human-readable string representation of the object.



204
205
206
207
208
209
210
211
# File 'lib/verizon/models/user_network_experience_history.rb', line 204

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}, hours:"\
  " #{@hours}, id: #{@id}, lastupdated: #{@lastupdated}, minutes: #{@minutes}, version:"\
  " #{@version}, versionid: #{@versionid}>"
end