pulp_file_client 3.69.2 → 3.70.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -7
  3. data/docs/AcsFileApi.md +343 -157
  4. data/docs/AsyncOperationResponse.md +8 -7
  5. data/docs/ContentFilesApi.md +114 -64
  6. data/docs/ContentSummaryResponse.md +12 -11
  7. data/docs/DistributionsFileApi.md +385 -182
  8. data/docs/FileFileAlternateContentSource.md +14 -13
  9. data/docs/FileFileAlternateContentSourceResponse.md +22 -21
  10. data/docs/FileFileContentResponse.md +30 -29
  11. data/docs/FileFileDistribution.md +20 -19
  12. data/docs/FileFileDistributionResponse.md +32 -31
  13. data/docs/FileFilePublication.md +12 -11
  14. data/docs/FileFilePublicationResponse.md +22 -21
  15. data/docs/FileFileRemote.md +48 -47
  16. data/docs/FileFileRemoteResponse.md +48 -47
  17. data/docs/FileFileRemoteResponseHiddenFieldsInner.md +20 -0
  18. data/docs/FileFileRepository.md +20 -19
  19. data/docs/FileFileRepositoryResponse.md +32 -31
  20. data/docs/MyPermissionsResponse.md +8 -7
  21. data/docs/NestedRole.md +12 -11
  22. data/docs/NestedRoleResponse.md +12 -11
  23. data/docs/ObjectRolesResponse.md +8 -7
  24. data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
  25. data/docs/PaginatedfileFileAlternateContentSourceResponseList.md +14 -13
  26. data/docs/PaginatedfileFileContentResponseList.md +14 -13
  27. data/docs/PaginatedfileFileDistributionResponseList.md +14 -13
  28. data/docs/PaginatedfileFilePublicationResponseList.md +14 -13
  29. data/docs/PaginatedfileFileRemoteResponseList.md +14 -13
  30. data/docs/PaginatedfileFileRepositoryResponseList.md +14 -13
  31. data/docs/PatchedfileFileAlternateContentSource.md +14 -13
  32. data/docs/PatchedfileFileDistribution.md +20 -19
  33. data/docs/PatchedfileFileRemote.md +48 -47
  34. data/docs/PatchedfileFileRepository.md +20 -19
  35. data/docs/PolicyEnum.md +4 -5
  36. data/docs/PublicationsFileApi.md +267 -130
  37. data/docs/RemotesFileApi.md +389 -184
  38. data/docs/Repair.md +8 -7
  39. data/docs/RepositoriesFileApi.md +444 -207
  40. data/docs/RepositoriesFileVersionsApi.md +152 -82
  41. data/docs/RepositoryAddRemoveContent.md +12 -11
  42. data/docs/RepositorySyncURL.md +10 -9
  43. data/docs/RepositoryVersionResponse.md +22 -21
  44. data/docs/SetLabel.md +10 -9
  45. data/docs/SetLabelResponse.md +10 -9
  46. data/docs/TaskGroupOperationResponse.md +8 -7
  47. data/docs/UnsetLabel.md +8 -7
  48. data/docs/UnsetLabelResponse.md +10 -9
  49. data/lib/pulp_file_client/api/acs_file_api.rb +76 -50
  50. data/lib/pulp_file_client/api/content_files_api.rb +20 -14
  51. data/lib/pulp_file_client/api/distributions_file_api.rb +89 -56
  52. data/lib/pulp_file_client/api/publications_file_api.rb +67 -47
  53. data/lib/pulp_file_client/api/remotes_file_api.rb +104 -68
  54. data/lib/pulp_file_client/api/repositories_file_api.rb +107 -66
  55. data/lib/pulp_file_client/api/repositories_file_versions_api.rb +40 -30
  56. data/lib/pulp_file_client/api_client.rb +137 -102
  57. data/lib/pulp_file_client/api_error.rb +2 -1
  58. data/lib/pulp_file_client/configuration.rb +162 -21
  59. data/lib/pulp_file_client/models/async_operation_response.rb +32 -22
  60. data/lib/pulp_file_client/models/content_summary_response.rb +36 -22
  61. data/lib/pulp_file_client/models/file_file_alternate_content_source.rb +35 -23
  62. data/lib/pulp_file_client/models/file_file_alternate_content_source_response.rb +37 -25
  63. data/lib/pulp_file_client/models/file_file_content_response.rb +34 -24
  64. data/lib/pulp_file_client/models/file_file_distribution.rb +34 -22
  65. data/lib/pulp_file_client/models/file_file_distribution_response.rb +36 -24
  66. data/lib/pulp_file_client/models/file_file_publication.rb +30 -22
  67. data/lib/pulp_file_client/models/file_file_publication_response.rb +32 -24
  68. data/lib/pulp_file_client/models/file_file_remote.rb +56 -22
  69. data/lib/pulp_file_client/models/file_file_remote_response.rb +59 -25
  70. data/lib/pulp_file_client/models/{file_file_remote_response_hidden_fields.rb → file_file_remote_response_hidden_fields_inner.rb} +37 -25
  71. data/lib/pulp_file_client/models/file_file_repository.rb +32 -22
  72. data/lib/pulp_file_client/models/file_file_repository_response.rb +34 -24
  73. data/lib/pulp_file_client/models/my_permissions_response.rb +32 -22
  74. data/lib/pulp_file_client/models/nested_role.rb +32 -22
  75. data/lib/pulp_file_client/models/nested_role_response.rb +32 -22
  76. data/lib/pulp_file_client/models/object_roles_response.rb +32 -22
  77. data/lib/pulp_file_client/models/paginated_repository_version_response_list.rb +34 -22
  78. data/lib/pulp_file_client/models/paginatedfile_file_alternate_content_source_response_list.rb +34 -22
  79. data/lib/pulp_file_client/models/paginatedfile_file_content_response_list.rb +34 -22
  80. data/lib/pulp_file_client/models/paginatedfile_file_distribution_response_list.rb +34 -22
  81. data/lib/pulp_file_client/models/paginatedfile_file_publication_response_list.rb +34 -22
  82. data/lib/pulp_file_client/models/paginatedfile_file_remote_response_list.rb +34 -22
  83. data/lib/pulp_file_client/models/paginatedfile_file_repository_response_list.rb +34 -22
  84. data/lib/pulp_file_client/models/patchedfile_file_alternate_content_source.rb +36 -24
  85. data/lib/pulp_file_client/models/patchedfile_file_distribution.rb +40 -24
  86. data/lib/pulp_file_client/models/patchedfile_file_remote.rb +62 -24
  87. data/lib/pulp_file_client/models/patchedfile_file_repository.rb +35 -23
  88. data/lib/pulp_file_client/models/policy_enum.rb +8 -4
  89. data/lib/pulp_file_client/models/repair.rb +30 -22
  90. data/lib/pulp_file_client/models/repository_add_remove_content.rb +30 -22
  91. data/lib/pulp_file_client/models/repository_sync_url.rb +30 -22
  92. data/lib/pulp_file_client/models/repository_version_response.rb +32 -24
  93. data/lib/pulp_file_client/models/set_label.rb +34 -22
  94. data/lib/pulp_file_client/models/set_label_response.rb +34 -22
  95. data/lib/pulp_file_client/models/task_group_operation_response.rb +32 -22
  96. data/lib/pulp_file_client/models/unset_label.rb +32 -22
  97. data/lib/pulp_file_client/models/unset_label_response.rb +32 -22
  98. data/lib/pulp_file_client/version.rb +2 -2
  99. data/lib/pulp_file_client.rb +2 -3
  100. data/pulp_file_client.gemspec +9 -6
  101. data/spec/api/acs_file_api_spec.rb +12 -12
  102. data/spec/api/content_files_api_spec.rb +4 -4
  103. data/spec/api/distributions_file_api_spec.rb +13 -13
  104. data/spec/api/publications_file_api_spec.rb +16 -15
  105. data/spec/api/remotes_file_api_spec.rb +20 -19
  106. data/spec/api/repositories_file_api_spec.rb +15 -15
  107. data/spec/api/repositories_file_versions_api_spec.rb +12 -11
  108. data/spec/models/async_operation_response_spec.rb +7 -12
  109. data/spec/models/content_summary_response_spec.rb +9 -14
  110. data/spec/models/file_file_alternate_content_source_response_spec.rb +14 -19
  111. data/spec/models/file_file_alternate_content_source_spec.rb +10 -15
  112. data/spec/models/file_file_content_response_spec.rb +18 -23
  113. data/spec/models/file_file_distribution_response_spec.rb +19 -24
  114. data/spec/models/file_file_distribution_spec.rb +13 -18
  115. data/spec/models/file_file_publication_response_spec.rb +14 -19
  116. data/spec/models/file_file_publication_spec.rb +9 -14
  117. data/spec/models/{file_file_remote_response_hidden_fields_spec.rb → file_file_remote_response_hidden_fields_inner_spec.rb} +11 -16
  118. data/spec/models/file_file_remote_response_spec.rb +27 -32
  119. data/spec/models/file_file_remote_spec.rb +27 -32
  120. data/spec/models/file_file_repository_response_spec.rb +19 -24
  121. data/spec/models/file_file_repository_spec.rb +13 -18
  122. data/spec/models/my_permissions_response_spec.rb +7 -12
  123. data/spec/models/nested_role_response_spec.rb +9 -14
  124. data/spec/models/nested_role_spec.rb +9 -14
  125. data/spec/models/object_roles_response_spec.rb +7 -12
  126. data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
  127. data/spec/models/paginatedfile_file_alternate_content_source_response_list_spec.rb +10 -15
  128. data/spec/models/paginatedfile_file_content_response_list_spec.rb +10 -15
  129. data/spec/models/paginatedfile_file_distribution_response_list_spec.rb +10 -15
  130. data/spec/models/paginatedfile_file_publication_response_list_spec.rb +10 -15
  131. data/spec/models/paginatedfile_file_remote_response_list_spec.rb +10 -15
  132. data/spec/models/paginatedfile_file_repository_response_list_spec.rb +10 -15
  133. data/spec/models/patchedfile_file_alternate_content_source_spec.rb +10 -15
  134. data/spec/models/patchedfile_file_distribution_spec.rb +13 -18
  135. data/spec/models/patchedfile_file_remote_spec.rb +27 -32
  136. data/spec/models/patchedfile_file_repository_spec.rb +13 -18
  137. data/spec/models/policy_enum_spec.rb +6 -11
  138. data/spec/models/repair_spec.rb +7 -12
  139. data/spec/models/repository_add_remove_content_spec.rb +9 -14
  140. data/spec/models/repository_sync_url_spec.rb +8 -13
  141. data/spec/models/repository_version_response_spec.rb +14 -19
  142. data/spec/models/set_label_response_spec.rb +8 -13
  143. data/spec/models/set_label_spec.rb +8 -13
  144. data/spec/models/task_group_operation_response_spec.rb +7 -12
  145. data/spec/models/unset_label_response_spec.rb +8 -13
  146. data/spec/models/unset_label_spec.rb +7 -12
  147. data/spec/spec_helper.rb +1 -1
  148. metadata +45 -25
  149. data/docs/FileFileContent.md +0 -27
  150. data/docs/FileFileRemoteResponseHiddenFields.md +0 -19
  151. data/lib/pulp_file_client/models/file_file_content.rb +0 -297
  152. data/spec/api_client_spec.rb +0 -188
  153. data/spec/configuration_spec.rb +0 -42
  154. data/spec/models/file_file_content_spec.rb +0 -71
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module PulpFileClient
16
17
  # Serializer for File Content.
@@ -68,13 +69,18 @@ module PulpFileClient
68
69
  }
69
70
  end
70
71
 
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ attribute_map.values
75
+ end
76
+
71
77
  # Attribute type mapping.
72
78
  def self.openapi_types
73
79
  {
74
80
  :'pulp_href' => :'String',
75
81
  :'prn' => :'String',
76
- :'pulp_created' => :'DateTime',
77
- :'pulp_last_updated' => :'DateTime',
82
+ :'pulp_created' => :'Time',
83
+ :'pulp_last_updated' => :'Time',
78
84
  :'artifact' => :'String',
79
85
  :'relative_path' => :'String',
80
86
  :'md5' => :'String',
@@ -129,6 +135,8 @@ module PulpFileClient
129
135
 
130
136
  if attributes.key?(:'relative_path')
131
137
  self.relative_path = attributes[:'relative_path']
138
+ else
139
+ self.relative_path = nil
132
140
  end
133
141
 
134
142
  if attributes.key?(:'md5')
@@ -159,6 +167,7 @@ module PulpFileClient
159
167
  # Show invalid properties with the reasons. Usually used together with valid?
160
168
  # @return Array for valid properties with the reasons
161
169
  def list_invalid_properties
170
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
162
171
  invalid_properties = Array.new
163
172
  if @relative_path.nil?
164
173
  invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
@@ -170,6 +179,7 @@ module PulpFileClient
170
179
  # Check to see if the all the properties in the model are valid
171
180
  # @return true if the model is valid
172
181
  def valid?
182
+ warn '[DEPRECATED] the `valid?` method is obsolete'
173
183
  return false if @relative_path.nil?
174
184
  true
175
185
  end
@@ -209,37 +219,33 @@ module PulpFileClient
209
219
  # @param [Hash] attributes Model attributes in the form of hash
210
220
  # @return [Object] Returns the model itself
211
221
  def self.build_from_hash(attributes)
212
- new.build_from_hash(attributes)
213
- end
214
-
215
- # Builds the object from hash
216
- # @param [Hash] attributes Model attributes in the form of hash
217
- # @return [Object] Returns the model itself
218
- def build_from_hash(attributes)
219
222
  return nil unless attributes.is_a?(Hash)
220
- self.class.openapi_types.each_pair do |key, type|
221
- if type =~ /\AArray<(.*)>/i
223
+ attributes = attributes.transform_keys(&:to_sym)
224
+ transformed_hash = {}
225
+ openapi_types.each_pair do |key, type|
226
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = nil
228
+ elsif type =~ /\AArray<(.*)>/i
222
229
  # check to ensure the input is an array given that the attribute
223
230
  # is documented as an array but the input is not
224
- if attributes[self.class.attribute_map[key]].is_a?(Array)
225
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
231
+ if attributes[attribute_map[key]].is_a?(Array)
232
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
226
233
  end
227
- elsif !attributes[self.class.attribute_map[key]].nil?
228
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
229
- end # or else data not found in attributes(hash), not an issue as the data can be optional
234
+ elsif !attributes[attribute_map[key]].nil?
235
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
236
+ end
230
237
  end
231
-
232
- self
238
+ new(transformed_hash)
233
239
  end
234
240
 
235
241
  # Deserializes the data based on type
236
242
  # @param string type Data type
237
243
  # @param string value Value to be deserialized
238
244
  # @return [Object] Deserialized data
239
- def _deserialize(type, value)
245
+ def self._deserialize(type, value)
240
246
  case type.to_sym
241
- when :DateTime
242
- DateTime.parse(value)
247
+ when :Time
248
+ Time.parse(value)
243
249
  when :Date
244
250
  Date.parse(value)
245
251
  when :String
@@ -269,7 +275,9 @@ module PulpFileClient
269
275
  end
270
276
  end
271
277
  else # model
272
- PulpFileClient.const_get(type).build_from_hash(value)
278
+ # models (e.g. Pet) or oneOf
279
+ klass = PulpFileClient.const_get(type)
280
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
273
281
  end
274
282
  end
275
283
 
@@ -295,7 +303,7 @@ module PulpFileClient
295
303
  is_nullable = self.class.openapi_nullable.include?(attr)
296
304
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
297
305
  end
298
-
306
+
299
307
  hash[param] = _to_hash(value)
300
308
  end
301
309
  hash
@@ -318,5 +326,7 @@ module PulpFileClient
318
326
  value
319
327
  end
320
328
  end
329
+
321
330
  end
331
+
322
332
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module PulpFileClient
16
17
  # Serializer for File Distributions.
@@ -48,6 +49,11 @@ module PulpFileClient
48
49
  }
