pulp_file_client 0.1.0b4 → 0.1.0rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +35 -9
  3. data/docs/ContentFilesApi.md +2 -2
  4. data/docs/ContentSummary.md +21 -0
  5. data/docs/DistributionsFileApi.md +8 -8
  6. data/docs/FileExportersFileApi.md +408 -0
  7. data/docs/{FileContent.md → FileFileContent.md} +2 -6
  8. data/docs/{FileDistribution.md → FileFileDistribution.md} +2 -2
  9. data/docs/FileFileFileSystemExporter.md +23 -0
  10. data/docs/{FilePublication.md → FileFilePublication.md} +2 -2
  11. data/docs/{FileRemote.md → FileFileRemote.md} +10 -14
  12. data/docs/FileFileRepository.md +27 -0
  13. data/docs/InlineResponse200.md +1 -1
  14. data/docs/InlineResponse2001.md +1 -1
  15. data/docs/InlineResponse2002.md +1 -1
  16. data/docs/InlineResponse2003.md +1 -1
  17. data/docs/InlineResponse2004.md +23 -0
  18. data/docs/InlineResponse2005.md +23 -0
  19. data/docs/InlineResponse2006.md +23 -0
  20. data/docs/PublicationExport.md +17 -0
  21. data/docs/PublicationsFileApi.md +9 -9
  22. data/docs/RemotesFileApi.md +12 -67
  23. data/docs/RepositoriesFileApi.md +464 -0
  24. data/docs/RepositoriesFileVersionsApi.md +214 -0
  25. data/docs/RepositoryAddRemoveContent.md +21 -0
  26. data/docs/RepositorySyncURL.md +2 -2
  27. data/docs/RepositoryVersion.md +25 -0
  28. data/lib/pulp_file_client/api/content_files_api.rb +4 -4
  29. data/lib/pulp_file_client/api/distributions_file_api.rb +10 -10
  30. data/lib/pulp_file_client/api/file_exporters_file_api.rb +496 -0
  31. data/lib/pulp_file_client/api/publications_file_api.rb +15 -15
  32. data/lib/pulp_file_client/api/remotes_file_api.rb +16 -84
  33. data/lib/pulp_file_client/api/repositories_file_api.rb +566 -0
  34. data/lib/pulp_file_client/api/repositories_file_versions_api.rb +268 -0
  35. data/lib/pulp_file_client/api_client.rb +1 -1
  36. data/lib/pulp_file_client/api_error.rb +1 -1
  37. data/lib/pulp_file_client/configuration.rb +1 -1
  38. data/lib/pulp_file_client/models/async_operation_response.rb +12 -2
  39. data/lib/pulp_file_client/models/content_summary.rb +246 -0
  40. data/lib/pulp_file_client/models/{file_content.rb → file_file_content.rb} +16 -26
  41. data/lib/pulp_file_client/models/{file_distribution.rb → file_file_distribution.rb} +17 -23
  42. data/lib/pulp_file_client/models/file_file_file_system_exporter.rb +284 -0
  43. data/lib/pulp_file_client/models/{file_publication.rb → file_file_publication.rb} +16 -5
  44. data/lib/pulp_file_client/models/{file_remote.rb → file_file_remote.rb} +69 -105
  45. data/lib/pulp_file_client/models/file_file_repository.rb +294 -0
  46. data/lib/pulp_file_client/models/inline_response200.rb +15 -3
  47. data/lib/pulp_file_client/models/inline_response2001.rb +15 -3
  48. data/lib/pulp_file_client/models/inline_response2002.rb +15 -3
  49. data/lib/pulp_file_client/models/inline_response2003.rb +15 -3
  50. data/lib/pulp_file_client/models/inline_response2004.rb +247 -0
  51. data/lib/pulp_file_client/models/inline_response2005.rb +247 -0
  52. data/lib/pulp_file_client/models/inline_response2006.rb +247 -0
  53. data/lib/pulp_file_client/models/publication_export.rb +212 -0
  54. data/lib/pulp_file_client/models/repository_add_remove_content.rb +231 -0
  55. data/lib/pulp_file_client/models/repository_sync_url.rb +22 -12
  56. data/lib/pulp_file_client/models/repository_version.rb +244 -0
  57. data/lib/pulp_file_client/version.rb +2 -2
  58. data/lib/pulp_file_client.rb +17 -5
  59. data/pulp_file_client.gemspec +1 -1
  60. data/spec/api/content_files_api_spec.rb +2 -2
  61. data/spec/api/distributions_file_api_spec.rb +2 -2
  62. data/spec/api/file_exporters_file_api_spec.rb +128 -0
  63. data/spec/api/publications_file_api_spec.rb +6 -6
  64. data/spec/api/remotes_file_api_spec.rb +4 -16
  65. data/spec/api/repositories_file_api_spec.rb +140 -0
  66. data/spec/api/repositories_file_versions_api_spec.rb +91 -0
  67. data/spec/api_client_spec.rb +1 -1
  68. data/spec/configuration_spec.rb +1 -1
  69. data/spec/models/async_operation_response_spec.rb +1 -1
  70. data/spec/models/content_summary_spec.rb +53 -0
  71. data/spec/models/{file_content_spec.rb → file_file_content_spec.rb} +7 -19
  72. data/spec/models/{file_distribution_spec.rb → file_file_distribution_spec.rb} +7 -7
  73. data/spec/models/file_file_file_system_exporter_spec.rb +59 -0
  74. data/spec/models/{file_publication_spec.rb → file_file_publication_spec.rb} +7 -7
  75. data/spec/models/{file_remote_spec.rb → file_file_remote_spec.rb} +11 -23
  76. data/spec/models/file_file_repository_spec.rb +71 -0
  77. data/spec/models/inline_response2001_spec.rb +1 -1
  78. data/spec/models/inline_response2002_spec.rb +1 -1
  79. data/spec/models/inline_response2003_spec.rb +1 -1
  80. data/spec/models/inline_response2004_spec.rb +59 -0
  81. data/spec/models/inline_response2005_spec.rb +59 -0
  82. data/spec/models/inline_response2006_spec.rb +59 -0
  83. data/spec/models/inline_response200_spec.rb +1 -1
  84. data/spec/models/publication_export_spec.rb +41 -0
  85. data/spec/models/repository_add_remove_content_spec.rb +53 -0
  86. data/spec/models/repository_sync_url_spec.rb +2 -2
  87. data/spec/models/repository_version_spec.rb +65 -0
  88. data/spec/spec_helper.rb +1 -1
  89. metadata +66 -18
