pulp_file_client 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -17
  3. data/docs/ContentFilesApi.md +5 -5
  4. data/docs/DistributionsFileApi.md +3 -3
  5. data/docs/{Export.md → ExportRead.md} +4 -4
  6. data/docs/ExportersFileExportsApi.md +16 -16
  7. data/docs/ExportersFilesystemApi.md +52 -52
  8. data/docs/{FileFileContent.md → FileFileContentRead.md} +2 -2
  9. data/docs/FileFileDistributionRead.md +29 -0
  10. data/docs/{FileFileFileSystemExporter.md → FileFileFilesystemExporter.md} +2 -2
  11. data/docs/FileFileFilesystemExporterRead.md +23 -0
  12. data/docs/FileFilePublicationRead.md +27 -0
  13. data/docs/FileFileRemote.md +7 -3
  14. data/docs/FileFileRemoteRead.md +43 -0
  15. data/docs/FileFileRepositoryRead.md +27 -0
  16. data/docs/InlineResponse200.md +1 -1
  17. data/docs/InlineResponse2001.md +1 -1
  18. data/docs/InlineResponse2002.md +1 -1
  19. data/docs/InlineResponse2003.md +1 -1
  20. data/docs/InlineResponse2004.md +1 -1
  21. data/docs/InlineResponse2005.md +1 -1
  22. data/docs/InlineResponse2006.md +1 -1
  23. data/docs/InlineResponse2007.md +1 -1
  24. data/docs/PublicationsFileApi.md +3 -3
  25. data/docs/RemotesFileApi.md +5 -5
  26. data/docs/RepositoriesFileApi.md +10 -10
  27. data/docs/RepositoriesFileVersionsApi.md +3 -3
  28. data/docs/RepositoryVersionRead.md +25 -0
  29. data/lib/pulp_file_client/api/content_files_api.rb +5 -5
  30. data/lib/pulp_file_client/api/distributions_file_api.rb +3 -3
  31. data/lib/pulp_file_client/api/exporters_file_exports_api.rb +27 -27
  32. data/lib/pulp_file_client/api/exporters_filesystem_api.rb +78 -78
  33. data/lib/pulp_file_client/api/publications_file_api.rb +3 -3
  34. data/lib/pulp_file_client/api/remotes_file_api.rb +6 -6
  35. data/lib/pulp_file_client/api/repositories_file_api.rb +15 -15
  36. data/lib/pulp_file_client/api/repositories_file_versions_api.rb +3 -3
  37. data/lib/pulp_file_client/configuration.rb +2 -2
  38. data/lib/pulp_file_client/models/{export.rb → export_read.rb} +4 -13
  39. data/lib/pulp_file_client/models/{file_file_content.rb → file_file_content_read.rb} +3 -3
  40. data/lib/pulp_file_client/models/file_file_distribution_read.rb +331 -0
  41. data/lib/pulp_file_client/models/{file_file_file_system_exporter.rb → file_file_filesystem_exporter.rb} +3 -3
  42. data/lib/pulp_file_client/models/file_file_filesystem_exporter_read.rb +284 -0
  43. data/lib/pulp_file_client/models/file_file_publication_read.rb +274 -0
  44. data/lib/pulp_file_client/models/file_file_remote.rb +56 -4
  45. data/lib/pulp_file_client/models/file_file_remote_read.rb +531 -0
  46. data/lib/pulp_file_client/models/file_file_repository_read.rb +294 -0
  47. data/lib/pulp_file_client/models/inline_response200.rb +1 -1
  48. data/lib/pulp_file_client/models/inline_response2001.rb +1 -1
  49. data/lib/pulp_file_client/models/inline_response2002.rb +1 -1
  50. data/lib/pulp_file_client/models/inline_response2003.rb +1 -1
  51. data/lib/pulp_file_client/models/inline_response2004.rb +1 -1
  52. data/lib/pulp_file_client/models/inline_response2005.rb +1 -1
  53. data/lib/pulp_file_client/models/inline_response2006.rb +1 -1
  54. data/lib/pulp_file_client/models/inline_response2007.rb +1 -1
  55. data/lib/pulp_file_client/models/repository_version_read.rb +244 -0
  56. data/lib/pulp_file_client/version.rb +1 -1
  57. data/lib/pulp_file_client.rb +9 -3
  58. data/spec/api/content_files_api_spec.rb +2 -2
  59. data/spec/api/distributions_file_api_spec.rb +1 -1
  60. data/spec/api/exporters_file_exports_api_spec.rb +6 -6
  61. data/spec/api/exporters_filesystem_api_spec.rb +20 -20
  62. data/spec/api/publications_file_api_spec.rb +1 -1
  63. data/spec/api/remotes_file_api_spec.rb +2 -2
  64. data/spec/api/repositories_file_api_spec.rb +6 -6
  65. data/spec/api/repositories_file_versions_api_spec.rb +1 -1
  66. data/spec/configuration_spec.rb +3 -3
  67. data/spec/models/{export_spec.rb → export_read_spec.rb} +6 -6
  68. data/spec/models/{file_file_content_spec.rb → file_file_content_read_spec.rb} +6 -6
  69. data/spec/models/file_file_distribution_read_spec.rb +77 -0
  70. data/spec/models/file_file_filesystem_exporter_read_spec.rb +59 -0
  71. data/spec/models/{file_file_file_system_exporter_spec.rb → file_file_filesystem_exporter_spec.rb} +6 -6
  72. data/spec/models/file_file_publication_read_spec.rb +71 -0
  73. data/spec/models/file_file_remote_read_spec.rb +123 -0
  74. data/spec/models/file_file_remote_spec.rb +12 -0
  75. data/spec/models/file_file_repository_read_spec.rb +71 -0
  76. data/spec/models/repository_version_read_spec.rb +65 -0
  77. metadata +38 -14
@@ -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.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpFileClient
16
+ class FileFileRepositoryRead
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::FileFileRepositoryRead` 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::FileFileRepositoryRead`. 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
@@ -38,7 +38,7 @@ module PulpFileClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<FileFileContent>'
41
+ :'results' => :'Array<FileFileContentRead>'
42
42
  }
43
43
  end
44
44
 
@@ -38,7 +38,7 @@ module PulpFileClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<FileFileDistribution>'
41
+ :'results' => :'Array<FileFileDistributionRead>'
42
42
  }
43
43
  end
44
44
 
@@ -38,7 +38,7 @@ module PulpFileClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<FileFileFileSystemExporter>'
41
+ :'results' => :'Array<FileFileFilesystemExporterRead>'
42
42
  }
43
43
  end
44
44
 
@@ -38,7 +38,7 @@ module PulpFileClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<Export>'
41
+ :'results' => :'Array<ExportRead>'
42
42
  }
43
43
  end
44
44
 
@@ -38,7 +38,7 @@ module PulpFileClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<FileFilePublication>'
41
+ :'results' => :'Array<FileFilePublicationRead>'
42
42
  }
43
43
  end
44
44
 
@@ -38,7 +38,7 @@ module PulpFileClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<FileFileRemote>'
41
+ :'results' => :'Array<FileFileRemoteRead>'
42
42
  }
43
43
  end
44
44
 
@@ -38,7 +38,7 @@ module PulpFileClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<FileFileRepository>'
41
+ :'results' => :'Array<FileFileRepositoryRead>'
42
42
  }
43
43
  end
44
44
 
@@ -38,7 +38,7 @@ module PulpFileClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<RepositoryVersion>'
41
+ :'results' => :'Array<RepositoryVersionRead>'
42
42
  }
43
43
  end
44
44
 
