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