Class: MistApi::JsInventoryItem

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/js_inventory_item.rb

Overview

JsInventoryItem 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(claimed = SKIP, device_name = SKIP, eol_psn = SKIP, eol_time = SKIP, eos_time = SKIP, has_support = SKIP, master = SKIP, model = SKIP, org_id = SKIP, serial = SKIP, sku = SKIP, status = SKIP, suggested_version = SKIP, type = SKIP, version = SKIP, version_description = SKIP, version_eos_time = SKIP, version_time = SKIP, warranty = SKIP, warranty_time = SKIP, warranty_type = SKIP) ⇒ JsInventoryItem

Returns a new instance of JsInventoryItem.



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
# File 'lib/mist_api/models/js_inventory_item.rb', line 168

def initialize(claimed = SKIP, device_name = SKIP, eol_psn = SKIP,
               eol_time = SKIP, eos_time = SKIP, has_support = SKIP,
               master = SKIP, model = SKIP, org_id = SKIP, serial = SKIP,
               sku = SKIP, status = SKIP, suggested_version = SKIP,
               type = SKIP, version = SKIP, version_description = SKIP,
               version_eos_time = SKIP, version_time = SKIP,
               warranty = SKIP, warranty_time = SKIP, warranty_type = SKIP)
  @claimed = claimed unless claimed == SKIP
  @device_name = device_name unless device_name == SKIP
  @eol_psn = eol_psn unless eol_psn == SKIP
  @eol_time = eol_time unless eol_time == SKIP
  @eos_time = eos_time unless eos_time == SKIP
  @has_support = has_support unless has_support == SKIP
  @master = master unless master == SKIP
  @model = model unless model == SKIP
  @org_id = org_id unless org_id == SKIP
  @serial = serial unless serial == SKIP
  @sku = sku unless sku == SKIP
  @status = status unless status == SKIP
  @suggested_version = suggested_version unless suggested_version == SKIP
  @type = type unless type == SKIP
  @version = version unless version == SKIP
  @version_description = version_description unless version_description == SKIP
  @version_eos_time = version_eos_time unless version_eos_time == SKIP
  @version_time = version_time unless version_time == SKIP
  @warranty = warranty unless warranty == SKIP
  @warranty_time = warranty_time unless warranty_time == SKIP
  @warranty_type = warranty_type unless warranty_type == SKIP
end

Instance Attribute Details

#claimedTrueClass | FalseClass

Indicates if the device is claimed by any org

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/mist_api/models/js_inventory_item.rb', line 14

def claimed
  @claimed
end

#device_nameString

Name of the device

Returns:

  • (String)


18
19
20
# File 'lib/mist_api/models/js_inventory_item.rb', line 18

def device_name
  @device_name
end

#eol_psnString

EOL PSN

Returns:

  • (String)


22
23
24
# File 'lib/mist_api/models/js_inventory_item.rb', line 22

def eol_psn
  @eol_psn
end

#eol_timeInteger

End of life time

Returns:

  • (Integer)


26
27
28
# File 'lib/mist_api/models/js_inventory_item.rb', line 26

def eol_time
  @eol_time
end

#eos_timeInteger

End of support time

Returns:

  • (Integer)


30
31
32
# File 'lib/mist_api/models/js_inventory_item.rb', line 30

def eos_time
  @eos_time
end

#has_supportTrueClass | FalseClass

Indicates if the device is covered under active support contract

Returns:

  • (TrueClass | FalseClass)


34
35
36
# File 'lib/mist_api/models/js_inventory_item.rb', line 34

def has_support
  @has_support
end

#masterTrueClass | FalseClass

Indicates whether it is Master

Returns:

  • (TrueClass | FalseClass)


38
39
40
# File 'lib/mist_api/models/js_inventory_item.rb', line 38

def master
  @master
end

#modelString

Model of the install base inventory

Returns:

  • (String)


42
43
44
# File 'lib/mist_api/models/js_inventory_item.rb', line 42

def model
  @model
end

#org_idUUID | String

Model of the install base inventory

Returns:

  • (UUID | String)


46
47
48
# File 'lib/mist_api/models/js_inventory_item.rb', line 46

def org_id
  @org_id