@@ -0,0 +1,244 @@
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.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpFileClient
16
+ class RepositoryVersionRead
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ attr_accessor :number
23
+
24
+ # A repository version whose content was used as the initial set of content for this repository version
25
+ attr_accessor :base_version
26
+
27
+ attr_accessor :content_summary
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'pulp_href' => :'pulp_href',
33
+ :'pulp_created' => :'pulp_created',
34
+ :'number' => :'number',
35
+ :'base_version' => :'base_version',
36
+ :'content_summary' => :'content_summary'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'pulp_href' => :'String',
44
+ :'pulp_created' => :'DateTime',
45
+ :'number' => :'Integer',
46
+ :'base_version' => :'String',
47
+ :'content_summary' => :'ContentSummary'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::RepositoryVersionRead` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::RepositoryVersionRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'pulp_href')
73
+ self.pulp_href = attributes[:'pulp_href']
74
+ end
75
+
76
+ if attributes.key?(:'pulp_created')
77
+ self.pulp_created = attributes[:'pulp_created']
78
+ end
79
+
80
+ if attributes.key?(:'number')
81
+ self.number = attributes[:'number']
82
+ end
83
+
84
+ if attributes.key?(:'base_version')
85
+ self.base_version = attributes[:'base_version']
86
+ end
87
+
88
+ if attributes.key?(:'content_summary')
89
+ self.content_summary = attributes[:'content_summary']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ pulp_href == o.pulp_href &&
112
+ pulp_created == o.pulp_created &&
113
+ number == o.number &&
114
+ base_version == o.base_version &&
115
+ content_summary == o.content_summary
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(o)
121
+ self == o
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Integer] Hash code
126
+ def hash
127
+ [pulp_href, pulp_created, number, base_version, content_summary].hash
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def self.build_from_hash(attributes)
134
+ new.build_from_hash(attributes)
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ self.class.openapi_types.each_pair do |key, type|
143
+ if type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
147
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
148
+ end
149
+ elsif !attributes[self.class.attribute_map[key]].nil?
150
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
151
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
152
+ end
153
+
154
+ self
155
+ end
156
+
157
+ # Deserializes the data based on type
158
+ # @param string type Data type
159
+ # @param string value Value to be deserialized
160
+ # @return [Object] Deserialized data
161
+ def _deserialize(type, value)
162
+ case type.to_sym
163
+ when :DateTime
164
+ DateTime.parse(value)
165
+ when :Date
166
+ Date.parse(value)
167
+ when :String
168
+ value.to_s
169
+ when :Integer
170
+ value.to_i
171
+ when :Float
172
+ value.to_f
173
+ when :Boolean
174
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
175
+ true
176
+ else
177
+ false
178
+ end
179
+ when :Object
180
+ # generic object (usually a Hash), return directly
181
+ value
182
+ when /\AArray<(?<inner_type>.+)>\z/
183
+ inner_type = Regexp.last_match[:inner_type]
184
+ value.map { |v| _deserialize(inner_type, v) }
185
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
186
+ k_type = Regexp.last_match[:k_type]
187
+ v_type = Regexp.last_match[:v_type]
188
+ {}.tap do |hash|
189
+ value.each do |k, v|
190
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
191
+ end
192
+ end
193
+ else # model
194
+ PulpFileClient.const_get(type).build_from_hash(value)
195
+ end
196
+ end
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # to_body is an alias to to_hash (backward compatibility)
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ if value.nil?
217
+ is_nullable = self.class.openapi_nullable.include?(attr)
218
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219
+ end
220
+
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map { |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+ end
244
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.2.3
11
11
  =end
12
12
 
13
13
  module PulpFileClient
14
- VERSION = '0.3.0'
14
+ VERSION = '1.0.0'
15
15
  end
@@ -19,13 +19,18 @@ require 'pulp_file_client/configuration'
19
19
  # Models
20
20
  require 'pulp_file_client/models/async_operation_response'
21
21
  require 'pulp_file_client/models/content_summary'
22
- require 'pulp_file_client/models/export'
23
- require 'pulp_file_client/models/file_file_content'
22
+ require 'pulp_file_client/models/export_read'
23
+ require 'pulp_file_client/models/file_file_content_read'
24
24
  require 'pulp_file_client/models/file_file_distribution'
25
- require 'pulp_file_client/models/file_file_file_system_exporter'
25
+ require 'pulp_file_client/models/file_file_distribution_read'
26
+ require 'pulp_file_client/models/file_file_filesystem_exporter'
27
+ require 'pulp_file_client/models/file_file_filesystem_exporter_read'
26
28
  require 'pulp_file_client/models/file_file_publication'
29
+ require 'pulp_file_client/models/file_file_publication_read'
27
30
  require 'pulp_file_client/models/file_file_remote'
31
+ require 'pulp_file_client/models/file_file_remote_read'
28
32
  require 'pulp_file_client/models/file_file_repository'
33
+ require 'pulp_file_client/models/file_file_repository_read'
29
34
  require 'pulp_file_client/models/inline_response200'
30
35
  require 'pulp_file_client/models/inline_response2001'
31
36
  require 'pulp_file_client/models/inline_response2002'
@@ -38,6 +43,7 @@ require 'pulp_file_client/models/publication_export'
38
43
  require 'pulp_file_client/models/repository_add_remove_content'
39
44
  require 'pulp_file_client/models/repository_sync_url'
40
45
  require 'pulp_file_client/models/repository_version'
46
+ require 'pulp_file_client/models/repository_version_read'
41
47
 
42
48
  # APIs
43
49
  require 'pulp_file_client/api/content_files_api'
@@ -38,7 +38,7 @@ describe 'ContentFilesApi' do
38
38
  # @param relative_path Path where the artifact is located relative to distributions base_path
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @option opts [String] :artifact Artifact file representing the physical content
41
- # @option opts [File] :file An uploaded file that should be turned into the artifact of the content unit.
41
+ # @option opts [File] :file An uploaded file that may be turned into the artifact of the content unit.
42
42
  # @option opts [String] :repository A URI of a repository the new content unit should be associated with.
43
43
  # @return [AsyncOperationResponse]
44
44
  describe 'create test' do
@@ -75,7 +75,7 @@ describe 'ContentFilesApi' do
75
75
  # @param [Hash] opts the optional parameters
76
76
  # @option opts [String] :fields A list of fields to include in the response.
77
77
  # @option opts [String] :exclude_fields A list of fields to exclude from the response.
78
- # @return [FileFileContent]
78
+ # @return [FileFileContentRead]
79
79
  describe 'read test' do
80
80
  it 'should work' do
81
81
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -98,7 +98,7 @@ describe 'DistributionsFileApi' do
98
98
  # @param [Hash] opts the optional parameters
99
99
  # @option opts [String] :fields A list of fields to include in the response.
100
100
  # @option opts [String] :exclude_fields A list of fields to exclude from the response.
101
- # @return [FileFileDistribution]
101
+ # @return [FileFileDistributionRead]
102
102
  describe 'read test' do
103
103
  it 'should work' do
104
104
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers