pulp_maven_client 0.1.0b2

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 +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +79 -0
  4. data/README.md +119 -0
  5. data/Rakefile +10 -0
  6. data/docs/AsyncOperationResponse.md +17 -0
  7. data/docs/ContentApi.md +188 -0
  8. data/docs/DistributionsApi.md +352 -0
  9. data/docs/InlineResponse200.md +23 -0
  10. data/docs/InlineResponse2001.md +23 -0
  11. data/docs/InlineResponse2002.md +23 -0
  12. data/docs/MavenArtifact.md +33 -0
  13. data/docs/MavenDistribution.md +29 -0
  14. data/docs/MavenRemote.md +47 -0
  15. data/docs/RemotesApi.md +356 -0
  16. data/git_push.sh +55 -0
  17. data/lib/pulp_maven_client/api/content_api.rb +231 -0
  18. data/lib/pulp_maven_client/api/distributions_api.rb +430 -0
  19. data/lib/pulp_maven_client/api/remotes_api.rb +436 -0
  20. data/lib/pulp_maven_client/api_client.rb +387 -0
  21. data/lib/pulp_maven_client/api_error.rb +57 -0
  22. data/lib/pulp_maven_client/configuration.rb +251 -0
  23. data/lib/pulp_maven_client/models/async_operation_response.rb +202 -0
  24. data/lib/pulp_maven_client/models/inline_response200.rb +235 -0
  25. data/lib/pulp_maven_client/models/inline_response2001.rb +235 -0
  26. data/lib/pulp_maven_client/models/inline_response2002.rb +235 -0
  27. data/lib/pulp_maven_client/models/maven_artifact.rb +379 -0
  28. data/lib/pulp_maven_client/models/maven_distribution.rb +337 -0
  29. data/lib/pulp_maven_client/models/maven_remote.rb +549 -0
  30. data/lib/pulp_maven_client/version.rb +15 -0
  31. data/lib/pulp_maven_client.rb +49 -0
  32. data/pulp_maven_client.gemspec +45 -0
  33. data/spec/api/content_api_spec.rb +79 -0
  34. data/spec/api/distributions_api_spec.rb +116 -0
  35. data/spec/api/remotes_api_spec.rb +118 -0
  36. data/spec/api_client_spec.rb +226 -0
  37. data/spec/configuration_spec.rb +42 -0
  38. data/spec/models/async_operation_response_spec.rb +41 -0
  39. data/spec/models/inline_response2001_spec.rb +59 -0
  40. data/spec/models/inline_response2002_spec.rb +59 -0
  41. data/spec/models/inline_response200_spec.rb +59 -0
  42. data/spec/models/maven_artifact_spec.rb +89 -0
  43. data/spec/models/maven_distribution_spec.rb +77 -0
  44. data/spec/models/maven_remote_spec.rb +135 -0
  45. data/spec/spec_helper.rb +111 -0
  46. metadata +281 -0