end

#serialString

Serial Number of the inventory

Returns:

  • (String)


50
51
52
# File 'lib/mist_api/models/js_inventory_item.rb', line 50

def serial
  @serial
end

#skuString

Serviceable device stock

Returns:

  • (String)


54
55
56
# File 'lib/mist_api/models/js_inventory_item.rb', line 54

def sku
  @sku
end

#statusString

Status of the connected device

Returns:

  • (String)


58
59
60
# File 'lib/mist_api/models/js_inventory_item.rb', line 58

def status
  @status
end

#suggested_versionString

Suggested SW version

Returns:

  • (String)


62
63
64
# File 'lib/mist_api/models/js_inventory_item.rb', line 62

def suggested_version
  @suggested_version
end

#typeDeviceTypeEnum

enum: ‘ap`, `gateway`, `switch`

Returns:



66
67
68
# File 'lib/mist_api/models/js_inventory_item.rb', line 66

def type
  @type
end

#versionString

SW version running

Returns:

  • (String)


70
71
72
# File 'lib/mist_api/models/js_inventory_item.rb', line 70

def version
  @version
end

#version_descriptionString

Version description

Returns:

  • (String)


74
75
76
# File 'lib/mist_api/models/js_inventory_item.rb', line 74

def version_description
  @version_description
end

#version_eos_timeInteger

End of Service of version

Returns:

  • (Integer)


78
79
80
# File 'lib/mist_api/models/js_inventory_item.rb', line 78

def version_eos_time
  @version_eos_time
end

#version_timeInteger

FRS date of the version

Returns:

  • (Integer)


82
83
84
# File 'lib/mist_api/models/js_inventory_item.rb', line 82

def version_time
  @version_time
end

#warrantyString

warranty description

Returns:

  • (String)


86
87
88
# File 'lib/mist_api/models/js_inventory_item.rb', line 86

def warranty
  @warranty
end

#warranty_timeInteger

Time when warranty needs to be renewed

Returns:

  • (Integer)


90
91
92
# File 'lib/mist_api/models/js_inventory_item.rb', line 90

def warranty_time
  @warranty_time
end

#warranty_typeJsiWarrantyTypeEnum

Warranty type for Juniper Support Insight (JSI) devices. The warranty type is used to determine the support level and duration of the warranty for the device. enum:

* WTY00001: Standard Hardware Warranty
* WTY00002: Enhanced Hardware Warranty
* WTY00003: Dead On Arrival Warranty
* WTY00004: Limited Lifetime Warranty
* WTY00005: Software Warranty
* WTY00006: Limited Lifetime Warranty for WLA
* WTY00007: Warranty-JCPO EOL (DOA Not Included)
* WTY00008: MIST Enhanced Hardware Warranty
* WTY00009: MIST Standard Warranty
* WTY00099: Determine Lifetime warranty

Returns:



107
108
109
# File 'lib/mist_api/models/js_inventory_item.rb', line 107

def warranty_type
  @warranty_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/mist_api/models/js_inventory_item.rb', line 199

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  claimed = hash.key?('claimed') ? hash['claimed'] : SKIP
  device_name = hash.key?('device_name') ? hash['device_name'] : SKIP
  eol_psn = hash.key?('eol_psn') ? hash['eol_psn'] : SKIP
  eol_time = hash.key?('eol_time') ? hash['eol_time'] : SKIP
  eos_time = hash.key?('eos_time') ? hash['eos_time'] : SKIP
  has_support = hash.key?('has_support') ? hash['has_support'] : SKIP
  master = hash.key?('master') ? hash['master'] : SKIP
  model = hash.key?('model') ? hash['model'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  serial = hash.key?('serial') ? hash['serial'] : SKIP
  sku = hash.key?('sku') ? hash['sku'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  suggested_version =
    hash.key?('suggested_version') ? hash['suggested_version'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  version = hash.key?('version') ? hash['version'] : SKIP
  version_description =
    hash.key?('version_description') ? hash['version_description'] : SKIP
  version_eos_time =
    hash.key?('version_eos_time') ? hash['version_eos_time'] : SKIP
  version_time = hash.key?('version_time') ? hash['version_time'] : SKIP
  warranty = hash.key?('warranty') ? hash['warranty'] : SKIP
  warranty_time = hash.key?('warranty_time') ? hash['warranty_time'] : SKIP
  warranty_type = hash.key?('warranty_type') ? hash['warranty_type'] : SKIP

  # Create object from extracted values.
  JsInventoryItem.new(claimed,
                      device_name,
                      eol_psn,
                      eol_time,
                      eos_time,
                      has_support,
                      master,
                      model,
                      org_id,
                      serial,
                      sku,
                      status,
                      suggested_version,
                      type,
                      version,
                      version_description,
                      version_eos_time,
                      version_time,
                      warranty,
                      warranty_time,
                      warranty_type)
end

.namesObject

A mapping from model property names to API property names.



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/mist_api/models/js_inventory_item.rb', line 110

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['claimed'] = 'claimed'
  @_hash['device_name'] = 'device_name'
  @_hash['eol_psn'] = 'eol_psn'
  @_hash['eol_time'] = 'eol_time'
  @_hash['eos_time'] = 'eos_time'
  @_hash['has_support'] = 'has_support'
  @_hash['master'] = 'master'
  @_hash['model'] = 'model'
  @_hash['org_id'] = 'org_id'
  @_hash['serial'] = 'serial'
  @_hash['sku'] = 'sku'
  @_hash['status'] = 'status'
  @_hash['suggested_version'] = 'suggested_version'
  @_hash['type'] = 'type'
  @_hash['version'] = 'version'
  @_hash['version_description'] = 'version_description'
  @_hash['version_eos_time'] = 'version_eos_time'
  @_hash['version_time'] = 'version_time'
  @_hash['warranty'] = 'warranty'
  @_hash['warranty_time'] = 'warranty_time'
  @_hash['warranty_type'] = 'warranty_type'
  @_hash
end

.nullablesObject

An array for nullable fields



164
165
166
# File 'lib/mist_api/models/js_inventory_item.rb', line 164

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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
# File 'lib/mist_api/models/js_inventory_item.rb', line 137

def self.optionals
  %w[
    claimed
    device_name
    eol_psn
    eol_time
    eos_time
    has_support
    master
    model
    org_id
    serial
    sku
    status
    suggested_version
    type
    version
    version_description
    version_eos_time
    version_time
    warranty
    warranty_time
    warranty_type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/mist_api/models/js_inventory_item.rb', line 265

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} claimed: #{@claimed.inspect}, device_name: #{@device_name.inspect},"\
  " eol_psn: #{@eol_psn.inspect}, eol_time: #{@eol_time.inspect}, eos_time:"\
  " #{@eos_time.inspect}, has_support: #{@has_support.inspect}, master: #{@master.inspect},"\
  " model: #{@model.inspect}, org_id: #{@org_id.inspect}, serial: #{@serial.inspect}, sku:"\
  " #{@sku.inspect}, status: #{@status.inspect}, suggested_version:"\
  " #{@suggested_version.inspect}, type: #{@type.inspect}, version: #{@version.inspect},"\
  " version_description: #{@version_description.inspect}, version_eos_time:"\
  " #{@version_eos_time.inspect}, version_time: #{@version_time.inspect}, warranty:"\
  " #{@warranty.inspect}, warranty_time: #{@warranty_time.inspect}, warranty_type:"\
  " #{@warranty_type.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



253
254
255
256
257
258
259
260
261
262
# File 'lib/mist_api/models/js_inventory_item.rb', line 253

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} claimed: #{@claimed}, device_name: #{@device_name}, eol_psn: #{@eol_psn},"\
  " eol_time: #{@eol_time}, eos_time: #{@eos_time}, has_support: #{@has_support}, master:"\
  " #{@master}, model: #{@model}, org_id: #{@org_id}, serial: #{@serial}, sku: #{@sku},"\
  " status: #{@status}, suggested_version: #{@suggested_version}, type: #{@type}, version:"\
  " #{@version}, version_description: #{@version_description}, version_eos_time:"\
  " #{@version_eos_time}, version_time: #{@version_time}, warranty: #{@warranty},"\
  " warranty_time: #{@warranty_time}, warranty_type: #{@warranty_type}>"
end