cloudsmith-api 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) 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/HelmPackageUploadRequest.md +1 -0
  6. data/docs/PackagesApi.md +123 -0
  7. data/docs/StatusBasic.md +1 -1
  8. data/docs/SwiftPackageUpload.md +75 -0
  9. data/docs/SwiftPackageUploadRequest.md +11 -0
  10. data/lib/cloudsmith-api/api/packages_api.rb +123 -0
  11. data/lib/cloudsmith-api/models/helm_package_upload_request.rb +11 -1
  12. data/lib/cloudsmith-api/models/status_basic.rb +1 -1
  13. data/lib/cloudsmith-api/models/swift_package_upload.rb +855 -0
  14. data/lib/cloudsmith-api/models/swift_package_upload_request.rb +225 -0
  15. data/lib/cloudsmith-api/version.rb +1 -1
  16. data/lib/cloudsmith-api.rb +2 -0
  17. data/spec/api/packages_api_spec.rb +28 -0
  18. data/spec/models/helm_package_upload_request_spec.rb +6 -0
  19. data/spec/models/swift_package_upload_request_spec.rb +59 -0
  20. data/spec/models/swift_package_upload_spec.rb +447 -0
  21. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/autotest-fsevent-0.2.20/gem_make.out +1 -1
  22. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.15.5/gem_make.out +2 -2
  23. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.6.3/gem_make.out +1 -1
  24. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.6.3/mkmf.log +1 -1
  25. data/vendor/bundle/ruby/2.6.0/gems/ffi-1.15.5/ext/ffi_c/Makefile +2 -2
  26. data/vendor/bundle/ruby/2.6.0/gems/json-2.6.3/ext/json/Makefile +2 -2
  27. data/vendor/bundle/ruby/2.6.0/gems/json-2.6.3/ext/json/ext/generator/Makefile +2 -2
  28. data/vendor/bundle/ruby/2.6.0/gems/json-2.6.3/ext/json/ext/parser/Makefile +2 -2
  29. metadata +10 -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
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.26
11
11
  =end
12
12
 
13
13
  module CloudsmithApi
14
- VERSION = '2.0.3'
14
+ VERSION = '2.0.4'
15
15
  end
@@ -178,6 +178,8 @@ require 'cloudsmith-api/models/storage_allocated_limit_raw'
178
178
  require 'cloudsmith-api/models/storage_region'
179
179
  require 'cloudsmith-api/models/storage_usage'
180
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'
181
183
  require 'cloudsmith-api/models/tags'
182
184
  require 'cloudsmith-api/models/terraform_package_upload'
183
185
  require 'cloudsmith-api/models/terraform_package_upload_request'
@@ -501,6 +501,20 @@ describe 'PackagesApi' do
501
501
  end
502
502
  end
503
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
+
504
518
  # unit tests for packages_upload_terraform
505
519
  # Create a new Terraform package
506
520
  # Create a new Terraform package
@@ -837,6 +851,20 @@ describe 'PackagesApi' do
837
851
  end
838
852
  end
839
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
+
840
868
  # unit tests for packages_validate_upload_terraform
841
869
  # Validate parameters for create Terraform package
842
870
  # Validate parameters for create Terraform package
@@ -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,59 @@
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::SwiftPackageUploadRequest
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'SwiftPackageUploadRequest' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudsmithApi::SwiftPackageUploadRequest.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of SwiftPackageUploadRequest' do
31
+ it 'should create an instance of SwiftPackageUploadRequest' do
32
+ expect(@instance).to be_instance_of(CloudsmithApi::SwiftPackageUploadRequest)
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
+ describe 'test attribute "version"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ end