cloudsmith-api 2.0.2 → 2.0.4

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 (76) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +13 -5
  4. data/build.json +1 -1
  5. data/docs/Eula.md +1 -1
  6. data/docs/HelmPackageUploadRequest.md +1 -0
  7. data/docs/HexPackageUpload.md +75 -0
  8. data/docs/HexPackageUploadRequest.md +10 -0
  9. data/docs/NestedLicensePolicy.md +1 -0
  10. data/docs/NestedVulnerabilityPolicy.md +1 -0
  11. data/docs/NestedVulnerabilityScanResults.md +1 -1
  12. data/docs/OrganizationPackageLicensePolicy.md +1 -0
  13. data/docs/OrganizationPackageLicensePolicyRequest.md +1 -0
  14. data/docs/OrganizationPackageLicensePolicyRequestPatch.md +1 -0
  15. data/docs/OrganizationPackageVulnerabilityPolicy.md +1 -0
  16. data/docs/OrganizationPackageVulnerabilityPolicyRequest.md +1 -0
  17. data/docs/OrganizationPackageVulnerabilityPolicyRequestPatch.md +1 -0
  18. data/docs/PackagesApi.md +246 -0
  19. data/docs/RepositoryToken.md +1 -1
  20. data/docs/RepositoryTokenRefresh.md +1 -1
  21. data/docs/RepositoryWebhook.md +1 -1
  22. data/docs/StatusBasic.md +1 -1
  23. data/docs/SwiftPackageUpload.md +75 -0
  24. data/docs/SwiftPackageUploadRequest.md +11 -0
  25. data/docs/VulnerabilitiesApi.md +8 -8
  26. data/docs/VulnerabilityScanResults.md +1 -1
  27. data/docs/VulnerabilityScanResultsList.md +1 -1
  28. data/lib/cloudsmith-api/api/packages_api.rb +246 -0
  29. data/lib/cloudsmith-api/api/vulnerabilities_api.rb +13 -13
  30. data/lib/cloudsmith-api/models/eula.rb +0 -5
  31. data/lib/cloudsmith-api/models/helm_package_upload_request.rb +11 -1
  32. data/lib/cloudsmith-api/models/hex_package_upload.rb +850 -0
  33. data/lib/cloudsmith-api/models/hex_package_upload_request.rb +210 -0
  34. data/lib/cloudsmith-api/models/nested_license_policy.rb +10 -1
  35. data/lib/cloudsmith-api/models/nested_vulnerability_policy.rb +10 -1
  36. data/lib/cloudsmith-api/models/nested_vulnerability_scan_results.rb +1 -0
  37. data/lib/cloudsmith-api/models/organization_package_license_policy.rb +10 -1
  38. data/lib/cloudsmith-api/models/organization_package_license_policy_request.rb +10 -1
  39. data/lib/cloudsmith-api/models/organization_package_license_policy_request_patch.rb +10 -1
  40. data/lib/cloudsmith-api/models/organization_package_vulnerability_policy.rb +10 -1
  41. data/lib/cloudsmith-api/models/organization_package_vulnerability_policy_request.rb +13 -4
  42. data/lib/cloudsmith-api/models/organization_package_vulnerability_policy_request_patch.rb +13 -4
  43. data/lib/cloudsmith-api/models/repository_token.rb +1 -0
  44. data/lib/cloudsmith-api/models/repository_token_refresh.rb +1 -0
  45. data/lib/cloudsmith-api/models/repository_webhook.rb +1 -0
  46. data/lib/cloudsmith-api/models/status_basic.rb +1 -1
  47. data/lib/cloudsmith-api/models/swift_package_upload.rb +855 -0
  48. data/lib/cloudsmith-api/models/swift_package_upload_request.rb +225 -0
  49. data/lib/cloudsmith-api/models/vulnerability_scan_results.rb +1 -0
  50. data/lib/cloudsmith-api/models/vulnerability_scan_results_list.rb +1 -0
  51. data/lib/cloudsmith-api/version.rb +1 -1
  52. data/lib/cloudsmith-api.rb +4 -0
  53. data/spec/api/packages_api_spec.rb +56 -0
  54. data/spec/api/vulnerabilities_api_spec.rb +3 -3
  55. data/spec/models/helm_package_upload_request_spec.rb +6 -0
  56. data/spec/models/hex_package_upload_request_spec.rb +53 -0
  57. data/spec/models/hex_package_upload_spec.rb +447 -0
  58. data/spec/models/nested_license_policy_spec.rb +6 -0
  59. data/spec/models/nested_vulnerability_policy_spec.rb +6 -0
  60. data/spec/models/organization_package_license_policy_request_patch_spec.rb +6 -0
  61. data/spec/models/organization_package_license_policy_request_spec.rb +6 -0
  62. data/spec/models/organization_package_license_policy_spec.rb +6 -0
  63. data/spec/models/organization_package_vulnerability_policy_request_patch_spec.rb +6 -0
  64. data/spec/models/organization_package_vulnerability_policy_request_spec.rb +6 -0
  65. data/spec/models/organization_package_vulnerability_policy_spec.rb +6 -0
  66. data/spec/models/swift_package_upload_request_spec.rb +59 -0
  67. data/spec/models/swift_package_upload_spec.rb +447 -0
  68. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/autotest-fsevent-0.2.20/gem_make.out +1 -1
  69. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.15.5/gem_make.out +2 -2
  70. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.6.3/gem_make.out +1 -1
  71. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.6.3/mkmf.log +1 -1
  72. data/vendor/bundle/ruby/2.6.0/gems/ffi-1.15.5/ext/ffi_c/Makefile +2 -2
  73. data/vendor/bundle/ruby/2.6.0/gems/json-2.6.3/ext/json/Makefile +2 -2
  74. data/vendor/bundle/ruby/2.6.0/gems/json-2.6.3/ext/json/ext/generator/Makefile +2 -2
  75. data/vendor/bundle/ruby/2.6.0/gems/json-2.6.3/ext/json/ext/parser/Makefile +2 -2
  76. metadata +18 -2
