Class: CrxPackageManager::Package

Inherits:
Object
  • Object
show all
Defined in:
lib/crx_packmgr_api_client/models/package.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Package

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/crx_packmgr_api_client/models/package.rb', line 176

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'pid')
    self.pid = attributes[:'pid']
  end

  if attributes.has_key?(:'path')
    self.path = attributes[:'path']
  end

  if attributes.has_key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.has_key?(:'downloadName')
    self.download_name = attributes[:'downloadName']
  end

  if attributes.has_key?(:'group')
    self.group = attributes[:'group']
  end

  if attributes.has_key?(:'groupTitle')
    self.group_title = attributes[:'groupTitle']
  end

  if attributes.has_key?(:'version')
    self.version = attributes[:'version']
  end

  if attributes.has_key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.has_key?(:'thumbnail')
    self.thumbnail = attributes[:'thumbnail']
  end

  if attributes.has_key?(:'buildCount')
    self.build_count = attributes[:'buildCount']
  end

  if attributes.has_key?(:'lastModified')
    self.last_modified = attributes[:'lastModified']
  end

  if attributes.has_key?(:'lastModifiedBy')
    self.last_modified_by = attributes[:'lastModifiedBy']
  end

  if attributes.has_key?(:'created')
    self.created = attributes[:'created']
  end

  if attributes.has_key?(:'createBy')
    self.create_by = attributes[:'createBy']
  end

  if attributes.has_key?(:'lastUnpacked')
    self.last_unpacked = attributes[:'lastUnpacked']
  end

  if attributes.has_key?(:'lastUnpackedBy')
    self.last_unpacked_by = attributes[:'lastUnpackedBy']
  end

  if attributes.has_key?(:'lastWrapped')
    self.last_wrapped = attributes[:'lastWrapped']
  end

  if attributes.has_key?(:'lastWrappedBy')
    self.last_wrapped_by = attributes[:'lastWrappedBy']
  end

  if attributes.has_key?(:'lastUnwrapped')
    self.last_unwrapped = attributes[:'lastUnwrapped']
  end

  if attributes.has_key?(:'lastUnwrappedBy')
    self.last_unwrapped_by = attributes[:'lastUnwrappedBy']
  end

  if attributes.has_key?(:'size')
    self.size = attributes[:'size']
  end

  if attributes.has_key?(:'hasSnapshot')
    self.has_snapshot = attributes[:'hasSnapshot']
  end

  if attributes.has_key?(:'needsRewrap')
    self.needs_rewrap = attributes[:'needsRewrap']
  end

  if attributes.has_key?(:'builtWith')
    self.built_with = attributes[:'builtWith']
  end

  if attributes.has_key?(:'testedWith')
    self.tested_with = attributes[:'testedWith']
  end

  if attributes.has_key?(:'fixedBugs')
    self.fixed_bugs = attributes[:'fixedBugs']
  end

  if attributes.has_key?(:'requiresRoot')
    self.requires_root = attributes[:'requiresRoot']
  end

  if attributes.has_key?(:'requiresRestart')
    self.requires_restart = attributes[:'requiresRestart']
  end

  if attributes.has_key?(:'acHandling')
    self.ac_handling = attributes[:'acHandling']
  end

  if attributes.has_key?(:'dependencies')
    if (value = attributes[:'dependencies']).is_a?(Array)
      self.dependencies = value
    end
  end

  if attributes.has_key?(:'resolved')
    self.resolved = attributes[:'resolved']
  end

  if attributes.has_key?(:'filter')
    if (value = attributes[:'filter']).is_a?(Array)
      self.filter = value
    end
  end

  if attributes.has_key?(:'screenshots')
    if (value = attributes[:'screenshots']).is_a?(Array)
      self.screenshots = value
    end
  end

end

Instance Attribute Details

#ac_handlingObject

Returns the value of attribute ac_handling.



85
86
87
# File 'lib/crx_packmgr_api_client/models/package.rb', line 85

def ac_handling
  @ac_handling
end

#build_countObject

Returns the value of attribute build_count.



47
48
49
# File 'lib/crx_packmgr_api_client/models/package.rb', line 47

def build_count
  @build_count
end

#built_withObject

Returns the value of attribute built_with.



75
76
77
# File 'lib/crx_packmgr_api_client/models/package.rb', line 75

def built_with
  @built_with
end

#create_byObject

Returns the value of attribute create_by.



55
56
57
# File 'lib/crx_packmgr_api_client/models/package.rb', line 55

def create_by
  @create_by
end

#createdObject

Returns the value of attribute created.



53
54
55
# File 'lib/crx_packmgr_api_client/models/package.rb', line 53

def created
  @created
end

#dependenciesObject

Returns the value of attribute dependencies.



87
88
89
# File 'lib/crx_packmgr_api_client/models/package.rb', line 87

def dependencies
  @dependencies
end

#descriptionObject

Returns the value of attribute description.



43
44
45
# File 'lib/crx_packmgr_api_client/models/package.rb', line 43

def description
  @description
end

#download_nameObject

Returns the value of attribute download_name.



35
36
37
# File 'lib/crx_packmgr_api_client/models/package.rb', line 35

def download_name
  @download_name
end

#filterObject

Returns the value of attribute filter.



91
92
93
# File 'lib/crx_packmgr_api_client/models/package.rb', line 91

def filter
  @filter
end

#fixed_bugsObject

Returns the value of attribute fixed_bugs.



79
80
81
# File 'lib/crx_packmgr_api_client/models/package.rb', line 79

def fixed_bugs
  @fixed_bugs
end

#groupObject

Returns the value of attribute group.



37
38
39
# File 'lib/crx_packmgr_api_client/models/package.rb', line 37

def group
  @group
end

#group_titleObject

Returns the value of attribute group_title.



39
40
41
# File 'lib/crx_packmgr_api_client/models/package.rb', line 39

def group_title
  @group_title
end

#has_snapshotObject

Returns the value of attribute has_snapshot.



71
72
73
# File 'lib/crx_packmgr_api_client/models/package.rb', line 71

def has_snapshot
  @has_snapshot
end

#last_modifiedObject

Returns the value of attribute last_modified.



49
50
51
# File 'lib/crx_packmgr_api_client/models/package.rb', line 49

def last_modified
  @last_modified
end

#last_modified_byObject

Returns the value of attribute last_modified_by.



51
52
53
# File 'lib/crx_packmgr_api_client/models/package.rb', line 51

def last_modified_by
  @last_modified_by
end

#last_unpackedObject

Returns the value of attribute last_unpacked.



57
58
59
# File 'lib/crx_packmgr_api_client/models/package.rb', line 57

def last_unpacked
  @last_unpacked
end

#last_unpacked_byObject

Returns the value of attribute last_unpacked_by.



59
60
61
# File 'lib/crx_packmgr_api_client/models/package.rb', line 59

def last_unpacked_by
  @last_unpacked_by
end

#last_unwrappedObject

Returns the value of attribute last_unwrapped.



65
66
67
# File 'lib/crx_packmgr_api_client/models/package.rb', line 65

def last_unwrapped
  @last_unwrapped
end

#last_unwrapped_byObject

Returns the value of attribute last_unwrapped_by.



67
68
69
# File 'lib/crx_packmgr_api_client/models/package.rb', line 67

def last_unwrapped_by
  @last_unwrapped_by
end

#last_wrappedObject

Returns the value of attribute last_wrapped.



61
62
63
# File 'lib/crx_packmgr_api_client/models/package.rb', line 61

def last_wrapped
  @last_wrapped
end

#last_wrapped_byObject

Returns the value of attribute last_wrapped_by.



63
64
65
# File 'lib/crx_packmgr_api_client/models/package.rb', line 63

def last_wrapped_by
  @last_wrapped_by
end

#nameObject

Returns the value of attribute name.



33
34
35
# File 'lib/crx_packmgr_api_client/models/package.rb', line 33

def name
  @name
end

#needs_rewrapObject

Returns the value of attribute needs_rewrap.



73
74
75
# File 'lib/crx_packmgr_api_client/models/package.rb', line 73

def needs_rewrap
  @needs_rewrap
end

#pathObject

Returns the value of attribute path.



31
32
33
# File 'lib/crx_packmgr_api_client/models/package.rb', line 31

def path
  @path
end

#pidObject

Returns the value of attribute pid.



29
30
31
# File 'lib/crx_packmgr_api_client/models/package.rb', line 29

def pid
  @pid
end

#requires_restartObject

Returns the value of attribute requires_restart.



83
84
85
# File 'lib/crx_packmgr_api_client/models/package.rb', line 83

def requires_restart
  @requires_restart
end

#requires_rootObject

Returns the value of attribute requires_root.



81
82
83
# File 'lib/crx_packmgr_api_client/models/package.rb', line 81

def requires_root
  @requires_root
end

#resolvedObject

Returns the value of attribute resolved.



89
90
91
# File 'lib/crx_packmgr_api_client/models/package.rb', line 89

def resolved
  @resolved
end

#screenshotsObject

Returns the value of attribute screenshots.



93
94
95
# File 'lib/crx_packmgr_api_client/models/package.rb', line 93

def screenshots
  @screenshots
end

#sizeObject

Returns the value of attribute size.



69
70
71
# File 'lib/crx_packmgr_api_client/models/package.rb', line 69

def size
  @size
end

#tested_withObject

Returns the value of attribute tested_with.



77
78
79
# File 'lib/crx_packmgr_api_client/models/package.rb', line 77

def tested_with
  @tested_with
end

#thumbnailObject

Returns the value of attribute thumbnail.



45
46
47
# File 'lib/crx_packmgr_api_client/models/package.rb', line 45

def thumbnail
  @thumbnail
end

#versionObject

Returns the value of attribute version.



41
42
43
# File 'lib/crx_packmgr_api_client/models/package.rb', line 41

def version
  @version
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



97
98
99
100
101
102
103
104
105
106
107
108
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
# File 'lib/crx_packmgr_api_client/models/package.rb', line 97

def self.attribute_map
  {
    :'pid' => :'pid',
    :'path' => :'path',
    :'name' => :'name',
    :'download_name' => :'downloadName',
    :'group' => :'group',
    :'group_title' => :'groupTitle',
    :'version' => :'version',
    :'description' => :'description',
    :'thumbnail' => :'thumbnail',
    :'build_count' => :'buildCount',
    :'last_modified' => :'lastModified',
    :'last_modified_by' => :'lastModifiedBy',
    :'created' => :'created',
    :'create_by' => :'createBy',
    :'last_unpacked' => :'lastUnpacked',
    :'last_unpacked_by' => :'lastUnpackedBy',
    :'last_wrapped' => :'lastWrapped',
    :'last_wrapped_by' => :'lastWrappedBy',
    :'last_unwrapped' => :'lastUnwrapped',
    :'last_unwrapped_by' => :'lastUnwrappedBy',
    :'size' => :'size',
    :'has_snapshot' => :'hasSnapshot',
    :'needs_rewrap' => :'needsRewrap',
    :'built_with' => :'builtWith',
    :'tested_with' => :'testedWith',
    :'fixed_bugs' => :'fixedBugs',
    :'requires_root' => :'requiresRoot',
    :'requires_restart' => :'requiresRestart',
    :'ac_handling' => :'acHandling',
    :'dependencies' => :'dependencies',
    :'resolved' => :'resolved',
    :'filter' => :'filter',
    :'screenshots' => :'screenshots'
  }
end

.swagger_typesObject

Attribute type mapping.



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/crx_packmgr_api_client/models/package.rb', line 136

def self.swagger_types
  {
    :'pid' => :'String',
    :'path' => :'String',
    :'name' => :'String',
    :'download_name' => :'String',
    :'group' => :'String',
    :'group_title' => :'String',
    :'version' => :'String',
    :'description' => :'String',
    :'thumbnail' => :'String',
    :'build_count' => :'Integer',
    :'last_modified' => :'Integer',
    :'last_modified_by' => :'String',
    :'created' => :'Integer',
    :'create_by' => :'String',
    :'last_unpacked' => :'Integer',
    :'last_unpacked_by' => :'String',
    :'last_wrapped' => :'Integer',
    :'last_wrapped_by' => :'String',
    :'last_unwrapped' => :'Integer',
    :'last_unwrapped_by' => :'String',
    :'size' => :'Integer',
    :'has_snapshot' => :'BOOLEAN',
    :'needs_rewrap' => :'BOOLEAN',
    :'built_with' => :'String',
    :'tested_with' => :'String',
    :'fixed_bugs' => :'String',
    :'requires_root' => :'BOOLEAN',
    :'requires_restart' => :'BOOLEAN',
    :'ac_handling' => :'String',
    :'dependencies' => :'Array<String>',
    :'resolved' => :'BOOLEAN',
    :'filter' => :'Array<PackageFilter>',
    :'screenshots' => :'Array<String>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# File 'lib/crx_packmgr_api_client/models/package.rb', line 337

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      pid == o.pid &&
      path == o.path &&
      name == o.name &&
      download_name == o.download_name &&
      group == o.group &&
      group_title == o.group_title &&
      version == o.version &&
      description == o.description &&
      thumbnail == o.thumbnail &&
      build_count == o.build_count &&
      last_modified == o.last_modified &&
      last_modified_by == o.last_modified_by &&
      created == o.created &&
      create_by == o.create_by &&
      last_unpacked == o.last_unpacked &&
      last_unpacked_by == o.last_unpacked_by &&
      last_wrapped == o.last_wrapped &&
      last_wrapped_by == o.last_wrapped_by &&
      last_unwrapped == o.last_unwrapped &&
      last_unwrapped_by == o.last_unwrapped_by &&
      size == o.size &&
      has_snapshot == o.has_snapshot &&
      needs_rewrap == o.needs_rewrap &&
      built_with == o.built_with &&
      tested_with == o.tested_with &&
      fixed_bugs == o.fixed_bugs &&
      requires_root == o.requires_root &&
      requires_restart == o.requires_restart &&
      ac_handling == o.ac_handling &&
      dependencies == o.dependencies &&
      resolved == o.resolved &&
      filter == o.filter &&
      screenshots == o.screenshots
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
# File 'lib/crx_packmgr_api_client/models/package.rb', line 411

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /^(true|t|yes|y|1)$/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = CrxPackageManager.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



477
478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/crx_packmgr_api_client/models/package.rb', line 477

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/crx_packmgr_api_client/models/package.rb', line 390

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


377
378
379
# File 'lib/crx_packmgr_api_client/models/package.rb', line 377

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



383
384
385
# File 'lib/crx_packmgr_api_client/models/package.rb', line 383

def hash
  [pid, path, name, download_name, group, group_title, version, description, thumbnail, build_count, last_modified, last_modified_by, created, create_by, last_unpacked, last_unpacked_by, last_wrapped, last_wrapped_by, last_unwrapped, last_unwrapped_by, size, has_snapshot, needs_rewrap, built_with, tested_with, fixed_bugs, requires_root, requires_restart, ac_handling, dependencies, resolved, filter, screenshots].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



324
325
326
327
# File 'lib/crx_packmgr_api_client/models/package.rb', line 324

def list_invalid_properties
  invalid_properties = Array.new
  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



457
458
459
# File 'lib/crx_packmgr_api_client/models/package.rb', line 457

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



463
464
465
466
467
468
469
470
471
# File 'lib/crx_packmgr_api_client/models/package.rb', line 463

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



451
452
453
# File 'lib/crx_packmgr_api_client/models/package.rb', line 451

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



331
332
333
# File 'lib/crx_packmgr_api_client/models/package.rb', line 331

def valid?
  return true
end