@@ -6,14 +6,14 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.0-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module PulpFileClient
16
- class FileRemote
16
+ class FileFileRemote
17
17
  attr_accessor :pulp_href
18
18
 
19
19
  # Timestamp of creation.
@@ -26,26 +26,20 @@ module PulpFileClient
26
26
  attr_accessor :url
27
27
 
28
28
  # A string containing the PEM encoded CA certificate used to validate the server certificate presented by the remote server. All new line characters must be escaped. Returns SHA256 sum on GET.
29
- attr_accessor :ssl_ca_certificate
29
+ attr_accessor :ca_cert
30
30
 
31
31
  # A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped. Returns SHA256 sum on GET.
32
- attr_accessor :ssl_client_certificate
32
+ attr_accessor :client_cert
33
33
 
34
34
  # A PEM encoded private key used for authentication. Returns SHA256 sum on GET.
35
- attr_accessor :ssl_client_key
35
+ attr_accessor :client_key
36
36
 
37
- # If True, SSL peer validation must be performed.
38
- attr_accessor :ssl_validation
37
+ # If True, TLS peer validation must be performed.
38
+ attr_accessor :tls_validation
39
39
 
40
40
  # The proxy URL. Format: scheme://user:password@host:port
41
41
  attr_accessor :proxy_url
42
42
 
43
- # The username to be used for authentication when syncing.
44
- attr_accessor :username
45
-
46
- # The password to be used for authentication when syncing.
47
- attr_accessor :password
48
-
49
43
  # Timestamp of the most recent update of the remote.
50
44
  attr_accessor :pulp_last_updated
51
45
 
@@ -84,13 +78,11 @@ module PulpFileClient
84
78
  :'pulp_created' => :'pulp_created',
85
79
  :'name' => :'name',
86
80
  :'url' => :'url',
87
- :'ssl_ca_certificate' => :'ssl_ca_certificate',
88
- :'ssl_client_certificate' => :'ssl_client_certificate',
89
- :'ssl_client_key' => :'ssl_client_key',
90
- :'ssl_validation' => :'ssl_validation',
81
+ :'ca_cert' => :'ca_cert',
82
+ :'client_cert' => :'client_cert',
83
+ :'client_key' => :'client_key',
84
+ :'tls_validation' => :'tls_validation',
91
85
  :'proxy_url' => :'proxy_url',
92
- :'username' => :'username',
93
- :'password' => :'password',
94
86
  :'pulp_last_updated' => :'pulp_last_updated',
95
87
  :'download_concurrency' => :'download_concurrency',
96
88
  :'policy' => :'policy'
@@ -104,30 +96,38 @@ module PulpFileClient
104
96
  :'pulp_created' => :'DateTime',
105
97
  :'name' => :'String',
106
98
  :'url' => :'String',
107
- :'ssl_ca_certificate' => :'String',
108
- :'ssl_client_certificate' => :'String',
109
- :'ssl_client_key' => :'String',
110
- :'ssl_validation' => :'Boolean',
99
+ :'ca_cert' => :'String',
100
+ :'client_cert' => :'String',
101
+ :'client_key' => :'String',
102
+ :'tls_validation' => :'Boolean',
111
103
  :'proxy_url' => :'String',
112
- :'username' => :'String',
113
- :'password' => :'String',
114
104
  :'pulp_last_updated' => :'DateTime',
115
105
  :'download_concurrency' => :'Integer',
116
106
  :'policy' => :'String'
117
107
  }
118
108
  end
119
109
 
110
+ # List of attributes with nullable: true
111
+ def self.openapi_nullable
112
+ Set.new([
113
+ :'ca_cert',
114
+ :'client_cert',
115
+ :'client_key',
116
+ :'proxy_url',
117
+ ])
118
+ end
119
+
120
120
  # Initializes the object
121
121
  # @param [Hash] attributes Model attributes in the form of hash
122
122
  def initialize(attributes = {})
123
123
  if (!attributes.is_a?(Hash))
124
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileRemote` initialize method"
124
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileFileRemote` initialize method"
125
125
  end
126
126
 
127
127
  # check to see if the attribute exists and convert string to symbol for hash key
128
128
  attributes = attributes.each_with_object({}) { |(k, v), h|
129
129
  if (!self.class.attribute_map.key?(k.to_sym))
130
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
130
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileFileRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
131
131
  end
132
132
  h[k.to_sym] = v
133
133
  }
@@ -148,34 +148,26 @@ module PulpFileClient
148
148
  self.url = attributes[:'url']
149
149
  end
150
150
 
151
- if attributes.key?(:'ssl_ca_certificate')
152
- self.ssl_ca_certificate = attributes[:'ssl_ca_certificate']
151
+ if attributes.key?(:'ca_cert')
152
+ self.ca_cert = attributes[:'ca_cert']
153
153
  end
154
154
 
155
- if attributes.key?(:'ssl_client_certificate')
156
- self.ssl_client_certificate = attributes[:'ssl_client_certificate']
155
+ if attributes.key?(:'client_cert')
156
+ self.client_cert = attributes[:'client_cert']
157
157
  end
158
158
 
159
- if attributes.key?(:'ssl_client_key')
160
- self.ssl_client_key = attributes[:'ssl_client_key']
159
+ if attributes.key?(:'client_key')
160
+ self.client_key = attributes[:'client_key']
161
161
  end
162
162
 
163
- if attributes.key?(:'ssl_validation')
164
- self.ssl_validation = attributes[:'ssl_validation']
163
+ if attributes.key?(:'tls_validation')
164
+ self.tls_validation = attributes[:'tls_validation']
165
165
  end
166
166
 
167
167
  if attributes.key?(:'proxy_url')
168
168
  self.proxy_url = attributes[:'proxy_url']
169
169
  end
170
170
 
171
- if attributes.key?(:'username')
172
- self.username = attributes[:'username']
173
- end
174
-
175
- if attributes.key?(:'password')
176
- self.password = attributes[:'password']
177
- end
178
-
179
171
  if attributes.key?(:'pulp_last_updated')
180
172
  self.pulp_last_updated = attributes[:'pulp_last_updated']
181
173
  end
@@ -211,30 +203,22 @@ module PulpFileClient
211
203
  invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
212
204
  end
213
205
 
214
- if !@ssl_ca_certificate.nil? && @ssl_ca_certificate.to_s.length < 1
215
- invalid_properties.push('invalid value for "ssl_ca_certificate", the character length must be great than or equal to 1.')
206
+ if !@ca_cert.nil? && @ca_cert.to_s.length < 1
207
+ invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
216
208
  end
217
209
 
218
- if !@ssl_client_certificate.nil? && @ssl_client_certificate.to_s.length < 1
219
- invalid_properties.push('invalid value for "ssl_client_certificate", the character length must be great than or equal to 1.')
210
+ if !@client_cert.nil? && @client_cert.to_s.length < 1
211
+ invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
220
212
  end
221
213
 
222
- if !@ssl_client_key.nil? && @ssl_client_key.to_s.length < 1
223
- invalid_properties.push('invalid value for "ssl_client_key", the character length must be great than or equal to 1.')
214
+ if !@client_key.nil? && @client_key.to_s.length < 1
215
+ invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
224
216
  end
225
217
 
226
218
  if !@proxy_url.nil? && @proxy_url.to_s.length < 1
227
219
  invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
228
220
  end
229
221
 
230
- if !@username.nil? && @username.to_s.length < 1
231
- invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
232
- end
233
-
234
- if !@password.nil? && @password.to_s.length < 1
235
- invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
236
- end
237
-
238
222
  if !@download_concurrency.nil? && @download_concurrency < 1
239
223
  invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
240
224
  end
@@ -249,12 +233,10 @@ module PulpFileClient
249
233
  return false if @name.to_s.length < 1
250
234
  return false if @url.nil?
251
235
  return false if @url.to_s.length < 1
252
- return false if !@ssl_ca_certificate.nil? && @ssl_ca_certificate.to_s.length < 1
253
- return false if !@ssl_client_certificate.nil? && @ssl_client_certificate.to_s.length < 1
254
- return false if !@ssl_client_key.nil? && @ssl_client_key.to_s.length < 1
236
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
237
+ return false if !@client_cert.nil? && @client_cert.to_s.length < 1
238
+ return false if !@client_key.nil? && @client_key.to_s.length < 1
255
239
  return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
256
- return false if !@username.nil? && @username.to_s.length < 1
257
- return false if !@password.nil? && @password.to_s.length < 1
258
240
  return false if !@download_concurrency.nil? && @download_concurrency < 1
259
241
  policy_validator = EnumAttributeValidator.new('String', ["immediate", "on_demand", "streamed"])
260
242
  return false unless policy_validator.valid?(@policy)
@@ -290,33 +272,33 @@ module PulpFileClient
290
272
  end
291
273
 
292
274
  # Custom attribute writer method with validation
293
- # @param [Object] ssl_ca_certificate Value to be assigned
294
- def ssl_ca_certificate=(ssl_ca_certificate)
295
- if !ssl_ca_certificate.nil? && ssl_ca_certificate.to_s.length < 1
296
- fail ArgumentError, 'invalid value for "ssl_ca_certificate", the character length must be great than or equal to 1.'
275
+ # @param [Object] ca_cert Value to be assigned
276
+ def ca_cert=(ca_cert)
277
+ if !ca_cert.nil? && ca_cert.to_s.length < 1
278
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
297
279
  end
298
280
 
299
- @ssl_ca_certificate = ssl_ca_certificate
281
+ @ca_cert = ca_cert
300
282
  end
301
283
 
302
284
  # Custom attribute writer method with validation
303
- # @param [Object] ssl_client_certificate Value to be assigned
304
- def ssl_client_certificate=(ssl_client_certificate)
305
- if !ssl_client_certificate.nil? && ssl_client_certificate.to_s.length < 1
306
- fail ArgumentError, 'invalid value for "ssl_client_certificate", the character length must be great than or equal to 1.'
285
+ # @param [Object] client_cert Value to be assigned
286
+ def client_cert=(client_cert)
287
+ if !client_cert.nil? && client_cert.to_s.length < 1
288
+ fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
307
289
  end
308
290
 
309
- @ssl_client_certificate = ssl_client_certificate
291
+ @client_cert = client_cert
310
292
  end
311
293
 
312
294
  # Custom attribute writer method with validation
313
- # @param [Object] ssl_client_key Value to be assigned
314
- def ssl_client_key=(ssl_client_key)
315
- if !ssl_client_key.nil? && ssl_client_key.to_s.length < 1
316
- fail ArgumentError, 'invalid value for "ssl_client_key", the character length must be great than or equal to 1.'
295
+ # @param [Object] client_key Value to be assigned
296
+ def client_key=(client_key)
297
+ if !client_key.nil? && client_key.to_s.length < 1
298
+ fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
317
299
  end
318
300
 
319
- @ssl_client_key = ssl_client_key
301
+ @client_key = client_key
320
302
  end
321
303
 
322
304
  # Custom attribute writer method with validation
@@ -329,26 +311,6 @@ module PulpFileClient
329
311
  @proxy_url = proxy_url
330
312
  end
331
313
 
332
- # Custom attribute writer method with validation
333
- # @param [Object] username Value to be assigned
334
- def username=(username)
335
- if !username.nil? && username.to_s.length < 1
336
- fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
337
- end
338
-
339
- @username = username
340
- end
341
-
342
- # Custom attribute writer method with validation
343
- # @param [Object] password Value to be assigned
344
- def password=(password)
345
- if !password.nil? && password.to_s.length < 1
346
- fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
347
- end
348
-
349
- @password = password
350
- end
351
-
352
314
  # Custom attribute writer method with validation
353
315
  # @param [Object] download_concurrency Value to be assigned
354
316
  def download_concurrency=(download_concurrency)
@@ -378,13 +340,11 @@ module PulpFileClient
378
340
  pulp_created == o.pulp_created &&
379
341
  name == o.name &&
380
342
  url == o.url &&
381
- ssl_ca_certificate == o.ssl_ca_certificate &&
382
- ssl_client_certificate == o.ssl_client_certificate &&
383
- ssl_client_key == o.ssl_client_key &&
384
- ssl_validation == o.ssl_validation &&
343
+ ca_cert == o.ca_cert &&
344
+ client_cert == o.client_cert &&
345
+ client_key == o.client_key &&
346
+ tls_validation == o.tls_validation &&
385
347
  proxy_url == o.proxy_url &&
386
- username == o.username &&
387
- password == o.password &&
388
348
  pulp_last_updated == o.pulp_last_updated &&
389
349
  download_concurrency == o.download_concurrency &&
390
350
  policy == o.policy
@@ -399,7 +359,7 @@ module PulpFileClient
399
359
  # Calculates hash code according to all attributes.
400
360
  # @return [Integer] Hash code
401
361
  def hash
402
- [pulp_href, pulp_created, name, url, ssl_ca_certificate, ssl_client_certificate, ssl_client_key, ssl_validation, proxy_url, username, password, pulp_last_updated, download_concurrency, policy].hash
362
+ [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, pulp_last_updated, download_concurrency, policy].hash
403
363
  end
