pulp_ansible_client 0.2.0b3 → 0.2.0b5

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,15 +14,24 @@ require 'date'
14
14
 
15
15
  module PulpAnsibleClient
16
16
  class CollectionVersion
17
- # Artifact file representing the physical content
18
- attr_accessor :artifact
17
+ attr_accessor :_href
19
18
 
20
19
  # Timestamp of creation.
21
20
  attr_accessor :_created
22
21
 
23
22
  attr_accessor :_type
24
23
 
25
- attr_accessor :_href
24
+ # Artifact file representing the physical content
25
+ attr_accessor :artifact
26
+
27
+ # Path where the artifact is located relative to distributions base_path
28
+ attr_accessor :relative_path
29
+
30
+ # An uploaded file that should be turned into the artifact of the content unit.
31
+ attr_accessor :file
32
+
33
+ # A URI of a repository the new content unit should be associated with.
34
+ attr_accessor :repository
26
35
 
27
36
  # The MD5 checksum if available.
28
37
  attr_accessor :md5
@@ -81,21 +90,30 @@ module PulpAnsibleClient
81
90
  # The namespace of the collection.
82
91
  attr_accessor :namespace
83
92
 
84
- # The URL of the originating SCM repository.
85
- attr_accessor :repository
86
-
87
93
  attr_accessor :tags
88
94
 
89
95
  # The version of the collection.
90
96
  attr_accessor :version
91
97
 
98
+ # The expected 'name' of the Collection to be verified against the metadata during import.
99
+ attr_accessor :expected_name
100
+
101
+ # The expected 'namespace' of the Collection to be verified against the metadata during import.
102
+ attr_accessor :expected_namespace
103
+
104
+ # The expected version of the Collection to be verified against the metadata during import.
105
+ attr_accessor :expected_version
106
+
92
107
  # Attribute mapping from ruby-style variable name to JSON key.
93
108
  def self.attribute_map
94
109
  {
95
- :'artifact' => :'artifact',
110
+ :'_href' => :'_href',
96
111
  :'_created' => :'_created',
97
112
  :'_type' => :'_type',
98
- :'_href' => :'_href',
113
+ :'artifact' => :'artifact',
114
+ :'relative_path' => :'relative_path',
115
+ :'file' => :'file',
116
+ :'repository' => :'repository',
99
117
  :'md5' => :'md5',
100
118
  :'sha1' => :'sha1',
101
119
  :'sha224' => :'sha224',
@@ -115,19 +133,24 @@ module PulpAnsibleClient
115
133
  :'license' => :'license',
116
134
  :'name' => :'name',
117
135
  :'namespace' => :'namespace',
118
- :'repository' => :'repository',
119
136
  :'tags' => :'tags',
120
- :'version' => :'version'
137
+ :'version' => :'version',
138
+ :'expected_name' => :'expected_name',
139
+ :'expected_namespace' => :'expected_namespace',
140
+ :'expected_version' => :'expected_version'
121
141
  }
122
142
  end
123
143
 
124
144
  # Attribute type mapping.
125
145
  def self.openapi_types
126
146
  {
127
- :'artifact' => :'String',
147
+ :'_href' => :'String',
128
148
  :'_created' => :'DateTime',
129
149
  :'_type' => :'String',
130
- :'_href' => :'String',
150
+ :'artifact' => :'String',
151
+ :'relative_path' => :'String',
152
+ :'file' => :'String',
153
+ :'repository' => :'String',
131
154
  :'md5' => :'String',
132
155
  :'sha1' => :'String',
133
156
  :'sha224' => :'String',
@@ -147,9 +170,11 @@ module PulpAnsibleClient
147
170
  :'license' => :'Array<String>',
148
171
  :'name' => :'String',
149
172
  :'namespace' => :'String',
150
- :'repository' => :'String',
151
173
  :'tags' => :'Array<TagNested>',
152
- :'version' => :'String'
174
+ :'version' => :'String',
175
+ :'expected_name' => :'String',
176
+ :'expected_namespace' => :'String',
177
+ :'expected_version' => :'String'
153
178
  }