@@ -0,0 +1,225 @@
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.26
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudsmithApi
16
+ class SwiftPackageUploadRequest
17
+ # The primary file for the package.
18
+ attr_accessor :package_file
19
+
20
+ # If true, the uploaded package will overwrite any others with the same attributes (e.g. same version); otherwise, it will be flagged as a duplicate.
21
+ attr_accessor :republish
22
+
23
+ # A comma-separated values list of tags to add to the package.
24
+ attr_accessor :tags
25
+
26
+ # The raw version for this package.
27
+ attr_accessor :version
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'package_file' => :'package_file',
33
+ :'republish' => :'republish',
34
+ :'tags' => :'tags',
35
+ :'version' => :'version'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'package_file' => :'String',
43
+ :'republish' => :'BOOLEAN',
44
+ :'tags' => :'String',
45
+ :'version' => :'String'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'package_file')
58
+ self.package_file = attributes[:'package_file']
59
+ end
60
+
61
+ if attributes.has_key?(:'republish')
62
+ self.republish = attributes[:'republish']
63
+ end
64
+
65
+ if attributes.has_key?(:'tags')
66
+ self.tags = attributes[:'tags']
67
+ end
68
+
69
+ if attributes.has_key?(:'version')
70
+ self.version = attributes[:'version']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ if @package_file.nil?
79
+ invalid_properties.push('invalid value for "package_file", package_file cannot be nil.')
80
+ end
81
+
82
+ if @version.nil?
83
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ return false if @package_file.nil?
93
+ return false if @version.nil?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ package_file == o.package_file &&
103
+ republish == o.republish &&
104
+ tags == o.tags &&
105
+ version == o.version
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Fixnum] Hash code
116
+ def hash
117
+ [package_file, republish, tags, version].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ self.class.swagger_types.each_pair do |key, type|
126
+ if type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :DateTime
147
+ DateTime.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :BOOLEAN
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ temp_model = CloudsmithApi.const_get(type).new
178
+ temp_model.build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ next if value.nil?
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+
224
+ end
225
+ end
@@ -30,6 +30,7 @@ class VulnerabilityScanResults
30
30
 
31
31
  attr_accessor :scan
32
32
 
33
+ # Deprecated (23-05-15): Please use 'identifier' instead. Previously: A monotonically increasing number that identified a scan within a repository.
33
34
  attr_accessor :scan_id
34
35
 
35
36
  class EnumAttributeValidator
@@ -28,6 +28,7 @@ class VulnerabilityScanResultsList
28
28
 
29
29
  attr_accessor :package
30
30
 
31
+ # Deprecated (23-05-15): Please use 'identifier' instead. Previously: A monotonically increasing number that identified a scan within a repository.
31
32
  attr_accessor :scan_id
32
33
 
33
34
  class EnumAttributeValidator
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.26
11
11
  =end
12
12
 
13
13
  module CloudsmithApi
14
- VERSION = '2.0.2'
14
+ VERSION = '2.0.4'
15
15
  end
@@ -58,6 +58,8 @@ require 'cloudsmith-api/models/go_package_upload'
58
58
  require 'cloudsmith-api/models/go_package_upload_request'
59
59
  require 'cloudsmith-api/models/helm_package_upload'
60
60
  require 'cloudsmith-api/models/helm_package_upload_request'
61
+ require 'cloudsmith-api/models/hex_package_upload'
62
+ require 'cloudsmith-api/models/hex_package_upload_request'
61
63
  require 'cloudsmith-api/models/history'
62
64
  require 'cloudsmith-api/models/history_fieldset'
63
65
  require 'cloudsmith-api/models/history_fieldset_raw'
@@ -176,6 +178,8 @@ require 'cloudsmith-api/models/storage_allocated_limit_raw'
176
178
  require 'cloudsmith-api/models/storage_region'