@@ -0,0 +1,337 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpMavenClient
16
+ class MavenDistribution
17
+ attr_accessor :_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :_created
21
+
22
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
23
+ attr_accessor :base_path
24
+
25
+ # The URL for accessing the publication as defined by this distribution.
26
+ attr_accessor :base_url
27
+
28
+ # An optional content-guard.
29
+ attr_accessor :content_guard
30
+
31
+ # A unique name. Ex, `rawhide` and `stable`.
32
+ attr_accessor :name
33
+
34
+ # Remote that can be used to fetch content when using pull-through caching.
35
+ attr_accessor :remote
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'_href' => :'_href',
41
+ :'_created' => :'_created',
42
+ :'base_path' => :'base_path',
43
+ :'base_url' => :'base_url',
44
+ :'content_guard' => :'content_guard',
45
+ :'name' => :'name',
46
+ :'remote' => :'remote'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'_href' => :'String',
54
+ :'_created' => :'DateTime',
55
+ :'base_path' => :'String',
56
+ :'base_url' => :'String',
57
+ :'content_guard' => :'String',
58
+ :'name' => :'String',
59
+ :'remote' => :'String'
60
+ }
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::MavenDistribution` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!self.class.attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::MavenDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'_href')
79
+ self._href = attributes[:'_href']
80
+ end
81
+
82
+ if attributes.key?(:'_created')
83
+ self._created = attributes[:'_created']
84
+ end
85
+
86
+ if attributes.key?(:'base_path')
87
+ self.base_path = attributes[:'base_path']
88
+ end
89
+
90
+ if attributes.key?(:'base_url')
91
+ self.base_url = attributes[:'base_url']
92
+ end
93
+
94
+ if attributes.key?(:'content_guard')
95
+ self.content_guard = attributes[:'content_guard']
96
+ end
97
+
98
+ if attributes.key?(:'name')
99
+ self.name = attributes[:'name']
100
+ end
101
+
102
+ if attributes.key?(:'remote')
103
+ self.remote = attributes[:'remote']
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ if @base_path.nil?
112
+ invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
113
+ end
114
+
115
+ if @base_path.to_s.length > 255
116
+ invalid_properties.push('invalid value for "base_path", the character length must be smaller than or equal to 255.')
117
+ end
118
+
119
+ if @base_path.to_s.length < 1
120
+ invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
121
+ end
122
+
123
+ if !@base_url.nil? && @base_url.to_s.length < 1
124
+ invalid_properties.push('invalid value for "base_url", the character length must be great than or equal to 1.')
125
+ end
126
+
127
+ if @name.nil?
128
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
129
+ end
130
+
131
+ if @name.to_s.length > 255
132
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
133
+ end
134
+
135
+ if @name.to_s.length < 1
136
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
137
+ end
138
+
139
+ invalid_properties
140
+ end
141
+
142
+ # Check to see if the all the properties in the model are valid
143
+ # @return true if the model is valid
144
+ def valid?
145
+ return false if @base_path.nil?
146
+ return false if @base_path.to_s.length > 255
147
+ return false if @base_path.to_s.length < 1
148
+ return false if !@base_url.nil? && @base_url.to_s.length < 1
149
+ return false if @name.nil?
150
+ return false if @name.to_s.length > 255
151
+ return false if @name.to_s.length < 1
152
+ true
153
+ end
154
+
155
+ # Custom attribute writer method with validation
156
+ # @param [Object] base_path Value to be assigned
157
+ def base_path=(base_path)
158
+ if base_path.nil?
159
+ fail ArgumentError, 'base_path cannot be nil'
160
+ end
161
+
162
+ if base_path.to_s.length > 255
163
+ fail ArgumentError, 'invalid value for "base_path", the character length must be smaller than or equal to 255.'
164
+ end
165
+
166
+ if base_path.to_s.length < 1
167
+ fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
168
+ end
169
+
170
+ @base_path = base_path
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] base_url Value to be assigned
175
+ def base_url=(base_url)
176
+ if !base_url.nil? && base_url.to_s.length < 1
177
+ fail ArgumentError, 'invalid value for "base_url", the character length must be great than or equal to 1.'
178
+ end
179
+
180
+ @base_url = base_url
181
+ end
182
+
183
+ # Custom attribute writer method with validation
184
+ # @param [Object] name Value to be assigned
185
+ def name=(name)
186
+ if name.nil?
187
+ fail ArgumentError, 'name cannot be nil'
188
+ end
189
+
190
+ if name.to_s.length > 255
191
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
192
+ end
193
+
194
+ if name.to_s.length < 1
195
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
196
+ end
197
+
198
+ @name = name
199
+ end
200
+
201
+ # Checks equality by comparing each attribute.
202
+ # @param [Object] Object to be compared
203
+ def ==(o)
204
+ return true if self.equal?(o)
205
+ self.class == o.class &&
206
+ _href == o._href &&
207
+ _created == o._created &&
208
+ base_path == o.base_path &&
209
+ base_url == o.base_url &&
210
+ content_guard == o.content_guard &&
211
+ name == o.name &&
212
+ remote == o.remote
213
+ end
214
+
215
+ # @see the `==` method
216
+ # @param [Object] Object to be compared
217
+ def eql?(o)
218
+ self == o
219
+ end
220
+
221
+ # Calculates hash code according to all attributes.
222
+ # @return [Integer] Hash code
223
+ def hash
224
+ [_href, _created, base_path, base_url, content_guard, name, remote].hash
225
+ end
226
+
227
+ # Builds the object from hash
228
+ # @param [Hash] attributes Model attributes in the form of hash
229
+ # @return [Object] Returns the model itself
230
+ def self.build_from_hash(attributes)
231
+ new.build_from_hash(attributes)
232
+ end
233
+
234
+ # Builds the object from hash
235
+ # @param [Hash] attributes Model attributes in the form of hash
236
+ # @return [Object] Returns the model itself
237
+ def build_from_hash(attributes)
238
+ return nil unless attributes.is_a?(Hash)
239
+ self.class.openapi_types.each_pair do |key, type|
240
+ if type =~ /\AArray<(.*)>/i
241
+ # check to ensure the input is an array given that the attribute
242
+ # is documented as an array but the input is not
243
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
244
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
245
+ end
246
+ elsif !attributes[self.class.attribute_map[key]].nil?
247
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
248
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
249
+ end
250
+
251
+ self
252
+ end
253
+
254
+ # Deserializes the data based on type
255
+ # @param string type Data type
256
+ # @param string value Value to be deserialized
257
+ # @return [Object] Deserialized data
258
+ def _deserialize(type, value)
259
+ case type.to_sym
260
+ when :DateTime
261
+ DateTime.parse(value)
262
+ when :Date
263
+ Date.parse(value)
264
+ when :String
265
+ value.to_s
266
+ when :Integer
267
+ value.to_i
268
+ when :Float
269
+ value.to_f
270
+ when :Boolean
271
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
272
+ true
273
+ else
274
+ false
275
+ end
276
+ when :Object
277
+ # generic object (usually a Hash), return directly
278
+ value
279
+ when /\AArray<(?<inner_type>.+)>\z/
280
+ inner_type = Regexp.last_match[:inner_type]
281
+ value.map { |v| _deserialize(inner_type, v) }
282
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
283
+ k_type = Regexp.last_match[:k_type]
284
+ v_type = Regexp.last_match[:v_type]
285
+ {}.tap do |hash|
286
+ value.each do |k, v|
287
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
288
+ end
289
+ end
290
+ else # model
291
+ PulpMavenClient.const_get(type).build_from_hash(value)
292
+ end
293
+ end
294
+
295
+ # Returns the string representation of the object
296
+ # @return [String] String presentation of the object
297
+ def to_s
298
+ to_hash.to_s
299
+ end
300
+
301
+ # to_body is an alias to to_hash (backward compatibility)
302
+ # @return [Hash] Returns the object in the form of hash
303
+ def to_body
304
+ to_hash
305
+ end
306
+
307
+ # Returns the object in the form of hash
308
+ # @return [Hash] Returns the object in the form of hash
309
+ def to_hash
310
+ hash = {}
311
+ self.class.attribute_map.each_pair do |attr, param|
312
+ value = self.send(attr)
313
+ next if value.nil?
314
+ hash[param] = _to_hash(value)
315
+ end
316
+ hash
317
+ end
318
+
319
+ # Outputs non-array value in the form of hash
320
+ # For object, use to_hash. Otherwise, just return the value
321
+ # @param [Object] value Any valid value
322
+ # @return [Hash] Returns the value in the form of hash
323
+ def _to_hash(value)
324
+ if value.is_a?(Array)
325
+ value.compact.map { |v| _to_hash(v) }
326
+ elsif value.is_a?(Hash)
327
+ {}.tap do |hash|
328
+ value.each { |k, v| hash[k] = _to_hash(v) }
329
+ end
330
+ elsif value.respond_to? :to_hash
331
+ value.to_hash
332
+ else
333
+ value
334
+ end
335
+ end
336
+ end
337
+ end