pulp_ostree_client 2.4.5 → 2.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -12
  3. data/docs/AsyncOperationResponse.md +8 -7
  4. data/docs/ContentCommitsApi.md +80 -47
  5. data/docs/ContentConfigsApi.md +79 -46
  6. data/docs/ContentContentApi.md +107 -57
  7. data/docs/ContentObjectsApi.md +80 -47
  8. data/docs/ContentRefsApi.md +90 -57
  9. data/docs/ContentSummariesApi.md +79 -46
  10. data/docs/ContentSummaryResponse.md +12 -11
  11. data/docs/DistributionsOstreeApi.md +385 -182
  12. data/docs/MyPermissionsResponse.md +8 -7
  13. data/docs/NestedRole.md +12 -11
  14. data/docs/NestedRoleResponse.md +12 -11
  15. data/docs/ObjectRolesResponse.md +8 -7
  16. data/docs/OstreeImportAll.md +10 -9
  17. data/docs/OstreeImportCommitsToRef.md +12 -11
  18. data/docs/OstreeOstreeCommitResponse.md +24 -23
  19. data/docs/OstreeOstreeConfigResponse.md +18 -17
  20. data/docs/OstreeOstreeContent.md +14 -13
  21. data/docs/OstreeOstreeContentResponse.md +20 -19
  22. data/docs/OstreeOstreeDistribution.md +20 -19
  23. data/docs/OstreeOstreeDistributionResponse.md +32 -31
  24. data/docs/OstreeOstreeObjectResponse.md +22 -21
  25. data/docs/OstreeOstreeRefResponse.md +24 -23
  26. data/docs/OstreeOstreeRemote.md +54 -53
  27. data/docs/OstreeOstreeRemoteResponse.md +54 -53
  28. data/docs/OstreeOstreeRemoteResponseHiddenFieldsInner.md +20 -0
  29. data/docs/OstreeOstreeRepository.md +18 -17
  30. data/docs/OstreeOstreeRepositoryResponse.md +30 -29
  31. data/docs/OstreeOstreeSummaryResponse.md +18 -17
  32. data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
  33. data/docs/PaginatedostreeOstreeCommitResponseList.md +14 -13
  34. data/docs/PaginatedostreeOstreeConfigResponseList.md +14 -13
  35. data/docs/PaginatedostreeOstreeContentResponseList.md +14 -13
  36. data/docs/PaginatedostreeOstreeDistributionResponseList.md +14 -13
  37. data/docs/PaginatedostreeOstreeObjectResponseList.md +14 -13
  38. data/docs/PaginatedostreeOstreeRefResponseList.md +14 -13
  39. data/docs/PaginatedostreeOstreeRemoteResponseList.md +14 -13
  40. data/docs/PaginatedostreeOstreeRepositoryResponseList.md +14 -13
  41. data/docs/PaginatedostreeOstreeSummaryResponseList.md +14 -13
  42. data/docs/PatchedostreeOstreeDistribution.md +20 -19
  43. data/docs/PatchedostreeOstreeRemote.md +54 -53
  44. data/docs/PatchedostreeOstreeRepository.md +18 -17
  45. data/docs/PolicyEnum.md +4 -5
  46. data/docs/RemotesOstreeApi.md +389 -184
  47. data/docs/Repair.md +8 -7
  48. data/docs/RepositoriesOstreeApi.md +502 -231
  49. data/docs/RepositoriesOstreeVersionsApi.md +152 -82
  50. data/docs/RepositoryAddRemoveContent.md +12 -11
  51. data/docs/RepositorySyncURL.md +10 -9
  52. data/docs/RepositoryVersionResponse.md +22 -21
  53. data/docs/SetLabel.md +10 -9
  54. data/docs/SetLabelResponse.md +10 -9
  55. data/docs/UnsetLabel.md +8 -7
  56. data/docs/UnsetLabelResponse.md +10 -9
  57. data/lib/pulp_ostree_client/api/content_commits_api.rb +11 -9
  58. data/lib/pulp_ostree_client/api/content_configs_api.rb +11 -9
  59. data/lib/pulp_ostree_client/api/content_content_api.rb +20 -14
  60. data/lib/pulp_ostree_client/api/content_objects_api.rb +11 -9
  61. data/lib/pulp_ostree_client/api/content_refs_api.rb +11 -9
  62. data/lib/pulp_ostree_client/api/content_summaries_api.rb +11 -9
  63. data/lib/pulp_ostree_client/api/distributions_ostree_api.rb +89 -56
  64. data/lib/pulp_ostree_client/api/remotes_ostree_api.rb +104 -68
  65. data/lib/pulp_ostree_client/api/repositories_ostree_api.rb +125 -76
  66. data/lib/pulp_ostree_client/api/repositories_ostree_versions_api.rb +40 -30
  67. data/lib/pulp_ostree_client/api_client.rb +137 -102
  68. data/lib/pulp_ostree_client/api_error.rb +2 -1
  69. data/lib/pulp_ostree_client/configuration.rb +162 -21
  70. data/lib/pulp_ostree_client/models/async_operation_response.rb +32 -22
  71. data/lib/pulp_ostree_client/models/content_summary_response.rb +36 -22
  72. data/lib/pulp_ostree_client/models/my_permissions_response.rb +32 -22
  73. data/lib/pulp_ostree_client/models/nested_role.rb +32 -22
  74. data/lib/pulp_ostree_client/models/nested_role_response.rb +32 -22
  75. data/lib/pulp_ostree_client/models/object_roles_response.rb +32 -22
  76. data/lib/pulp_ostree_client/models/ostree_import_all.rb +34 -22
  77. data/lib/pulp_ostree_client/models/ostree_import_commits_to_ref.rb +36 -22
  78. data/lib/pulp_ostree_client/models/ostree_ostree_commit_response.rb +40 -24
  79. data/lib/pulp_ostree_client/models/ostree_ostree_config_response.rb +36 -24
  80. data/lib/pulp_ostree_client/models/ostree_ostree_content.rb +36 -22
  81. data/lib/pulp_ostree_client/models/ostree_ostree_content_response.rb +38 -24
  82. data/lib/pulp_ostree_client/models/ostree_ostree_distribution.rb +34 -22
  83. data/lib/pulp_ostree_client/models/ostree_ostree_distribution_response.rb +36 -24
  84. data/lib/pulp_ostree_client/models/ostree_ostree_object_response.rb +40 -24
  85. data/lib/pulp_ostree_client/models/ostree_ostree_ref_response.rb +40 -24
  86. data/lib/pulp_ostree_client/models/ostree_ostree_remote.rb +61 -23
  87. data/lib/pulp_ostree_client/models/ostree_ostree_remote_response.rb +64 -26
  88. data/lib/pulp_ostree_client/models/{ostree_ostree_remote_response_hidden_fields.rb → ostree_ostree_remote_response_hidden_fields_inner.rb} +37 -25
  89. data/lib/pulp_ostree_client/models/ostree_ostree_repository.rb +32 -22
  90. data/lib/pulp_ostree_client/models/ostree_ostree_repository_response.rb +34 -24
  91. data/lib/pulp_ostree_client/models/ostree_ostree_summary_response.rb +36 -24
  92. data/lib/pulp_ostree_client/models/paginated_repository_version_response_list.rb +34 -22
  93. data/lib/pulp_ostree_client/models/paginatedostree_ostree_commit_response_list.rb +34 -22
  94. data/lib/pulp_ostree_client/models/paginatedostree_ostree_config_response_list.rb +34 -22
  95. data/lib/pulp_ostree_client/models/paginatedostree_ostree_content_response_list.rb +34 -22
  96. data/lib/pulp_ostree_client/models/paginatedostree_ostree_distribution_response_list.rb +34 -22
  97. data/lib/pulp_ostree_client/models/paginatedostree_ostree_object_response_list.rb +34 -22
  98. data/lib/pulp_ostree_client/models/paginatedostree_ostree_ref_response_list.rb +34 -22
  99. data/lib/pulp_ostree_client/models/paginatedostree_ostree_remote_response_list.rb +34 -22
  100. data/lib/pulp_ostree_client/models/paginatedostree_ostree_repository_response_list.rb +34 -22
  101. data/lib/pulp_ostree_client/models/paginatedostree_ostree_summary_response_list.rb +34 -22
  102. data/lib/pulp_ostree_client/models/patchedostree_ostree_distribution.rb +40 -24
  103. data/lib/pulp_ostree_client/models/patchedostree_ostree_remote.rb +67 -25
  104. data/lib/pulp_ostree_client/models/patchedostree_ostree_repository.rb +35 -23
  105. data/lib/pulp_ostree_client/models/policy_enum.rb +8 -4
  106. data/lib/pulp_ostree_client/models/repair.rb +30 -22
  107. data/lib/pulp_ostree_client/models/repository_add_remove_content.rb +30 -22
  108. data/lib/pulp_ostree_client/models/repository_sync_url.rb +30 -22
  109. data/lib/pulp_ostree_client/models/repository_version_response.rb +32 -24
  110. data/lib/pulp_ostree_client/models/set_label.rb +34 -22
  111. data/lib/pulp_ostree_client/models/set_label_response.rb +34 -22
  112. data/lib/pulp_ostree_client/models/unset_label.rb +32 -22
  113. data/lib/pulp_ostree_client/models/unset_label_response.rb +32 -22
  114. data/lib/pulp_ostree_client/version.rb +2 -2
  115. data/lib/pulp_ostree_client.rb +2 -2
  116. data/pulp_ostree_client.gemspec +9 -6
  117. data/spec/api/content_commits_api_spec.rb +3 -3
  118. data/spec/api/content_configs_api_spec.rb +3 -3
  119. data/spec/api/content_content_api_spec.rb +4 -4
  120. data/spec/api/content_objects_api_spec.rb +3 -3
  121. data/spec/api/content_refs_api_spec.rb +3 -3
  122. data/spec/api/content_summaries_api_spec.rb +3 -3
  123. data/spec/api/distributions_ostree_api_spec.rb +13 -13
  124. data/spec/api/remotes_ostree_api_spec.rb +20 -19
  125. data/spec/api/repositories_ostree_api_spec.rb +17 -17
  126. data/spec/api/repositories_ostree_versions_api_spec.rb +12 -11
  127. data/spec/models/async_operation_response_spec.rb +7 -12
  128. data/spec/models/content_summary_response_spec.rb +9 -14
  129. data/spec/models/my_permissions_response_spec.rb +7 -12
  130. data/spec/models/nested_role_response_spec.rb +9 -14
  131. data/spec/models/nested_role_spec.rb +9 -14
  132. data/spec/models/object_roles_response_spec.rb +7 -12
  133. data/spec/models/ostree_import_all_spec.rb +8 -13
  134. data/spec/models/ostree_import_commits_to_ref_spec.rb +9 -14
  135. data/spec/models/ostree_ostree_commit_response_spec.rb +15 -20
  136. data/spec/models/ostree_ostree_config_response_spec.rb +12 -17
  137. data/spec/models/ostree_ostree_content_response_spec.rb +13 -18
  138. data/spec/models/ostree_ostree_content_spec.rb +10 -15
  139. data/spec/models/ostree_ostree_distribution_response_spec.rb +19 -24
  140. data/spec/models/ostree_ostree_distribution_spec.rb +13 -18
  141. data/spec/models/ostree_ostree_object_response_spec.rb +14 -19
  142. data/spec/models/ostree_ostree_ref_response_spec.rb +15 -20
  143. data/spec/models/{ostree_ostree_remote_response_hidden_fields_spec.rb → ostree_ostree_remote_response_hidden_fields_inner_spec.rb} +11 -16
  144. data/spec/models/ostree_ostree_remote_response_spec.rb +30 -35
  145. data/spec/models/ostree_ostree_remote_spec.rb +30 -35
  146. data/spec/models/ostree_ostree_repository_response_spec.rb +18 -23
  147. data/spec/models/ostree_ostree_repository_spec.rb +12 -17
  148. data/spec/models/ostree_ostree_summary_response_spec.rb +12 -17
  149. data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
  150. data/spec/models/paginatedostree_ostree_commit_response_list_spec.rb +10 -15
  151. data/spec/models/paginatedostree_ostree_config_response_list_spec.rb +10 -15
  152. data/spec/models/paginatedostree_ostree_content_response_list_spec.rb +10 -15
  153. data/spec/models/paginatedostree_ostree_distribution_response_list_spec.rb +10 -15
  154. data/spec/models/paginatedostree_ostree_object_response_list_spec.rb +10 -15
  155. data/spec/models/paginatedostree_ostree_ref_response_list_spec.rb +10 -15
  156. data/spec/models/paginatedostree_ostree_remote_response_list_spec.rb +10 -15
  157. data/spec/models/paginatedostree_ostree_repository_response_list_spec.rb +10 -15
  158. data/spec/models/paginatedostree_ostree_summary_response_list_spec.rb +10 -15
  159. data/spec/models/patchedostree_ostree_distribution_spec.rb +13 -18
  160. data/spec/models/patchedostree_ostree_remote_spec.rb +30 -35
  161. data/spec/models/patchedostree_ostree_repository_spec.rb +12 -17
  162. data/spec/models/policy_enum_spec.rb +6 -11
  163. data/spec/models/repair_spec.rb +7 -12
  164. data/spec/models/repository_add_remove_content_spec.rb +9 -14
  165. data/spec/models/repository_sync_url_spec.rb +8 -13
  166. data/spec/models/repository_version_response_spec.rb +14 -19
  167. data/spec/models/set_label_response_spec.rb +8 -13
  168. data/spec/models/set_label_spec.rb +8 -13
  169. data/spec/models/unset_label_response_spec.rb +8 -13
  170. data/spec/models/unset_label_spec.rb +7 -12
  171. data/spec/spec_helper.rb +1 -1
  172. metadata +84 -60
  173. data/docs/OstreeOstreeRemoteResponseHiddenFields.md +0 -19
  174. data/spec/api_client_spec.rb +0 -188
  175. data/spec/configuration_spec.rb +0 -42
@@ -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 PulpOstreeClient
16
17
  # A Serializer class for OSTree commits.
@@ -53,13 +54,18 @@ module PulpOstreeClient
53
54
  }
54
55
  end
55
56
 
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ attribute_map.values
60
+ end
61
+
56
62
  # Attribute type mapping.
57
63
  def self.openapi_types
58
64
  {
59
65
  :'pulp_href' => :'String',
60
66
  :'prn' => :'String',
61
- :'pulp_created' => :'DateTime',
62
- :'pulp_last_updated' => :'DateTime',
67
+ :'pulp_created' => :'Time',
68
+ :'pulp_last_updated' => :'Time',
63
69
  :'artifact' => :'String',
64
70
  :'relative_path' => :'String',
65
71
  :'parent_commit' => :'String',
@@ -108,10 +114,14 @@ module PulpOstreeClient
108
114
 
109
115
  if attributes.key?(:'artifact')
110
116
  self.artifact = attributes[:'artifact']
117
+ else
118
+ self.artifact = nil
111
119
  end
112
120
 
113
121
  if attributes.key?(:'relative_path')
114
122
  self.relative_path = attributes[:'relative_path']
123
+ else
124
+ self.relative_path = nil
115
125
  end
116
126
 
117
127
  if attributes.key?(:'parent_commit')
@@ -120,18 +130,23 @@ module PulpOstreeClient
120
130
 
121
131
  if attributes.key?(:'checksum')
122
132
  self.checksum = attributes[:'checksum']
133
+ else
134
+ self.checksum = nil
123
135
  end
124
136
 
125
137
  if attributes.key?(:'objs')
126
138
  if (value = attributes[:'objs']).is_a?(Array)
127
139
  self.objs = value
128
140
  end
141
+ else
142
+ self.objs = nil
129
143
  end
130
144
  end
131
145
 
132
146
  # Show invalid properties with the reasons. Usually used together with valid?
133
147
  # @return Array for valid properties with the reasons
134
148
  def list_invalid_properties
149
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
135
150
  invalid_properties = Array.new
136
151
  if @artifact.nil?
137
152
  invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
@@ -155,6 +170,7 @@ module PulpOstreeClient
155
170
  # Check to see if the all the properties in the model are valid
156
171
  # @return true if the model is valid
157
172
  def valid?
173
+ warn '[DEPRECATED] the `valid?` method is obsolete'
158
174
  return false if @artifact.nil?
159
175
  return false if @relative_path.nil?
160
176
  return false if @checksum.nil?
@@ -194,37 +210,33 @@ module PulpOstreeClient
194
210
  # @param [Hash] attributes Model attributes in the form of hash
195
211
  # @return [Object] Returns the model itself
196
212
  def self.build_from_hash(attributes)
197
- new.build_from_hash(attributes)
198
- end
199
-
200
- # Builds the object from hash
201
- # @param [Hash] attributes Model attributes in the form of hash
202
- # @return [Object] Returns the model itself
203
- def build_from_hash(attributes)
204
213
  return nil unless attributes.is_a?(Hash)
205
- self.class.openapi_types.each_pair do |key, type|
206
- if type =~ /\AArray<(.*)>/i
214
+ attributes = attributes.transform_keys(&:to_sym)
215
+ transformed_hash = {}
216
+ openapi_types.each_pair do |key, type|
217
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = nil
219
+ elsif type =~ /\AArray<(.*)>/i
207
220
  # check to ensure the input is an array given that the attribute
208
221
  # is documented as an array but the input is not
209
- if attributes[self.class.attribute_map[key]].is_a?(Array)
210
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
222
+ if attributes[attribute_map[key]].is_a?(Array)
223
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
211
224
  end
212
- elsif !attributes[self.class.attribute_map[key]].nil?
213
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
214
- end # or else data not found in attributes(hash), not an issue as the data can be optional
225
+ elsif !attributes[attribute_map[key]].nil?
226
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
227
+ end
215
228
  end
216
-
217
- self
229
+ new(transformed_hash)
218
230
  end
219
231
 
220
232
  # Deserializes the data based on type
221
233
  # @param string type Data type
222
234
  # @param string value Value to be deserialized
223
235
  # @return [Object] Deserialized data
224
- def _deserialize(type, value)
236
+ def self._deserialize(type, value)
225
237
  case type.to_sym
226
- when :DateTime
227
- DateTime.parse(value)
238
+ when :Time
239
+ Time.parse(value)
228
240
  when :Date
229
241
  Date.parse(value)
230
242
  when :String
@@ -254,7 +266,9 @@ module PulpOstreeClient
254
266
  end
255
267
  end
256
268
  else # model
257
- PulpOstreeClient.const_get(type).build_from_hash(value)
269
+ # models (e.g. Pet) or oneOf
270
+ klass = PulpOstreeClient.const_get(type)
271
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
258
272
  end
259
273
  end
260
274
 
@@ -280,7 +294,7 @@ module PulpOstreeClient
280
294
  is_nullable = self.class.openapi_nullable.include?(attr)
281
295
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
282
296
  end
283
-
297
+
284
298
  hash[param] = _to_hash(value)
285
299
  end
286
300
  hash
@@ -303,5 +317,7 @@ module PulpOstreeClient
303
317
  value
304
318
  end
305
319
  end
320
+
306
321
  end
322
+
307
323
  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 PulpOstreeClient
16
17
  # A Serializer class for OSTree repository configuration files.
@@ -44,13 +45,18 @@ module PulpOstreeClient
44
45
  }