177
179
  require 'cloudsmith-api/models/storage_usage'
178
180
  require 'cloudsmith-api/models/storage_usage_raw'
181
+ require 'cloudsmith-api/models/swift_package_upload'
182
+ require 'cloudsmith-api/models/swift_package_upload_request'
179
183
  require 'cloudsmith-api/models/tags'
180
184
  require 'cloudsmith-api/models/terraform_package_upload'
181
185
  require 'cloudsmith-api/models/terraform_package_upload_request'
@@ -361,6 +361,20 @@ describe 'PackagesApi' do
361
361
  end
362
362
  end
363
363
 
364
+ # unit tests for packages_upload_hex
365
+ # Create a new Hex package
366
+ # Create a new Hex package
367
+ # @param owner
368
+ # @param repo
369
+ # @param [Hash] opts the optional parameters
370
+ # @option opts [HexPackageUploadRequest] :data
371
+ # @return [HexPackageUpload]
372
+ describe 'packages_upload_hex test' do
373
+ it 'should work' do
374
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
375
+ end
376
+ end
377
+
364
378
  # unit tests for packages_upload_luarocks
365
379
  # Create a new LuaRocks package
366
380
  # Create a new LuaRocks package
@@ -487,6 +501,20 @@ describe 'PackagesApi' do
487
501
  end
488
502
  end
489
503
 
504
+ # unit tests for packages_upload_swift
505
+ # Create a new Swift package
506
+ # Create a new Swift package
507
+ # @param owner
508
+ # @param repo
509
+ # @param [Hash] opts the optional parameters
510
+ # @option opts [SwiftPackageUploadRequest] :data
511
+ # @return [SwiftPackageUpload]
512
+ describe 'packages_upload_swift test' do
513
+ it 'should work' do
514
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
515
+ end
516
+ end
517
+
490
518
  # unit tests for packages_upload_terraform
491
519
  # Create a new Terraform package
492
520
  # Create a new Terraform package
@@ -683,6 +711,20 @@ describe 'PackagesApi' do
683
711
  end
684
712
  end
685
713
 
714
+ # unit tests for packages_validate_upload_hex
715
+ # Validate parameters for create Hex package
716
+ # Validate parameters for create Hex package
717
+ # @param owner
718
+ # @param repo
719
+ # @param [Hash] opts the optional parameters
720
+ # @option opts [HexPackageUploadRequest] :data
721
+ # @return [nil]
722
+ describe 'packages_validate_upload_hex test' do
723
+ it 'should work' do
724
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
725
+ end
726
+ end
727
+
686
728
  # unit tests for packages_validate_upload_luarocks
687
729
  # Validate parameters for create LuaRocks package
688
730
  # Validate parameters for create LuaRocks package
@@ -809,6 +851,20 @@ describe 'PackagesApi' do
809
851
  end
810
852
  end
811
853
 
854
+ # unit tests for packages_validate_upload_swift
855
+ # Validate parameters for create Swift package
856
+ # Validate parameters for create Swift package
857
+ # @param owner
858
+ # @param repo
859
+ # @param [Hash] opts the optional parameters
860
+ # @option opts [SwiftPackageUploadRequest] :data
861
+ # @return [nil]
862
+ describe 'packages_validate_upload_swift test' do
863
+ it 'should work' do
864
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
865
+ end
866
+ end
867
+
812
868
  # unit tests for packages_validate_upload_terraform
813
869
  # Validate parameters for create Terraform package
814
870
  # Validate parameters for create Terraform package
@@ -63,12 +63,12 @@ describe 'VulnerabilitiesApi' do
63
63
  end
64
64
 
65
65
  # unit tests for vulnerabilities_read
66
- # Returns a Scan Result.
67
- # Returns a Scan Result.
66
+ # Get a scan result.
67
+ # Get a scan result.
68
68
  # @param owner
69
69
  # @param repo
70
70
  # @param package
71
- # @param scan_id
71
+ # @param identifier
72
72
  # @param [Hash] opts the optional parameters
73
73
  # @return [VulnerabilityScanResults]
74
74
  describe 'vulnerabilities_read test' do
@@ -38,6 +38,12 @@ describe 'HelmPackageUploadRequest' do
38
38
  end
39
39
  end
40
40
 
41
+ describe 'test attribute "provenance_file"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
41
47
  describe 'test attribute "republish"' do
42
48
  it 'should work' do
43
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -0,0 +1,53 @@
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.26
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudsmithApi::HexPackageUploadRequest
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'HexPackageUploadRequest' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudsmithApi::HexPackageUploadRequest.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of HexPackageUploadRequest' do
31
+ it 'should create an instance of HexPackageUploadRequest' do
32
+ expect(@instance).to be_instance_of(CloudsmithApi::HexPackageUploadRequest)
33
+ end
34
+ end
35
+ describe 'test attribute "package_file"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "republish"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "tags"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ end