pulp_ostree_client 2.4.5 → 2.4.7

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 +29 -12
  3. data/docs/AsyncOperationResponse.md +8 -7
  4. data/docs/ContentCommitsApi.md +228 -47
  5. data/docs/ContentConfigsApi.md +227 -46
  6. data/docs/ContentContentApi.md +255 -57
  7. data/docs/ContentObjectsApi.md +228 -47
  8. data/docs/ContentRefsApi.md +238 -57
  9. data/docs/ContentSummariesApi.md +227 -46
  10. data/docs/ContentSummaryResponse.md +12 -11
  11. data/docs/DistributionsOstreeApi.md +387 -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 +26 -23
  19. data/docs/OstreeOstreeConfigResponse.md +20 -17
  20. data/docs/OstreeOstreeContent.md +16 -13
  21. data/docs/OstreeOstreeContentResponse.md +22 -19
  22. data/docs/OstreeOstreeDistribution.md +20 -19
  23. data/docs/OstreeOstreeDistributionResponse.md +32 -31
  24. data/docs/OstreeOstreeObjectResponse.md +24 -21
  25. data/docs/OstreeOstreeRefResponse.md +26 -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 +20 -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 +165 -12
  58. data/lib/pulp_ostree_client/api/content_configs_api.rb +162 -9
  59. data/lib/pulp_ostree_client/api/content_content_api.rb +171 -14
  60. data/lib/pulp_ostree_client/api/content_objects_api.rb +165 -12
  61. data/lib/pulp_ostree_client/api/content_refs_api.rb +165 -12
  62. data/lib/pulp_ostree_client/api/content_summaries_api.rb +162 -9
  63. data/lib/pulp_ostree_client/api/distributions_ostree_api.rb +95 -59
  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 +53 -25
  79. data/lib/pulp_ostree_client/models/ostree_ostree_config_response.rb +49 -25
  80. data/lib/pulp_ostree_client/models/ostree_ostree_content.rb +49 -23
  81. data/lib/pulp_ostree_client/models/ostree_ostree_content_response.rb +51 -25
  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 +53 -25
  85. data/lib/pulp_ostree_client/models/ostree_ostree_ref_response.rb +53 -25
  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 +49 -25
  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 +33 -23
  113. data/lib/pulp_ostree_client/models/unset_label_response.rb +33 -23
  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 +31 -4
  118. data/spec/api/content_configs_api_spec.rb +30 -3
  119. data/spec/api/content_content_api_spec.rb +31 -4
  120. data/spec/api/content_objects_api_spec.rb +31 -4
  121. data/spec/api/content_refs_api_spec.rb +31 -4
  122. data/spec/api/content_summaries_api_spec.rb +30 -3
  123. data/spec/api/distributions_ostree_api_spec.rb +15 -14
  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 +21 -20
  136. data/spec/models/ostree_ostree_config_response_spec.rb +18 -17
  137. data/spec/models/ostree_ostree_content_response_spec.rb +19 -18
  138. data/spec/models/ostree_ostree_content_spec.rb +16 -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 +20 -19
  142. data/spec/models/ostree_ostree_ref_response_spec.rb +21 -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 +18 -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 +83 -59
  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.
@@ -26,6 +27,9 @@ module PulpOstreeClient
26
27
  # Timestamp of the last time this resource was updated. Note: for immutable resources - like content, repository versions, and publication - pulp_created and pulp_last_updated dates will be the same.
27
28
  attr_accessor :pulp_last_updated
28
29
 
30
+ # A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
31
+ attr_accessor :pulp_labels
32
+
29
33
  # Artifact file representing the physical content
30
34
  attr_accessor :artifact
31
35
 
@@ -45,6 +49,7 @@ module PulpOstreeClient
45
49
  :'prn' => :'prn',
46
50
  :'pulp_created' => :'pulp_created',
47
51
  :'pulp_last_updated' => :'pulp_last_updated',
52
+ :'pulp_labels' => :'pulp_labels',
48
53
  :'artifact' => :'artifact',
49
54
  :'relative_path' => :'relative_path',
50
55
  :'parent_commit' => :'parent_commit',
@@ -53,13 +58,19 @@ module PulpOstreeClient
53
58
  }
54
59
  end
55
60
 
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ attribute_map.values
64
+ end
65
+
56
66
  # Attribute type mapping.