154
179
  end
155
180
 
@@ -168,8 +193,8 @@ module PulpAnsibleClient
168
193
  h[k.to_sym] = v
169
194
  }
170
195
 
171
- if attributes.key?(:'artifact')
172
- self.artifact = attributes[:'artifact']
196
+ if attributes.key?(:'_href')
197
+ self._href = attributes[:'_href']
173
198
  end
174
199
 
175
200
  if attributes.key?(:'_created')
@@ -180,8 +205,20 @@ module PulpAnsibleClient
180
205
  self._type = attributes[:'_type']
181
206
  end
182
207
 
183
- if attributes.key?(:'_href')
184
- self._href = attributes[:'_href']
208
+ if attributes.key?(:'artifact')
209
+ self.artifact = attributes[:'artifact']
210
+ end
211
+
212
+ if attributes.key?(:'relative_path')
213
+ self.relative_path = attributes[:'relative_path']
214
+ end
215
+
216
+ if attributes.key?(:'file')
217
+ self.file = attributes[:'file']
218
+ end
219
+
220
+ if attributes.key?(:'repository')
221
+ self.repository = attributes[:'repository']
185
222
  end
186
223
 
187
224
  if attributes.key?(:'md5')
@@ -270,10 +307,6 @@ module PulpAnsibleClient
270
307
  self.namespace = attributes[:'namespace']
271
308
  end
272
309
 
273
- if attributes.key?(:'repository')
274
- self.repository = attributes[:'repository']
275
- end
276
-
277
310
  if attributes.key?(:'tags')
278
311
  if (value = attributes[:'tags']).is_a?(Array)
279
312
  self.tags = value
@@ -283,20 +316,36 @@ module PulpAnsibleClient
283
316
  if attributes.key?(:'version')
284
317
  self.version = attributes[:'version']
285
318
  end
319
+
320
+ if attributes.key?(:'expected_name')
321
+ self.expected_name = attributes[:'expected_name']
322
+ end
323
+
324
+ if attributes.key?(:'expected_namespace')
325
+ self.expected_namespace = attributes[:'expected_namespace']
326
+ end
327
+
328
+ if attributes.key?(:'expected_version')
329
+ self.expected_version = attributes[:'expected_version']
330
+ end
286
331
  end
287
332
 
288
333
  # Show invalid properties with the reasons. Usually used together with valid?
289
334
  # @return Array for valid properties with the reasons
290
335
  def list_invalid_properties
291
336
  invalid_properties = Array.new
292
- if @artifact.nil?
293
- invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
294
- end
295
-
296
337
  if !@_type.nil? && @_type.to_s.length < 1
297
338
  invalid_properties.push('invalid value for "_type", the character length must be great than or equal to 1.')
298
339
  end
299
340
 
341
+ if @relative_path.nil?
342
+ invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
343
+ end
344
+
345
+ if @relative_path.to_s.length < 1
346
+ invalid_properties.push('invalid value for "relative_path", the character length must be great than or equal to 1.')
347
+ end
348
+
300
349
  if !@md5.nil? && @md5.to_s.length < 1
301
350
  invalid_properties.push('invalid value for "md5", the character length must be great than or equal to 1.')
302
351
  end
@@ -321,104 +370,52 @@ module PulpAnsibleClient
321
370
  invalid_properties.push('invalid value for "sha512", the character length must be great than or equal to 1.')
322
371
  end
323
372
 
