cloudsmith-api 2.0.36 → 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 (30) 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/error_detail.rb +11 -1
  11. data/lib/cloudsmith-api/models/skills_package_upload.rb +1060 -0
  12. data/lib/cloudsmith-api/models/skills_package_upload_request.rb +238 -0
  13. data/lib/cloudsmith-api/version.rb +1 -1
  14. data/lib/cloudsmith-api.rb +2 -0
  15. data/spec/api/packages_api_spec.rb +28 -0
  16. data/spec/models/error_detail_spec.rb +6 -0
  17. data/spec/models/skills_package_upload_request_spec.rb +65 -0
  18. data/spec/models/skills_package_upload_spec.rb +573 -0
  19. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/autotest-fsevent-0.3.2/gem_make.out +1 -1
  20. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/bigdecimal-4.1.3/gem_make.out +2 -2
  21. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/bigdecimal-4.1.3/mkmf.log +4 -4
  22. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.17.4/gem_make.out +2 -2
  23. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.17.4/mkmf.log +1 -1
  24. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.7.6/gem_make.out +2 -2
  25. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.7.6/mkmf.log +1 -1
  26. data/vendor/bundle/ruby/2.6.0/gems/bigdecimal-4.1.3/ext/bigdecimal/Makefile +2 -2
  27. data/vendor/bundle/ruby/2.6.0/gems/ffi-1.17.4/ext/ffi_c/Makefile +2 -2
  28. data/vendor/bundle/ruby/2.6.0/gems/json-2.7.6/ext/json/ext/generator/Makefile +2 -2
  29. data/vendor/bundle/ruby/2.6.0/gems/json-2.7.6/ext/json/ext/parser/Makefile +2 -2
  30. metadata +10 -2
@@ -0,0 +1,238 @@
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 SkillsPackageUploadRequest
17
+ attr_accessor :name
18
+
19
+ # The primary file for the package.
20
+ attr_accessor :package_file
21
+
22
+ # 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.
23
+ attr_accessor :republish
24
+
25
+ # A comma-separated values list of tags to add to the package.
26
+ attr_accessor :tags
27
+
28
+ attr_accessor :version
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'name' => :'name',
34
+ :'package_file' => :'package_file',
35
+ :'republish' => :'republish',
36
+ :'tags' => :'tags',
37
+ :'version' => :'version'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'name' => :'String',
45
+ :'package_file' => :'String',
46
+ :'republish' => :'BOOLEAN',
47
+ :'tags' => :'String',
48
+ :'version' => :'String'
49
+ }
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ return unless attributes.is_a?(Hash)
56
+
57
+ # convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
59
+
60
+ if attributes.has_key?(:'name')
61
+ self.name = attributes[:'name']
62
+ end
63
+
64
+ if attributes.has_key?(:'package_file')
65
+ self.package_file = attributes[:'package_file']
66
+ end
67
+
68
+ if attributes.has_key?(:'republish')
69
+ self.republish = attributes[:'republish']
70
+ end
71
+
72
+ if attributes.has_key?(:'tags')
73
+ self.tags = attributes[:'tags']
74
+ end
75
+
76
+ if attributes.has_key?(:'version')
77
+ self.version = attributes[:'version']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ if @name.nil?
86
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
87
+ end
88
+
89
+ if @package_file.nil?
90
+ invalid_properties.push('invalid value for "package_file", package_file cannot be nil.')
91
+ end
92
+
93
+ if @version.nil?
94
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
95
+ end
96
+
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ return false if @name.nil?
104
+ return false if @package_file.nil?
105
+ return false if @version.nil?
106
+ true
107
+ end
108
+
109
+ # Checks equality by comparing each attribute.
110
+ # @param [Object] Object to be compared
111
+ def ==(o)
112
+ return true if self.equal?(o)
113
+ self.class == o.class &&
114
+ name == o.name &&
115
+ package_file == o.package_file &&
116
+ republish == o.republish &&
117
+ tags == o.tags &&
118
+ version == o.version
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Fixnum] Hash code
129
+ def hash
130
+ [name, package_file, republish, tags, version].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.swagger_types.each_pair do |key, type|
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :DateTime
160
+ DateTime.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :BOOLEAN
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ temp_model = CloudsmithApi.const_get(type).new
191
+ temp_model.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ next if value.nil?
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.50
11
11
  =end
12
12
 
13
13
  module CloudsmithApi
14
- VERSION = '2.0.36'
14
+ VERSION = '2.0.37'
15
15
  end
@@ -307,6 +307,8 @@ require 'cloudsmith-api/models/service'
307
307
  require 'cloudsmith-api/models/service_request'
308
308
  require 'cloudsmith-api/models/service_request_patch'
309
309
  require 'cloudsmith-api/models/service_teams'
310
+ require 'cloudsmith-api/models/skills_package_upload'
311
+ require 'cloudsmith-api/models/skills_package_upload_request'
310
312
  require 'cloudsmith-api/models/status_basic'
311
313
  require 'cloudsmith-api/models/storage_allocated_limit'
312
314
  require 'cloudsmith-api/models/storage_allocated_limit_raw'
@@ -596,6 +596,20 @@ describe 'PackagesApi' do
596
596
  end
597
597
  end
598
598
 
599
+ # unit tests for packages_upload_skills
600
+ # Create a new AI Skills package
601
+ # Create a new AI Skills package
602
+ # @param owner
603
+ # @param repo
604
+ # @param [Hash] opts the optional parameters
605
+ # @option opts [SkillsPackageUploadRequest] :data
606
+ # @return [SkillsPackageUpload]
607
+ describe 'packages_upload_skills test' do
608
+ it 'should work' do
609
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
610
+ end
611
+ end
612
+
599
613
  # unit tests for packages_upload_swift
600
614
  # Create a new Swift package
601
615
  # Create a new Swift package
@@ -1016,6 +1030,20 @@ describe 'PackagesApi' do
1016
1030
  end
1017
1031
  end
1018
1032
 
1033
+ # unit tests for packages_validate_upload_skills
1034
+ # Validate parameters for create AI Skills package
1035
+ # Validate parameters for create AI Skills package
1036
+ # @param owner
1037
+ # @param repo
1038
+ # @param [Hash] opts the optional parameters
1039
+ # @option opts [SkillsPackageUploadRequest] :data
1040
+ # @return [nil]
1041
+ describe 'packages_validate_upload_skills test' do
1042
+ it 'should work' do
1043
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
1044
+ end
1045
+ end
1046
+
1019
1047
  # unit tests for packages_validate_upload_swift
1020
1048
  # Validate parameters for create Swift package
1021
1049
  # Validate parameters for create Swift package
@@ -32,6 +32,12 @@ describe 'ErrorDetail' do
32
32
  expect(@instance).to be_instance_of(CloudsmithApi::ErrorDetail)
33
33
  end
34
34
  end
35
+ describe 'test attribute "code"' 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
+
35
41
  describe 'test attribute "detail"' do
36
42
  it 'should work' do
37
43
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -0,0 +1,65 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudsmithApi::SkillsPackageUploadRequest
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'SkillsPackageUploadRequest' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudsmithApi::SkillsPackageUploadRequest.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of SkillsPackageUploadRequest' do
31
+ it 'should create an instance of SkillsPackageUploadRequest' do
32
+ expect(@instance).to be_instance_of(CloudsmithApi::SkillsPackageUploadRequest)
33
+ end
34
+ end
35
+ describe 'test attribute "name"' 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 "package_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
+
47
+ describe 'test attribute "republish"' 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 "tags"' 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
+ describe 'test attribute "version"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
65
+ end