57
67
  def self.openapi_types
58
68
  {
59
69
  :'pulp_href' => :'String',
60
70
  :'prn' => :'String',
61
- :'pulp_created' => :'DateTime',
62
- :'pulp_last_updated' => :'DateTime',
71
+ :'pulp_created' => :'Time',
72
+ :'pulp_last_updated' => :'Time',
73
+ :'pulp_labels' => :'Hash<String, String>',
63
74
  :'artifact' => :'String',
64
75
  :'relative_path' => :'String',
65
76
  :'parent_commit' => :'String',
@@ -106,12 +117,22 @@ module PulpOstreeClient
106
117
  self.pulp_last_updated = attributes[:'pulp_last_updated']
107
118
  end
108
119
 
120
+ if attributes.key?(:'pulp_labels')
121
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
122
+ self.pulp_labels = value
123
+ end
124
+ end
125
+
109
126
  if attributes.key?(:'artifact')
110
127
  self.artifact = attributes[:'artifact']
128
+ else
129
+ self.artifact = nil
111
130
  end
112
131
 
113
132
  if attributes.key?(:'relative_path')
114
133
  self.relative_path = attributes[:'relative_path']
134
+ else
135
+ self.relative_path = nil
115
136
  end
116
137
 
117
138
  if attributes.key?(:'parent_commit')
@@ -120,18 +141,23 @@ module PulpOstreeClient
120
141
 
121
142
  if attributes.key?(:'checksum')
122
143
  self.checksum = attributes[:'checksum']
144
+ else
145
+ self.checksum = nil
123
146
  end
124
147
 
125
148
  if attributes.key?(:'objs')
126
149
  if (value = attributes[:'objs']).is_a?(Array)
127
150
  self.objs = value
128
151
  end
152
+ else
153
+ self.objs = nil
129
154
  end
130
155
  end
131
156
 
132
157
  # Show invalid properties with the reasons. Usually used together with valid?
133
158
  # @return Array for valid properties with the reasons
134
159
  def list_invalid_properties
160
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
135
161
  invalid_properties = Array.new
136
162
  if @artifact.nil?
137
163
  invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
@@ -155,6 +181,7 @@ module PulpOstreeClient
155
181
  # Check to see if the all the properties in the model are valid
156
182
  # @return true if the model is valid
157
183
  def valid?
184
+ warn '[DEPRECATED] the `valid?` method is obsolete'
158
185
  return false if @artifact.nil?
159
186
  return false if @relative_path.nil?
160
187
  return false if @checksum.nil?
@@ -171,6 +198,7 @@ module PulpOstreeClient
171
198
  prn == o.prn &&
172
199
  pulp_created == o.pulp_created &&
173
200
  pulp_last_updated == o.pulp_last_updated &&
201
+ pulp_labels == o.pulp_labels &&
174
202
  artifact == o.artifact &&
175
203
  relative_path == o.relative_path &&
176
204
  parent_commit == o.parent_commit &&
@@ -187,44 +215,40 @@ module PulpOstreeClient
187
215
  # Calculates hash code according to all attributes.
188
216
  # @return [Integer] Hash code
189
217
  def hash
190
- [pulp_href, prn, pulp_created, pulp_last_updated, artifact, relative_path, parent_commit, checksum, objs].hash
218
+ [pulp_href, prn, pulp_created, pulp_last_updated, pulp_labels, artifact, relative_path, parent_commit, checksum, objs].hash
191
219
  end
192
220
 
193
221
  # Builds the object from hash
194
222
  # @param [Hash] attributes Model attributes in the form of hash
195
223
  # @return [Object] Returns the model itself
196
224
  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
225
  return nil unless attributes.is_a?(Hash)
205
- self.class.openapi_types.each_pair do |key, type|
206
- if type =~ /\AArray<(.*)>/i
226
+ attributes = attributes.transform_keys(&:to_sym)
227
+ transformed_hash = {}
228
+ openapi_types.each_pair do |key, type|
229
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
230
+ transformed_hash["#{key}"] = nil
231
+ elsif type =~ /\AArray<(.*)>/i
207
232
  # check to ensure the input is an array given that the attribute
208
233
  # 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) })
234
+ if attributes[attribute_map[key]].is_a?(Array)
235
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
211
236
  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
237
+ elsif !attributes[attribute_map[key]].nil?
238
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
239
+ end
215
240
  end
216
-
217
- self
241
+ new(transformed_hash)
218
242
  end
219
243
 
220
244
  # Deserializes the data based on type
221
245
  # @param string type Data type
222
246
  # @param string value Value to be deserialized
223
247
  # @return [Object] Deserialized data
224
- def _deserialize(type, value)
248
+ def self._deserialize(type, value)
225
249
  case type.to_sym
226
- when :DateTime
227
- DateTime.parse(value)
250
+ when :Time
251
+ Time.parse(value)
228
252
  when :Date
229
253
  Date.parse(value)
230
254
  when :String
@@ -254,7 +278,9 @@ module PulpOstreeClient
254
278
  end
255
279
  end
256
280
  else # model
257
- PulpOstreeClient.const_get(type).build_from_hash(value)
281
+ # models (e.g. Pet) or oneOf
282
+ klass = PulpOstreeClient.const_get(type)
283
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
258
284
  end
259
285
  end
260
286
 
@@ -280,7 +306,7 @@ module PulpOstreeClient
280
306
  is_nullable = self.class.openapi_nullable.include?(attr)
281
307
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
282
308
  end
283
-
309
+
284
310
  hash[param] = _to_hash(value)
285
311
  end
286
312
  hash
@@ -303,5 +329,7 @@ module PulpOstreeClient
303
329
  value
304
330
  end
305
331
  end
332
+
306
333
  end
334
+
307
335
  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.
@@ -26,6 +27,9 @@ module PulpOstreeClient
26
27
  # Timestamp of the last time this resource was updated. Note: for immutable resources - like content, repository versions, and publication - pulp_created and pulp_last_updated dates will be the same.
27
28
  attr_accessor :pulp_last_updated
28
29
 
30
+ # A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
31
+ attr_accessor :pulp_labels
32
+
29
33
  # Artifact file representing the physical content
30
34
  attr_accessor :artifact
31
35
 
@@ -39,18 +43,25 @@ module PulpOstreeClient
39
43
  :'prn' => :'prn',
40
44
  :'pulp_created' => :'pulp_created',
41
45
  :'pulp_last_updated' => :'pulp_last_updated',
46
+ :'pulp_labels' => :'pulp_labels',
42
47
  :'artifact' => :'artifact',
43
48
  :'relative_path' => :'relative_path'
44
49
  }
45
50
  end
46
51
 
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
47
57
  # Attribute type mapping.
48
58
  def self.openapi_types
49
59
  {
50
60
  :'pulp_href' => :'String',
51
61
  :'prn' => :'String',
52
- :'pulp_created' => :'DateTime',
53
- :'pulp_last_updated' => :'DateTime',
62
+ :'pulp_created' => :'Time',
63
+ :'pulp_last_updated' => :'Time',
64
+ :'pulp_labels' => :'Hash<String, String>',
54
65
  :'artifact' => :'String',
55
66
  :'relative_path' => :'String'
56
67
  }
@@ -93,18 +104,29 @@ module PulpOstreeClient
93
104
  self.pulp_last_updated = attributes[:'pulp_last_updated']
94
105
  end
95
106
 
107
+ if attributes.key?(:'pulp_labels')
108
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
109
+ self.pulp_labels = value
110
+ end
111
+ end
112
+
96
113
  if attributes.key?(:'artifact')
97
114
  self.artifact = attributes[:'artifact']
115
+ else
116
+ self.artifact = nil
98
117
  end
99
118
 
100
119
  if attributes.key?(:'relative_path')
101
120
  self.relative_path = attributes[:'relative_path']
121
+ else
122
+ self.relative_path = nil
102
123
  end
103
124
  end
104
125
 
105
126
  # Show invalid properties with the reasons. Usually used together with valid?
106
127
  # @return Array for valid properties with the reasons
107
128
  def list_invalid_properties
129
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
130
  invalid_properties = Array.new
109
131
  if @artifact.nil?
110
132
  invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
@@ -120,6 +142,7 @@ module PulpOstreeClient
120
142
  # Check to see if the all the properties in the model are valid
121
143
  # @return true if the model is valid
122
144
  def valid?
145
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
146
  return false if @artifact.nil?
124
147
  return false if @relative_path.nil?
125
148
  true