324
- if @id.nil?
325
- invalid_properties.push('invalid value for "id", id cannot be nil.')
326
- end
327
-
328
- if @authors.nil?
329
- invalid_properties.push('invalid value for "authors", authors cannot be nil.')
330
- end
331
-
332
- if @contents.nil?
333
- invalid_properties.push('invalid value for "contents", contents cannot be nil.')
334
- end
335
-
336
- if @dependencies.nil?
337
- invalid_properties.push('invalid value for "dependencies", dependencies cannot be nil.')
338
- end
339
-
340
- if @description.nil?
341
- invalid_properties.push('invalid value for "description", description cannot be nil.')
342
- end
343
-
344
- if @docs_blob.nil?
345
- invalid_properties.push('invalid value for "docs_blob", docs_blob cannot be nil.')
346
- end
347
-
348
- if @documentation.nil?
349
- invalid_properties.push('invalid value for "documentation", documentation cannot be nil.')
350
- end
351
-
352
- if @documentation.to_s.length > 128
373
+ if !@documentation.nil? && @documentation.to_s.length > 128
353
374
  invalid_properties.push('invalid value for "documentation", the character length must be smaller than or equal to 128.')
354
375
  end
355
376
 
356
- if @homepage.nil?
357
- invalid_properties.push('invalid value for "homepage", homepage cannot be nil.')
358
- end
359
-
360
- if @homepage.to_s.length > 128
377
+ if !@homepage.nil? && @homepage.to_s.length > 128
361
378
  invalid_properties.push('invalid value for "homepage", the character length must be smaller than or equal to 128.')
362
379
  end
363
380
 
364
- if @issues.nil?
365
- invalid_properties.push('invalid value for "issues", issues cannot be nil.')
366
- end
367
-
368
- if @issues.to_s.length > 128
381
+ if !@issues.nil? && @issues.to_s.length > 128
369
382
  invalid_properties.push('invalid value for "issues", the character length must be smaller than or equal to 128.')
370
383
  end
371
384
 
372
- if @is_certified.nil?
373
- invalid_properties.push('invalid value for "is_certified", is_certified cannot be nil.')
374
- end
375
-
376
- if @license.nil?
377
- invalid_properties.push('invalid value for "license", license cannot be nil.')
378
- end
379
-
380
- if @name.nil?
381
- invalid_properties.push('invalid value for "name", name cannot be nil.')
382
- end
383
-
384
- if @name.to_s.length > 32
385
+ if !@name.nil? && @name.to_s.length > 32
385
386
  invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 32.')
386
387
  end
387
388
 
388
- if @name.to_s.length < 1
389
+ if !@name.nil? && @name.to_s.length < 1
389
390
  invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
390
391
  end
391
392
 
392
- if @namespace.nil?
393
- invalid_properties.push('invalid value for "namespace", namespace cannot be nil.')
394
- end
395
-
396
- if @namespace.to_s.length > 32
393
+ if !@namespace.nil? && @namespace.to_s.length > 32
397
394
  invalid_properties.push('invalid value for "namespace", the character length must be smaller than or equal to 32.')
398
395
  end
399
396
 
400
- if @namespace.to_s.length < 1
397
+ if !@namespace.nil? && @namespace.to_s.length < 1
401
398
  invalid_properties.push('invalid value for "namespace", the character length must be great than or equal to 1.')
402
399
  end
403
400
 
404
- if @repository.nil?
405
- invalid_properties.push('invalid value for "repository", repository cannot be nil.')
401
+ if !@version.nil? && @version.to_s.length > 32
402
+ invalid_properties.push('invalid value for "version", the character length must be smaller than or equal to 32.')
406
403
  end
407
404
 
408
- if @repository.to_s.length > 128
409
- invalid_properties.push('invalid value for "repository", the character length must be smaller than or equal to 128.')
405
+ if !@version.nil? && @version.to_s.length < 1
406
+ invalid_properties.push('invalid value for "version", the character length must be great than or equal to 1.')
410
407
  end
411
408
 
412
- if @version.nil?
413
- invalid_properties.push('invalid value for "version", version cannot be nil.')
409
+ if !@expected_name.nil? && @expected_name.to_s.length < 1
410
+ invalid_properties.push('invalid value for "expected_name", the character length must be great than or equal to 1.')
414
411
  end
415
412
 
416
- if @version.to_s.length > 32
417
- invalid_properties.push('invalid value for "version", the character length must be smaller than or equal to 32.')
413
+ if !@expected_namespace.nil? && @expected_namespace.to_s.length < 1
414
+ invalid_properties.push('invalid value for "expected_namespace", the character length must be great than or equal to 1.')
418
415
  end
