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 FileContent
16
+ class FileFileContent
17
17
  attr_accessor :pulp_href
18
18
 
19
19
  # Timestamp of creation.
@@ -25,12 +25,6 @@ module PulpFileClient
25
25
  # Path where the artifact is located relative to distributions base_path
26
26
  attr_accessor :relative_path
27
27
 
28
- # An uploaded file that should be turned into the artifact of the content unit.
29
- attr_accessor :file
30
-
31
- # A URI of a repository the new content unit should be associated with.
32
- attr_accessor :repository
33
-
34
28
  # The MD5 checksum if available.
35
29
  attr_accessor :md5
36
30
 
@@ -56,8 +50,6 @@ module PulpFileClient
56
50
  :'pulp_created' => :'pulp_created',
57
51
  :'artifact' => :'artifact',
58
52
  :'relative_path' => :'relative_path',
59
- :'file' => :'file',
60
- :'repository' => :'repository',
61
53
  :'md5' => :'md5',
62
54
  :'sha1' => :'sha1',
63
55
  :'sha224' => :'sha224',
@@ -74,8 +66,6 @@ module PulpFileClient
74
66
  :'pulp_created' => :'DateTime',
75
67
  :'artifact' => :'String',
76
68
  :'relative_path' => :'String',
77
- :'file' => :'String',
78
- :'repository' => :'String',
79
69
  :'md5' => :'String',
80
70
  :'sha1' => :'String',
81
71
  :'sha224' => :'String',
@@ -85,17 +75,23 @@ module PulpFileClient
85
75
  }
86
76
  end
87
77
 
78
+ # List of attributes with nullable: true
79
+ def self.openapi_nullable
80
+ Set.new([
81
+ ])
82
+ end
83
+
88
84
  # Initializes the object
89
85
  # @param [Hash] attributes Model attributes in the form of hash
90
86
  def initialize(attributes = {})
91
87
  if (!attributes.is_a?(Hash))
92
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileContent` initialize method"
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileFileContent` initialize method"
93
89
  end
94
90
 
95
91
  # check to see if the attribute exists and convert string to symbol for hash key
96
92
  attributes = attributes.each_with_object({}) { |(k, v), h|
97
93
  if (!self.class.attribute_map.key?(k.to_sym))
98
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileContent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileFileContent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
99
95
  end
100
96
  h[k.to_sym] = v
101
97
  }
@@ -116,14 +112,6 @@ module PulpFileClient
116
112
  self.relative_path = attributes[:'relative_path']
117
113
  end
118
114
 
119
- if attributes.key?(:'file')
120
- self.file = attributes[:'file']
121
- end
122
-
123
- if attributes.key?(:'repository')
124
- self.repository = attributes[:'repository']
125
- end
126
-
127
115
  if attributes.key?(:'md5')
128
116
  self.md5 = attributes[:'md5']
129
117
  end
@@ -285,8 +273,6 @@ module PulpFileClient
285
273
  pulp_created == o.pulp_created &&
286
274
  artifact == o.artifact &&
287
275
  relative_path == o.relative_path &&
288
- file == o.file &&
289
- repository == o.repository &&
290
276
  md5 == o.md5 &&
291
277
  sha1 == o.sha1 &&
292
278
  sha224 == o.sha224 &&
@@ -304,7 +290,7 @@ module PulpFileClient
304
290
  # Calculates hash code according to all attributes.
305
291
  # @return [Integer] Hash code
306
292
  def hash
307
- [pulp_href, pulp_created, artifact, relative_path, file, repository, md5, sha1, sha224, sha256, sha384, sha512].hash
293
+ [pulp_href, pulp_created, artifact, relative_path, md5, sha1, sha224, sha256, sha384, sha512].hash
308
294
  end
309
295
 
310
296
  # Builds the object from hash
@@ -393,7 +379,11 @@ module PulpFileClient
393
379
  hash = {}
394
380
  self.class.attribute_map.each_pair do |attr, param|
395
381
  value = self.send(attr)
396
- next if value.nil?
382
+ if value.nil?
383
+ is_nullable = self.class.openapi_nullable.include?(attr)
384
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
385
+ end
386
+
397
387
  hash[param] = _to_hash(value)
398
388
  end
399
389
  hash
@@ -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 FileDistribution
16
+ class FileFileDistribution
17
17
  attr_accessor :pulp_href
18
18
 
19
19
  # Timestamp of creation.
@@ -60,17 +60,25 @@ module PulpFileClient
60
60
  }
61
61
  end
62
62
 
63
+ # List of attributes with nullable: true
64
+ def self.openapi_nullable
65
+ Set.new([
66
+ :'content_guard',
67
+ :'publication'
68
+ ])
69
+ end
70
+
63
71
  # Initializes the object
64
72
  # @param [Hash] attributes Model attributes in the form of hash
65
73
  def initialize(attributes = {})
66
74
  if (!attributes.is_a?(Hash))
67
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileDistribution` initialize method"
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileFileDistribution` initialize method"
68
76
  end
69
77
 
70
78
  # check to see if the attribute exists and convert string to symbol for hash key
71
79
  attributes = attributes.each_with_object({}) { |(k, v), h|
72
80
  if (!self.class.attribute_map.key?(k.to_sym))
73
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileFileDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
74
82
  end
75
83
  h[k.to_sym] = v
76
84
  }
@@ -112,10 +120,6 @@ module PulpFileClient
112
120
  invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
113
121
  end
114
122
 
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
123
  if @base_path.to_s.length < 1
120
124
  invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
121
125
  end
@@ -128,10 +132,6 @@ module PulpFileClient
128
132
  invalid_properties.push('invalid value for "name", name cannot be nil.')
129
133
  end
130
134
 
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
135
  if @name.to_s.length < 1
136
136
  invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
137
137
  end
@@ -143,11 +143,9 @@ module PulpFileClient
143
143
  # @return true if the model is valid
144
144
  def valid?
145
145
  return false if @base_path.nil?
146
- return false if @base_path.to_s.length > 255
147
146
  return false if @base_path.to_s.length < 1
148
147
  return false if !@base_url.nil? && @base_url.to_s.length < 1
149
148
  return false if @name.nil?
150
- return false if @name.to_s.length > 255
151
149
  return false if @name.to_s.length < 1
152
150
  true
153
151
  end
@@ -159,10 +157,6 @@ module PulpFileClient
159
157
  fail ArgumentError, 'base_path cannot be nil'
160
158
  end
161
159
 
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
160
  if base_path.to_s.length < 1
167
161
  fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
168
162
  end
@@ -187,10 +181,6 @@ module PulpFileClient
187
181
  fail ArgumentError, 'name cannot be nil'
188
182
  end
189
183
 
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
184
  if name.to_s.length < 1
195
185
  fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
196
186
  end
@@ -310,7 +300,11 @@ module PulpFileClient
310
300
  hash = {}
311
301
  self.class.attribute_map.each_pair do |attr, param|
312
302
  value = self.send(attr)
313
- next if value.nil?
303
+ if value.nil?
304
+ is_nullable = self.class.openapi_nullable.include?(attr)
305
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
306
+ end
307
+
314
308
  hash[param] = _to_hash(value)
315
309
  end
316
310
  hash