@@ -134,6 +157,7 @@ module PulpOstreeClient
134
157
  prn == o.prn &&
135
158
  pulp_created == o.pulp_created &&
136
159
  pulp_last_updated == o.pulp_last_updated &&
160
+ pulp_labels == o.pulp_labels &&
137
161
  artifact == o.artifact &&
138
162
  relative_path == o.relative_path
139
163
  end
@@ -147,44 +171,40 @@ module PulpOstreeClient
147
171
  # Calculates hash code according to all attributes.
148
172
  # @return [Integer] Hash code
149
173
  def hash
150
- [pulp_href, prn, pulp_created, pulp_last_updated, artifact, relative_path].hash
174
+ [pulp_href, prn, pulp_created, pulp_last_updated, pulp_labels, artifact, relative_path].hash
151
175
  end
152
176
 
153
177
  # Builds the object from hash
154
178
  # @param [Hash] attributes Model attributes in the form of hash
155
179
  # @return [Object] Returns the model itself
156
180
  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
181
  return nil unless attributes.is_a?(Hash)
165
- self.class.openapi_types.each_pair do |key, type|
166
- if type =~ /\AArray<(.*)>/i
182
+ attributes = attributes.transform_keys(&:to_sym)
183
+ transformed_hash = {}
184
+ openapi_types.each_pair do |key, type|
185
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = nil
187
+ elsif type =~ /\AArray<(.*)>/i
167
188
  # check to ensure the input is an array given that the attribute
168
189
  # 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) })
190
+ if attributes[attribute_map[key]].is_a?(Array)
191
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
171
192
  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
193
+ elsif !attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
195
+ end
175
196
  end
176
-
177
- self
197
+ new(transformed_hash)
178
198
  end
179
199
 
180
200
  # Deserializes the data based on type
181
201
  # @param string type Data type
182
202
  # @param string value Value to be deserialized
183
203
  # @return [Object] Deserialized data
184
- def _deserialize(type, value)
204
+ def self._deserialize(type, value)
185
205
  case type.to_sym
186
- when :DateTime
187
- DateTime.parse(value)
206
+ when :Time
207
+ Time.parse(value)
188
208
  when :Date
189
209
  Date.parse(value)
190
210
  when :String
@@ -214,7 +234,9 @@ module PulpOstreeClient
214
234
  end
215
235
  end
216
236
  else # model
217
- PulpOstreeClient.const_get(type).build_from_hash(value)
237
+ # models (e.g. Pet) or oneOf
238
+ klass = PulpOstreeClient.const_get(type)
239
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
218
240
  end
219
241
  end
220
242
 
@@ -240,7 +262,7 @@ module PulpOstreeClient
240
262
  is_nullable = self.class.openapi_nullable.include?(attr)
241
263
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
264
  end
243
-
265
+
244
266
  hash[param] = _to_hash(value)
245
267
  end
246
268
  hash
@@ -263,5 +285,7 @@ module PulpOstreeClient
263
285
  value
264
286
  end
265
287
  end
288
+
266
289
  end
290
+
267
291
  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).
@@ -18,6 +19,9 @@ module PulpOstreeClient
18
19
  # A URI of a repository the new content unit should be associated with.
19
20
  attr_accessor :repository
20
21
 
22
+ # A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
23
+ attr_accessor :pulp_labels
24
+
21
25
  # Artifact file representing the physical content
22
26
  attr_accessor :artifact
23
27
 
@@ -29,16 +33,23 @@ module PulpOstreeClient
29
33
  def self.attribute_map
30
34
  {
31
35
  :'repository' => :'repository',
36
+ :'pulp_labels' => :'pulp_labels',
32
37
  :'artifact' => :'artifact',
33
38
  :'relative_path' => :'relative_path',
34
39
  :'digest' => :'digest'
35
40
  }
36
41
  end
37
42
 
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ attribute_map.values
46
+ end
47
+
38
48
  # Attribute type mapping.
39
49
  def self.openapi_types
40
50
  {
41
51
  :'repository' => :'String',
52
+ :'pulp_labels' => :'Hash<String, String>',
42
53
  :'artifact' => :'String',
43
54
  :'relative_path' => :'String',
44
55
  :'digest' => :'String'
@@ -70,22 +81,35 @@ module PulpOstreeClient
70
81
  self.repository = attributes[:'repository']
71
82
  end
72
83
 
84
+ if attributes.key?(:'pulp_labels')
85
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
86
+ self.pulp_labels = value
87
+ end
88
+ end
89
+
73
90
  if attributes.key?(:'artifact')
74
91
  self.artifact = attributes[:'artifact']
92
+ else
93
+ self.artifact = nil
75
94
  end
76
95
 
77
96
  if attributes.key?(:'relative_path')
78
97
  self.relative_path = attributes[:'relative_path']
98
+ else
99
+ self.relative_path = nil
79
100
  end
80
101
 
81
102
  if attributes.key?(:'digest')
82
103
  self.digest = attributes[:'digest']
104
+ else
105
+ self.digest = nil
83
106
  end
84
107
  end
85
108
 
86
109
  # Show invalid properties with the reasons. Usually used together with valid?
87
110
  # @return Array for valid properties with the reasons
88
111
  def list_invalid_properties
112
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
113
  invalid_properties = Array.new
90
114
  if @artifact.nil?
91
115
  invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
@@ -113,6 +137,7 @@ module PulpOstreeClient
113
137
  # Check to see if the all the properties in the model are valid
114
138
  # @return true if the model is valid
115
139
  def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
116
141
  return false if @artifact.nil?
117
142
  return false if @relative_path.nil?
118
143
  return false if @relative_path.to_s.length < 1
@@ -155,6 +180,7 @@ module PulpOstreeClient
155
180
  return true if self.equal?(o)
156
181
  self.class == o.class &&
157
182
  repository == o.repository &&
183
+ pulp_labels == o.pulp_labels &&
158
184
  artifact == o.artifact &&
159
185
  relative_path == o.relative_path &&
160
186
  digest == o.digest
@@ -169,44 +195,40 @@ module PulpOstreeClient
169
195
  # Calculates hash code according to all attributes.
170
196
  # @return [Integer] Hash code
171
197
  def hash
172
- [repository, artifact, relative_path, digest].hash
198
+ [repository, pulp_labels, artifact, relative_path, digest].hash
173
199
  end
174
200
 
175
201
  # Builds the object from hash
176
202
  # @param [Hash] attributes Model attributes in the form of hash
177
203
  # @return [Object] Returns the model itself
178
204
  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
205
  return nil unless attributes.is_a?(Hash)
187
- self.class.openapi_types.each_pair do |key, type|
188
- if type =~ /\AArray<(.*)>/i
206
+ attributes = attributes.transform_keys(&:to_sym)
207
+ transformed_hash = {}
208
+ openapi_types.each_pair do |key, type|
209
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = nil
211
+ elsif type =~ /\AArray<(.*)>/i
189
212
  # check to ensure the input is an array given that the attribute
190
213
  # 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) })
214
+ if attributes[attribute_map[key]].is_a?(Array)
215
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
216
  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
217
+ elsif !attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
+ end
197
220
  end
198
-
199
- self
221
+ new(transformed_hash)
200
222
  end
201
223
 
202
224
  # Deserializes the data based on type
203
225
  # @param string type Data type
204
226
  # @param string value Value to be deserialized
205
227
  # @return [Object] Deserialized data
206
- def _deserialize(type, value)
228
+ def self._deserialize(type, value)
207
229
  case type.to_sym
208
- when :DateTime
209
- DateTime.parse(value)
230
+ when :Time
231
+ Time.parse(value)
210
232
  when :Date
211
233
  Date.parse(value)
212
234
  when :String
@@ -236,7 +258,9 @@ module PulpOstreeClient
236
258
  end
237
259
  end
238
260
  else # model
239
- PulpOstreeClient.const_get(type).build_from_hash(value)
261
+ # models (e.g. Pet) or oneOf
262
+ klass = PulpOstreeClient.const_get(type)
263
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
240
264
  end
241
265
  end
242
266
 
@@ -262,7 +286,7 @@ module PulpOstreeClient
262
286
  is_nullable = self.class.openapi_nullable.include?(attr)
263
287
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
264
288
  end
265
-
289
+
266
290
  hash[param] = _to_hash(value)
267
291
  end
268
292
  hash
@@ -285,5 +309,7 @@ module PulpOstreeClient
285
309
  value
286
310
  end
287
311
  end
312
+
288
313
  end
314
+
289
315
  end