419
416
 
420
- if @version.to_s.length < 1
421
- invalid_properties.push('invalid value for "version", the character length must be great than or equal to 1.')
417
+ if !@expected_version.nil? && @expected_version.to_s.length < 1
418
+ invalid_properties.push('invalid value for "expected_version", the character length must be great than or equal to 1.')
422
419
  end
423
420
 
424
421
  invalid_properties
@@ -427,39 +424,27 @@ module PulpAnsibleClient
427
424
  # Check to see if the all the properties in the model are valid
428
425
  # @return true if the model is valid
429
426
  def valid?
430
- return false if @artifact.nil?
431
427
  return false if !@_type.nil? && @_type.to_s.length < 1
428
+ return false if @relative_path.nil?
429
+ return false if @relative_path.to_s.length < 1
432
430
  return false if !@md5.nil? && @md5.to_s.length < 1
433
431
  return false if !@sha1.nil? && @sha1.to_s.length < 1
434
432
  return false if !@sha224.nil? && @sha224.to_s.length < 1
435
433
  return false if !@sha256.nil? && @sha256.to_s.length < 1
436
434
  return false if !@sha384.nil? && @sha384.to_s.length < 1
437
435
  return false if !@sha512.nil? && @sha512.to_s.length < 1
438
- return false if @id.nil?
439
- return false if @authors.nil?
440
- return false if @contents.nil?
441
- return false if @dependencies.nil?
442
- return false if @description.nil?
443
- return false if @docs_blob.nil?
444
- return false if @documentation.nil?
445
- return false if @documentation.to_s.length > 128
446
- return false if @homepage.nil?
447
- return false if @homepage.to_s.length > 128
448
- return false if @issues.nil?
449
- return false if @issues.to_s.length > 128
450
- return false if @is_certified.nil?
451
- return false if @license.nil?
452
- return false if @name.nil?
453
- return false if @name.to_s.length > 32
454
- return false if @name.to_s.length < 1
455
- return false if @namespace.nil?
456
- return false if @namespace.to_s.length > 32
457
- return false if @namespace.to_s.length < 1
458
- return false if @repository.nil?
459
- return false if @repository.to_s.length > 128
460
- return false if @version.nil?
461
- return false if @version.to_s.length > 32
462
- return false if @version.to_s.length < 1
436
+ return false if !@documentation.nil? && @documentation.to_s.length > 128
437
+ return false if !@homepage.nil? && @homepage.to_s.length > 128
438
+ return false if !@issues.nil? && @issues.to_s.length > 128
439
+ return false if !@name.nil? && @name.to_s.length > 32
440
+ return false if !@name.nil? && @name.to_s.length < 1
441
+ return false if !@namespace.nil? && @namespace.to_s.length > 32
442
+ return false if !@namespace.nil? && @namespace.to_s.length < 1
443
+ return false if !@version.nil? && @version.to_s.length > 32
444
+ return false if !@version.nil? && @version.to_s.length < 1
445
+ return false if !@expected_name.nil? && @expected_name.to_s.length < 1
446
+ return false if !@expected_namespace.nil? && @expected_namespace.to_s.length < 1
447
+ return false if !@expected_version.nil? && @expected_version.to_s.length < 1
463
448
  true
464
449
  end
465
450
 
@@ -473,6 +458,20 @@ module PulpAnsibleClient
473
458
  @_type = _type
474
459
  end
475
460
 
461
+ # Custom attribute writer method with validation
462
+ # @param [Object] relative_path Value to be assigned
463
+ def relative_path=(relative_path)
464
+ if relative_path.nil?
465
+ fail ArgumentError, 'relative_path cannot be nil'
466
+ end
467
+
468
+ if relative_path.to_s.length < 1
469
+ fail ArgumentError, 'invalid value for "relative_path", the character length must be great than or equal to 1.'
470
+ end
471
+
472
+ @relative_path = relative_path
473
+ end
474
+
476
475
  # Custom attribute writer method with validation
