cloudsmith-api 2.0.35 → 2.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +8 -4
  4. data/build.json +1 -1
  5. data/docs/ErrorDetail.md +1 -0
  6. data/docs/PackagesApi.md +131 -0
  7. data/docs/SkillsPackageUpload.md +96 -0
  8. data/docs/SkillsPackageUploadRequest.md +12 -0
  9. data/lib/cloudsmith-api/api/packages_api.rb +123 -0
  10. data/lib/cloudsmith-api/models/alpine_upstream.rb +2 -2
  11. data/lib/cloudsmith-api/models/alpine_upstream_request.rb +2 -2
  12. data/lib/cloudsmith-api/models/alpine_upstream_request_patch.rb +2 -2
  13. data/lib/cloudsmith-api/models/error_detail.rb +11 -1
  14. data/lib/cloudsmith-api/models/skills_package_upload.rb +1060 -0
  15. data/lib/cloudsmith-api/models/skills_package_upload_request.rb +238 -0
  16. data/lib/cloudsmith-api/version.rb +1 -1
  17. data/lib/cloudsmith-api.rb +2 -0
  18. data/spec/api/packages_api_spec.rb +28 -0
  19. data/spec/models/alpine_upstream_request_patch_spec.rb +1 -1
  20. data/spec/models/alpine_upstream_request_spec.rb +1 -1
  21. data/spec/models/alpine_upstream_spec.rb +1 -1
  22. data/spec/models/error_detail_spec.rb +6 -0
  23. data/spec/models/skills_package_upload_request_spec.rb +65 -0
  24. data/spec/models/skills_package_upload_spec.rb +573 -0
  25. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/autotest-fsevent-0.3.2/gem_make.out +1 -1
  26. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/bigdecimal-4.1.3/gem_make.out +2 -2
  27. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/bigdecimal-4.1.3/mkmf.log +4 -4
  28. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.17.4/gem_make.out +2 -2
  29. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.17.4/mkmf.log +1 -1
  30. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.7.6/gem_make.out +2 -2
  31. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.7.6/mkmf.log +1 -1
  32. data/vendor/bundle/ruby/2.6.0/gems/bigdecimal-4.1.3/ext/bigdecimal/Makefile +2 -2
  33. data/vendor/bundle/ruby/2.6.0/gems/ffi-1.17.4/ext/ffi_c/Makefile +2 -2
  34. data/vendor/bundle/ruby/2.6.0/gems/json-2.7.6/ext/json/ext/generator/Makefile +2 -2
  35. data/vendor/bundle/ruby/2.6.0/gems/json-2.7.6/ext/json/ext/parser/Makefile +2 -2
  36. metadata +10 -2
@@ -0,0 +1,1060 @@
1
+ =begin
2
+ #Cloudsmith API (v1)
3
+
4
+ #The API to the Cloudsmith Service
5
+
6
+ OpenAPI spec version: v1
7
+ Contact: support@cloudsmith.io
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.50
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudsmithApi
16
+ class SkillsPackageUpload
17
+ attr_accessor :architectures
18
+
19
+ attr_accessor :cdn_url
20
+
21
+ attr_accessor :checksum_md5
22
+
23
+ attr_accessor :checksum_sha1
24
+
25
+ attr_accessor :checksum_sha256
26
+
27
+ attr_accessor :checksum_sha512
28
+
29
+ # A checksum of all of the package's dependencies.
30
+ attr_accessor :dependencies_checksum_md5
31
+
32
+ attr_accessor :dependencies_url
33
+
34
+ # A textual description of this package.
35
+ attr_accessor :description
36
+
37
+ attr_accessor :display_name
38
+
39
+ # Where the package originated, for example: 'upstream' (proxied/cached from a configured upstream), 'connected_repository' (blended in from a connected target repository), or 'manual_upload' (uploaded directly to Cloudsmith).
40
+ attr_accessor :display_source
41
+
42
+ attr_accessor :distro
43
+
44
+ attr_accessor :distro_version
45
+
46
+ attr_accessor :downloads
47
+
48
+ # The epoch of the package version (if any).
49
+ attr_accessor :epoch
50
+
51
+ attr_accessor :extension
52
+
53
+ attr_accessor :filename
54
+
55
+ attr_accessor :files
56
+
57
+ attr_accessor :format
58
+
59
+ attr_accessor :format_url
60
+
61
+ # Amount of storage that will be freed if this package is deleted
62
+ attr_accessor :freeable_storage
63
+
64
+ attr_accessor :fully_qualified_name
65
+
66
+ # Unique and permanent identifier for the package.
67
+ attr_accessor :identifier_perm
68
+
69
+ # Return a map of identifier field names and their values.
70
+ attr_accessor :identifiers
71
+
72
+ attr_accessor :indexed
73
+
74
+ attr_accessor :is_cancellable
75
+
76
+ attr_accessor :is_copyable
77
+
78
+ attr_accessor :is_deleteable
79
+
80
+ attr_accessor :is_downloadable
81
+
82
+ attr_accessor :is_hidden
83
+
84
+ attr_accessor :is_moveable
85
+
86
+ attr_accessor :is_quarantinable
87
+
88
+ attr_accessor :is_quarantined
89
+
90
+ attr_accessor :is_resyncable
91
+
92
+ attr_accessor :is_security_scannable
93
+
94
+ attr_accessor :is_sync_awaiting
95
+
96
+ attr_accessor :is_sync_completed
97
+
98
+ attr_accessor :is_sync_failed
99
+
100
+ attr_accessor :is_sync_in_flight
101
+
102
+ attr_accessor :is_sync_in_progress
103
+
104
+ # The license of this package.
105
+ attr_accessor :license
106
+
107
+ attr_accessor :name
108
+
109
+ attr_accessor :namespace
110
+
111
+ attr_accessor :namespace_url
112
+
113
+ attr_accessor :num_files
114
+
115
+ attr_accessor :origin_repository
116
+
117
+ attr_accessor :origin_repository_url
118
+
119
+ # Whether the package's SPDX license is OSI-approved.
120
+ attr_accessor :osi_approved
121
+
122
+ # The type of package contents.
123
+ attr_accessor :package_type
124
+
125
+ # Whether or not the package has violated any policy.
126
+ attr_accessor :policy_violated
127
+
128
+ # The raw license string.
129
+ attr_accessor :raw_license
130
+
131
+ # The release of the package version (if any).
132
+ attr_accessor :release
133
+
134
+ attr_accessor :repository
135
+
136
+ attr_accessor :repository_url
137
+
138
+ # The datetime the security scanning was completed.
139
+ attr_accessor :security_scan_completed_at
140
+
141
+ # The datetime the security scanning was started.
142
+ attr_accessor :security_scan_started_at
143
+
144
+ attr_accessor :security_scan_status
145
+
146
+ # The datetime the security scanning status was updated.
147
+ attr_accessor :security_scan_status_updated_at
148
+
149
+ attr_accessor :self_html_url
150
+
151
+ attr_accessor :self_url
152
+
153
+ attr_accessor :self_webapp_url
154
+
155
+ attr_accessor :signature_url
156
+
157
+ # The calculated size of the package.
158
+ attr_accessor :size
159
+
160
+ # The public unique identifier for the package.
161
+ attr_accessor :slug
162
+
163
+ attr_accessor :slug_perm
164
+
165
+ # The SPDX license identifier for this package.
166
+ attr_accessor :spdx_license
167
+
168
+ # The synchronisation (in progress) stage of the package.
169
+ attr_accessor :stage
170
+
171
+ attr_accessor :stage_str
172
+
173
+ # The datetime the package stage was updated at.
174
+ attr_accessor :stage_updated_at
175
+
176
+ # The synchronisation status of the package.
177
+ attr_accessor :status
178
+
179
+ # A textual description for the synchronous status reason (if any
180
+ attr_accessor :status_reason
181
+
182
+ attr_accessor :status_str
183
+
184
+ # The datetime the package status was updated at.
185
+ attr_accessor :status_updated_at
186
+
187
+ attr_accessor :status_url
188
+
189
+ # Absolute store path for the package, including store hash and name.
190
+ attr_accessor :store_path
191
+
192
+ attr_accessor :subtype
193
+
194
+ # A one-liner synopsis of this package.
195
+ attr_accessor :summary
196
+
197
+ # The datetime the package sync was finished at.
198
+ attr_accessor :sync_finished_at
199
+
200
+ # Synchronisation progress (from 0-100)
201
+ attr_accessor :sync_progress
202
+
203
+ attr_accessor :tags_automatic
204
+
205
+ attr_accessor :tags_immutable
206
+
207
+ # All static tags on the package, grouped by context. Static tags are derived from the package's properties at request time and carry a 'context' (rather than a tag type). Includes format-specific badges and the package's architecture, subtype, and extension.
208
+ attr_accessor :tags_static
209
+
210
+ attr_accessor :type_display
211
+
212
+ # The date this package was uploaded.
213
+ attr_accessor :uploaded_at
214
+
215
+ attr_accessor :uploader
216
+
217
+ attr_accessor :uploader_url
218
+
219
+ attr_accessor :version
220
+
221
+ attr_accessor :version_orig
222
+
223
+ attr_accessor :vulnerability_scan_results_url
224
+
225
+ class EnumAttributeValidator
226
+ attr_reader :datatype
227
+ attr_reader :allowable_values
228
+
229
+ def initialize(datatype, allowable_values)
230
+ @allowable_values = allowable_values.map do |value|
231
+ case datatype.to_s
232
+ when /Integer/i
233
+ value.to_i
234
+ when /Float/i
235
+ value.to_f
236
+ else
237
+ value
238
+ end
239
+ end
240
+ end
241
+
242
+ def valid?(value)
243
+ !value || allowable_values.include?(value)
244
+ end
245
+ end
246
+
247
+ # Attribute mapping from ruby-style variable name to JSON key.
248
+ def self.attribute_map
249
+ {
250
+ :'architectures' => :'architectures',
251
+ :'cdn_url' => :'cdn_url',
252
+ :'checksum_md5' => :'checksum_md5',
253
+ :'checksum_sha1' => :'checksum_sha1',
254
+ :'checksum_sha256' => :'checksum_sha256',
255
+ :'checksum_sha512' => :'checksum_sha512',
256
+ :'dependencies_checksum_md5' => :'dependencies_checksum_md5',
257
+ :'dependencies_url' => :'dependencies_url',
258
+ :'description' => :'description',
259
+ :'display_name' => :'display_name',
260
+ :'display_source' => :'display_source',
261
+ :'distro' => :'distro',
262
+ :'distro_version' => :'distro_version',
263
+ :'downloads' => :'downloads',
264
+ :'epoch' => :'epoch',
265
+ :'extension' => :'extension',
266
+ :'filename' => :'filename',
267
+ :'files' => :'files',
268
+ :'format' => :'format',
269
+ :'format_url' => :'format_url',
270
+ :'freeable_storage' => :'freeable_storage',
271
+ :'fully_qualified_name' => :'fully_qualified_name',
272
+ :'identifier_perm' => :'identifier_perm',
273
+ :'identifiers' => :'identifiers',
274
+ :'indexed' => :'indexed',
275
+ :'is_cancellable' => :'is_cancellable',
276
+ :'is_copyable' => :'is_copyable',
277
+ :'is_deleteable' => :'is_deleteable',
278
+ :'is_downloadable' => :'is_downloadable',
279
+ :'is_hidden' => :'is_hidden',
280
+ :'is_moveable' => :'is_moveable',
281
+ :'is_quarantinable' => :'is_quarantinable',
282
+ :'is_quarantined' => :'is_quarantined',
283
+ :'is_resyncable' => :'is_resyncable',
284
+ :'is_security_scannable' => :'is_security_scannable',
285
+ :'is_sync_awaiting' => :'is_sync_awaiting',
286
+ :'is_sync_completed' => :'is_sync_completed',
287
+ :'is_sync_failed' => :'is_sync_failed',
288
+ :'is_sync_in_flight' => :'is_sync_in_flight',
289
+ :'is_sync_in_progress' => :'is_sync_in_progress',
290
+ :'license' => :'license',
291
+ :'name' => :'name',
292
+ :'namespace' => :'namespace',
293
+ :'namespace_url' => :'namespace_url',
294
+ :'num_files' => :'num_files',
295
+ :'origin_repository' => :'origin_repository',
296
+ :'origin_repository_url' => :'origin_repository_url',
297
+ :'osi_approved' => :'osi_approved',
298
+ :'package_type' => :'package_type',
299
+ :'policy_violated' => :'policy_violated',
300
+ :'raw_license' => :'raw_license',
301
+ :'release' => :'release',
302
+ :'repository' => :'repository',
303
+ :'repository_url' => :'repository_url',
304
+ :'security_scan_completed_at' => :'security_scan_completed_at',
305
+ :'security_scan_started_at' => :'security_scan_started_at',
306
+ :'security_scan_status' => :'security_scan_status',
307
+ :'security_scan_status_updated_at' => :'security_scan_status_updated_at',
308
+ :'self_html_url' => :'self_html_url',
309
+ :'self_url' => :'self_url',
310
+ :'self_webapp_url' => :'self_webapp_url',
311
+ :'signature_url' => :'signature_url',
312
+ :'size' => :'size',
313
+ :'slug' => :'slug',
314
+ :'slug_perm' => :'slug_perm',
315
+ :'spdx_license' => :'spdx_license',
316
+ :'stage' => :'stage',
317
+ :'stage_str' => :'stage_str',
318
+ :'stage_updated_at' => :'stage_updated_at',
319
+ :'status' => :'status',
320
+ :'status_reason' => :'status_reason',
321
+ :'status_str' => :'status_str',
322
+ :'status_updated_at' => :'status_updated_at',
323
+ :'status_url' => :'status_url',
324
+ :'store_path' => :'store_path',
325
+ :'subtype' => :'subtype',
326
+ :'summary' => :'summary',
327
+ :'sync_finished_at' => :'sync_finished_at',
328
+ :'sync_progress' => :'sync_progress',
329
+ :'tags_automatic' => :'tags_automatic',
330
+ :'tags_immutable' => :'tags_immutable',
331
+ :'tags_static' => :'tags_static',
332
+ :'type_display' => :'type_display',
333
+ :'uploaded_at' => :'uploaded_at',
334
+ :'uploader' => :'uploader',
335
+ :'uploader_url' => :'uploader_url',
336
+ :'version' => :'version',
337
+ :'version_orig' => :'version_orig',
338
+ :'vulnerability_scan_results_url' => :'vulnerability_scan_results_url'
339
+ }
340
+ end
341
+
342
+ # Attribute type mapping.
343
+ def self.swagger_types
344
+ {
345
+ :'architectures' => :'Array<Architecture>',
346
+ :'cdn_url' => :'String',
347
+ :'checksum_md5' => :'String',
348
+ :'checksum_sha1' => :'String',
349
+ :'checksum_sha256' => :'String',
350
+ :'checksum_sha512' => :'String',
351
+ :'dependencies_checksum_md5' => :'String',
352
+ :'dependencies_url' => :'String',
353
+ :'description' => :'String',
354
+ :'display_name' => :'String',
355
+ :'display_source' => :'String',
356
+ :'distro' => :'Distribution',
357
+ :'distro_version' => :'DistributionVersion',
358
+ :'downloads' => :'Integer',
359
+ :'epoch' => :'Integer',
360
+ :'extension' => :'String',
361
+ :'filename' => :'String',
362
+ :'files' => :'Array<PackageFile>',
363
+ :'format' => :'String',
364
+ :'format_url' => :'String',
365
+ :'freeable_storage' => :'Integer',
366
+ :'fully_qualified_name' => :'String',
367
+ :'identifier_perm' => :'String',
368
+ :'identifiers' => :'Hash<String, String>',
369
+ :'indexed' => :'BOOLEAN',
370
+ :'is_cancellable' => :'BOOLEAN',
371
+ :'is_copyable' => :'BOOLEAN',
372
+ :'is_deleteable' => :'BOOLEAN',
373
+ :'is_downloadable' => :'BOOLEAN',
374
+ :'is_hidden' => :'BOOLEAN',
375
+ :'is_moveable' => :'BOOLEAN',
376
+ :'is_quarantinable' => :'BOOLEAN',
377
+ :'is_quarantined' => :'BOOLEAN',
378
+ :'is_resyncable' => :'BOOLEAN',
379
+ :'is_security_scannable' => :'BOOLEAN',
380
+ :'is_sync_awaiting' => :'BOOLEAN',
381
+ :'is_sync_completed' => :'BOOLEAN',
382
+ :'is_sync_failed' => :'BOOLEAN',
383
+ :'is_sync_in_flight' => :'BOOLEAN',
384
+ :'is_sync_in_progress' => :'BOOLEAN',
385
+ :'license' => :'String',
386
+ :'name' => :'String',
387
+ :'namespace' => :'String',
388
+ :'namespace_url' => :'String',
389
+ :'num_files' => :'Integer',
390
+ :'origin_repository' => :'String',
391
+ :'origin_repository_url' => :'String',
392
+ :'osi_approved' => :'BOOLEAN',
393
+ :'package_type' => :'Integer',
394
+ :'policy_violated' => :'BOOLEAN',
395
+ :'raw_license' => :'String',
396
+ :'release' => :'String',
397
+ :'repository' => :'String',
398
+ :'repository_url' => :'String',
399
+ :'security_scan_completed_at' => :'DateTime',
400
+ :'security_scan_started_at' => :'DateTime',
401
+ :'security_scan_status' => :'String',
402
+ :'security_scan_status_updated_at' => :'DateTime',
403
+ :'self_html_url' => :'String',
404
+ :'self_url' => :'String',
405
+ :'self_webapp_url' => :'String',
406
+ :'signature_url' => :'String',
407
+ :'size' => :'Integer',
408
+ :'slug' => :'String',
409
+ :'slug_perm' => :'String',
410
+ :'spdx_license' => :'String',
411
+ :'stage' => :'Integer',
412
+ :'stage_str' => :'String',
413
+ :'stage_updated_at' => :'DateTime',
414
+ :'status' => :'Integer',
415
+ :'status_reason' => :'String',
416
+ :'status_str' => :'String',
417
+ :'status_updated_at' => :'DateTime',
418
+ :'status_url' => :'String',
419
+ :'store_path' => :'String',
420
+ :'subtype' => :'String',
421
+ :'summary' => :'String',
422
+ :'sync_finished_at' => :'DateTime',
423
+ :'sync_progress' => :'Integer',
424
+ :'tags_automatic' => :'Tags',
425
+ :'tags_immutable' => :'Tags',
426
+ :'tags_static' => :'Hash<String, Array<String>>',
427
+ :'type_display' => :'String',
428
+ :'uploaded_at' => :'DateTime',
429
+ :'uploader' => :'String',
430
+ :'uploader_url' => :'String',
431
+ :'version' => :'String',
432
+ :'version_orig' => :'String',
433
+ :'vulnerability_scan_results_url' => :'String'
434
+ }
435
+ end
436
+
437
+ # Initializes the object
438
+ # @param [Hash] attributes Model attributes in the form of hash
439
+ def initialize(attributes = {})
440
+ return unless attributes.is_a?(Hash)
441
+
442
+ # convert string to symbol for hash key
443
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
444
+
445
+ if attributes.has_key?(:'architectures')
446
+ if (value = attributes[:'architectures']).is_a?(Array)
447
+ self.architectures = value
448
+ end
449
+ end
450
+
451
+ if attributes.has_key?(:'cdn_url')
452
+ self.cdn_url = attributes[:'cdn_url']
453
+ end
454
+
455
+ if attributes.has_key?(:'checksum_md5')
456
+ self.checksum_md5 = attributes[:'checksum_md5']
457
+ end
458
+
459
+ if attributes.has_key?(:'checksum_sha1')
460
+ self.checksum_sha1 = attributes[:'checksum_sha1']
461
+ end
462
+
463
+ if attributes.has_key?(:'checksum_sha256')
464
+ self.checksum_sha256 = attributes[:'checksum_sha256']
465
+ end
466
+
467
+ if attributes.has_key?(:'checksum_sha512')
468
+ self.checksum_sha512 = attributes[:'checksum_sha512']
469
+ end
470
+
471
+ if attributes.has_key?(:'dependencies_checksum_md5')
472
+ self.dependencies_checksum_md5 = attributes[:'dependencies_checksum_md5']
473
+ end
474
+
475
+ if attributes.has_key?(:'dependencies_url')
476
+ self.dependencies_url = attributes[:'dependencies_url']
477
+ end
478
+
479
+ if attributes.has_key?(:'description')
480
+ self.description = attributes[:'description']
481
+ end
482
+
483
+ if attributes.has_key?(:'display_name')
484
+ self.display_name = attributes[:'display_name']
485
+ end
486
+
487
+ if attributes.has_key?(:'display_source')
488
+ self.display_source = attributes[:'display_source']
489
+ end
490
+
491
+ if attributes.has_key?(:'distro')
492
+ self.distro = attributes[:'distro']
493
+ end
494
+
495
+ if attributes.has_key?(:'distro_version')
496
+ self.distro_version = attributes[:'distro_version']
497
+ end
498
+
499
+ if attributes.has_key?(:'downloads')
500
+ self.downloads = attributes[:'downloads']
501
+ end
502
+
503
+ if attributes.has_key?(:'epoch')
504
+ self.epoch = attributes[:'epoch']
505
+ end
506
+
507
+ if attributes.has_key?(:'extension')
508
+ self.extension = attributes[:'extension']
509
+ end
510
+
511
+ if attributes.has_key?(:'filename')
512
+ self.filename = attributes[:'filename']
513
+ end
514
+
515
+ if attributes.has_key?(:'files')
516
+ if (value = attributes[:'files']).is_a?(Array)
517
+ self.files = value
518
+ end
519
+ end
520
+
521
+ if attributes.has_key?(:'format')
522
+ self.format = attributes[:'format']
523
+ end
524
+
525
+ if attributes.has_key?(:'format_url')
526
+ self.format_url = attributes[:'format_url']
527
+ end
528
+
529
+ if attributes.has_key?(:'freeable_storage')
530
+ self.freeable_storage = attributes[:'freeable_storage']
531
+ end
532
+
533
+ if attributes.has_key?(:'fully_qualified_name')
534
+ self.fully_qualified_name = attributes[:'fully_qualified_name']
535
+ end
536
+
537
+ if attributes.has_key?(:'identifier_perm')
538
+ self.identifier_perm = attributes[:'identifier_perm']
539
+ end
540
+
541
+ if attributes.has_key?(:'identifiers')
542
+ if (value = attributes[:'identifiers']).is_a?(Hash)
543
+ self.identifiers = value
544
+ end
545
+ end
546
+
547
+ if attributes.has_key?(:'indexed')
548
+ self.indexed = attributes[:'indexed']
549
+ end
550
+
551
+ if attributes.has_key?(:'is_cancellable')
552
+ self.is_cancellable = attributes[:'is_cancellable']
553
+ end
554
+
555
+ if attributes.has_key?(:'is_copyable')
556
+ self.is_copyable = attributes[:'is_copyable']
557
+ end
558
+
559
+ if attributes.has_key?(:'is_deleteable')
560
+ self.is_deleteable = attributes[:'is_deleteable']
561
+ end
562
+
563
+ if attributes.has_key?(:'is_downloadable')
564
+ self.is_downloadable = attributes[:'is_downloadable']
565
+ end
566
+
567
+ if attributes.has_key?(:'is_hidden')
568
+ self.is_hidden = attributes[:'is_hidden']
569
+ end
570
+
571
+ if attributes.has_key?(:'is_moveable')
572
+ self.is_moveable = attributes[:'is_moveable']
573
+ end
574
+
575
+ if attributes.has_key?(:'is_quarantinable')
576
+ self.is_quarantinable = attributes[:'is_quarantinable']
577
+ end
578
+
579
+ if attributes.has_key?(:'is_quarantined')
580
+ self.is_quarantined = attributes[:'is_quarantined']
581
+ end
582
+
583
+ if attributes.has_key?(:'is_resyncable')
584
+ self.is_resyncable = attributes[:'is_resyncable']
585
+ end
586
+
587
+ if attributes.has_key?(:'is_security_scannable')
588
+ self.is_security_scannable = attributes[:'is_security_scannable']
589
+ end
590
+
591
+ if attributes.has_key?(:'is_sync_awaiting')
592
+ self.is_sync_awaiting = attributes[:'is_sync_awaiting']
593
+ end
594
+
595
+ if attributes.has_key?(:'is_sync_completed')
596
+ self.is_sync_completed = attributes[:'is_sync_completed']
597
+ end
598
+
599
+ if attributes.has_key?(:'is_sync_failed')
600
+ self.is_sync_failed = attributes[:'is_sync_failed']
601
+ end
602
+
603
+ if attributes.has_key?(:'is_sync_in_flight')
604
+ self.is_sync_in_flight = attributes[:'is_sync_in_flight']
605
+ end
606
+
607
+ if attributes.has_key?(:'is_sync_in_progress')
608
+ self.is_sync_in_progress = attributes[:'is_sync_in_progress']
609
+ end
610
+
611
+ if attributes.has_key?(:'license')
612
+ self.license = attributes[:'license']
613
+ end
614
+
615
+ if attributes.has_key?(:'name')
616
+ self.name = attributes[:'name']
617
+ end
618
+
619
+ if attributes.has_key?(:'namespace')
620
+ self.namespace = attributes[:'namespace']
621
+ end
622
+
623
+ if attributes.has_key?(:'namespace_url')
624
+ self.namespace_url = attributes[:'namespace_url']
625
+ end
626
+
627
+ if attributes.has_key?(:'num_files')
628
+ self.num_files = attributes[:'num_files']
629
+ end
630
+
631
+ if attributes.has_key?(:'origin_repository')
632
+ self.origin_repository = attributes[:'origin_repository']
633
+ end
634
+
635
+ if attributes.has_key?(:'origin_repository_url')
636
+ self.origin_repository_url = attributes[:'origin_repository_url']
637
+ end
638
+
639
+ if attributes.has_key?(:'osi_approved')
640
+ self.osi_approved = attributes[:'osi_approved']
641
+ end
642
+
643
+ if attributes.has_key?(:'package_type')
644
+ self.package_type = attributes[:'package_type']
645
+ end
646
+
647
+ if attributes.has_key?(:'policy_violated')
648
+ self.policy_violated = attributes[:'policy_violated']
649
+ end
650
+
651
+ if attributes.has_key?(:'raw_license')
652
+ self.raw_license = attributes[:'raw_license']
653
+ end
654
+
655
+ if attributes.has_key?(:'release')
656
+ self.release = attributes[:'release']
657
+ end
658
+
659
+ if attributes.has_key?(:'repository')
660
+ self.repository = attributes[:'repository']
661
+ end
662
+
663
+ if attributes.has_key?(:'repository_url')
664
+ self.repository_url = attributes[:'repository_url']
665
+ end
666
+
667
+ if attributes.has_key?(:'security_scan_completed_at')
668
+ self.security_scan_completed_at = attributes[:'security_scan_completed_at']
669
+ end
670
+
671
+ if attributes.has_key?(:'security_scan_started_at')
672
+ self.security_scan_started_at = attributes[:'security_scan_started_at']
673
+ end
674
+
675
+ if attributes.has_key?(:'security_scan_status')
676
+ self.security_scan_status = attributes[:'security_scan_status']
677
+ else
678
+ self.security_scan_status = 'Awaiting Security Scan'
679
+ end
680
+
681
+ if attributes.has_key?(:'security_scan_status_updated_at')
682
+ self.security_scan_status_updated_at = attributes[:'security_scan_status_updated_at']
683
+ end
684
+
685
+ if attributes.has_key?(:'self_html_url')
686
+ self.self_html_url = attributes[:'self_html_url']
687
+ end
688
+
689
+ if attributes.has_key?(:'self_url')
690
+ self.self_url = attributes[:'self_url']
691
+ end
692
+
693
+ if attributes.has_key?(:'self_webapp_url')
694
+ self.self_webapp_url = attributes[:'self_webapp_url']
695
+ end
696
+
697
+ if attributes.has_key?(:'signature_url')
698
+ self.signature_url = attributes[:'signature_url']
699
+ end
700
+
701
+ if attributes.has_key?(:'size')
702
+ self.size = attributes[:'size']
703
+ end
704
+
705
+ if attributes.has_key?(:'slug')
706
+ self.slug = attributes[:'slug']
707
+ end
708
+
709
+ if attributes.has_key?(:'slug_perm')
710
+ self.slug_perm = attributes[:'slug_perm']
711
+ end
712
+
713
+ if attributes.has_key?(:'spdx_license')
714
+ self.spdx_license = attributes[:'spdx_license']
715
+ end
716
+
717
+ if attributes.has_key?(:'stage')
718
+ self.stage = attributes[:'stage']
719
+ end
720
+
721
+ if attributes.has_key?(:'stage_str')
722
+ self.stage_str = attributes[:'stage_str']
723
+ end
724
+
725
+ if attributes.has_key?(:'stage_updated_at')
726
+ self.stage_updated_at = attributes[:'stage_updated_at']
727
+ end
728
+
729
+ if attributes.has_key?(:'status')
730
+ self.status = attributes[:'status']
731
+ end
732
+
733
+ if attributes.has_key?(:'status_reason')
734
+ self.status_reason = attributes[:'status_reason']
735
+ end
736
+
737
+ if attributes.has_key?(:'status_str')
738
+ self.status_str = attributes[:'status_str']
739
+ end
740
+
741
+ if attributes.has_key?(:'status_updated_at')
742
+ self.status_updated_at = attributes[:'status_updated_at']
743
+ end
744
+
745
+ if attributes.has_key?(:'status_url')
746
+ self.status_url = attributes[:'status_url']
747
+ end
748
+
749
+ if attributes.has_key?(:'store_path')
750
+ self.store_path = attributes[:'store_path']
751
+ end
752
+
753
+ if attributes.has_key?(:'subtype')
754
+ self.subtype = attributes[:'subtype']
755
+ end
756
+
757
+ if attributes.has_key?(:'summary')
758
+ self.summary = attributes[:'summary']
759
+ end
760
+
761
+ if attributes.has_key?(:'sync_finished_at')
762
+ self.sync_finished_at = attributes[:'sync_finished_at']
763
+ end
764
+
765
+ if attributes.has_key?(:'sync_progress')
766
+ self.sync_progress = attributes[:'sync_progress']
767
+ end
768
+
769
+ if attributes.has_key?(:'tags_automatic')
770
+ self.tags_automatic = attributes[:'tags_automatic']
771
+ end
772
+
773
+ if attributes.has_key?(:'tags_immutable')
774
+ self.tags_immutable = attributes[:'tags_immutable']
775
+ end
776
+
777
+ if attributes.has_key?(:'tags_static')
778
+ if (value = attributes[:'tags_static']).is_a?(Hash)
779
+ self.tags_static = value
780
+ end
781
+ end
782
+
783
+ if attributes.has_key?(:'type_display')
784
+ self.type_display = attributes[:'type_display']
785
+ end
786
+
787
+ if attributes.has_key?(:'uploaded_at')
788
+ self.uploaded_at = attributes[:'uploaded_at']
789
+ end
790
+
791
+ if attributes.has_key?(:'uploader')
792
+ self.uploader = attributes[:'uploader']
793
+ end
794
+
795
+ if attributes.has_key?(:'uploader_url')
796
+ self.uploader_url = attributes[:'uploader_url']
797
+ end
798
+
799
+ if attributes.has_key?(:'version')
800
+ self.version = attributes[:'version']
801
+ end
802
+
803
+ if attributes.has_key?(:'version_orig')
804
+ self.version_orig = attributes[:'version_orig']
805
+ end
806
+
807
+ if attributes.has_key?(:'vulnerability_scan_results_url')
808
+ self.vulnerability_scan_results_url = attributes[:'vulnerability_scan_results_url']
809
+ end
810
+ end
811
+
812
+ # Show invalid properties with the reasons. Usually used together with valid?
813
+ # @return Array for valid properties with the reasons
814
+ def list_invalid_properties
815
+ invalid_properties = Array.new
816
+ if @name.nil?
817
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
818
+ end
819
+
820
+ if @version.nil?
821
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
822
+ end
823
+
824
+ invalid_properties
825
+ end
826
+
827
+ # Check to see if the all the properties in the model are valid
828
+ # @return true if the model is valid
829
+ def valid?
830
+ return false if @name.nil?
831
+ security_scan_status_validator = EnumAttributeValidator.new('String', ['Awaiting Security Scan', 'Security Scanning in Progress', 'Scan Detected Vulnerabilities', 'Scan Detected No Vulnerabilities', 'Security Scanning Disabled', 'Security Scanning Failed', 'Security Scanning Skipped', 'Security Scanning Not Supported'])
832
+ return false unless security_scan_status_validator.valid?(@security_scan_status)
833
+ return false if @version.nil?
834
+ true
835
+ end
836
+
837
+ # Custom attribute writer method checking allowed values (enum).
838
+ # @param [Object] security_scan_status Object to be assigned
839
+ def security_scan_status=(security_scan_status)
840
+ validator = EnumAttributeValidator.new('String', ['Awaiting Security Scan', 'Security Scanning in Progress', 'Scan Detected Vulnerabilities', 'Scan Detected No Vulnerabilities', 'Security Scanning Disabled', 'Security Scanning Failed', 'Security Scanning Skipped', 'Security Scanning Not Supported'])
841
+ unless validator.valid?(security_scan_status)
842
+ fail ArgumentError, 'invalid value for "security_scan_status", must be one of #{validator.allowable_values}.'
843
+ end
844
+ @security_scan_status = security_scan_status
845
+ end
846
+
847
+ # Checks equality by comparing each attribute.
848
+ # @param [Object] Object to be compared
849
+ def ==(o)
850
+ return true if self.equal?(o)
851
+ self.class == o.class &&
852
+ architectures == o.architectures &&
853
+ cdn_url == o.cdn_url &&
854
+ checksum_md5 == o.checksum_md5 &&
855
+ checksum_sha1 == o.checksum_sha1 &&
856
+ checksum_sha256 == o.checksum_sha256 &&
857
+ checksum_sha512 == o.checksum_sha512 &&
858
+ dependencies_checksum_md5 == o.dependencies_checksum_md5 &&
859
+ dependencies_url == o.dependencies_url &&
860
+ description == o.description &&
861
+ display_name == o.display_name &&
862
+ display_source == o.display_source &&
863
+ distro == o.distro &&
864
+ distro_version == o.distro_version &&
865
+ downloads == o.downloads &&
866
+ epoch == o.epoch &&
867
+ extension == o.extension &&
868
+ filename == o.filename &&
869
+ files == o.files &&
870
+ format == o.format &&
871
+ format_url == o.format_url &&
872
+ freeable_storage == o.freeable_storage &&
873
+ fully_qualified_name == o.fully_qualified_name &&
874
+ identifier_perm == o.identifier_perm &&
875
+ identifiers == o.identifiers &&
876
+ indexed == o.indexed &&
877
+ is_cancellable == o.is_cancellable &&
878
+ is_copyable == o.is_copyable &&
879
+ is_deleteable == o.is_deleteable &&
880
+ is_downloadable == o.is_downloadable &&
881
+ is_hidden == o.is_hidden &&
882
+ is_moveable == o.is_moveable &&
883
+ is_quarantinable == o.is_quarantinable &&
884
+ is_quarantined == o.is_quarantined &&
885
+ is_resyncable == o.is_resyncable &&
886
+ is_security_scannable == o.is_security_scannable &&
887
+ is_sync_awaiting == o.is_sync_awaiting &&
888
+ is_sync_completed == o.is_sync_completed &&
889
+ is_sync_failed == o.is_sync_failed &&
890
+ is_sync_in_flight == o.is_sync_in_flight &&
891
+ is_sync_in_progress == o.is_sync_in_progress &&
892
+ license == o.license &&
893
+ name == o.name &&
894
+ namespace == o.namespace &&
895
+ namespace_url == o.namespace_url &&
896
+ num_files == o.num_files &&
897
+ origin_repository == o.origin_repository &&
898
+ origin_repository_url == o.origin_repository_url &&
899
+ osi_approved == o.osi_approved &&
900
+ package_type == o.package_type &&
901
+ policy_violated == o.policy_violated &&
902
+ raw_license == o.raw_license &&
903
+ release == o.release &&
904
+ repository == o.repository &&
905
+ repository_url == o.repository_url &&
906
+ security_scan_completed_at == o.security_scan_completed_at &&
907
+ security_scan_started_at == o.security_scan_started_at &&
908
+ security_scan_status == o.security_scan_status &&
909
+ security_scan_status_updated_at == o.security_scan_status_updated_at &&
910
+ self_html_url == o.self_html_url &&
911
+ self_url == o.self_url &&
912
+ self_webapp_url == o.self_webapp_url &&
913
+ signature_url == o.signature_url &&
914
+ size == o.size &&
915
+ slug == o.slug &&
916
+ slug_perm == o.slug_perm &&
917
+ spdx_license == o.spdx_license &&
918
+ stage == o.stage &&
919
+ stage_str == o.stage_str &&
920
+ stage_updated_at == o.stage_updated_at &&
921
+ status == o.status &&
922
+ status_reason == o.status_reason &&
923
+ status_str == o.status_str &&
924
+ status_updated_at == o.status_updated_at &&
925
+ status_url == o.status_url &&
926
+ store_path == o.store_path &&
927
+ subtype == o.subtype &&
928
+ summary == o.summary &&
929
+ sync_finished_at == o.sync_finished_at &&
930
+ sync_progress == o.sync_progress &&
931
+ tags_automatic == o.tags_automatic &&
932
+ tags_immutable == o.tags_immutable &&
933
+ tags_static == o.tags_static &&
934
+ type_display == o.type_display &&
935
+ uploaded_at == o.uploaded_at &&
936
+ uploader == o.uploader &&
937
+ uploader_url == o.uploader_url &&
938
+ version == o.version &&
939
+ version_orig == o.version_orig &&
940
+ vulnerability_scan_results_url == o.vulnerability_scan_results_url
941
+ end
942
+
943
+ # @see the `==` method
944
+ # @param [Object] Object to be compared
945
+ def eql?(o)
946
+ self == o
947
+ end
948
+
949
+ # Calculates hash code according to all attributes.
950
+ # @return [Fixnum] Hash code
951
+ def hash
952
+ [architectures, cdn_url, checksum_md5, checksum_sha1, checksum_sha256, checksum_sha512, dependencies_checksum_md5, dependencies_url, description, display_name, display_source, distro, distro_version, downloads, epoch, extension, filename, files, format, format_url, freeable_storage, fully_qualified_name, identifier_perm, identifiers, indexed, is_cancellable, is_copyable, is_deleteable, is_downloadable, is_hidden, is_moveable, is_quarantinable, is_quarantined, is_resyncable, is_security_scannable, is_sync_awaiting, is_sync_completed, is_sync_failed, is_sync_in_flight, is_sync_in_progress, license, name, namespace, namespace_url, num_files, origin_repository, origin_repository_url, osi_approved, package_type, policy_violated, raw_license, release, repository, repository_url, security_scan_completed_at, security_scan_started_at, security_scan_status, security_scan_status_updated_at, self_html_url, self_url, self_webapp_url, signature_url, size, slug, slug_perm, spdx_license, stage, stage_str, stage_updated_at, status, status_reason, status_str, status_updated_at, status_url, store_path, subtype, summary, sync_finished_at, sync_progress, tags_automatic, tags_immutable, tags_static, type_display, uploaded_at, uploader, uploader_url, version, version_orig, vulnerability_scan_results_url].hash
953
+ end
954
+
955
+ # Builds the object from hash
956
+ # @param [Hash] attributes Model attributes in the form of hash
957
+ # @return [Object] Returns the model itself
958
+ def build_from_hash(attributes)
959
+ return nil unless attributes.is_a?(Hash)
960
+ self.class.swagger_types.each_pair do |key, type|
961
+ if type =~ /\AArray<(.*)>/i
962
+ # check to ensure the input is an array given that the attribute
963
+ # is documented as an array but the input is not
964
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
965
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
966
+ end
967
+ elsif !attributes[self.class.attribute_map[key]].nil?
968
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
969
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
970
+ end
971
+
972
+ self
973
+ end
974
+
975
+ # Deserializes the data based on type
976
+ # @param string type Data type
977
+ # @param string value Value to be deserialized
978
+ # @return [Object] Deserialized data
979
+ def _deserialize(type, value)
980
+ case type.to_sym
981
+ when :DateTime
982
+ DateTime.parse(value)
983
+ when :Date
984
+ Date.parse(value)
985
+ when :String
986
+ value.to_s
987
+ when :Integer
988
+ value.to_i
989
+ when :Float
990
+ value.to_f
991
+ when :BOOLEAN
992
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
993
+ true
994
+ else
995
+ false
996
+ end
997
+ when :Object
998
+ # generic object (usually a Hash), return directly
999
+ value
1000
+ when /\AArray<(?<inner_type>.+)>\z/
1001
+ inner_type = Regexp.last_match[:inner_type]
1002
+ value.map { |v| _deserialize(inner_type, v) }
1003
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
1004
+ k_type = Regexp.last_match[:k_type]
1005
+ v_type = Regexp.last_match[:v_type]
1006
+ {}.tap do |hash|
1007
+ value.each do |k, v|
1008
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1009
+ end
1010
+ end
1011
+ else # model
1012
+ temp_model = CloudsmithApi.const_get(type).new
1013
+ temp_model.build_from_hash(value)
1014
+ end
1015
+ end
1016
+
1017
+ # Returns the string representation of the object
1018
+ # @return [String] String presentation of the object
1019
+ def to_s
1020
+ to_hash.to_s
1021
+ end
1022
+
1023
+ # to_body is an alias to to_hash (backward compatibility)
1024
+ # @return [Hash] Returns the object in the form of hash
1025
+ def to_body
1026
+ to_hash
1027
+ end
1028
+
1029
+ # Returns the object in the form of hash
1030
+ # @return [Hash] Returns the object in the form of hash
1031
+ def to_hash
1032
+ hash = {}
1033
+ self.class.attribute_map.each_pair do |attr, param|
1034
+ value = self.send(attr)
1035
+ next if value.nil?
1036
+ hash[param] = _to_hash(value)
1037
+ end
1038
+ hash
1039
+ end
1040
+
1041
+ # Outputs non-array value in the form of hash
1042
+ # For object, use to_hash. Otherwise, just return the value
1043
+ # @param [Object] value Any valid value
1044
+ # @return [Hash] Returns the value in the form of hash
1045
+ def _to_hash(value)
1046
+ if value.is_a?(Array)
1047
+ value.compact.map { |v| _to_hash(v) }
1048
+ elsif value.is_a?(Hash)
1049
+ {}.tap do |hash|
1050
+ value.each { |k, v| hash[k] = _to_hash(v) }
1051
+ end
1052
+ elsif value.respond_to? :to_hash
1053
+ value.to_hash
1054
+ else
1055
+ value
1056
+ end
1057
+ end
1058
+
1059
+ end
1060
+ end