Class: Verizon::ActionResultwithDeviceConfig

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

Overview

ActionResultwithDeviceConfig 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: SKIP, description: SKIP, deviceid: SKIP, errmsg: SKIP, fields: SKIP, foreignid: SKIP, id: SKIP, lastupdated: SKIP, state: SKIP, transactionid: SKIP, version: SKIP, versionid: SKIP, additional_properties: nil) ⇒ ActionResultwithDeviceConfig

Returns a new instance of ActionResultwithDeviceConfig.



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 103

def initialize(createdon: SKIP, description: SKIP, deviceid: SKIP,
               errmsg: SKIP, fields: SKIP, foreignid: SKIP, id: SKIP,
               lastupdated: SKIP, state: SKIP, transactionid: SKIP,
               version: SKIP, versionid: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @createdon = createdon unless createdon == SKIP
  @description = description unless description == SKIP
  @deviceid = deviceid unless deviceid == SKIP
  @errmsg = errmsg unless errmsg == SKIP
  @fields = fields unless fields == SKIP
  @foreignid = foreignid unless foreignid == SKIP
  @id = id unless id == SKIP
  @lastupdated = lastupdated unless lastupdated == SKIP
  @state = state unless state == SKIP
  @transactionid = transactionid unless transactionid == SKIP
  @version = version unless version == SKIP
  @versionid = versionid unless versionid == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#createdonDateTime

Timestamp of the record

Returns:

  • (DateTime)


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

def createdon
  @createdon
end

#descriptionString

Timestamp of the record

Returns:

  • (String)


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

def description
  @description
end

#deviceidString

This is a UUID value of the device created when the device is onboarded

Returns:

  • (String)


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

def deviceid
  @deviceid
end

#errmsgString

Error message

Returns:

  • (String)


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

def errmsg
  @errmsg
end

#fieldsDtoDeviceActionSetConfiguration

Error message



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

def fields
  @fields
end

#foreignidString

UUID of the ECPD account the user belongs to

Returns:

  • (String)


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

def foreignid
  @foreignid
end

#idString

UUID of the user record, assigned at creation

Returns:

  • (String)


39
40
41
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 39

def id
  @id
end

#lastupdatedDateTime

Timestamp of the record

Returns:

  • (DateTime)


43
44
45
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 43

def lastupdated
  @lastupdated
end

#stateString

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

Returns:

  • (String)


48
49
50
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 48

def state
  @state
end

#transactionidString

The system-generated UUID of the transaction

Returns:

  • (String)


52
53
54
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 52

def transactionid
  @transactionid
end

#versionString

The resource version

Returns:

  • (String)


56
57
58
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 56

def version
  @version
end

#versionidString

The UUID of the resource version

Returns:

  • (String)


60
61
62
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 60

def versionid
  @versionid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

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'])
              else
                SKIP
              end
  description = hash.key?('description') ? hash['description'] : SKIP
  deviceid = hash.key?('deviceid') ? hash['deviceid'] : SKIP
  errmsg = hash.key?('errmsg') ? hash['errmsg'] : SKIP
  fields = DtoDeviceActionSetConfiguration.from_hash(hash['fields']) if hash['fields']
  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
  state = hash.key?('state') ? hash['state'] : SKIP
  transactionid = hash.key?('transactionid') ? hash['transactionid'] : SKIP
  version = hash.key?('version') ? hash['version'] : SKIP
  versionid = hash.key?('versionid') ? hash['versionid'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  ActionResultwithDeviceConfig.new(createdon: createdon,
                                   description: description,
                                   deviceid: deviceid,
                                   errmsg: errmsg,
                                   fields: fields,
                                   foreignid: foreignid,
                                   id: id,
                                   lastupdated: lastupdated,
                                   state: state,
                                   transactionid: transactionid,
                                   version: version,
                                   versionid: versionid,
                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 63

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['createdon'] = 'createdon'
  @_hash['description'] = 'description'
  @_hash['deviceid'] = 'deviceid'
  @_hash['errmsg'] = 'errmsg'
  @_hash['fields'] = 'fields'
  @_hash['foreignid'] = 'foreignid'
  @_hash['id'] = 'id'
  @_hash['lastupdated'] = 'lastupdated'
  @_hash['state'] = 'state'
  @_hash['transactionid'] = 'transactionid'
  @_hash['version'] = 'version'
  @_hash['versionid'] = 'versionid'
  @_hash
end

.nullablesObject

An array for nullable fields



99
100
101
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 99

def self.nullables
  []
end

.optionalsObject

An array for optional fields



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 81

def self.optionals
  %w[
    createdon
    description
    deviceid
    errmsg
    fields
    foreignid
    id
    lastupdated
    state
    transactionid
    version
    versionid
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} createdon: #{@createdon.inspect}, description: #{@description.inspect},"\
  " deviceid: #{@deviceid.inspect}, errmsg: #{@errmsg.inspect}, fields: #{@fields.inspect},"\
  " foreignid: #{@foreignid.inspect}, id: #{@id.inspect}, lastupdated:"\
  " #{@lastupdated.inspect}, state: #{@state.inspect}, transactionid:"\
  " #{@transactionid.inspect}, version: #{@version.inspect}, versionid: #{@versionid.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_custom_createdonObject



174
175
176
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 174

def to_custom_createdon
  DateTimeHelper.to_rfc3339(createdon)
end

#to_custom_lastupdatedObject



178
179
180
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 178

def to_custom_lastupdated
  DateTimeHelper.to_rfc3339(lastupdated)
end

#to_sObject

Provides a human-readable string representation of the object.



183
184
185
186
187
188
189
190
# File 'lib/verizon/models/action_resultwith_device_config.rb', line 183

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} createdon: #{@createdon}, description: #{@description}, deviceid:"\
  " #{@deviceid}, errmsg: #{@errmsg}, fields: #{@fields}, foreignid: #{@foreignid}, id:"\
  " #{@id}, lastupdated: #{@lastupdated}, state: #{@state}, transactionid: #{@transactionid},"\
  " version: #{@version}, versionid: #{@versionid}, additional_properties:"\
  " #{@additional_properties}>"
end