Class: PulpRpmClient::RpmDistributionTree

Inherits:
Object
  • Object
show all
Defined in:
lib/pulp_rpm_client/models/rpm_distribution_tree.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RpmDistributionTree

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 127

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RpmDistributionTree` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::RpmDistributionTree`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'pulp_href')
    self.pulp_href = attributes[:'pulp_href']
  end

  if attributes.key?(:'header_version')
    self.header_version = attributes[:'header_version']
  end

  if attributes.key?(:'release_name')
    self.release_name = attributes[:'release_name']
  end

  if attributes.key?(:'release_short')
    self.release_short = attributes[:'release_short']
  end

  if attributes.key?(:'release_version')
    self.release_version = attributes[:'release_version']
  end

  if attributes.key?(:'release_is_layered')
    self.release_is_layered = attributes[:'release_is_layered']
  end

  if attributes.key?(:'base_product_name')
    self.base_product_name = attributes[:'base_product_name']
  end

  if attributes.key?(:'base_product_short')
    self.base_product_short = attributes[:'base_product_short']
  end

  if attributes.key?(:'base_product_version')
    self.base_product_version = attributes[:'base_product_version']
  end

  if attributes.key?(:'arch')
    self.arch = attributes[:'arch']
  end

  if attributes.key?(:'build_timestamp')
    self.build_timestamp = attributes[:'build_timestamp']
  end

  if attributes.key?(:'instimage')
    self.instimage = attributes[:'instimage']
  end

  if attributes.key?(:'mainimage')
    self.mainimage = attributes[:'mainimage']
  end

  if attributes.key?(:'discnum')
    self.discnum = attributes[:'discnum']
  end

  if attributes.key?(:'totaldiscs')
    self.totaldiscs = attributes[:'totaldiscs']
  end

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

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

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

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

Instance Attribute Details

#addonsObject

Returns the value of attribute addons.



61
62
63
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 61

def addons
  @addons
end

#archObject

Tree architecturerch.



44
45
46
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 44

def arch
  @arch
end

#base_product_nameObject

Base Product name.



35
36
37
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 35

def base_product_name
  @base_product_name
end

#base_product_shortObject

Base Product short name.



38
39
40
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 38

def base_product_short
  @base_product_short
end

#base_product_versionObject

Base Product version.



41
42
43
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 41

def base_product_version
  @base_product_version
end

#build_timestampObject

Tree build time timestamp.



47
48
49
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 47

def build_timestamp
  @build_timestamp
end

#checksumsObject

Returns the value of attribute checksums.



63
64
65
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 63

def checksums
  @checksums
end

#discnumObject

Disc number.



56
57
58
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 56

def discnum
  @discnum
end

#header_versionObject

Header Version.



20
21
22
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 20

def header_version
  @header_version
end

#imagesObject

Returns the value of attribute images.



65
66
67
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 65

def images
  @images
end

#instimageObject

Relative path to Anaconda instimage.



50
51
52
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 50

def instimage
  @instimage
end

#mainimageObject

Relative path to Anaconda stage2 image.



53
54
55
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 53

def mainimage
  @mainimage
end

#pulp_hrefObject

Returns the value of attribute pulp_href.



17
18
19
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 17

def pulp_href
  @pulp_href
end

#release_is_layeredObject

Typically False for an operating system, True otherwise.



32
33
34
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 32

def release_is_layered
  @release_is_layered
end

#release_nameObject

Release name.



23
24
25
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 23

def release_name
  @release_name
end

#release_shortObject

Release short name.



26
27
28
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 26

def release_short
  @release_short
end

#release_versionObject

Release version.



29
30
31
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 29

def release_version
  @release_version
end

#totaldiscsObject

Number of discs in media set.



59
60
61
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 59

def totaldiscs
  @totaldiscs
end

#variantsObject

Returns the value of attribute variants.



67
68
69
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 67

def variants
  @variants
end

Class Method Details

.attribute_mapObject

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



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 70

