pulp_maven_client 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +43 -31
  3. data/docs/ContentArtifactApi.md +37 -35
  4. data/docs/ContentSummary.md +3 -3
  5. data/docs/ContentSummaryResponse.md +21 -0
  6. data/docs/DistributionsMavenApi.md +63 -61
  7. data/docs/MavenMavenArtifact.md +3 -13
  8. data/docs/MavenMavenArtifactResponse.md +29 -0
  9. data/docs/MavenMavenDistribution.md +1 -7
  10. data/docs/MavenMavenDistributionResponse.md +29 -0
  11. data/docs/MavenMavenRemote.md +18 -12
  12. data/docs/MavenMavenRemoteResponse.md +51 -0
  13. data/docs/MavenMavenRepository.md +4 -10
  14. data/docs/MavenMavenRepositoryResponse.md +29 -0
  15. data/docs/PaginatedRepositoryVersionResponseList.md +23 -0
  16. data/docs/PaginatedmavenMavenArtifactResponseList.md +23 -0
  17. data/docs/PaginatedmavenMavenDistributionResponseList.md +23 -0
  18. data/docs/PaginatedmavenMavenRemoteResponseList.md +23 -0
  19. data/docs/PaginatedmavenMavenRepositoryResponseList.md +23 -0
  20. data/docs/PatchedmavenMavenDistribution.md +23 -0
  21. data/docs/PatchedmavenMavenRemote.md +45 -0
  22. data/docs/PatchedmavenMavenRepository.md +21 -0
  23. data/docs/PolicyEnum.md +16 -0
  24. data/docs/RemotesMavenApi.md +68 -66
  25. data/docs/RepositoriesMavenApi.md +60 -58
  26. data/docs/RepositoriesMavenVersionsApi.md +110 -53
  27. data/docs/RepositoryVersion.md +1 -9
  28. data/docs/RepositoryVersionResponse.md +25 -0
  29. data/lib/pulp_maven_client/api/content_artifact_api.rb +55 -52
  30. data/lib/pulp_maven_client/api/distributions_maven_api.rb +94 -91
  31. data/lib/pulp_maven_client/api/remotes_maven_api.rb +104 -101
  32. data/lib/pulp_maven_client/api/repositories_maven_api.rb +97 -94
  33. data/lib/pulp_maven_client/api/repositories_maven_versions_api.rb +149 -78
  34. data/lib/pulp_maven_client/api_client.rb +3 -3
  35. data/lib/pulp_maven_client/api_error.rb +3 -3
  36. data/lib/pulp_maven_client/configuration.rb +6 -6
  37. data/lib/pulp_maven_client/models/async_operation_response.rb +4 -3
  38. data/lib/pulp_maven_client/models/content_summary.rb +10 -16
  39. data/lib/pulp_maven_client/models/content_summary_response.rb +240 -0
  40. data/lib/pulp_maven_client/models/maven_maven_artifact.rb +15 -118
  41. data/lib/pulp_maven_client/models/maven_maven_artifact_response.rb +272 -0
  42. data/lib/pulp_maven_client/models/maven_maven_distribution.rb +5 -86
  43. data/lib/pulp_maven_client/models/maven_maven_distribution_response.rb +279 -0
  44. data/lib/pulp_maven_client/models/maven_maven_remote.rb +111 -147
  45. data/lib/pulp_maven_client/models/maven_maven_remote_response.rb +472 -0
  46. data/lib/pulp_maven_client/models/maven_maven_repository.rb +19 -79
  47. data/lib/pulp_maven_client/models/maven_maven_repository_response.rb +271 -0
  48. data/lib/pulp_maven_client/models/{inline_response200.rb → paginated_repository_version_response_list.rb} +7 -17
  49. data/lib/pulp_maven_client/models/{inline_response2002.rb → paginatedmaven_maven_artifact_response_list.rb} +7 -17
  50. data/lib/pulp_maven_client/models/{inline_response2004.rb → paginatedmaven_maven_distribution_response_list.rb} +7 -17
  51. data/lib/pulp_maven_client/models/{inline_response2003.rb → paginatedmaven_maven_remote_response_list.rb} +7 -17
  52. data/lib/pulp_maven_client/models/paginatedmaven_maven_repository_response_list.rb +237 -0
  53. data/lib/pulp_maven_client/models/{inline_response2001.rb → patchedmaven_maven_distribution.rb} +38 -45
  54. data/lib/pulp_maven_client/models/patchedmaven_maven_remote.rb +433 -0
  55. data/lib/pulp_maven_client/models/patchedmaven_maven_repository.rb +229 -0
  56. data/lib/pulp_maven_client/models/policy_enum.rb +36 -0
  57. data/lib/pulp_maven_client/models/repository_version.rb +8 -44
  58. data/lib/pulp_maven_client/models/repository_version_response.rb +246 -0
  59. data/lib/pulp_maven_client/version.rb +4 -4
  60. data/lib/pulp_maven_client.rb +18 -8
  61. data/pulp_maven_client.gemspec +5 -5
  62. data/spec/api/content_artifact_api_spec.rb +16 -15
  63. data/spec/api/distributions_maven_api_spec.rb +20 -19
  64. data/spec/api/remotes_maven_api_spec.rb +23 -22
  65. data/spec/api/repositories_maven_api_spec.rb +21 -20
  66. data/spec/api/repositories_maven_versions_api_spec.rb +36 -23
  67. data/spec/api_client_spec.rb +3 -3
  68. data/spec/configuration_spec.rb +6 -6
  69. data/spec/models/async_operation_response_spec.rb +3 -3
  70. data/spec/models/content_summary_response_spec.rb +53 -0
  71. data/spec/models/content_summary_spec.rb +3 -3
  72. data/spec/models/maven_maven_artifact_response_spec.rb +77 -0
  73. data/spec/models/maven_maven_artifact_spec.rb +4 -34
  74. data/spec/models/maven_maven_distribution_response_spec.rb +77 -0
  75. data/spec/models/maven_maven_distribution_spec.rb +3 -21
  76. data/spec/models/maven_maven_remote_response_spec.rb +143 -0
  77. data/spec/models/maven_maven_remote_spec.rb +33 -19
  78. data/spec/models/maven_maven_repository_response_spec.rb +77 -0
  79. data/spec/models/maven_maven_repository_spec.rb +6 -24
  80. data/spec/models/{inline_response2002_spec.rb → paginated_repository_version_response_list_spec.rb} +9 -9
  81. data/spec/models/{inline_response2003_spec.rb → paginatedmaven_maven_artifact_response_list_spec.rb} +9 -9
  82. data/spec/models/paginatedmaven_maven_distribution_response_list_spec.rb +59 -0
  83. data/spec/models/{inline_response2001_spec.rb → paginatedmaven_maven_remote_response_list_spec.rb} +9 -9
  84. data/spec/models/{inline_response2004_spec.rb → paginatedmaven_maven_repository_response_list_spec.rb} +9 -9
  85. data/spec/models/patchedmaven_maven_distribution_spec.rb +59 -0
  86. data/spec/models/patchedmaven_maven_remote_spec.rb +125 -0
  87. data/spec/models/{inline_response200_spec.rb → patchedmaven_maven_repository_spec.rb} +12 -18
  88. data/spec/models/policy_enum_spec.rb +35 -0
  89. data/spec/models/repository_version_response_spec.rb +65 -0
  90. data/spec/models/repository_version_spec.rb +3 -27
  91. data/spec/spec_helper.rb +3 -3
  92. metadata +70 -30
  93. data/docs/InlineResponse200.md +0 -23
  94. data/docs/InlineResponse2001.md +0 -23
  95. data/docs/InlineResponse2002.md +0 -23
  96. data/docs/InlineResponse2003.md +0 -23
  97. data/docs/InlineResponse2004.md +0 -23
