zest 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +16 -23
  3. data/docs/Artifact.md +1 -0
  4. data/docs/Distribution.md +3 -2
  5. data/docs/FileContent.md +1 -0
  6. data/docs/FilePublisher.md +1 -1
  7. data/docs/InlineResponse2009.md +1 -1
  8. data/docs/Publication.md +1 -2
  9. data/docs/PulpApi.md +212 -75
  10. data/docs/RepositorySyncURL.md +1 -1
  11. data/docs/RepositoryVersion.md +1 -6
  12. data/docs/Task.md +0 -1
  13. data/docs/Upload.md +11 -0
  14. data/docs/Worker.md +1 -1
  15. data/lib/zest.rb +1 -2
  16. data/lib/zest/api/pulp_api.rb +269 -125
  17. data/lib/zest/configuration.rb +1 -1
  18. data/lib/zest/models/artifact.rb +13 -4
  19. data/lib/zest/models/distribution.rb +34 -24
  20. data/lib/zest/models/file_content.rb +35 -1
  21. data/lib/zest/models/file_publisher.rb +8 -8
  22. data/lib/zest/models/inline_response_200_9.rb +1 -1
  23. data/lib/zest/models/publication.rb +8 -23
  24. data/lib/zest/models/repository_sync_url.rb +1 -1
  25. data/lib/zest/models/repository_version.rb +5 -55
  26. data/lib/zest/models/task.rb +1 -11
  27. data/lib/zest/models/{inline_response_200_10.rb → upload.rb} +47 -34
  28. data/lib/zest/models/worker.rb +10 -10
  29. data/lib/zest/version.rb +1 -1
  30. data/spec/api/pulp_api_spec.rb +60 -33
  31. data/spec/configuration_spec.rb +3 -3
  32. data/spec/models/artifact_spec.rb +6 -0
  33. data/spec/models/distribution_spec.rb +12 -6
  34. data/spec/models/file_content_spec.rb +6 -0
  35. data/spec/models/file_publisher_spec.rb +1 -1
  36. data/spec/models/publication_spec.rb +1 -7
  37. data/spec/models/repository_version_spec.rb +0 -30
  38. data/spec/models/task_spec.rb +0 -6
  39. data/spec/models/{user_spec.rb → upload_spec.rb} +9 -9
  40. data/spec/models/worker_spec.rb +2 -2
  41. data/zest.gemspec +1 -1
  42. metadata +62 -66
  43. data/docs/InlineResponse20010.md +0 -11
  44. data/docs/User.md +0 -11
  45. data/lib/zest/models/user.rb +0 -284
  46. data/spec/models/inline_response_200_10_spec.rb +0 -60
@@ -1,11 +0,0 @@
1
- # Zest::InlineResponse20010
2
-
3
- ## Properties
4
- Name | Type | Description | Notes
5
- ------------ | ------------- | ------------- | -------------
6
- **count** | **Integer** | |
7
- **_next** | **String** | | [optional]
8
- **previous** | **String** | | [optional]
9
- **results** | [**Array<Worker>**](Worker.md) | |
10
-
11
-
data/docs/User.md DELETED
@@ -1,11 +0,0 @@
1
- # Zest::User
2
-
3
- ## Properties
4
- Name | Type | Description | Notes
5
- ------------ | ------------- | ------------- | -------------
6
- **_href** | **String** | | [optional]
7
- **_created** | **DateTime** | Timestamp of creation. | [optional]
8
- **username** | **String** | Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. |
9
- **password** | **String** | Password |
10
-
11
-
@@ -1,284 +0,0 @@
1
- =begin
2
- #Pulp3 API
3
-
4
- #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
-
6
- OpenAPI spec version: v3
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module Zest
16
-
17
- class User
18
- attr_accessor :_href
19
-
20
- # Timestamp of creation.
21
- attr_accessor :_created
22
-
23
- # Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
24
- attr_accessor :username
25
-
26
- # Password
27
- attr_accessor :password
28
-
29
-
30
- # Attribute mapping from ruby-style variable name to JSON key.
31
- def self.attribute_map
32
- {
33
- :'_href' => :'_href',
34
- :'_created' => :'_created',
35
- :'username' => :'username',
36
- :'password' => :'password'
37
- }
38
- end
39
-
40
- # Attribute type mapping.
41
- def self.swagger_types
42
- {
43
- :'_href' => :'String',
44
- :'_created' => :'DateTime',
45
- :'username' => :'String',
46
- :'password' => :'String'
47
- }
48
- end
49
-
50
- # Initializes the object
51
- # @param [Hash] attributes Model attributes in the form of hash
52
- def initialize(attributes = {})
53
- return unless attributes.is_a?(Hash)
54
-
55
- # convert string to symbol for hash key
56
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
57
-
58
- if attributes.has_key?(:'_href')
59
- self._href = attributes[:'_href']
60
- end
61
-
62
- if attributes.has_key?(:'_created')
63
- self._created = attributes[:'_created']
64
- end
65
-
66
- if attributes.has_key?(:'username')
67
- self.username = attributes[:'username']
68
- end
69
-
70
- if attributes.has_key?(:'password')
71
- self.password = attributes[:'password']
72
- end
73
-
74
- end
75
-
76
- # Show invalid properties with the reasons. Usually used together with valid?
77
- # @return Array for valid properties with the reasons
78
- def list_invalid_properties
79
- invalid_properties = Array.new
80
- if @username.nil?
81
- invalid_properties.push("invalid value for 'username', username cannot be nil.")
82
- end
83
-
84
- if @username.to_s.length > 150
85
- invalid_properties.push("invalid value for 'username', the character length must be smaller than or equal to 150.")
86
- end
87
-
88
- if @username.to_s.length < 1
89
- invalid_properties.push("invalid value for 'username', the character length must be great than or equal to 1.")
90
- end
91
-
92
- if @username !~ Regexp.new(/^[\\w.@+-]+$/)
93
- invalid_properties.push("invalid value for 'username', must conform to the pattern /^[\\w.@+-]+$/.")
94
- end
95
-
96
- if @password.nil?
97
- invalid_properties.push("invalid value for 'password', password cannot be nil.")
98
- end
99
-
100
- if @password.to_s.length < 1
101
- invalid_properties.push("invalid value for 'password', the character length must be great than or equal to 1.")
102
- end
103
-
104
- return invalid_properties
105
- end
106
-
107
- # Check to see if the all the properties in the model are valid
108
- # @return true if the model is valid
109
- def valid?
110
- return false if @username.nil?
111
- return false if @username.to_s.length > 150
112
- return false if @username.to_s.length < 1
113
- return false if @username !~ Regexp.new(/^[\\w.@+-]+$/)
114
- return false if @password.nil?
115
- return false if @password.to_s.length < 1
116
- return true
117
- end
118
-
119
- # Custom attribute writer method with validation
120
- # @param [Object] username Value to be assigned
121
- def username=(username)
122
- if username.nil?
123
- fail ArgumentError, "username cannot be nil"
124
- end
125
-
126
- if username.to_s.length > 150
127
- fail ArgumentError, "invalid value for 'username', the character length must be smaller than or equal to 150."
128
- end
129
-
130
- if username.to_s.length < 1
131
- fail ArgumentError, "invalid value for 'username', the character length must be great than or equal to 1."
132
- end
133
-
134
- if username !~ Regexp.new(/^[\\w.@+-]+$/)
135
- fail ArgumentError, "invalid value for 'username', must conform to the pattern /^[\\w.@+-]+$/."
136
- end
137
-
138
- @username = username
139
- end
140
-
141
- # Custom attribute writer method with validation
142
- # @param [Object] password Value to be assigned
143
- def password=(password)
144
- if password.nil?
145
- fail ArgumentError, "password cannot be nil"
146
- end
147
-
148
- if password.to_s.length < 1
149
- fail ArgumentError, "invalid value for 'password', the character length must be great than or equal to 1."
150
- end
151
-
152
- @password = password
153
- end
154
-
155
- # Checks equality by comparing each attribute.
156
- # @param [Object] Object to be compared
157
- def ==(o)
158
- return true if self.equal?(o)
159
- self.class == o.class &&
160
- _href == o._href &&
161
- _created == o._created &&
162
- username == o.username &&
163
- password == o.password
164
- end
165
-
166
- # @see the `==` method
167
- # @param [Object] Object to be compared
168
- def eql?(o)
169
- self == o
170
- end
171
-
172
- # Calculates hash code according to all attributes.
173
- # @return [Fixnum] Hash code
174
- def hash
175
- [_href, _created, username, password].hash
176
- end
177
-
178
- # Builds the object from hash
179
- # @param [Hash] attributes Model attributes in the form of hash
180
- # @return [Object] Returns the model itself
181
- def build_from_hash(attributes)
182
- return nil unless attributes.is_a?(Hash)
183
- self.class.swagger_types.each_pair do |key, type|
184
- if type =~ /\AArray<(.*)>/i
185
- # check to ensure the input is an array given that the the attribute
186
- # is documented as an array but the input is not
187
- if attributes[self.class.attribute_map[key]].is_a?(Array)
188
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
189
- end
190
- elsif !attributes[self.class.attribute_map[key]].nil?
191
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
- end # or else data not found in attributes(hash), not an issue as the data can be optional
193
- end
194
-
195
- self
196
- end
197
-
198
- # Deserializes the data based on type
199
- # @param string type Data type
200
- # @param string value Value to be deserialized
201
- # @return [Object] Deserialized data
202
- def _deserialize(type, value)
203
- case type.to_sym
204
- when :DateTime
205
- DateTime.parse(value)
206
- when :Date
207
- Date.parse(value)
208
- when :String
209
- value.to_s
210
- when :Integer
211
- value.to_i
212
- when :Float
213
- value.to_f
214
- when :BOOLEAN
215
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
- true
217
- else
218
- false
219
- end
220
- when :Object
221
- # generic object (usually a Hash), return directly
222
- value
223
- when /\AArray<(?<inner_type>.+)>\z/
224
- inner_type = Regexp.last_match[:inner_type]
225
- value.map { |v| _deserialize(inner_type, v) }
226
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
- k_type = Regexp.last_match[:k_type]
228
- v_type = Regexp.last_match[:v_type]
229
- {}.tap do |hash|
230
- value.each do |k, v|
231
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
- end
233
- end
234
- else # model
235
- temp_model = Zest.const_get(type).new
236
- temp_model.build_from_hash(value)
237
- end
238
- end
239
-
240
- # Returns the string representation of the object
241
- # @return [String] String presentation of the object
242
- def to_s
243
- to_hash.to_s
244
- end
245
-
246
- # to_body is an alias to to_hash (backward compatibility)
247
- # @return [Hash] Returns the object in the form of hash
248
- def to_body
249
- to_hash
250
- end
251
-
252
- # Returns the object in the form of hash
253
- # @return [Hash] Returns the object in the form of hash
254
- def to_hash
255
- hash = {}
256
- self.class.attribute_map.each_pair do |attr, param|
257
- value = self.send(attr)
258
- next if value.nil?
259
- hash[param] = _to_hash(value)
260
- end
261
- hash
262
- end
263
-
264
- # Outputs non-array value in the form of hash
265
- # For object, use to_hash. Otherwise, just return the value
266
- # @param [Object] value Any valid value
267
- # @return [Hash] Returns the value in the form of hash
268
- def _to_hash(value)
269
- if value.is_a?(Array)
270
- value.compact.map{ |v| _to_hash(v) }
271
- elsif value.is_a?(Hash)
272
- {}.tap do |hash|
273
- value.each { |k, v| hash[k] = _to_hash(v) }
274
- end
275
- elsif value.respond_to? :to_hash
276
- value.to_hash
277
- else
278
- value
279
- end
280
- end
281
-
282
- end
283
-
284
- end
@@ -1,60 +0,0 @@
1
- =begin
2
- #Pulp3 API
3
-
4
- #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
-
6
- OpenAPI spec version: v3
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
16
-
17
- # Unit tests for Zest::InlineResponse20010
18
- # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
- # Please update as you see appropriate
20
- describe 'InlineResponse20010' do
21
- before do
22
- # run before each test
23
- @instance = Zest::InlineResponse20010.new
24
- end
25
-
26
- after do
27
- # run after each test
28
- end
29
-
30
- describe 'test an instance of InlineResponse20010' do
31
- it 'should create an instance of InlineResponse20010' do
32
- expect(@instance).to be_instance_of(Zest::InlineResponse20010)
33
- end
34
- end
35
- describe 'test attribute "count"' 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 "_next"' 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 "previous"' 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 "results"' 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
60
-