Class: PulpDebClient::DebSourcePackageResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/pulp_deb_client/models/deb_source_package_response.rb

Overview

A Serializer for DscFile.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DebSourcePackageResponse

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 165

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::DebSourcePackageResponse` 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 `PulpDebClient::DebSourcePackageResponse`. 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?(:'pulp_created')
    self.pulp_created = attributes[:'pulp_created']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#architectureObject

Returns the value of attribute architecture.



35
36
37
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 35

def architecture
  @architecture
end

#artifactsObject

A dict mapping relative paths inside the Content to the correspondingArtifact URLs. E.g.: {‘relative/path’: ‘/artifacts/1/’



24
25
26
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 24

def artifacts
  @artifacts
end

#binaryObject

Returns the value of attribute binary.



33
34
35
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 33

def binary
  @binary
end

#build_conflictsObject

Returns the value of attribute build_conflicts.



75
76
77
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 75

def build_conflicts
  @build_conflicts
end

#build_conflicts_archObject

Returns the value of attribute build_conflicts_arch.



79
80
81
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 79

def build_conflicts_arch
  @build_conflicts_arch
end

#build_conflicts_indepObject

Returns the value of attribute build_conflicts_indep.



77
78
79
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 77

def build_conflicts_indep
  @build_conflicts_indep
end

#build_dependsObject

Returns the value of attribute build_depends.



69
70
71
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 69

def build_depends
  @build_depends
end

#build_depends_archObject

Returns the value of attribute build_depends_arch.



73
74
75
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 73

def build_depends_arch
  @build_depends_arch
end

#build_depends_indepObject

Returns the value of attribute build_depends_indep.



71
72
73
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 71

def build_depends_indep
  @build_depends_indep
end

#dgitObject

Returns the value of attribute dgit.



65
66
67
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 65

def dgit
  @dgit
end

#formatObject

Returns the value of attribute format.



29
30
31
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 29

def format
  @format
end

#homepageObject

Returns the value of attribute homepage.



43
44
45
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 43

def homepage
  @homepage
end

#maintainerObject

Returns the value of attribute maintainer.



39
40
41
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 39

def maintainer
  @maintainer
end

#package_listObject

Returns the value of attribute package_list.



81
82
83
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 81

def package_list
  @package_list
end

#pulp_createdObject

Timestamp of creation.



21
22
23
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 21

def pulp_created
  @pulp_created
end

#pulp_hrefObject

Returns the value of attribute pulp_href.



18
19
20
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 18

def pulp_href
  @pulp_href
end

#relative_pathObject

Relative path of the Debian Source Control (dsc) file.It is normally advised to let Pulp generate this.



27
28
29
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 27

def relative_path
  @relative_path
end

#sourceObject

Returns the value of attribute source.



31
32
33
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 31

def source
  @source
end

#standards_versionObject

Returns the value of attribute standards_version.



67
68
69
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 67

def standards_version
  @standards_version
end

#testsuiteObject

Returns the value of attribute testsuite.



63
64
65
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 63

def testsuite
  @testsuite
end

#uploadersObject

Returns the value of attribute uploaders.



41
42
43
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 41

def uploaders
  @uploaders
end

#vcs_archObject

Returns the value of attribute vcs_arch.



47
48
49
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 47

def vcs_arch
  @vcs_arch
end

#vcs_browserObject

Returns the value of attribute vcs_browser.



45
46
47
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 45

def vcs_browser
  @vcs_browser
end

#vcs_bzrObject

Returns the value of attribute vcs_bzr.



49
50
51
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 49

def vcs_bzr
  @vcs_bzr
end

#vcs_cvsObject

Returns the value of attribute vcs_cvs.



51
52
53
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 51

def vcs_cvs
  @vcs_cvs
end

#vcs_darcsObject

Returns the value of attribute vcs_darcs.



53
54
55
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 53

def vcs_darcs
  @vcs_darcs
end

#vcs_gitObject

Returns the value of attribute vcs_git.



55
56
57
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 55

def vcs_git
  @vcs_git
end

#vcs_hgObject

Returns the value of attribute vcs_hg.



57
58
59
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 57

def vcs_hg
  @vcs_hg
end

#vcs_mtnObject

Returns the value of attribute vcs_mtn.



59
60
61
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 59

def vcs_mtn
  @vcs_mtn
end

#vcs_snvObject

Returns the value of attribute vcs_snv.



61
62
63
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 61

def vcs_snv
  @vcs_snv
end

#versionObject

Returns the value of attribute version.



37
38
39
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 37

def version
  @version
end

Class Method Details

.attribute_mapObject

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



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 84

def self.attribute_map
  {
    :'pulp_href' => :'pulp_href',
    :'pulp_created' => :'pulp_created',
    :'artifacts' => :'artifacts',
    :'relative_path' => :'relative_path',
    :'format' => :'format',
    :'source' => :'source',
    :'binary' => :'binary',
    :'architecture' => :'architecture',
    :'version' => :'version',
    :'maintainer' => :'maintainer',
    :'uploaders' => :'uploaders',
    :'homepage' => :'homepage',
    :'vcs_browser' => :'vcs_browser',
    :'vcs_arch' => :'vcs_arch',
    :'vcs_bzr' => :'vcs_bzr',
    :'vcs_cvs' => :'vcs_cvs',
    :'vcs_darcs' => :'vcs_darcs',
    :'vcs_git' => :'vcs_git',
    :'vcs_hg' => :'vcs_hg',
    :'vcs_mtn' => :'vcs_mtn',
    :'vcs_snv' => :'vcs_snv',
    :'testsuite' => :'testsuite',
    :'dgit' => :'dgit',
    :'standards_version' => :'standards_version',
    :'build_depends' => :'build_depends',
    :'build_depends_indep' => :'build_depends_indep',
    :'build_depends_arch' => :'build_depends_arch',
    :'build_conflicts' => :'build_conflicts',
    :'build_conflicts_indep' => :'build_conflicts_indep',
    :'build_conflicts_arch' => :'build_conflicts_arch',
    :'package_list' => :'package_list'
  }
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



374
375
376
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 374

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

.openapi_nullableObject

List of attributes with nullable: true



158
159
160
161
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 158

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

.openapi_typesObject

Attribute type mapping.



121
122
123
124
125
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
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 121

def self.openapi_types
  {
    :'pulp_href' => :'String',
    :'pulp_created' => :'DateTime',
    :'artifacts' => :'Object',
    :'relative_path' => :'String',
    :'format' => :'String',
    :'source' => :'String',
    :'binary' => :'String',
    :'architecture' => :'String',
    :'version' => :'String',
    :'maintainer' => :'String',
    :'uploaders' => :'String',
    :'homepage' => :'String',
    :'vcs_browser' => :'String',
    :'vcs_arch' => :'String',
    :'vcs_bzr' => :'String',
    :'vcs_cvs' => :'String',
    :'vcs_darcs' => :'String',
    :'vcs_git' => :'String',
    :'vcs_hg' => :'String',
    :'vcs_mtn' => :'String',
    :'vcs_snv' => :'String',
    :'testsuite' => :'String',
    :'dgit' => :'String',
    :'standards_version' => :'String',
    :'build_depends' => :'String',
    :'build_depends_indep' => :'String',
    :'build_depends_arch' => :'String',
    :'build_conflicts' => :'String',
    :'build_conflicts_indep' => :'String',
    :'build_conflicts_arch' => :'String',
    :'package_list' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 323

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      pulp_href == o.pulp_href &&
      pulp_created == o.pulp_created &&
      artifacts == o.artifacts &&
      relative_path == o.relative_path &&
      format == o.format &&
      source == o.source &&
      binary == o.binary &&
      architecture == o.architecture &&
      version == o.version &&
      maintainer == o.maintainer &&
      uploaders == o.uploaders &&
      homepage == o.homepage &&
      vcs_browser == o.vcs_browser &&
      vcs_arch == o.vcs_arch &&
      vcs_bzr == o.vcs_bzr &&
      vcs_cvs == o.vcs_cvs &&
      vcs_darcs == o.vcs_darcs &&
      vcs_git == o.vcs_git &&
      vcs_hg == o.vcs_hg &&
      vcs_mtn == o.vcs_mtn &&
      vcs_snv == o.vcs_snv &&
      testsuite == o.testsuite &&
      dgit == o.dgit &&
      standards_version == o.standards_version &&
      build_depends == o.build_depends &&
      build_depends_indep == o.build_depends_indep &&
      build_depends_arch == o.build_depends_arch &&
      build_conflicts == o.build_conflicts &&
      build_conflicts_indep == o.build_conflicts_indep &&
      build_conflicts_arch == o.build_conflicts_arch &&
      package_list == o.package_list
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



402
403
404
405
406
407
408
409
410
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
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 402

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
    PulpDebClient.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



471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 471

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



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 381

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


361
362
363
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 361

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



367
368
369
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 367

def hash
  [pulp_href, pulp_created, artifacts, relative_path, format, source, binary, architecture, version, maintainer, uploaders, homepage, vcs_browser, vcs_arch, vcs_bzr, vcs_cvs, vcs_darcs, vcs_git, vcs_hg, vcs_mtn, vcs_snv, testsuite, dgit, standards_version, build_depends, build_depends_indep, build_depends_arch, build_conflicts, build_conflicts_indep, build_conflicts_arch, package_list].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



305
306
307
308
309
310
311
312
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 305

def list_invalid_properties
  invalid_properties = Array.new
  if @artifacts.nil?
    invalid_properties.push('invalid value for "artifacts", artifacts 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



447
448
449
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 447

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



453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 453

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



441
442
443
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 441

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



316
317
318
319
# File 'lib/pulp_deb_client/models/deb_source_package_response.rb', line 316

def valid?
  return false if @artifacts.nil?
  true
end