49
50
  end
50
51
 
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
51
57
  # Attribute type mapping.
52
58
  def self.openapi_types
53
59
  {
@@ -87,6 +93,8 @@ module PulpFileClient
87
93
 
88
94
  if attributes.key?(:'base_path')
89
95
  self.base_path = attributes[:'base_path']
96
+ else
97
+ self.base_path = nil
90
98
  end
91
99
 
92
100
  if attributes.key?(:'content_guard')
@@ -107,6 +115,8 @@ module PulpFileClient
107
115
 
108
116
  if attributes.key?(:'name')
109
117
  self.name = attributes[:'name']
118
+ else
119
+ self.name = nil
110
120
  end
111
121
 
112
122
  if attributes.key?(:'repository')
@@ -121,6 +131,7 @@ module PulpFileClient
121
131
  # Show invalid properties with the reasons. Usually used together with valid?
122
132
  # @return Array for valid properties with the reasons
123
133
  def list_invalid_properties
134
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
124
135
  invalid_properties = Array.new
125
136
  if @base_path.nil?
126
137
  invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
@@ -144,6 +155,7 @@ module PulpFileClient
144
155
  # Check to see if the all the properties in the model are valid
145
156
  # @return true if the model is valid
146
157
  def valid?
158
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
159
  return false if @base_path.nil?
148
160
  return false if @base_path.to_s.length < 1
149
161
  return false if @name.nil?
@@ -209,37 +221,33 @@ module PulpFileClient
209
221
  # @param [Hash] attributes Model attributes in the form of hash
210
222
  # @return [Object] Returns the model itself
211
223
  def self.build_from_hash(attributes)
212
- new.build_from_hash(attributes)
213
- end
214
-
215
- # Builds the object from hash
216
- # @param [Hash] attributes Model attributes in the form of hash
217
- # @return [Object] Returns the model itself
218
- def build_from_hash(attributes)
219
224
  return nil unless attributes.is_a?(Hash)
220
- self.class.openapi_types.each_pair do |key, type|
221
- if type =~ /\AArray<(.*)>/i
225
+ attributes = attributes.transform_keys(&:to_sym)
226
+ transformed_hash = {}
227
+ openapi_types.each_pair do |key, type|
228
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
229
+ transformed_hash["#{key}"] = nil
230
+ elsif type =~ /\AArray<(.*)>/i
222
231
  # check to ensure the input is an array given that the attribute
223
232
  # is documented as an array but the input is not
224
- if attributes[self.class.attribute_map[key]].is_a?(Array)
225
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
233
+ if attributes[attribute_map[key]].is_a?(Array)
234
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
226
235
  end
227
- elsif !attributes[self.class.attribute_map[key]].nil?
228
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
229
- end # or else data not found in attributes(hash), not an issue as the data can be optional
236
+ elsif !attributes[attribute_map[key]].nil?
237
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
238
+ end
230
239
  end
231
-
232
- self
240
+ new(transformed_hash)
233
241
  end
234
242
 
235
243
  # Deserializes the data based on type
236
244
  # @param string type Data type
237
245
  # @param string value Value to be deserialized
238
246
  # @return [Object] Deserialized data
239
- def _deserialize(type, value)
247
+ def self._deserialize(type, value)
240
248
  case type.to_sym
241
- when :DateTime
242
- DateTime.parse(value)
249
+ when :Time
250
+ Time.parse(value)
243
251
  when :Date
244
252
  Date.parse(value)
245
253
  when :String
@@ -269,7 +277,9 @@ module PulpFileClient
269
277
  end
270
278
  end
271
279
  else # model
272
- PulpFileClient.const_get(type).build_from_hash(value)
280
+ # models (e.g. Pet) or oneOf
281
+ klass = PulpFileClient.const_get(type)
282
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
273
283
  end
274
284
  end
275
285
 
@@ -295,7 +305,7 @@ module PulpFileClient
295
305
  is_nullable = self.class.openapi_nullable.include?(attr)
296
306
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
297
307
  end
298
-
308
+
299
309
  hash[param] = _to_hash(value)
300
310
  end
301
311
  hash
@@ -318,5 +328,7 @@ module PulpFileClient
318
328
  value
319
329
  end
320
330
  end
331
+
321
332
  end
333
+
322
334
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module PulpFileClient
16
17
  # Serializer for File Distributions.
@@ -71,13 +72,18 @@ module PulpFileClient
71
72
  }
72
73
  end
73
74
 
75
+ # Returns all the JSON keys this model knows about
76
+ def self.acceptable_attributes
77
+ attribute_map.values
78
+ end
79
+
74
80
  # Attribute type mapping.
75
81
  def self.openapi_types
76
82
  {
77
83
  :'pulp_href' => :'String',
78
84
  :'prn' => :'String',
79
- :'pulp_created' => :'DateTime',
80
- :'pulp_last_updated' => :'DateTime',
85
+ :'pulp_created' => :'Time',
86
+ :'pulp_last_updated' => :'Time',
81
87
  :'base_path' => :'String',
82
88
  :'base_url' => :'String',
83
89
  :'content_guard' => :'String',
@@ -132,6 +138,8 @@ module PulpFileClient
132
138
 
133
139
  if attributes.key?(:'base_path')
134
140
  self.base_path = attributes[:'base_path']
141
+ else
142
+ self.base_path = nil
135
143
  end
136
144
 
137
145
  if attributes.key?(:'base_url')
@@ -160,6 +168,8 @@ module PulpFileClient
160
168
 
161
169
  if attributes.key?(:'name')
162
170
  self.name = attributes[:'name']
171
+ else
172
+ self.name = nil
163
173
  end
164
174
 
165
175
  if attributes.key?(:'repository')
@@ -174,6 +184,7 @@ module PulpFileClient
174
184
  # Show invalid properties with the reasons. Usually used together with valid?
175
185
  # @return Array for valid properties with the reasons
176
186
  def list_invalid_properties
187
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
177
188
  invalid_properties = Array.new
178
189
  if @base_path.nil?
179
190
  invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
@@ -189,6 +200,7 @@ module PulpFileClient
189
200
  # Check to see if the all the properties in the model are valid
190
201
  # @return true if the model is valid
191
202
  def valid?
203
+ warn '[DEPRECATED] the `valid?` method is obsolete'
192
204
  return false if @base_path.nil?
193
205
  return false if @name.nil?
194
206
  true
@@ -230,37 +242,33 @@ module PulpFileClient
230
242
  # @param [Hash] attributes Model attributes in the form of hash
231
243
  # @return [Object] Returns the model itself
232
244
  def self.build_from_hash(attributes)
233
- new.build_from_hash(attributes)
234
- end
235
-
236
- # Builds the object from hash
237
- # @param [Hash] attributes Model attributes in the form of hash
238
- # @return [Object] Returns the model itself
239
- def build_from_hash(attributes)
240
245
  return nil unless attributes.is_a?(Hash)
241
- self.class.openapi_types.each_pair do |key, type|
242
- if type =~ /\AArray<(.*)>/i
246
+ attributes = attributes.transform_keys(&:to_sym)
247
+ transformed_hash = {}
248
+ openapi_types.each_pair do |key, type|
249
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
250
+ transformed_hash["#{key}"] = nil
251
+ elsif type =~ /\AArray<(.*)>/i
243
252
  # check to ensure the input is an array given that the attribute
244
253
  # is documented as an array but the input is not
245
- if attributes[self.class.attribute_map[key]].is_a?(Array)
246
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
254
+ if attributes[attribute_map[key]].is_a?(Array)
255
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
247
256
  end
248
- elsif !attributes[self.class.attribute_map[key]].nil?
249
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
250
- end # or else data not found in attributes(hash), not an issue as the data can be optional
257
+ elsif !attributes[attribute_map[key]].nil?
258
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
259
+ end
251
260
  end
252
-
253
- self
261
+ new(transformed_hash)
254
262
  end
255
263
 
256
264
  # Deserializes the data based on type
257
265
  # @param string type Data type
258
266
  # @param string value Value to be deserialized
259
267
  # @return [Object] Deserialized data
260
- def _deserialize(type, value)
268
+ def self._deserialize(type, value)
261
269
  case type.to_sym
262
- when :DateTime
263
- DateTime.parse(value)
270
+ when :Time
271
+ Time.parse(value)
264
272
  when :Date
265
273
  Date.parse(value)
266
274
  when :String
@@ -290,7 +298,9 @@ module PulpFileClient
290
298
  end
291
299
  end
292
300
  else # model
293
- PulpFileClient.const_get(type).build_from_hash(value)
301
+ # models (e.g. Pet) or oneOf
302
+ klass = PulpFileClient.const_get(type)
303
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
294
304
  end
295
305
  end
296
306
 
@@ -316,7 +326,7 @@ module PulpFileClient
316
326
  is_nullable = self.class.openapi_nullable.include?(attr)
317
327
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
318
328
  end
319
-
329
+
320
330
  hash[param] = _to_hash(value)
321
331
  end
322
332
  hash
@@ -339,5 +349,7 @@ module PulpFileClient
339
349
  value
340
350
  end
341
351
  end
352
+
342
353
  end
354
+
343
355
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module PulpFileClient
16
17
  # Serializer for File Publications.
@@ -32,6 +33,11 @@ module PulpFileClient
32
33
  }
33
34
  end
34
35
 
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
35
41
  # Attribute type mapping.
36
42
  def self.openapi_types
37
43
  {
@@ -81,6 +87,7 @@ module PulpFileClient
81
87
  # Show invalid properties with the reasons. Usually used together with valid?
82
88
  # @return Array for valid properties with the reasons
83
89
  def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
91
  invalid_properties = Array.new
85
92
  if !@manifest.nil? && @manifest.to_s.length < 1
86
93
  invalid_properties.push('invalid value for "manifest", the character length must be great than or equal to 1.')
@@ -92,6 +99,7 @@ module PulpFileClient
92
99
  # Check to see if the all the properties in the model are valid
93
100
  # @return true if the model is valid
94
101
  def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
95
103
  return false if !@manifest.nil? && @manifest.to_s.length < 1
96
104
  true
97
105
  end
@@ -132,37 +140,33 @@ module PulpFileClient
132
140
  # @param [Hash] attributes Model attributes in the form of hash
133
141
  # @return [Object] Returns the model itself
134
142
  def self.build_from_hash(attributes)
135
- new.build_from_hash(attributes)
136
- end
137
-
138
- # Builds the object from hash
139
- # @param [Hash] attributes Model attributes in the form of hash
140
- # @return [Object] Returns the model itself
141
- def build_from_hash(attributes)
142
143
  return nil unless attributes.is_a?(Hash)
143
- self.class.openapi_types.each_pair do |key, type|
144
- if type =~ /\AArray<(.*)>/i
144
+ attributes = attributes.transform_keys(&:to_sym)
145
+ transformed_hash = {}
146
+ openapi_types.each_pair do |key, type|
147
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
148
+ transformed_hash["#{key}"] = nil
149
+ elsif type =~ /\AArray<(.*)>/i
145
150
  # check to ensure the input is an array given that the attribute
146
151
  # is documented as an array but the input is not
147
- if attributes[self.class.attribute_map[key]].is_a?(Array)
148
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ if attributes[attribute_map[key]].is_a?(Array)
153
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
149
154
  end
150
- elsif !attributes[self.class.attribute_map[key]].nil?
151
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
- end # or else data not found in attributes(hash), not an issue as the data can be optional
155
+ elsif !attributes[attribute_map[key]].nil?
156
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
157
+ end
153
158
  end
154
-
155
- self
159
+ new(transformed_hash)
156
160
  end
157
161
 
158
162
  # Deserializes the data based on type
159
163
  # @param string type Data type
160
164
  # @param string value Value to be deserialized
161
165
  # @return [Object] Deserialized data
162
- def _deserialize(type, value)
166
+ def self._deserialize(type, value)
163
167
  case type.to_sym
164
- when :DateTime
165
- DateTime.parse(value)
168
+ when :Time
169
+ Time.parse(value)
166
170
  when :Date
167
171
  Date.parse(value)
168
172
  when :String
@@ -192,7 +196,9 @@ module PulpFileClient
192
196
  end
193
197
  end
194
198
  else # model
195
- PulpFileClient.const_get(type).build_from_hash(value)
199
+ # models (e.g. Pet) or oneOf
200
+ klass = PulpFileClient.const_get(type)
201
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
196
202
  end
197
203
  end
198
204
 
@@ -218,7 +224,7 @@ module PulpFileClient
218
224
  is_nullable = self.class.openapi_nullable.include?(attr)
219
225
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
220
226
  end
221
-
227
+
222
228
  hash[param] = _to_hash(value)
223
229
  end
224
230
  hash
@@ -241,5 +247,7 @@ module PulpFileClient
241
247
  value
242
248
  end
243
249
  end
250
+
244
251
  end
252
+
245
253
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module PulpFileClient
16
17
  # Serializer for File Publications.
@@ -51,13 +52,18 @@ module PulpFileClient
51
52
  }
