Class: Verizon::ResourceUser

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

Overview

ResourceUser 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(createdon:, credentialstype:, foreignid:, lastupdated:, versionid:, accountclientid: SKIP, ackterms: SKIP, acktermson: SKIP, billingaccountid: SKIP, credentialsid: SKIP, customdata: SKIP, description: SKIP, displayname: SKIP, email: SKIP, firstname: SKIP, id: SKIP, lastname: SKIP, mdn: SKIP, middlename: SKIP, name: SKIP, secondarybillingaccountids: SKIP, state: SKIP, version: SKIP) ⇒ ResourceUser

Returns a new instance of ResourceUser.



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/verizon/models/resource_user.rb', line 166

def initialize(createdon:, credentialstype:, foreignid:, lastupdated:,
               versionid:, accountclientid: SKIP, ackterms: SKIP,
               acktermson: SKIP, billingaccountid: SKIP,
               credentialsid: SKIP, customdata: SKIP, description: SKIP,
               displayname: SKIP, email: SKIP, firstname: SKIP, id: SKIP,
               lastname: SKIP, mdn: SKIP, middlename: SKIP, name: SKIP,
               secondarybillingaccountids: SKIP, state: SKIP, version: SKIP)
  @accountclientid = accountclientid unless accountclientid == SKIP
  @ackterms = ackterms unless ackterms == SKIP
  @acktermson = acktermson unless acktermson == SKIP
  @billingaccountid = billingaccountid unless billingaccountid == SKIP
  @createdon = createdon
  @credentialsid = credentialsid unless credentialsid == SKIP
  @credentialstype = credentialstype
  @customdata = customdata unless customdata == SKIP
  @description = description unless description == SKIP
  @displayname = displayname unless displayname == SKIP
  @email = email unless email == SKIP
  @firstname = firstname unless firstname == SKIP
  @foreignid = foreignid
  @id = id unless id == SKIP
  @lastname = lastname unless lastname == SKIP
  @lastupdated = lastupdated
  @mdn = mdn unless mdn == SKIP
  @middlename = middlename unless middlename == SKIP
  @name = name unless name == SKIP
  unless secondarybillingaccountids == SKIP
    @secondarybillingaccountids =
      secondarybillingaccountids
  end
  @state = state unless state == SKIP
  @version = version unless version == SKIP
  @versionid = versionid
end

Instance Attribute Details

#accountclientidString

Not used in this release, future functionality

Returns:

  • (String)


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

def accountclientid
  @accountclientid
end

#acktermsTrueClass | FalseClass

Indicates if terms are agreed to (true) or not

Returns:

  • (TrueClass | FalseClass)


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

def ackterms
  @ackterms
end

#acktermsonDateTime

Indicates if terms are agreed to (true) or not

Returns:

  • (DateTime)


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

def acktermson
  @acktermson
end

#billingaccountidString

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

Returns:

  • (String)


27
28
29
# File 'lib/verizon/models/resource_user.rb', line 27

def billingaccountid
  @billingaccountid
end

#createdonDateTime

Timestamp of the record

Returns:

  • (DateTime)


31
32
33
# File 'lib/verizon/models/resource_user.rb', line 31

def createdon
  @createdon
end

#credentialsidString

User credentials. The only valid value is an email address

Returns:

  • (String)


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

def credentialsid
  @credentialsid
end

#credentialstypeString

The type of credential represented by the ID. The only valid value is ‘email`

Returns:

  • (String)


40
41
42
# File 'lib/verizon/models/resource_user.rb', line 40

def credentialstype
  @credentialstype
end

#customdataHash[String, Object]

Name/value pair, where the value is client defined. The purpose is to keep track of current state per device action.

Returns:

  • (Hash[String, Object])


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

def customdata
  @customdata
end

#descriptionString

a short description

Returns:

  • (String)


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

def description
  @description
end

#displaynameString

the user name value to display

Returns:

  • (String)


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

def displayname
  @displayname
end

#emailString

Contact email for the group

Returns:

  • (String)


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

def email
  @email
end

#firstnameString

The first name in the user record

Returns:

  • (String)


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

def firstname
  @firstname
end

#foreignidString

UUID of the ECPD account the user belongs to

Returns:

  • (String)


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

def foreignid
  @foreignid
end

#idString

UUID of the user record, assigned at creation

Returns:

  • (String)


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

def id
  @id
end

#lastnameString

The last name in the user record

Returns:

  • (String)


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

def lastname
  @lastname
end

#lastupdatedDateTime

Timestamp of the record

Returns:

  • (DateTime)


77
78
79
# File 'lib/verizon/models/resource_user.rb', line 77

def lastupdated
  @lastupdated
end

#mdnString

The Mobile Directory Number

Returns:

  • (String)


81
82
83
# File 'lib/verizon/models/resource_user.rb', line 81

def mdn
  @mdn
end

#middlenameString

optional field for middle name or initial

Returns:

  • (String)


85
86
87
# File 'lib/verizon/models/resource_user.rb', line 85

def middlename
  @middlename
end

#nameString

User defined name of the record

Returns:

  • (String)


89
90
91
# File 'lib/verizon/models/resource_user.rb', line 89

def name
  @name
end

#secondarybillingaccountidsArray[String]

Virtual field; will not be used in this implementation

Returns:

  • (Array[String])


93
94
95
# File 'lib/verizon/models/resource_user.rb', line 93

def secondarybillingaccountids
  @secondarybillingaccountids
end

#stateString

The current status of the device or transaction and will be ‘success` or `failed`

Returns:

  • (String)


98
99
100
# File 'lib/verizon/models/resource_user.rb', line 98

def state
  @state
end

#versionString

The resource version

Returns:

  • (String)


102
103
104
# File 'lib/verizon/models/resource_user.rb', line 102

def version
  @version
end

#versionidString

The UUID of the resource version

Returns:

  • (String)


106
107
108
# File 'lib/verizon/models/resource_user.rb', line 106

def versionid
  @versionid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  createdon = if hash.key?('createdon')
                (DateTimeHelper.from_rfc3339(hash['createdon']) if hash['createdon'])
              end
  credentialstype =
    hash.key?('credentialstype') ? hash['credentialstype'] : nil
  foreignid = hash.key?('foreignid') ? hash['foreignid'] : nil
  lastupdated = if hash.key?('lastupdated')
                  (DateTimeHelper.from_rfc3339(hash['lastupdated']) if hash['lastupdated'])
                end
  versionid = hash.key?('versionid') ? hash['versionid'] : nil
  accountclientid =
    hash.key?('accountclientid') ? hash['accountclientid'] : SKIP
  ackterms = hash.key?('ackterms') ? hash['ackterms'] : SKIP
  acktermson = if hash.key?('acktermson')
                 (DateTimeHelper.from_rfc3339(hash['acktermson']) if hash['acktermson'])
               else
                 SKIP
               end
  billingaccountid =
    hash.key?('billingaccountid') ? hash['billingaccountid'] : SKIP
  credentialsid = hash.key?('credentialsid') ? hash['credentialsid'] : SKIP
  customdata = hash.key?('customdata') ? hash['customdata'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
  displayname = hash.key?('displayname') ? hash['displayname'] : SKIP
  email = hash.key?('email') ? hash['email'] : SKIP
  firstname = hash.key?('firstname') ? hash['firstname'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  lastname = hash.key?('lastname') ? hash['lastname'] : SKIP
  mdn = hash.key?('mdn') ? hash['mdn'] : SKIP
  middlename = hash.key?('middlename') ? hash['middlename'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  secondarybillingaccountids =
    hash.key?('secondarybillingaccountids') ? hash['secondarybillingaccountids'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  version = hash.key?('version') ? hash['version'] : SKIP

  # Create object from extracted values.
  ResourceUser.new(createdon: createdon,
                   credentialstype: credentialstype,
                   foreignid: foreignid,
                   lastupdated: lastupdated,
                   versionid: versionid,
                   accountclientid: accountclientid,
                   ackterms: ackterms,
                   acktermson: acktermson,
                   billingaccountid: billingaccountid,
                   credentialsid: credentialsid,
                   customdata: customdata,
                   description: description,
                   displayname: displayname,
                   email: email,
                   firstname: firstname,
                   id: id,
                   lastname: lastname,
                   mdn: mdn,
                   middlename: middlename,
                   name: name,
                   secondarybillingaccountids: secondarybillingaccountids,
                   state: state,
                   version: version)
end

.namesObject

A mapping from model property names to API property names.



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
135
# File 'lib/verizon/models/resource_user.rb', line 109

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['accountclientid'] = 'accountclientid'
  @_hash['ackterms'] = 'ackterms'
  @_hash['acktermson'] = 'acktermson'
  @_hash['billingaccountid'] = 'billingaccountid'
  @_hash['createdon'] = 'createdon'
  @_hash['credentialsid'] = 'credentialsid'
  @_hash['credentialstype'] = 'credentialstype'
  @_hash['customdata'] = 'customdata'
  @_hash['description'] = 'description'
  @_hash['displayname'] = 'displayname'
  @_hash['email'] = 'email'
  @_hash['firstname'] = 'firstname'
  @_hash['foreignid'] = 'foreignid'
  @_hash['id'] = 'id'
  @_hash['lastname'] = 'lastname'
  @_hash['lastupdated'] = 'lastupdated'
  @_hash['mdn'] = 'mdn'
  @_hash['middlename'] = 'middlename'
  @_hash['name'] = 'name'
  @_hash['secondarybillingaccountids'] = 'secondarybillingaccountids'
  @_hash['state'] = 'state'
  @_hash['version'] = 'version'
  @_hash['versionid'] = 'versionid'
  @_hash
end

.nullablesObject

An array for nullable fields



162
163
164
# File 'lib/verizon/models/resource_user.rb', line 162

def self.nullables
  []
end

.optionalsObject

An array for optional fields



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/verizon/models/resource_user.rb', line 138

def self.optionals
  %w[
    accountclientid
    ackterms
    acktermson
    billingaccountid
    credentialsid
    customdata
    description
    displayname
    email
    firstname
    id
    lastname
    mdn
    middlename
    name
    secondarybillingaccountids
    state
    version
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



294
295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/verizon/models/resource_user.rb', line 294

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} accountclientid: #{@accountclientid.inspect}, ackterms:"\
  " #{@ackterms.inspect}, acktermson: #{@acktermson.inspect}, billingaccountid:"\
  " #{@billingaccountid.inspect}, createdon: #{@createdon.inspect}, credentialsid:"\
  " #{@credentialsid.inspect}, credentialstype: #{@credentialstype.inspect}, customdata:"\
  " #{@customdata.inspect}, description: #{@description.inspect}, displayname:"\
  " #{@displayname.inspect}, email: #{@email.inspect}, firstname: #{@firstname.inspect},"\
  " foreignid: #{@foreignid.inspect}, id: #{@id.inspect}, lastname: #{@lastname.inspect},"\
  " lastupdated: #{@lastupdated.inspect}, mdn: #{@mdn.inspect}, middlename:"\
  " #{@middlename.inspect}, name: #{@name.inspect}, secondarybillingaccountids:"\
  " #{@secondarybillingaccountids.inspect}, state: #{@state.inspect}, version:"\
  " #{@version.inspect}, versionid: #{@versionid.inspect}>"
end

#to_custom_acktermsonObject



268
269
270
# File 'lib/verizon/models/resource_user.rb', line 268

def to_custom_acktermson
  DateTimeHelper.to_rfc3339(acktermson)
end

#to_custom_createdonObject



272
273
274
# File 'lib/verizon/models/resource_user.rb', line 272

def to_custom_createdon
  DateTimeHelper.to_rfc3339(createdon)
end

#to_custom_lastupdatedObject



276
277
278
# File 'lib/verizon/models/resource_user.rb', line 276

def to_custom_lastupdated
  DateTimeHelper.to_rfc3339(lastupdated)
end

#to_sObject

Provides a human-readable string representation of the object.



281
282
283
284
285
286
287
288
289
290
291
# File 'lib/verizon/models/resource_user.rb', line 281

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} accountclientid: #{@accountclientid}, ackterms: #{@ackterms}, acktermson:"\
  " #{@acktermson}, billingaccountid: #{@billingaccountid}, createdon: #{@createdon},"\
  " credentialsid: #{@credentialsid}, credentialstype: #{@credentialstype}, customdata:"\
  " #{@customdata}, description: #{@description}, displayname: #{@displayname}, email:"\
  " #{@email}, firstname: #{@firstname}, foreignid: #{@foreignid}, id: #{@id}, lastname:"\
  " #{@lastname}, lastupdated: #{@lastupdated}, mdn: #{@mdn}, middlename: #{@middlename},"\
  " name: #{@name}, secondarybillingaccountids: #{@secondarybillingaccountids}, state:"\
  " #{@state}, version: #{@version}, versionid: #{@versionid}>"
end