477
476
  # @param [Object] md5 Value to be assigned
478
477
  def md5=(md5)
@@ -536,11 +535,7 @@ module PulpAnsibleClient
536
535
  # Custom attribute writer method with validation
537
536
  # @param [Object] documentation Value to be assigned
538
537
  def documentation=(documentation)
539
- if documentation.nil?
540
- fail ArgumentError, 'documentation cannot be nil'
541
- end
542
-
543
- if documentation.to_s.length > 128
538
+ if !documentation.nil? && documentation.to_s.length > 128
544
539
  fail ArgumentError, 'invalid value for "documentation", the character length must be smaller than or equal to 128.'
545
540
  end
546
541
 
@@ -550,11 +545,7 @@ module PulpAnsibleClient
550
545
  # Custom attribute writer method with validation
551
546
  # @param [Object] homepage Value to be assigned
552
547
  def homepage=(homepage)
553
- if homepage.nil?
554
- fail ArgumentError, 'homepage cannot be nil'
555
- end
556
-
557
- if homepage.to_s.length > 128
548
+ if !homepage.nil? && homepage.to_s.length > 128
558
549
  fail ArgumentError, 'invalid value for "homepage", the character length must be smaller than or equal to 128.'
559
550
  end
560
551
 
@@ -564,11 +555,7 @@ module PulpAnsibleClient
564
555
  # Custom attribute writer method with validation
565
556
  # @param [Object] issues Value to be assigned
566
557
  def issues=(issues)
567
- if issues.nil?
568
- fail ArgumentError, 'issues cannot be nil'
569
- end
570
-
571
- if issues.to_s.length > 128
558
+ if !issues.nil? && issues.to_s.length > 128
572
559
  fail ArgumentError, 'invalid value for "issues", the character length must be smaller than or equal to 128.'
573
560
  end
574
561
 
@@ -578,15 +565,11 @@ module PulpAnsibleClient
578
565
  # Custom attribute writer method with validation
579
566
  # @param [Object] name Value to be assigned
580
567
  def name=(name)
581
- if name.nil?
582
- fail ArgumentError, 'name cannot be nil'
583
- end
584
-
585
- if name.to_s.length > 32
568
+ if !name.nil? && name.to_s.length > 32
586
569
  fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 32.'
587
570
  end
588
571
 
589
- if name.to_s.length < 1
572
+ if !name.nil? && name.to_s.length < 1
590
573
  fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
591
574
  end
592
575
 
@@ -596,15 +579,11 @@ module PulpAnsibleClient
596
579
  # Custom attribute writer method with validation
597
580
  # @param [Object] namespace Value to be assigned
598
581
  def namespace=(namespace)
599
- if namespace.nil?
600
- fail ArgumentError, 'namespace cannot be nil'
601
- end
602
-
603
- if namespace.to_s.length > 32
582
+ if !namespace.nil? && namespace.to_s.length > 32
604
583
  fail ArgumentError, 'invalid value for "namespace", the character length must be smaller than or equal to 32.'
605
584
  end
606
585
 
607
- if namespace.to_s.length < 1
586
+ if !namespace.nil? && namespace.to_s.length < 1
608
587
  fail ArgumentError, 'invalid value for "namespace", the character length must be great than or equal to 1.'
609
588
  end
610
589
 
@@ -612,35 +591,47 @@ module PulpAnsibleClient
612
591
  end
613
592
 
614
593
  # Custom attribute writer method with validation
615
- # @param [Object] repository Value to be assigned
616
- def repository=(repository)
617
- if repository.nil?
618
- fail ArgumentError, 'repository cannot be nil'
594
+ # @param [Object] version Value to be assigned
595
+ def version=(version)
596
+ if !version.nil? && version.to_s.length > 32
597
+ fail ArgumentError, 'invalid value for "version", the character length must be smaller than or equal to 32.'
619
598
  end
620
599
 