52
53
  end
53
54
 
55
+ # Returns all the JSON keys this model knows about
56
+ def self.acceptable_attributes
57
+ attribute_map.values
58
+ end
59
+
54
60
  # Attribute type mapping.
55
61
  def self.openapi_types
56
62
  {
57
63
  :'pulp_href' => :'String',
58
64
  :'prn' => :'String',
59
- :'pulp_created' => :'DateTime',
60
- :'pulp_last_updated' => :'DateTime',
65
+ :'pulp_created' => :'Time',
66
+ :'pulp_last_updated' => :'Time',
61
67
  :'repository_version' => :'String',
62
68
  :'repository' => :'String',
63
69
  :'distributions' => :'Array<String>',
@@ -127,6 +133,7 @@ module PulpFileClient
127
133
  # Show invalid properties with the reasons. Usually used together with valid?
128
134
  # @return Array for valid properties with the reasons
129
135
  def list_invalid_properties
136
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
130
137
  invalid_properties = Array.new
131
138
  invalid_properties
132
139
  end
@@ -134,6 +141,7 @@ module PulpFileClient
134
141
  # Check to see if the all the properties in the model are valid
135
142
  # @return true if the model is valid
136
143
  def valid?
144
+ warn '[DEPRECATED] the `valid?` method is obsolete'
137
145
  true
138
146
  end
139
147
 
@@ -168,37 +176,33 @@ module PulpFileClient
168
176
  # @param [Hash] attributes Model attributes in the form of hash
169
177
  # @return [Object] Returns the model itself
170
178
  def self.build_from_hash(attributes)
171
- new.build_from_hash(attributes)
172
- end
173
-
174
- # Builds the object from hash
175
- # @param [Hash] attributes Model attributes in the form of hash
176
- # @return [Object] Returns the model itself
177
- def build_from_hash(attributes)
178
179
  return nil unless attributes.is_a?(Hash)
179
- self.class.openapi_types.each_pair do |key, type|
180
- if type =~ /\AArray<(.*)>/i
180
+ attributes = attributes.transform_keys(&:to_sym)
181
+ transformed_hash = {}
182
+ openapi_types.each_pair do |key, type|
183
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = nil
185
+ elsif type =~ /\AArray<(.*)>/i
181
186
  # check to ensure the input is an array given that the attribute
182
187
  # is documented as an array but the input is not
183
- if attributes[self.class.attribute_map[key]].is_a?(Array)
184
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
188
+ if attributes[attribute_map[key]].is_a?(Array)
189
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
185
190
  end
186
- elsif !attributes[self.class.attribute_map[key]].nil?
187
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
- end # or else data not found in attributes(hash), not an issue as the data can be optional
191
+ elsif !attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ end
189
194
  end
190
-
191
- self
195
+ new(transformed_hash)
192
196
  end
193
197
 
194
198
  # Deserializes the data based on type
195
199
  # @param string type Data type
196
200
  # @param string value Value to be deserialized
197
201
  # @return [Object] Deserialized data
198
- def _deserialize(type, value)
202
+ def self._deserialize(type, value)
199
203
  case type.to_sym
200
- when :DateTime
201
- DateTime.parse(value)
204
+ when :Time
205
+ Time.parse(value)
202
206
  when :Date
203
207
  Date.parse(value)
204
208
  when :String
@@ -228,7 +232,9 @@ module PulpFileClient
228
232
  end
229
233
  end
230
234
  else # model
231
- PulpFileClient.const_get(type).build_from_hash(value)
235
+ # models (e.g. Pet) or oneOf
236
+ klass = PulpFileClient.const_get(type)
237
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
232
238
  end
233
239
  end
234
240
 
@@ -254,7 +260,7 @@ module PulpFileClient
254
260
  is_nullable = self.class.openapi_nullable.include?(attr)
255
261
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
256
262
  end
257
-
263
+
258
264
  hash[param] = _to_hash(value)
259
265
  end
260
266
  hash
@@ -277,5 +283,7 @@ module PulpFileClient
277
283
  value
278
284
  end
279
285
  end
286
+
280
287
  end
288
+
281
289
  end