404
364
 
405
365
  # Builds the object from hash
@@ -488,7 +448,11 @@ module PulpFileClient
488
448
  hash = {}
489
449
  self.class.attribute_map.each_pair do |attr, param|
490
450
  value = self.send(attr)
491
- next if value.nil?
451
+ if value.nil?
452
+ is_nullable = self.class.openapi_nullable.include?(attr)
453
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
454
+ end
455
+
492
456
  hash[param] = _to_hash(value)
493
457
  end
494
458
  hash
@@ -0,0 +1,294 @@
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.2.2-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpFileClient
16
+ class FileFileRepository
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ attr_accessor :versions_href
23
+
24
+ attr_accessor :latest_version_href
25
+
26
+ # A unique name for this repository.
27
+ attr_accessor :name
28
+
29
+ # An optional description.
30
+ attr_accessor :description
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'pulp_href' => :'pulp_href',
36
+ :'pulp_created' => :'pulp_created',
37
+ :'versions_href' => :'versions_href',
38
+ :'latest_version_href' => :'latest_version_href',
39
+ :'name' => :'name',
40
+ :'description' => :'description'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'pulp_href' => :'String',
48
+ :'pulp_created' => :'DateTime',
49
+ :'versions_href' => :'String',
50
+ :'latest_version_href' => :'String',
51
+ :'name' => :'String',
52
+ :'description' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ :'description'
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 `PulpFileClient::FileFileRepository` 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 `PulpFileClient::FileFileRepository`. 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?(:'pulp_href')
79
+ self.pulp_href = attributes[:'pulp_href']
80
+ end
81
+
82
+ if attributes.key?(:'pulp_created')
83
+ self.pulp_created = attributes[:'pulp_created']
84
+ end
85
+
86
+ if attributes.key?(:'versions_href')
87
+ self.versions_href = attributes[:'versions_href']
88
+ end
89
+
90
+ if attributes.key?(:'latest_version_href')
91
+ self.latest_version_href = attributes[:'latest_version_href']
92
+ end
93
+
94
+ if attributes.key?(:'name')
95
+ self.name = attributes[:'name']
96
+ end
97
+
98
+ if attributes.key?(:'description')
99
+ self.description = attributes[:'description']
100
+ end
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properties with the reasons
105
+ def list_invalid_properties
106
+ invalid_properties = Array.new
107
+ if @name.nil?
108
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
109
+ end
110
+
111
+ if @name.to_s.length < 1
112
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
113
+ end
114
+
115
+ if !@description.nil? && @description.to_s.length < 1
116
+ invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
117
+ end
118
+
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ return false if @name.nil?
126
+ return false if @name.to_s.length < 1
127
+ return false if !@description.nil? && @description.to_s.length < 1
128
+ true
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param [Object] name Value to be assigned
133
+ def name=(name)
134
+ if name.nil?
135
+ fail ArgumentError, 'name cannot be nil'
136
+ end
137
+
138
+ if name.to_s.length < 1
139
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
140
+ end
141
+
142
+ @name = name
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] description Value to be assigned
147
+ def description=(description)
148
+ if !description.nil? && description.to_s.length < 1
149
+ fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
150
+ end
151
+
152
+ @description = description
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
+ pulp_href == o.pulp_href &&
161
+ pulp_created == o.pulp_created &&
162
+ versions_href == o.versions_href &&
163
+ latest_version_href == o.latest_version_href &&
164
+ name == o.name &&
165
+ description == o.description
166
+ end
167
+
168
+ # @see the `==` method
169
+ # @param [Object] Object to be compared
170
+ def eql?(o)
171
+ self == o
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Integer] Hash code
176
+ def hash
177
+ [pulp_href, pulp_created, versions_href, latest_version_href, name, description].hash
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def self.build_from_hash(attributes)
184
+ new.build_from_hash(attributes)
185
+ end
186
+
187
+ # Builds the object from hash
188
+ # @param [Hash] attributes Model attributes in the form of hash
189
+ # @return [Object] Returns the model itself
190
+ def build_from_hash(attributes)
191
+ return nil unless attributes.is_a?(Hash)
192
+ self.class.openapi_types.each_pair do |key, type|
193
+ if type =~ /\AArray<(.*)>/i
194
+ # check to ensure the input is an array given that the attribute
195
+ # is documented as an array but the input is not
196
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
197
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
198
+ end
199
+ elsif !attributes[self.class.attribute_map[key]].nil?
200
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
201
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
202
+ end
203
+
204
+ self
205
+ end
206
+
207
+ # Deserializes the data based on type
208
+ # @param string type Data type
209
+ # @param string value Value to be deserialized
210
+ # @return [Object] Deserialized data
211
+ def _deserialize(type, value)
212
+ case type.to_sym
213
+ when :DateTime
214
+ DateTime.parse(value)
215
+ when :Date
216
+ Date.parse(value)
217
+ when :String
218
+ value.to_s
219
+ when :Integer
220
+ value.to_i
221
+ when :Float
222
+ value.to_f
223
+ when :Boolean
224
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
225
+ true
226
+ else
227
+ false
228
+ end
229
+ when :Object
230
+ # generic object (usually a Hash), return directly
231
+ value
232
+ when /\AArray<(?<inner_type>.+)>\z/
233
+ inner_type = Regexp.last_match[:inner_type]
234
+ value.map { |v| _deserialize(inner_type, v) }
235
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
236
+ k_type = Regexp.last_match[:k_type]
237
+ v_type = Regexp.last_match[:v_type]
238
+ {}.tap do |hash|
239
+ value.each do |k, v|
240
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
241
+ end
242
+ end
243
+ else # model
244
+ PulpFileClient.const_get(type).build_from_hash(value)
245
+ end
246
+ end
247
+
248
+ # Returns the string representation of the object
249
+ # @return [String] String presentation of the object
250
+ def to_s
251
+ to_hash.to_s
252
+ end
253
+
254
+ # to_body is an alias to to_hash (backward compatibility)
255
+ # @return [Hash] Returns the object in the form of hash
256
+ def to_body
257
+ to_hash
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ self.class.attribute_map.each_pair do |attr, param|
265
+ value = self.send(attr)
266
+ if value.nil?
267
+ is_nullable = self.class.openapi_nullable.include?(attr)
268
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
269
+ end
270
+
271
+ hash[param] = _to_hash(value)
272
+ end
273
+ hash
274
+ end
275
+
276
+ # Outputs non-array value in the form of hash
277
+ # For object, use to_hash. Otherwise, just return the value
278
+ # @param [Object] value Any valid value
279
+ # @return [Hash] Returns the value in the form of hash
280
+ def _to_hash(value)
281
+ if value.is_a?(Array)
282
+ value.compact.map { |v| _to_hash(v) }
283
+ elsif value.is_a?(Hash)
284
+ {}.tap do |hash|
285
+ value.each { |k, v| hash[k] = _to_hash(v) }
286
+ end
287
+ elsif value.respond_to? :to_hash
288
+ value.to_hash
289
+ else
290
+ value
291
+ end
292
+ end
293
+ end
294
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.0-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -38,10 +38,18 @@ module PulpFileClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<FileContent>'
41
+ :'results' => :'Array<FileFileContent>'
42
42
  }
43
43
  end
44
44
 
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ :'_next',
49
+ :'previous',
50
+ ])
51
+ end
52
+
45
53
  # Initializes the object
46
54
  # @param [Hash] attributes Model attributes in the form of hash
47
55
  def initialize(attributes = {})
@@ -208,7 +216,11 @@ module PulpFileClient
208
216
  hash = {}
209
217
  self.class.attribute_map.each_pair do |attr, param|
210
218
  value = self.send(attr)
211
- next if value.nil?
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
212
224
  hash[param] = _to_hash(value)
213
225
  end
214
226
  hash