621
- if repository.to_s.length > 128
622
- fail ArgumentError, 'invalid value for "repository", the character length must be smaller than or equal to 128.'
600
+ if !version.nil? && version.to_s.length < 1
601
+ fail ArgumentError, 'invalid value for "version", the character length must be great than or equal to 1.'
623
602
  end
624
603
 
625
- @repository = repository
604
+ @version = version
626
605
  end
627
606
 
628
607
  # Custom attribute writer method with validation
629
- # @param [Object] version Value to be assigned
630
- def version=(version)
631
- if version.nil?
632
- fail ArgumentError, 'version cannot be nil'
608
+ # @param [Object] expected_name Value to be assigned
609
+ def expected_name=(expected_name)
610
+ if !expected_name.nil? && expected_name.to_s.length < 1
611
+ fail ArgumentError, 'invalid value for "expected_name", the character length must be great than or equal to 1.'
633
612
  end
634
613
 
635
- if version.to_s.length > 32
636
- fail ArgumentError, 'invalid value for "version", the character length must be smaller than or equal to 32.'
614
+ @expected_name = expected_name
615
+ end
616
+
617
+ # Custom attribute writer method with validation
618
+ # @param [Object] expected_namespace Value to be assigned
619
+ def expected_namespace=(expected_namespace)
620
+ if !expected_namespace.nil? && expected_namespace.to_s.length < 1
621
+ fail ArgumentError, 'invalid value for "expected_namespace", the character length must be great than or equal to 1.'
637
622
  end
638
623
 
639
- if version.to_s.length < 1
640
- fail ArgumentError, 'invalid value for "version", the character length must be great than or equal to 1.'
624
+ @expected_namespace = expected_namespace
625
+ end
626
+
627
+ # Custom attribute writer method with validation
628
+ # @param [Object] expected_version Value to be assigned
629
+ def expected_version=(expected_version)
630
+ if !expected_version.nil? && expected_version.to_s.length < 1
631
+ fail ArgumentError, 'invalid value for "expected_version", the character length must be great than or equal to 1.'
641
632
  end
642
633
 
643
- @version = version
634
+ @expected_version = expected_version
644
635
  end
645
636
 
646
637
  # Checks equality by comparing each attribute.
@@ -648,10 +639,13 @@ module PulpAnsibleClient
648
639
  def ==(o)
649
640
  return true if self.equal?(o)
650
641
  self.class == o.class &&
651
- artifact == o.artifact &&
642
+ _href == o._href &&
652
643
  _created == o._created &&
653
644
  _type == o._type &&
654
- _href == o._href &&
645
+ artifact == o.artifact &&
646
+ relative_path == o.relative_path &&
647
+ file == o.file &&
648
+ repository == o.repository &&
655
649
  md5 == o.md5 &&
656
650
  sha1 == o.sha1 &&
657
651
  sha224 == o.sha224 &&
@@ -671,9 +665,11 @@ module PulpAnsibleClient
671
665
  license == o.license &&
672
666
  name == o.name &&
673
667
  namespace == o.namespace &&
674
- repository == o.repository &&
675
668
  tags == o.tags &&
676
- version == o.version
669
+ version == o.version &&
670
+ expected_name == o.expected_name &&
671
+ expected_namespace == o.expected_namespace &&
672
+ expected_version == o.expected_version
677
673
  end
678
674
 
679
675
  # @see the `==` method
@@ -685,7 +681,7 @@ module PulpAnsibleClient
685
681
  # Calculates hash code according to all attributes.
686
682
  # @return [Integer] Hash code
687
683
  def hash
688
- [artifact, _created, _type, _href, md5, sha1, sha224, sha256, sha384, sha512, id, authors, contents, dependencies, description, docs_blob, documentation, homepage, issues, is_certified, license, name, namespace, repository, tags, version].hash
684
+ [_href, _created, _type, artifact, relative_path, file, repository, md5, sha1, sha224, sha256, sha384, sha512, id, authors, contents, dependencies, description, docs_blob, documentation, homepage, issues, is_certified, license, name, namespace, tags, version, expected_name, expected_namespace, expected_version].hash
689
685
  end
690
686
 
691
687
  # Builds the object from hash