@@ -0,0 +1,433 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpMavenClient
16
+ # A Serializer for MavenRemote. Add any new fields if defined on MavenRemote. Similar to the example above, in MavenArtifactSerializer. Additional validators can be added to the parent validators list For example:: class Meta: validators = platform.RemoteSerializer.Meta.validators + [myValidator1, myValidator2]
17
+ class PatchedmavenMavenRemote
18
+ # A unique name for this remote.
19
+ attr_accessor :name
20
+
21
+ # The URL of an external content source.
22
+ attr_accessor :url
23
+
24
+ # A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
25
+ attr_accessor :ca_cert
26
+
27
+ # A PEM encoded client certificate used for authentication.
28
+ attr_accessor :client_cert
29
+
30
+ # A PEM encoded private key used for authentication.
31
+ attr_accessor :client_key
32
+
33
+ # If True, TLS peer validation must be performed.
34
+ attr_accessor :tls_validation
35
+
36
+ # The proxy URL. Format: scheme://user:password@host:port
37
+ attr_accessor :proxy_url
38
+
39
+ # The username to be used for authentication when syncing.
40
+ attr_accessor :username
41
+
42
+ # The password to be used for authentication when syncing.
43
+ attr_accessor :password
44
+
45
+ # Total number of simultaneous connections.
46
+ attr_accessor :download_concurrency
47
+
48
+ # The policy to use when downloading content.
49
+ attr_accessor :policy
50
+
51
+ # aiohttp.ClientTimeout.total (q.v.) for download-connections.
52
+ attr_accessor :total_timeout
53
+
54
+ # aiohttp.ClientTimeout.connect (q.v.) for download-connections.
55
+ attr_accessor :connect_timeout
56
+
57
+ # aiohttp.ClientTimeout.sock_connect (q.v.) for download-connections.
58
+ attr_accessor :sock_connect_timeout
59
+
60
+ # aiohttp.ClientTimeout.sock_read (q.v.) for download-connections.
61
+ attr_accessor :sock_read_timeout
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'name' => :'name',
67
+ :'url' => :'url',
68
+ :'ca_cert' => :'ca_cert',
69
+ :'client_cert' => :'client_cert',
70
+ :'client_key' => :'client_key',
71
+ :'tls_validation' => :'tls_validation',
72
+ :'proxy_url' => :'proxy_url',
73
+ :'username' => :'username',
74
+ :'password' => :'password',
75
+ :'download_concurrency' => :'download_concurrency',
76
+ :'policy' => :'policy',
77
+ :'total_timeout' => :'total_timeout',
78
+ :'connect_timeout' => :'connect_timeout',
79
+ :'sock_connect_timeout' => :'sock_connect_timeout',
80
+ :'sock_read_timeout' => :'sock_read_timeout'
81
+ }
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'name' => :'String',
88
+ :'url' => :'String',
89
+ :'ca_cert' => :'String',
90
+ :'client_cert' => :'String',
91
+ :'client_key' => :'String',
92
+ :'tls_validation' => :'Boolean',
93
+ :'proxy_url' => :'String',
94
+ :'username' => :'String',
95
+ :'password' => :'String',
96
+ :'download_concurrency' => :'Integer',
97
+ :'policy' => :'PolicyEnum',
98
+ :'total_timeout' => :'Float',
99
+ :'connect_timeout' => :'Float',
100
+ :'sock_connect_timeout' => :'Float',
101
+ :'sock_read_timeout' => :'Float'
102
+ }
103
+ end
104
+
105
+ # List of attributes with nullable: true
106
+ def self.openapi_nullable
107
+ Set.new([
108
+ :'ca_cert',
109
+ :'client_cert',
110
+ :'client_key',
111
+ :'proxy_url',
112
+ :'username',
113
+ :'password',
114
+ :'total_timeout',
115
+ :'connect_timeout',
116
+ :'sock_connect_timeout',
117
+ :'sock_read_timeout'
118
+ ])
119
+ end
120
+
121
+ # Initializes the object
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ def initialize(attributes = {})
124
+ if (!attributes.is_a?(Hash))
125
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::PatchedmavenMavenRemote` initialize method"
126
+ end
127
+
128
+ # check to see if the attribute exists and convert string to symbol for hash key
129
+ attributes = attributes.each_with_object({}) { |(k, v), h|
130
+ if (!self.class.attribute_map.key?(k.to_sym))
131
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::PatchedmavenMavenRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
132
+ end
133
+ h[k.to_sym] = v
134
+ }
135
+
136
+ if attributes.key?(:'name')
137
+ self.name = attributes[:'name']
138
+ end
139
+
140
+ if attributes.key?(:'url')
141
+ self.url = attributes[:'url']
142
+ end
143
+
144
+ if attributes.key?(:'ca_cert')
145
+ self.ca_cert = attributes[:'ca_cert']
146
+ end
147
+
148
+ if attributes.key?(:'client_cert')
149
+ self.client_cert = attributes[:'client_cert']
150
+ end
151
+
152
+ if attributes.key?(:'client_key')
153
+ self.client_key = attributes[:'client_key']
154
+ end
155
+
156
+ if attributes.key?(:'tls_validation')
157
+ self.tls_validation = attributes[:'tls_validation']
158
+ end
159
+
160
+ if attributes.key?(:'proxy_url')
161
+ self.proxy_url = attributes[:'proxy_url']
162
+ end
163
+
164
+ if attributes.key?(:'username')
165
+ self.username = attributes[:'username']
166
+ end
167
+
168
+ if attributes.key?(:'password')
169
+ self.password = attributes[:'password']
170
+ end
171
+
172
+ if attributes.key?(:'download_concurrency')
173
+ self.download_concurrency = attributes[:'download_concurrency']
174
+ end
175
+
176
+ if attributes.key?(:'policy')
177
+ self.policy = attributes[:'policy']
178
+ end
179
+
180
+ if attributes.key?(:'total_timeout')
181
+ self.total_timeout = attributes[:'total_timeout']
182
+ end
183
+
184
+ if attributes.key?(:'connect_timeout')
185
+ self.connect_timeout = attributes[:'connect_timeout']
186
+ end
187
+
188
+ if attributes.key?(:'sock_connect_timeout')
189
+ self.sock_connect_timeout = attributes[:'sock_connect_timeout']
190
+ end
191
+
192
+ if attributes.key?(:'sock_read_timeout')
193
+ self.sock_read_timeout = attributes[:'sock_read_timeout']
194
+ end
195
+ end
196
+
197
+ # Show invalid properties with the reasons. Usually used together with valid?
198
+ # @return Array for valid properties with the reasons
199
+ def list_invalid_properties
200
+ invalid_properties = Array.new
201
+ if !@download_concurrency.nil? && @download_concurrency < 1
202
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
203
+ end
204
+
205
+ if !@total_timeout.nil? && @total_timeout < 0.0
206
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
207
+ end
208
+
209
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
210
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
211
+ end
212
+
213
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
214
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
215
+ end
216
+
217
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
218
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
219
+ end
220
+
221
+ invalid_properties
222
+ end
223
+
224
+ # Check to see if the all the properties in the model are valid
225
+ # @return true if the model is valid
226
+ def valid?
227
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
228
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
229
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
230
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
231
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
232
+ true
233
+ end
234
+
235
+ # Custom attribute writer method with validation
236
+ # @param [Object] download_concurrency Value to be assigned
237
+ def download_concurrency=(download_concurrency)
238
+ if !download_concurrency.nil? && download_concurrency < 1
239
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
240
+ end
241
+
242
+ @download_concurrency = download_concurrency
243
+ end
244
+
245
+ # Custom attribute writer method with validation
246
+ # @param [Object] total_timeout Value to be assigned
247
+ def total_timeout=(total_timeout)
248
+ if !total_timeout.nil? && total_timeout < 0.0
249
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
250
+ end
251
+
252
+ @total_timeout = total_timeout
253
+ end
254
+
255
+ # Custom attribute writer method with validation
256
+ # @param [Object] connect_timeout Value to be assigned
257
+ def connect_timeout=(connect_timeout)
258
+ if !connect_timeout.nil? && connect_timeout < 0.0
259
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
260
+ end
261
+
262
+ @connect_timeout = connect_timeout
263
+ end
264
+
265
+ # Custom attribute writer method with validation
266
+ # @param [Object] sock_connect_timeout Value to be assigned
267
+ def sock_connect_timeout=(sock_connect_timeout)
268
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
269
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
270
+ end
271
+
272
+ @sock_connect_timeout = sock_connect_timeout
273
+ end
274
+
275
+ # Custom attribute writer method with validation
276
+ # @param [Object] sock_read_timeout Value to be assigned
277
+ def sock_read_timeout=(sock_read_timeout)
278
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
279
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
280
+ end
281
+
282
+ @sock_read_timeout = sock_read_timeout
283
+ end
284
+
285
+ # Checks equality by comparing each attribute.
286
+ # @param [Object] Object to be compared
287
+ def ==(o)
288
+ return true if self.equal?(o)
289
+ self.class == o.class &&
290
+ name == o.name &&
291
+ url == o.url &&
292
+ ca_cert == o.ca_cert &&
293
+ client_cert == o.client_cert &&
294
+ client_key == o.client_key &&
295
+ tls_validation == o.tls_validation &&
296
+ proxy_url == o.proxy_url &&
297
+ username == o.username &&
298
+ password == o.password &&
299
+ download_concurrency == o.download_concurrency &&
300
+ policy == o.policy &&
301
+ total_timeout == o.total_timeout &&
302
+ connect_timeout == o.connect_timeout &&
303
+ sock_connect_timeout == o.sock_connect_timeout &&
304
+ sock_read_timeout == o.sock_read_timeout
305
+ end
306
+
307
+ # @see the `==` method
308
+ # @param [Object] Object to be compared
309
+ def eql?(o)
310
+ self == o
311
+ end
312
+
313
+ # Calculates hash code according to all attributes.
314
+ # @return [Integer] Hash code
315
+ def hash
316
+ [name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, download_concurrency, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout].hash
317
+ end
318
+
319
+ # Builds the object from hash
320
+ # @param [Hash] attributes Model attributes in the form of hash
321
+ # @return [Object] Returns the model itself
322
+ def self.build_from_hash(attributes)
323
+ new.build_from_hash(attributes)
324
+ end
325
+
326
+ # Builds the object from hash
327
+ # @param [Hash] attributes Model attributes in the form of hash
328
+ # @return [Object] Returns the model itself
329
+ def build_from_hash(attributes)
330
+ return nil unless attributes.is_a?(Hash)
331
+ self.class.openapi_types.each_pair do |key, type|
332
+ if type =~ /\AArray<(.*)>/i
333
+ # check to ensure the input is an array given that the attribute
334
+ # is documented as an array but the input is not
335
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
336
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
337
+ end
338
+ elsif !attributes[self.class.attribute_map[key]].nil?
339
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
340
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
341
+ end
342
+
343
+ self
344
+ end
345
+
346
+ # Deserializes the data based on type
347
+ # @param string type Data type
348
+ # @param string value Value to be deserialized
349
+ # @return [Object] Deserialized data
350
+ def _deserialize(type, value)
351
+ case type.to_sym
352
+ when :DateTime
353
+ DateTime.parse(value)
354
+ when :Date
355
+ Date.parse(value)
356
+ when :String
357
+ value.to_s
358
+ when :Integer
359
+ value.to_i
360
+ when :Float
361
+ value.to_f
362
+ when :Boolean
363
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
364
+ true
365
+ else
366
+ false
367
+ end
368
+ when :Object
369
+ # generic object (usually a Hash), return directly
370
+ value
371
+ when /\AArray<(?<inner_type>.+)>\z/
372
+ inner_type = Regexp.last_match[:inner_type]
373
+ value.map { |v| _deserialize(inner_type, v) }
374
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
375
+ k_type = Regexp.last_match[:k_type]
376
+ v_type = Regexp.last_match[:v_type]
377
+ {}.tap do |hash|
378
+ value.each do |k, v|
379
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
380
+ end
381
+ end
382
+ else # model
383
+ PulpMavenClient.const_get(type).build_from_hash(value)
384
+ end
385
+ end
386
+
387
+ # Returns the string representation of the object
388
+ # @return [String] String presentation of the object
389
+ def to_s
390
+ to_hash.to_s
391
+ end
392
+
393
+ # to_body is an alias to to_hash (backward compatibility)
394
+ # @return [Hash] Returns the object in the form of hash
395
+ def to_body
396
+ to_hash
397
+ end
398
+
399
+ # Returns the object in the form of hash
400
+ # @return [Hash] Returns the object in the form of hash
401
+ def to_hash
402
+ hash = {}
403
+ self.class.attribute_map.each_pair do |attr, param|
404
+ value = self.send(attr)
405
+ if value.nil?
406
+ is_nullable = self.class.openapi_nullable.include?(attr)
407
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
408
+ end
409
+
410
+ hash[param] = _to_hash(value)
411
+ end
412
+ hash
413
+ end
414
+
415
+ # Outputs non-array value in the form of hash
416
+ # For object, use to_hash. Otherwise, just return the value
417
+ # @param [Object] value Any valid value
418
+ # @return [Hash] Returns the value in the form of hash
419
+ def _to_hash(value)
420
+ if value.is_a?(Array)
421
+ value.compact.map { |v| _to_hash(v) }
422
+ elsif value.is_a?(Hash)
423
+ {}.tap do |hash|
424
+ value.each { |k, v| hash[k] = _to_hash(v) }
425
+ end
426
+ elsif value.respond_to? :to_hash
427
+ value.to_hash
428
+ else
429
+ value
430
+ end
431
+ end
432
+ end
433
+ end
@@ -0,0 +1,229 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpMavenClient
16
+ # Serializer for Maven Repositories.
17
+ class PatchedmavenMavenRepository
18
+ # A unique name for this repository.
19
+ attr_accessor :name
20
+
21
+ # An optional description.
22
+ attr_accessor :description
23
+
24
+ attr_accessor :remote
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'name' => :'name',
30
+ :'description' => :'description',
31
+ :'remote' => :'remote'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'name' => :'String',
39
+ :'description' => :'String',
40
+ :'remote' => :'String'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ :'description',
48
+ :'remote'
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::PatchedmavenMavenRepository` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::PatchedmavenMavenRepository`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'name')
68
+ self.name = attributes[:'name']
69
+ end
70
+
71
+ if attributes.key?(:'description')
72
+ self.description = attributes[:'description']
73
+ end
74
+
75
+ if attributes.key?(:'remote')
76
+ self.remote = attributes[:'remote']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ name == o.name &&
99
+ description == o.description &&
100
+ remote == o.remote
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [name, description, remote].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ new.build_from_hash(attributes)
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ self.class.openapi_types.each_pair do |key, type|
128
+ if type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
132
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
133
+ end
134
+ elsif !attributes[self.class.attribute_map[key]].nil?
135
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
136
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
137
+ end
138
+
139
+ self
140
+ end
141
+
142
+ # Deserializes the data based on type
143
+ # @param string type Data type
144
+ # @param string value Value to be deserialized
145
+ # @return [Object] Deserialized data
146
+ def _deserialize(type, value)
147
+ case type.to_sym
148
+ when :DateTime
149
+ DateTime.parse(value)
150
+ when :Date
151
+ Date.parse(value)
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :Boolean
159
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else # model
179
+ PulpMavenClient.const_get(type).build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+ end
229
+ end
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpMavenClient
16
+ class PolicyEnum
17
+ IMMEDIATE = "immediate".freeze
18
+ WHEN_SYNCING_DOWNLOAD_ALL_METADATA_AND_CONTENT_NOW = "When syncing, download all metadata and content now.".freeze
19
+
20
+ # Builds the enum from string
21
+ # @param [String] The enum value in the form of the string
22
+ # @return [String] The enum value
23
+ def self.build_from_hash(value)
24
+ new.build_from_hash(value)
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def build_from_hash(value)
31
+ constantValues = PolicyEnum.constants.select { |c| PolicyEnum::const_get(c) == value }
32
+ raise "Invalid ENUM value #{value} for class #PolicyEnum" if constantValues.empty?
33
+ value
34
+ end
35
+ end
36
+ end