45
46
  end
46
47
 
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
47
53
  # Attribute type mapping.
48
54
  def self.openapi_types
49
55
  {
50
56
  :'pulp_href' => :'String',
51
57
  :'prn' => :'String',
52
- :'pulp_created' => :'DateTime',
53
- :'pulp_last_updated' => :'DateTime',
58
+ :'pulp_created' => :'Time',
59
+ :'pulp_last_updated' => :'Time',
54
60
  :'artifact' => :'String',
55
61
  :'relative_path' => :'String'
56
62
  }
@@ -95,16 +101,21 @@ module PulpOstreeClient
95
101
 
96
102
  if attributes.key?(:'artifact')
97
103
  self.artifact = attributes[:'artifact']
104
+ else
105
+ self.artifact = nil
98
106
  end
99
107
 
100
108
  if attributes.key?(:'relative_path')
101
109
  self.relative_path = attributes[:'relative_path']
110
+ else
111
+ self.relative_path = nil
102
112
  end
103
113
  end
104
114
 
105
115
  # Show invalid properties with the reasons. Usually used together with valid?
106
116
  # @return Array for valid properties with the reasons
107
117
  def list_invalid_properties
118
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
119
  invalid_properties = Array.new
109
120
  if @artifact.nil?
110
121
  invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
@@ -120,6 +131,7 @@ module PulpOstreeClient
120
131
  # Check to see if the all the properties in the model are valid
121
132
  # @return true if the model is valid
122
133
  def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
135
  return false if @artifact.nil?
124
136
  return false if @relative_path.nil?
125
137
  true
@@ -154,37 +166,33 @@ module PulpOstreeClient
154
166
  # @param [Hash] attributes Model attributes in the form of hash
155
167
  # @return [Object] Returns the model itself
156
168
  def self.build_from_hash(attributes)
157
- new.build_from_hash(attributes)
158
- end
159
-
160
- # Builds the object from hash
161
- # @param [Hash] attributes Model attributes in the form of hash
162
- # @return [Object] Returns the model itself
163
- def build_from_hash(attributes)
164
169
  return nil unless attributes.is_a?(Hash)
165
- self.class.openapi_types.each_pair do |key, type|
166
- if type =~ /\AArray<(.*)>/i
170
+ attributes = attributes.transform_keys(&:to_sym)
171
+ transformed_hash = {}
172
+ openapi_types.each_pair do |key, type|
173
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = nil
175
+ elsif type =~ /\AArray<(.*)>/i
167
176
  # check to ensure the input is an array given that the attribute
168
177
  # is documented as an array but the input is not
169
- if attributes[self.class.attribute_map[key]].is_a?(Array)
170
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
178
+ if attributes[attribute_map[key]].is_a?(Array)
179
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
171
180
  end
172
- elsif !attributes[self.class.attribute_map[key]].nil?
173
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
174
- end # or else data not found in attributes(hash), not an issue as the data can be optional
181
+ elsif !attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
183
+ end
175
184
  end
176
-
177
- self
185
+ new(transformed_hash)
178
186
  end
179
187
 
180
188
  # Deserializes the data based on type
181
189
  # @param string type Data type
182
190
  # @param string value Value to be deserialized
183
191
  # @return [Object] Deserialized data
184
- def _deserialize(type, value)
192
+ def self._deserialize(type, value)
185
193
  case type.to_sym
186
- when :DateTime
187
- DateTime.parse(value)
194
+ when :Time
195
+ Time.parse(value)
188
196
  when :Date
189
197
  Date.parse(value)
190
198
  when :String
@@ -214,7 +222,9 @@ module PulpOstreeClient
214
222
  end
215
223
  end
216
224
  else # model
217
- PulpOstreeClient.const_get(type).build_from_hash(value)
225
+ # models (e.g. Pet) or oneOf
226
+ klass = PulpOstreeClient.const_get(type)
227
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
218
228
  end