def self.attribute_map
  {
    :'pulp_href' => :'pulp_href',
    :'header_version' => :'header_version',
    :'release_name' => :'release_name',
    :'release_short' => :'release_short',
    :'release_version' => :'release_version',
    :'release_is_layered' => :'release_is_layered',
    :'base_product_name' => :'base_product_name',
    :'base_product_short' => :'base_product_short',
    :'base_product_version' => :'base_product_version',
    :'arch' => :'arch',
    :'build_timestamp' => :'build_timestamp',
    :'instimage' => :'instimage',
    :'mainimage' => :'mainimage',
    :'discnum' => :'discnum',
    :'totaldiscs' => :'totaldiscs',
    :'addons' => :'addons',
    :'checksums' => :'checksums',
    :'images' => :'images',
    :'variants' => :'variants'
  }
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



559
560
561
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 559

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



120
121
122
123
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 120

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 95

def self.openapi_types
  {
    :'pulp_href' => :'String',
    :'header_version' => :'String',
    :'release_name' => :'String',
    :'release_short' => :'String',
    :'release_version' => :'String',
    :'release_is_layered' => :'Boolean',
    :'base_product_name' => :'String',
    :'base_product_short' => :'String',
    :'base_product_version' => :'String',
    :'arch' => :'String',
    :'build_timestamp' => :'Float',
    :'instimage' => :'String',
    :'mainimage' => :'String',
    :'discnum' => :'Integer',
    :'totaldiscs' => :'Integer',
    :'addons' => :'Array<Addon>',
    :'checksums' => :'Array<Checksum>',
    :'images' => :'Array<Image>',
    :'variants' => :'Array<Variant>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 520

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      pulp_href == o.pulp_href &&
      header_version == o.header_version &&
      release_name == o.release_name &&
      release_short == o.release_short &&
      release_version == o.release_version &&
      release_is_layered == o.release_is_layered &&
      base_product_name == o.base_product_name &&
      base_product_short == o.base_product_short &&
      base_product_version == o.base_product_version &&
      arch == o.arch &&
      build_timestamp == o.build_timestamp &&
      instimage == o.instimage &&
      mainimage == o.mainimage &&
      discnum == o.discnum &&
      totaldiscs == o.totaldiscs &&
      addons == o.addons &&
      checksums == o.checksums &&
      images == o.images &&
      variants == o.variants
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



587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 587

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 =~ /\A(true|t|yes|y|1)\z/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
    PulpRpmClient.const_get(type).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



656
657
658
659
660
661
662
663
664
665
666
667
668
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 656

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



566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 566

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that 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


546
547
548
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 546

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



552
553
554
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 552

def hash
  [pulp_href, header_version, release_name, release_short, release_version, release_is_layered, base_product_name, base_product_short, base_product_version, arch, build_timestamp, instimage, mainimage, discnum, totaldiscs, addons, checksums, images, variants].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 227

def list_invalid_properties
  invalid_properties = Array.new
  if @header_version.nil?
    invalid_properties.push('invalid value for "header_version", header_version cannot be nil.')
  end

  if @header_version.to_s.length < 1
    invalid_properties.push('invalid value for "header_version", the character length must be great than or equal to 1.')
  end

  if @release_name.nil?
    invalid_properties.push('invalid value for "release_name", release_name cannot be nil.')
  end

  if @release_name.to_s.length < 1
    invalid_properties.push('invalid value for "release_name", the character length must be great than or equal to 1.')
  end

  if @release_short.nil?
    invalid_properties.push('invalid value for "release_short", release_short cannot be nil.')
  end

  if @release_short.to_s.length < 1
    invalid_properties.push('invalid value for "release_short", the character length must be great than or equal to 1.')
  end

  if @release_version.nil?
    invalid_properties.push('invalid value for "release_version", release_version cannot be nil.')
  end

  if @release_version.to_s.length < 1
    invalid_properties.push('invalid value for "release_version", the character length must be great than or equal to 1.')
  end

  if @release_is_layered.nil?
    invalid_properties.push('invalid value for "release_is_layered", release_is_layered cannot be nil.')
  end

  if @base_product_name.nil?
    invalid_properties.push('invalid value for "base_product_name", base_product_name cannot be nil.')
  end

  if @base_product_name.to_s.length < 1
    invalid_properties.push('invalid value for "base_product_name", the character length must be great than or equal to 1.')
  end

  if @base_product_short.nil?
    invalid_properties.push('invalid value for "base_product_short", base_product_short cannot be nil.')
  end

  if @base_product_short.to_s.length < 1
    invalid_properties.push('invalid value for "base_product_short", the character length must be great than or equal to 1.')
  end

  if @base_product_version.nil?
    invalid_properties.push('invalid value for "base_product_version", base_product_version cannot be nil.')
  end

  if @base_product_version.to_s.length < 1
    invalid_properties.push('invalid value for "base_product_version", the character length must be great than or equal to 1.')
  end

  if @arch.nil?
    invalid_properties.push('invalid value for "arch", arch cannot be nil.')
  end

  if @arch.to_s.length < 1
    invalid_properties.push('invalid value for "arch", the character length must be great than or equal to 1.')
  end

  if @build_timestamp.nil?
    invalid_properties.push('invalid value for "build_timestamp", build_timestamp cannot be nil.')
  end

  if @instimage.nil?
    invalid_properties.push('invalid value for "instimage", instimage cannot be nil.')
  end

  if @instimage.to_s.length < 1
    invalid_properties.push('invalid value for "instimage", the character length must be great than or equal to 1.')
  end

  if @mainimage.nil?
    invalid_properties.push('invalid value for "mainimage", mainimage cannot be nil.')
  end

  if @mainimage.to_s.length < 1
    invalid_properties.push('invalid value for "mainimage", the character length must be great than or equal to 1.')
  end

  if @discnum.nil?
    invalid_properties.push('invalid value for "discnum", discnum cannot be nil.')
  end

  if @totaldiscs.nil?
    invalid_properties.push('invalid value for "totaldiscs", totaldiscs cannot be nil.')
  end

  if @addons.nil?
    invalid_properties.push('invalid value for "addons", addons cannot be nil.')
  end

  if @checksums.nil?
    invalid_properties.push('invalid value for "checksums", checksums cannot be nil.')
  end

  if @images.nil?
    invalid_properties.push('invalid value for "images", images cannot be nil.')
  end

  if @variants.nil?
    invalid_properties.push('invalid value for "variants", variants cannot be nil.')
  end

  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



632
633
634
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 632

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



638
639
640
641
642
643
644
645
646
647
648
649
650
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 638

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end
    
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



626
627
628
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 626

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



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
374
375
376
# File 'lib/pulp_rpm_client/models/rpm_distribution_tree.rb', line 346

def valid?
  return false if @header_version.nil?
  return false if @header_version.to_s.length < 1
  return false if @release_name.nil?
  return false if @release_name.to_s.length < 1
  return false if @release_short.nil?
  return false if @release_short.to_s.length < 1
  return false if @release_version.nil?
  return false if @release_version.to_s.length < 1
  return false if @release_is_layered.nil?
  return false if @base_product_name.nil?
  return false if @base_product_name.to_s.length < 1
  return false if @base_product_short.nil?
  return false if @base_product_short.to_s.length < 1
  return false if @base_product_version.nil?
  return false if @base_product_version.to_s.length < 1
  return false if @arch.nil?
  return false if @arch.to_s.length < 1
  return false if @build_timestamp.nil?
  return false if @instimage.nil?
  return false if @instimage.to_s.length < 1
  return false if @mainimage.nil?
  return false if @mainimage.to_s.length < 1
  return false if @discnum.nil?
  return false if @totaldiscs.nil?
  return false if @addons.nil?
  return false if @checksums.nil?
  return false if @images.nil?
  return false if @variants.nil?
  true
end