@@ -0,0 +1,284 @@
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 FileFileFileSystemExporter
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ # File system location to export to.
23
+ attr_accessor :path
24
+
25
+ # Unique name of the file system exporter.
26
+ attr_accessor :name
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'pulp_href' => :'pulp_href',
32
+ :'pulp_created' => :'pulp_created',
33
+ :'path' => :'path',
34
+ :'name' => :'name'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'pulp_href' => :'String',
42
+ :'pulp_created' => :'DateTime',
43
+ :'path' => :'String',
44
+ :'name' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileFileFileSystemExporter` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileFileFileSystemExporter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+
69
+ if attributes.key?(:'pulp_href')
70
+ self.pulp_href = attributes[:'pulp_href']
71
+ end
72
+
73
+ if attributes.key?(:'pulp_created')
74
+ self.pulp_created = attributes[:'pulp_created']
75
+ end
76
+
77
+ if attributes.key?(:'path')
78
+ self.path = attributes[:'path']
79
+ end
80
+
81
+ if attributes.key?(:'name')
82
+ self.name = attributes[:'name']
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ if @path.nil?
91
+ invalid_properties.push('invalid value for "path", path cannot be nil.')
92
+ end
93
+
94
+ if @path.to_s.length < 1
95
+ invalid_properties.push('invalid value for "path", the character length must be great than or equal to 1.')
96
+ end
97
+
98
+ if @name.nil?
99
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
100
+ end
101
+
102
+ if @name.to_s.length < 1
103
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
104
+ end
105
+
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ return false if @path.nil?
113
+ return false if @path.to_s.length < 1
114
+ return false if @name.nil?
115
+ return false if @name.to_s.length < 1
116
+ true
117
+ end
118
+
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] path Value to be assigned
121
+ def path=(path)
122
+ if path.nil?
123
+ fail ArgumentError, 'path cannot be nil'
124
+ end
125
+
126
+ if path.to_s.length < 1
127
+ fail ArgumentError, 'invalid value for "path", the character length must be great than or equal to 1.'
128
+ end
129
+
130
+ @path = path
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] name Value to be assigned
135
+ def name=(name)
136
+ if name.nil?
137
+ fail ArgumentError, 'name cannot be nil'
138
+ end
139
+
140
+ if name.to_s.length < 1
141
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
142
+ end
143
+
144
+ @name = name
145
+ end
146
+
147
+ # Checks equality by comparing each attribute.
148
+ # @param [Object] Object to be compared
149
+ def ==(o)
150
+ return true if self.equal?(o)
151
+ self.class == o.class &&
152
+ pulp_href == o.pulp_href &&
153
+ pulp_created == o.pulp_created &&
154
+ path == o.path &&
155
+ name == o.name
156
+ end
157
+
158
+ # @see the `==` method
159
+ # @param [Object] Object to be compared
160
+ def eql?(o)
161
+ self == o
162
+ end
163
+
164
+ # Calculates hash code according to all attributes.
165
+ # @return [Integer] Hash code
166
+ def hash
167
+ [pulp_href, pulp_created, path, name].hash
168
+ end
169
+
170
+ # Builds the object from hash
171
+ # @param [Hash] attributes Model attributes in the form of hash
172
+ # @return [Object] Returns the model itself
173
+ def self.build_from_hash(attributes)
174
+ new.build_from_hash(attributes)
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ self.class.openapi_types.each_pair do |key, type|
183
+ if type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
187
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
188
+ end
189
+ elsif !attributes[self.class.attribute_map[key]].nil?
190
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
191
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
192
+ end
193
+
194
+ self
195
+ end
196
+
197
+ # Deserializes the data based on type
198
+ # @param string type Data type
199
+ # @param string value Value to be deserialized
200
+ # @return [Object] Deserialized data
201
+ def _deserialize(type, value)
202
+ case type.to_sym
203
+ when :DateTime
204
+ DateTime.parse(value)
205
+ when :Date
206
+ Date.parse(value)
207
+ when :String
208
+ value.to_s
209
+ when :Integer
210
+ value.to_i
211
+ when :Float
212
+ value.to_f
213
+ when :Boolean
214
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
215
+ true
216
+ else
217
+ false
218
+ end
219
+ when :Object
220
+ # generic object (usually a Hash), return directly
221
+ value
222
+ when /\AArray<(?<inner_type>.+)>\z/
223
+ inner_type = Regexp.last_match[:inner_type]
224
+ value.map { |v| _deserialize(inner_type, v) }
225
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
226
+ k_type = Regexp.last_match[:k_type]
227
+ v_type = Regexp.last_match[:v_type]
228
+ {}.tap do |hash|
229
+ value.each do |k, v|
230
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
231
+ end
232
+ end
233
+ else # model
234
+ PulpFileClient.const_get(type).build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ if value.nil?
257
+ is_nullable = self.class.openapi_nullable.include?(attr)
258
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
+ end
260
+
261
+ hash[param] = _to_hash(value)
262
+ end
263
+ hash
264
+ end
265
+
266
+ # Outputs non-array value in the form of hash
267
+ # For object, use to_hash. Otherwise, just return the value
268
+ # @param [Object] value Any valid value
269
+ # @return [Hash] Returns the value in the form of hash
270
+ def _to_hash(value)
271
+ if value.is_a?(Array)
272
+ value.compact.map { |v| _to_hash(v) }
273
+ elsif value.is_a?(Hash)
274
+ {}.tap do |hash|
275
+ value.each { |k, v| hash[k] = _to_hash(v) }
276
+ end
277
+ elsif value.respond_to? :to_hash
278
+ value.to_hash
279
+ else
280
+ value
281
+ end
282
+ end
283
+ end
284
+ end
@@ -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 FilePublication
16
+ class FileFilePublication
17
17
  attr_accessor :pulp_href
18
18
 
19
19
  # Timestamp of creation.
@@ -58,17 +58,24 @@ module PulpFileClient
58
58
  }
59
59
  end
60
60
 
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ :'publisher',
65
+ ])
66
+ end
67
+
61
68
  # Initializes the object
62
69
  # @param [Hash] attributes Model attributes in the form of hash
63
70
  def initialize(attributes = {})
64
71
  if (!attributes.is_a?(Hash))
65
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FilePublication` initialize method"
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileFilePublication` initialize method"
66
73
  end
67
74
 
68
75
  # check to see if the attribute exists and convert string to symbol for hash key
69
76
  attributes = attributes.each_with_object({}) { |(k, v), h|
70
77
  if (!self.class.attribute_map.key?(k.to_sym))
71
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FilePublication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileFilePublication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
79
  end
73
80
  h[k.to_sym] = v
74
81
  }
@@ -246,7 +253,11 @@ module PulpFileClient
246
253
  hash = {}
247
254
  self.class.attribute_map.each_pair do |attr, param|
248
255
  value = self.send(attr)
249
- next if value.nil?
256
+ if value.nil?
257
+ is_nullable = self.class.openapi_nullable.include?(attr)
258
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
+ end
260
+
250
261
  hash[param] = _to_hash(value)
251
262
  end
252
263
  hash