219
229
  end
220
230
 
@@ -240,7 +250,7 @@ module PulpOstreeClient
240
250
  is_nullable = self.class.openapi_nullable.include?(attr)
241
251
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
252
  end
243
-
253
+
244
254
  hash[param] = _to_hash(value)
245
255
  end
246
256
  hash
@@ -263,5 +273,7 @@ module PulpOstreeClient
263
273
  value
264
274
  end
265
275
  end
276
+
266
277
  end
278
+
267
279
  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 PulpOstreeClient
16
17
  # A Serializer class for uncategorized content units (e.g., static deltas).
@@ -35,6 +36,11 @@ module PulpOstreeClient
35
36
  }
36
37
  end
37
38
 
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
38
44
  # Attribute type mapping.
39
45
  def self.openapi_types
40
46
  {
@@ -72,20 +78,27 @@ module PulpOstreeClient
72
78
 
73
79
  if attributes.key?(:'artifact')
74
80
  self.artifact = attributes[:'artifact']
81
+ else
82
+ self.artifact = nil
75
83
  end
76
84
 
77
85
  if attributes.key?(:'relative_path')
78
86
  self.relative_path = attributes[:'relative_path']
87
+ else
88
+ self.relative_path = nil
79
89
  end
80
90
 
81
91
  if attributes.key?(:'digest')
82
92
  self.digest = attributes[:'digest']
93
+ else
94
+ self.digest = nil
83
95
  end
84
96
  end
85
97
 
86
98
  # Show invalid properties with the reasons. Usually used together with valid?
87
99
  # @return Array for valid properties with the reasons
88
100
  def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
102
  invalid_properties = Array.new
90
103
  if @artifact.nil?
91
104
  invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
@@ -113,6 +126,7 @@ module PulpOstreeClient
113
126
  # Check to see if the all the properties in the model are valid
114
127
  # @return true if the model is valid
115
128
  def valid?
129
+ warn '[DEPRECATED] the `valid?` method is obsolete'
116
130
  return false if @artifact.nil?
117
131
  return false if @relative_path.nil?
118
132
  return false if @relative_path.to_s.length < 1
@@ -176,37 +190,33 @@ module PulpOstreeClient
176
190
  # @param [Hash] attributes Model attributes in the form of hash
177
191
  # @return [Object] Returns the model itself
178
192
  def self.build_from_hash(attributes)
179
- new.build_from_hash(attributes)
180
- end
181
-
182
- # Builds the object from hash
183
- # @param [Hash] attributes Model attributes in the form of hash
184
- # @return [Object] Returns the model itself
185
- def build_from_hash(attributes)
186
193
  return nil unless attributes.is_a?(Hash)
187
- self.class.openapi_types.each_pair do |key, type|
188
- if type =~ /\AArray<(.*)>/i
194
+ attributes = attributes.transform_keys(&:to_sym)
195
+ transformed_hash = {}
196
+ openapi_types.each_pair do |key, type|
197
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
198
+ transformed_hash["#{key}"] = nil
199
+ elsif type =~ /\AArray<(.*)>/i
189
200
  # check to ensure the input is an array given that the attribute
190
201
  # is documented as an array but the input is not
191
- if attributes[self.class.attribute_map[key]].is_a?(Array)
192
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
202
+ if attributes[attribute_map[key]].is_a?(Array)
203
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
204
  end
194
- elsif !attributes[self.class.attribute_map[key]].nil?
195
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
196
- end # or else data not found in attributes(hash), not an issue as the data can be optional
205
+ elsif !attributes[attribute_map[key]].nil?
206
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
207
+ end
197
208
  end
198
-
199
- self
209
+ new(transformed_hash)
200
210
  end
201
211
 
202
212
  # Deserializes the data based on type
203
213
  # @param string type Data type
204
214
  # @param string value Value to be deserialized
205
215
  # @return [Object] Deserialized data
206
- def _deserialize(type, value)
216
+ def self._deserialize(type, value)
207
217
  case type.to_sym
208
- when :DateTime
209
- DateTime.parse(value)
218
+ when :Time
219
+ Time.parse(value)
210
220
  when :Date
211
221
  Date.parse(value)
212
222
  when :String
@@ -236,7 +246,9 @@ module PulpOstreeClient
236
246
  end
237
247
  end
238
248
  else # model
239
- PulpOstreeClient.const_get(type).build_from_hash(value)
249
+ # models (e.g. Pet) or oneOf
250
+ klass = PulpOstreeClient.const_get(type)
251
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
240
252
  end
241
253
  end
242
254
 
@@ -262,7 +274,7 @@ module PulpOstreeClient
262
274
  is_nullable = self.class.openapi_nullable.include?(attr)
263
275
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
264
276
  end
265
-
277
+
266
278
  hash[param] = _to_hash(value)
267
279
  end
268
280
  hash
@@ -285,5 +297,7 @@ module PulpOstreeClient
285
297
  value
286
298
  end
287
299
  end
300
+
288
301
  end
302
+
289
303
  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 PulpOstreeClient
16
17
  # A Serializer class for uncategorized content units (e.g., static deltas).
@@ -46,13 +47,18 @@ module PulpOstreeClient
46
47
  }
47
48
  end
48
49
 
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ attribute_map.values
53
+ end
54
+
49
55
  # Attribute type mapping.
50
56
  def self.openapi_types
51
57
  {
52
58
  :'pulp_href' => :'String',
53
59
  :'prn' => :'String',
54
- :'pulp_created' => :'DateTime',
55
- :'pulp_last_updated' => :'DateTime',
60
+ :'pulp_created' => :'Time',
61
+ :'pulp_last_updated' => :'Time',
56
62
  :'artifact' => :'String',
57
63
  :'relative_path' => :'String',
58
64
  :'digest' => :'String'
@@ -98,20 +104,27 @@ module PulpOstreeClient
98
104
 
99
105
  if attributes.key?(:'artifact')
100
106
  self.artifact = attributes[:'artifact']
107
+ else
108
+ self.artifact = nil
101
109
  end
102
110
 
103
111
  if attributes.key?(:'relative_path')
104
112
  self.relative_path = attributes[:'relative_path']
113
+ else
114
+ self.relative_path = nil
105
115
  end
106
116
 
107
117
  if attributes.key?(:'digest')
108
118
  self.digest = attributes[:'digest']
119
+ else
120
+ self.digest = nil
109
121
  end
110
122
  end
111
123
 
112
124
  # Show invalid properties with the reasons. Usually used together with valid?
113
125
  # @return Array for valid properties with the reasons
114
126
  def list_invalid_properties
127
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
128
  invalid_properties = Array.new
116
129
  if @artifact.nil?
117
130
  invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
@@ -131,6 +144,7 @@ module PulpOstreeClient
131
144
  # Check to see if the all the properties in the model are valid
132
145
  # @return true if the model is valid
133
146
  def valid?
147
+ warn '[DEPRECATED] the `valid?` method is obsolete'
134
148
  return false if @artifact.nil?
135
149
  return false if @relative_path.nil?
136
150
  return false if @digest.nil?
@@ -167,37 +181,33 @@ module PulpOstreeClient
167
181
  # @param [Hash] attributes Model attributes in the form of hash
168
182
  # @return [Object] Returns the model itself
169
183
  def self.build_from_hash(attributes)
170
- new.build_from_hash(attributes)
171
- end
172
-
173
- # Builds the object from hash
174
- # @param [Hash] attributes Model attributes in the form of hash
175
- # @return [Object] Returns the model itself
176
- def build_from_hash(attributes)
177
184
  return nil unless attributes.is_a?(Hash)
178
- self.class.openapi_types.each_pair do |key, type|
179
- if type =~ /\AArray<(.*)>/i
185
+ attributes = attributes.transform_keys(&:to_sym)
186
+ transformed_hash = {}
187
+ openapi_types.each_pair do |key, type|
188
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = nil
190
+ elsif type =~ /\AArray<(.*)>/i
180
191
  # check to ensure the input is an array given that the attribute
181
192
  # is documented as an array but the input is not
182
- if attributes[self.class.attribute_map[key]].is_a?(Array)
183
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
193
+ if attributes[attribute_map[key]].is_a?(Array)
194
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
184
195
  end
185
- elsif !attributes[self.class.attribute_map[key]].nil?
186
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
187
- end # or else data not found in attributes(hash), not an issue as the data can be optional
196
+ elsif !attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
198
+ end
188
199
  end
189
-
190
- self
200
+ new(transformed_hash)
191
201
  end
192
202
 
193
203
  # Deserializes the data based on type
194
204
  # @param string type Data type
195
205
  # @param string value Value to be deserialized
196
206
  # @return [Object] Deserialized data
197
- def _deserialize(type, value)
207
+ def self._deserialize(type, value)
198
208
  case type.to_sym
199
- when :DateTime
200
- DateTime.parse(value)
209
+ when :Time
210
+ Time.parse(value)
201
211
  when :Date
202
212
  Date.parse(value)
203
213
  when :String
@@ -227,7 +237,9 @@ module PulpOstreeClient
227
237
  end
228
238
  end
229
239
  else # model
230
- PulpOstreeClient.const_get(type).build_from_hash(value)
240
+ # models (e.g. Pet) or oneOf
241
+ klass = PulpOstreeClient.const_get(type)
242
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
231
243
  end
232
244
  end
233
245
 
@@ -253,7 +265,7 @@ module PulpOstreeClient
253
265
  is_nullable = self.class.openapi_nullable.include?(attr)
254
266
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
267
  end
256
-
268
+
257
269
  hash[param] = _to_hash(value)
258
270
  end
259
271
  hash
@@ -276,5 +288,7 @@ module PulpOstreeClient
276
288
  value
277
289
  end
278
290
  end
291
+
279
292
  end
293
+
280
294
  end