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.
- checksums.yaml +4 -4
- data/README.md +29 -12
- data/docs/AsyncOperationResponse.md +8 -7
- data/docs/ContentCommitsApi.md +228 -47
- data/docs/ContentConfigsApi.md +227 -46
- data/docs/ContentContentApi.md +255 -57
- data/docs/ContentObjectsApi.md +228 -47
- data/docs/ContentRefsApi.md +238 -57
- data/docs/ContentSummariesApi.md +227 -46
- data/docs/ContentSummaryResponse.md +12 -11
- data/docs/DistributionsOstreeApi.md +387 -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 +26 -23
- data/docs/OstreeOstreeConfigResponse.md +20 -17
- data/docs/OstreeOstreeContent.md +16 -13
- data/docs/OstreeOstreeContentResponse.md +22 -19
- data/docs/OstreeOstreeDistribution.md +20 -19
- data/docs/OstreeOstreeDistributionResponse.md +32 -31
- data/docs/OstreeOstreeObjectResponse.md +24 -21
- data/docs/OstreeOstreeRefResponse.md +26 -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 +20 -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 +165 -12
- data/lib/pulp_ostree_client/api/content_configs_api.rb +162 -9
- data/lib/pulp_ostree_client/api/content_content_api.rb +171 -14
- data/lib/pulp_ostree_client/api/content_objects_api.rb +165 -12
- data/lib/pulp_ostree_client/api/content_refs_api.rb +165 -12
- data/lib/pulp_ostree_client/api/content_summaries_api.rb +162 -9
- data/lib/pulp_ostree_client/api/distributions_ostree_api.rb +95 -59
- 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 +53 -25
- data/lib/pulp_ostree_client/models/ostree_ostree_config_response.rb +49 -25
- data/lib/pulp_ostree_client/models/ostree_ostree_content.rb +49 -23
- data/lib/pulp_ostree_client/models/ostree_ostree_content_response.rb +51 -25
- 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 +53 -25
- data/lib/pulp_ostree_client/models/ostree_ostree_ref_response.rb +53 -25
- 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 +49 -25
- 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 +33 -23
- data/lib/pulp_ostree_client/models/unset_label_response.rb +33 -23
- 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 +31 -4
- data/spec/api/content_configs_api_spec.rb +30 -3
- data/spec/api/content_content_api_spec.rb +31 -4
- data/spec/api/content_objects_api_spec.rb +31 -4
- data/spec/api/content_refs_api_spec.rb +31 -4
- data/spec/api/content_summaries_api_spec.rb +30 -3
- data/spec/api/distributions_ostree_api_spec.rb +15 -14
- 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 +21 -20
- data/spec/models/ostree_ostree_config_response_spec.rb +18 -17
- data/spec/models/ostree_ostree_content_response_spec.rb +19 -18
- data/spec/models/ostree_ostree_content_spec.rb +16 -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 +20 -19
- data/spec/models/ostree_ostree_ref_response_spec.rb +21 -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 +18 -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 +83 -59
- 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 OSTree head 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
|
:'commit' => :'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' => :'
|
62
|
-
:'pulp_last_updated' => :'
|
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
|
:'commit' => :'String',
|
@@ -105,16 +116,28 @@ module PulpOstreeClient
|
|
105
116
|
self.pulp_last_updated = attributes[:'pulp_last_updated']
|
106
117
|
end
|
107
118
|
|
119
|
+
if attributes.key?(:'pulp_labels')
|
120
|
+
if (value = attributes[:'pulp_labels']).is_a?(Hash)
|
121
|
+
self.pulp_labels = value
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
108
125
|
if attributes.key?(:'artifact')
|
109
126
|
self.artifact = attributes[:'artifact']
|
127
|
+
else
|
128
|
+
self.artifact = nil
|
110
129
|
end
|
111
130
|
|
112
131
|
if attributes.key?(:'relative_path')
|
113
132
|
self.relative_path = attributes[:'relative_path']
|
133
|
+
else
|
134
|
+
self.relative_path = nil
|
114
135
|
end
|
115
136
|
|
116
137
|
if attributes.key?(:'commit')
|
117
138
|
self.commit = attributes[:'commit']
|
139
|
+
else
|
140
|
+
self.commit = nil
|
118
141
|
end
|
119
142
|
|
120
143
|
if attributes.key?(:'checksum')
|
@@ -123,12 +146,15 @@ module PulpOstreeClient
|
|
123
146
|
|
124
147
|
if attributes.key?(:'name')
|
125
148
|
self.name = attributes[:'name']
|
149
|
+
else
|
150
|
+
self.name = nil
|
126
151
|
end
|
127
152
|
end
|
128
153
|
|
129
154
|
# Show invalid properties with the reasons. Usually used together with valid?
|
130
155
|
# @return Array for valid properties with the reasons
|
131
156
|
def list_invalid_properties
|
157
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
132
158
|
invalid_properties = Array.new
|
133
159
|
if @artifact.nil?
|
134
160
|
invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
|
@@ -152,6 +178,7 @@ module PulpOstreeClient
|
|
152
178
|
# Check to see if the all the properties in the model are valid
|
153
179
|
# @return true if the model is valid
|
154
180
|
def valid?
|
181
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
155
182
|
return false if @artifact.nil?
|
156
183
|
return false if @relative_path.nil?
|
157
184
|
return false if @commit.nil?
|
@@ -168,6 +195,7 @@ module PulpOstreeClient
|
|
168
195
|
prn == o.prn &&
|
169
196
|
pulp_created == o.pulp_created &&
|
170
197
|
pulp_last_updated == o.pulp_last_updated &&
|
198
|
+
pulp_labels == o.pulp_labels &&
|
171
199
|
artifact == o.artifact &&
|
172
200
|
relative_path == o.relative_path &&
|
173
201
|
commit == o.commit &&
|
@@ -184,44 +212,40 @@ module PulpOstreeClient
|
|
184
212
|
# Calculates hash code according to all attributes.
|
185
213
|
# @return [Integer] Hash code
|
186
214
|
def hash
|
187
|
-
[pulp_href, prn, pulp_created, pulp_last_updated, artifact, relative_path, commit, checksum, name].hash
|
215
|
+
[pulp_href, prn, pulp_created, pulp_last_updated, pulp_labels, artifact, relative_path, commit, checksum, name].hash
|
188
216
|
end
|
189
217
|
|
190
218
|
# Builds the object from hash
|
191
219
|
# @param [Hash] attributes Model attributes in the form of hash
|
192
220
|
# @return [Object] Returns the model itself
|
193
221
|
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
222
|
return nil unless attributes.is_a?(Hash)
|
202
|
-
|
203
|
-
|
223
|
+
attributes = attributes.transform_keys(&:to_sym)
|
224
|
+
transformed_hash = {}
|
225
|
+
openapi_types.each_pair do |key, type|
|
226
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
227
|
+
transformed_hash["#{key}"] = nil
|
228
|
+
elsif type =~ /\AArray<(.*)>/i
|
204
229
|
# check to ensure the input is an array given that the attribute
|
205
230
|
# is documented as an array but the input is not
|
206
|
-
if attributes[
|
207
|
-
|
231
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
232
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
208
233
|
end
|
209
|
-
elsif !attributes[
|
210
|
-
|
211
|
-
end
|
234
|
+
elsif !attributes[attribute_map[key]].nil?
|
235
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
236
|
+
end
|
212
237
|
end
|
213
|
-
|
214
|
-
self
|
238
|
+
new(transformed_hash)
|
215
239
|
end
|
216
240
|
|
217
241
|
# Deserializes the data based on type
|
218
242
|
# @param string type Data type
|
219
243
|
# @param string value Value to be deserialized
|
220
244
|
# @return [Object] Deserialized data
|
221
|
-
def _deserialize(type, value)
|
245
|
+
def self._deserialize(type, value)
|
222
246
|
case type.to_sym
|
223
|
-
when :
|
224
|
-
|
247
|
+
when :Time
|
248
|
+
Time.parse(value)
|
225
249
|
when :Date
|
226
250
|
Date.parse(value)
|
227
251
|
when :String
|
@@ -251,7 +275,9 @@ module PulpOstreeClient
|
|
251
275
|
end
|
252
276
|
end
|
253
277
|
else # model
|
254
|
-
|
278
|
+
# models (e.g. Pet) or oneOf
|
279
|
+
klass = PulpOstreeClient.const_get(type)
|
280
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
255
281
|
end
|
256
282
|
end
|
257
283
|
|
@@ -277,7 +303,7 @@ module PulpOstreeClient
|
|
277
303
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
278
304
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
279
305
|
end
|
280
|
-
|
306
|
+
|
281
307
|
hash[param] = _to_hash(value)
|
282
308
|
end
|
283
309
|
hash
|
@@ -300,5 +326,7 @@ module PulpOstreeClient
|
|
300
326
|
value
|
301
327
|
end
|
302
328
|
end
|
329
|
+
|
303
330
|
end
|
331
|
+
|
304
332
|
end
|
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
Contact: pulp-list@redhat.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
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 a remote OSTree repository.
|
@@ -86,6 +87,28 @@ module PulpOstreeClient
|
|
86
87
|
# A list of tags to exclude during a sync. The wildcards *, ? are recognized. 'exclude_refs' is evaluated after 'include_refs'.
|
87
88
|
attr_accessor :exclude_refs
|
88
89
|
|
90
|
+
class EnumAttributeValidator
|
91
|
+
attr_reader :datatype
|
92
|
+
attr_reader :allowable_values
|
93
|
+
|
94
|
+
def initialize(datatype, allowable_values)
|
95
|
+
@allowable_values = allowable_values.map do |value|
|
96
|
+
case datatype.to_s
|
97
|
+
when /Integer/i
|
98
|
+
value.to_i
|
99
|
+
when /Float/i
|
100
|
+
value.to_f
|
101
|
+
else
|
102
|
+
value
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def valid?(value)
|
108
|
+
!value || allowable_values.include?(value)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
89
112
|
# Attribute mapping from ruby-style variable name to JSON key.
|
90
113
|
def self.attribute_map
|
91
114
|
{
|
@@ -116,6 +139,11 @@ module PulpOstreeClient
|
|
116
139
|
}
|
117
140
|
end
|
118
141
|
|
142
|
+
# Returns all the JSON keys this model knows about
|
143
|
+
def self.acceptable_attributes
|
144
|
+
attribute_map.values
|
145
|
+
end
|
146
|
+
|
119
147
|
# Attribute type mapping.
|
120
148
|
def self.openapi_types
|
121
149
|
{
|
@@ -186,10 +214,14 @@ module PulpOstreeClient
|
|
186
214
|
|
187
215
|
if attributes.key?(:'name')
|
188
216
|
self.name = attributes[:'name']
|
217
|
+
else
|
218
|
+
self.name = nil
|
189
219
|
end
|
190
220
|
|
191
221
|
if attributes.key?(:'url')
|
192
222
|
self.url = attributes[:'url']
|
223
|
+
else
|
224
|
+
self.url = nil
|
193
225
|
end
|
194
226
|
|
195
227
|
if attributes.key?(:'ca_cert')
|
@@ -294,6 +326,7 @@ module PulpOstreeClient
|
|
294
326
|
# Show invalid properties with the reasons. Usually used together with valid?
|
295
327
|
# @return Array for valid properties with the reasons
|
296
328
|
def list_invalid_properties
|
329
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
297
330
|
invalid_properties = Array.new
|
298
331
|
if @name.nil?
|
299
332
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
@@ -373,6 +406,7 @@ module PulpOstreeClient
|
|
373
406
|
# Check to see if the all the properties in the model are valid
|
374
407
|
# @return true if the model is valid
|
375
408
|
def valid?
|
409
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
376
410
|
return false if @name.nil?
|
377
411
|
return false if @name.to_s.length < 1
|
378
412
|
return false if @url.nil?
|
@@ -555,7 +589,11 @@ module PulpOstreeClient
|
|
555
589
|
# Custom attribute writer method with validation
|
556
590
|
# @param [Object] depth Value to be assigned
|
557
591
|
def depth=(depth)
|
558
|
-
if
|
592
|
+
if depth.nil?
|
593
|
+
fail ArgumentError, 'depth cannot be nil'
|
594
|
+
end
|
595
|
+
|
596
|
+
if depth < 0
|
559
597
|
fail ArgumentError, 'invalid value for "depth", must be greater than or equal to 0.'
|
560
598
|
end
|
561
599
|
|
@@ -609,37 +647,33 @@ module PulpOstreeClient
|
|
609
647
|
# @param [Hash] attributes Model attributes in the form of hash
|
610
648
|
# @return [Object] Returns the model itself
|
611
649
|
def self.build_from_hash(attributes)
|
612
|
-
new.build_from_hash(attributes)
|
613
|
-
end
|
614
|
-
|
615
|
-
# Builds the object from hash
|
616
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
617
|
-
# @return [Object] Returns the model itself
|
618
|
-
def build_from_hash(attributes)
|
619
650
|
return nil unless attributes.is_a?(Hash)
|
620
|
-
|
621
|
-
|
651
|
+
attributes = attributes.transform_keys(&:to_sym)
|
652
|
+
transformed_hash = {}
|
653
|
+
openapi_types.each_pair do |key, type|
|
654
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
655
|
+
transformed_hash["#{key}"] = nil
|
656
|
+
elsif type =~ /\AArray<(.*)>/i
|
622
657
|
# check to ensure the input is an array given that the attribute
|
623
658
|
# is documented as an array but the input is not
|
624
|
-
if attributes[
|
625
|
-
|
659
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
660
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
626
661
|
end
|
627
|
-
elsif !attributes[
|
628
|
-
|
629
|
-
end
|
662
|
+
elsif !attributes[attribute_map[key]].nil?
|
663
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
664
|
+
end
|
630
665
|
end
|
631
|
-
|
632
|
-
self
|
666
|
+
new(transformed_hash)
|
633
667
|
end
|
634
668
|
|
635
669
|
# Deserializes the data based on type
|
636
670
|
# @param string type Data type
|
637
671
|
# @param string value Value to be deserialized
|
638
672
|
# @return [Object] Deserialized data
|
639
|
-
def _deserialize(type, value)
|
673
|
+
def self._deserialize(type, value)
|
640
674
|
case type.to_sym
|
641
|
-
when :
|
642
|
-
|
675
|
+
when :Time
|
676
|
+
Time.parse(value)
|
643
677
|
when :Date
|
644
678
|
Date.parse(value)
|
645
679
|
when :String
|
@@ -669,7 +703,9 @@ module PulpOstreeClient
|
|
669
703
|
end
|
670
704
|
end
|
671
705
|
else # model
|
672
|
-
|
706
|
+
# models (e.g. Pet) or oneOf
|
707
|
+
klass = PulpOstreeClient.const_get(type)
|
708
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
673
709
|
end
|
674
710
|
end
|
675
711
|
|
@@ -695,7 +731,7 @@ module PulpOstreeClient
|
|
695
731
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
696
732
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
697
733
|
end
|
698
|
-
|
734
|
+
|
699
735
|
hash[param] = _to_hash(value)
|
700
736
|
end
|
701
737
|
hash
|
@@ -718,5 +754,7 @@ module PulpOstreeClient
|
|
718
754
|
value
|
719
755
|
end
|
720
756
|
end
|
757
|
+
|
721
758
|
end
|
759
|
+
|
722
760
|
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 a remote OSTree repository.
|
@@ -85,6 +86,28 @@ module PulpOstreeClient
|
|
85
86
|
# A list of tags to exclude during a sync. The wildcards *, ? are recognized. 'exclude_refs' is evaluated after 'include_refs'.
|
86
87
|
attr_accessor :exclude_refs
|
87
88
|
|
89
|
+
class EnumAttributeValidator
|
90
|
+
attr_reader :datatype
|
91
|
+
attr_reader :allowable_values
|
92
|
+
|
93
|
+
def initialize(datatype, allowable_values)
|
94
|
+
@allowable_values = allowable_values.map do |value|
|
95
|
+
case datatype.to_s
|
96
|
+
when /Integer/i
|
97
|
+
value.to_i
|
98
|
+
when /Float/i
|
99
|
+
value.to_f
|
100
|
+
else
|
101
|
+
value
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
def valid?(value)
|
107
|
+
!value || allowable_values.include?(value)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
88
111
|
# Attribute mapping from ruby-style variable name to JSON key.
|
89
112
|
def self.attribute_map
|
90
113
|
{
|
@@ -115,13 +138,18 @@ module PulpOstreeClient
|
|
115
138
|
}
|
116
139
|
end
|
117
140
|
|
141
|
+
# Returns all the JSON keys this model knows about
|
142
|
+
def self.acceptable_attributes
|
143
|
+
attribute_map.values
|
144
|
+
end
|
145
|
+
|
118
146
|
# Attribute type mapping.
|
119
147
|
def self.openapi_types
|
120
148
|
{
|
121
149
|
:'pulp_href' => :'String',
|
122
150
|
:'prn' => :'String',
|
123
|
-
:'pulp_created' => :'
|
124
|
-
:'pulp_last_updated' => :'
|
151
|
+
:'pulp_created' => :'Time',
|
152
|
+
:'pulp_last_updated' => :'Time',
|
125
153
|
:'name' => :'String',
|
126
154
|
:'url' => :'String',
|
127
155
|
:'ca_cert' => :'String',
|
@@ -138,7 +166,7 @@ module PulpOstreeClient
|
|
138
166
|
:'sock_read_timeout' => :'Float',
|
139
167
|
:'headers' => :'Array<Object>',
|
140
168
|
:'rate_limit' => :'Integer',
|
141
|
-
:'hidden_fields' => :'Array<
|
169
|
+
:'hidden_fields' => :'Array<OstreeOstreeRemoteResponseHiddenFieldsInner>',
|
142
170
|
:'depth' => :'Integer',
|
143
171
|
:'include_refs' => :'Array<String>',
|
144
172
|
:'exclude_refs' => :'Array<String>'
|
@@ -196,10 +224,14 @@ module PulpOstreeClient
|
|
196
224
|
|
197
225
|
if attributes.key?(:'name')
|
198
226
|
self.name = attributes[:'name']
|
227
|
+
else
|
228
|
+
self.name = nil
|
199
229
|
end
|
200
230
|
|
201
231
|
if attributes.key?(:'url')
|
202
232
|
self.url = attributes[:'url']
|
233
|
+
else
|
234
|
+
self.url = nil
|
203
235
|
end
|
204
236
|
|
205
237
|
if attributes.key?(:'ca_cert')
|
@@ -290,6 +322,7 @@ module PulpOstreeClient
|
|
290
322
|
# Show invalid properties with the reasons. Usually used together with valid?
|
291
323
|
# @return Array for valid properties with the reasons
|
292
324
|
def list_invalid_properties
|
325
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
293
326
|
invalid_properties = Array.new
|
294
327
|
if @name.nil?
|
295
328
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
@@ -329,6 +362,7 @@ module PulpOstreeClient
|
|
329
362
|
# Check to see if the all the properties in the model are valid
|
330
363
|
# @return true if the model is valid
|
331
364
|
def valid?
|
365
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
332
366
|
return false if @name.nil?
|
333
367
|
return false if @url.nil?
|
334
368
|
return false if !@download_concurrency.nil? && @download_concurrency < 1
|
@@ -393,7 +427,11 @@ module PulpOstreeClient
|
|
393
427
|
# Custom attribute writer method with validation
|
394
428
|
# @param [Object] depth Value to be assigned
|
395
429
|
def depth=(depth)
|
396
|
-
if
|
430
|
+
if depth.nil?
|
431
|
+
fail ArgumentError, 'depth cannot be nil'
|
432
|
+
end
|
433
|
+
|
434
|
+
if depth < 0
|
397
435
|
fail ArgumentError, 'invalid value for "depth", must be greater than or equal to 0.'
|
398
436
|
end
|
399
437
|
|
@@ -447,37 +485,33 @@ module PulpOstreeClient
|
|
447
485
|
# @param [Hash] attributes Model attributes in the form of hash
|
448
486
|
# @return [Object] Returns the model itself
|
449
487
|
def self.build_from_hash(attributes)
|
450
|
-
new.build_from_hash(attributes)
|
451
|
-
end
|
452
|
-
|
453
|
-
# Builds the object from hash
|
454
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
455
|
-
# @return [Object] Returns the model itself
|
456
|
-
def build_from_hash(attributes)
|
457
488
|
return nil unless attributes.is_a?(Hash)
|
458
|
-
|
459
|
-
|
489
|
+
attributes = attributes.transform_keys(&:to_sym)
|
490
|
+
transformed_hash = {}
|
491
|
+
openapi_types.each_pair do |key, type|
|
492
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
493
|
+
transformed_hash["#{key}"] = nil
|
494
|
+
elsif type =~ /\AArray<(.*)>/i
|
460
495
|
# check to ensure the input is an array given that the attribute
|
461
496
|
# is documented as an array but the input is not
|
462
|
-
if attributes[
|
463
|
-
|
497
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
498
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
464
499
|
end
|
465
|
-
elsif !attributes[
|
466
|
-
|
467
|
-
end
|
500
|
+
elsif !attributes[attribute_map[key]].nil?
|
501
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
502
|
+
end
|
468
503
|
end
|
469
|
-
|
470
|
-
self
|
504
|
+
new(transformed_hash)
|
471
505
|
end
|
472
506
|
|
473
507
|
# Deserializes the data based on type
|
474
508
|
# @param string type Data type
|
475
509
|
# @param string value Value to be deserialized
|
476
510
|
# @return [Object] Deserialized data
|
477
|
-
def _deserialize(type, value)
|
511
|
+
def self._deserialize(type, value)
|
478
512
|
case type.to_sym
|
479
|
-
when :
|
480
|
-
|
513
|
+
when :Time
|
514
|
+
Time.parse(value)
|
481
515
|
when :Date
|
482
516
|
Date.parse(value)
|
483
517
|
when :String
|
@@ -507,7 +541,9 @@ module PulpOstreeClient
|
|
507
541
|
end
|
508
542
|
end
|
509
543
|
else # model
|
510
|
-
|
544
|
+
# models (e.g. Pet) or oneOf
|
545
|
+
klass = PulpOstreeClient.const_get(type)
|
546
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
511
547
|
end
|
512
548
|
end
|
513
549
|
|
@@ -533,7 +569,7 @@ module PulpOstreeClient
|
|
533
569
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
534
570
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
535
571
|
end
|
536
|
-
|
572
|
+
|
537
573
|
hash[param] = _to_hash(value)
|
538
574
|
end
|
539
575
|
hash
|
@@ -556,5 +592,7 @@ module PulpOstreeClient
|
|
556
592
|
value
|
557
593
|
end
|
558
594
|
end
|
595
|
+
|
559
596
|
end
|
597
|
+
|
560
598
|
end
|