cloudsmith-api 2.0.23 → 2.0.24

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