pulp_gem_client 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -8
- data/docs/AsyncOperationResponse.md +8 -7
- data/docs/ContentGemApi.md +118 -66
- data/docs/ContentSummaryResponse.md +12 -11
- data/docs/DistributionsGemApi.md +388 -183
- data/docs/GemGemContentResponse.md +32 -29
- data/docs/GemGemDistribution.md +22 -21
- data/docs/GemGemDistributionResponse.md +34 -29
- data/docs/GemGemPublication.md +10 -9
- data/docs/GemGemPublicationResponse.md +18 -15
- data/docs/GemGemRemote.md +54 -53
- data/docs/GemGemRemoteResponse.md +54 -51
- data/docs/GemGemRemoteResponseHiddenFieldsInner.md +20 -0
- data/docs/GemGemRepository.md +16 -15
- data/docs/GemGemRepositoryResponse.md +28 -25
- 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/PaginatedRepositoryVersionResponseList.md +14 -13
- data/docs/PaginatedgemGemContentResponseList.md +14 -13
- data/docs/PaginatedgemGemDistributionResponseList.md +14 -13
- data/docs/PaginatedgemGemPublicationResponseList.md +14 -13
- data/docs/PaginatedgemGemRemoteResponseList.md +14 -13
- data/docs/PaginatedgemGemRepositoryResponseList.md +14 -13
- data/docs/PatchedgemGemDistribution.md +22 -21
- data/docs/PatchedgemGemRemote.md +54 -53
- data/docs/PatchedgemGemRepository.md +16 -15
- data/docs/PolicyEnum.md +4 -5
- data/docs/PublicationsGemApi.md +271 -132
- data/docs/RemotesGemApi.md +392 -185
- data/docs/Repair.md +8 -7
- data/docs/RepositoriesGemApi.md +449 -210
- data/docs/RepositoriesGemVersionsApi.md +155 -83
- data/docs/RepositoryAddRemoveContent.md +12 -11
- data/docs/RepositorySyncURL.md +10 -9
- data/docs/RepositoryVersionResponse.md +22 -19
- 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_gem_client/api/content_gem_api.rb +31 -22
- data/lib/pulp_gem_client/api/distributions_gem_api.rb +94 -58
- data/lib/pulp_gem_client/api/publications_gem_api.rb +81 -58
- data/lib/pulp_gem_client/api/remotes_gem_api.rb +109 -70
- data/lib/pulp_gem_client/api/repositories_gem_api.rb +116 -72
- data/lib/pulp_gem_client/api/repositories_gem_versions_api.rb +50 -37
- data/lib/pulp_gem_client/api_client.rb +137 -102
- data/lib/pulp_gem_client/api_error.rb +2 -1
- data/lib/pulp_gem_client/configuration.rb +162 -21
- data/lib/pulp_gem_client/models/async_operation_response.rb +32 -22
- data/lib/pulp_gem_client/models/content_summary_response.rb +36 -22
- data/lib/pulp_gem_client/models/gem_gem_content_response.rb +45 -25
- data/lib/pulp_gem_client/models/gem_gem_distribution.rb +34 -22
- data/lib/pulp_gem_client/models/gem_gem_distribution_response.rb +57 -25
- data/lib/pulp_gem_client/models/gem_gem_publication.rb +30 -22
- data/lib/pulp_gem_client/models/gem_gem_publication_response.rb +43 -25
- data/lib/pulp_gem_client/models/gem_gem_remote.rb +56 -22
- data/lib/pulp_gem_client/models/gem_gem_remote_response.rb +70 -26
- data/lib/pulp_gem_client/models/{gem_gem_remote_response_hidden_fields.rb → gem_gem_remote_response_hidden_fields_inner.rb} +37 -25
- data/lib/pulp_gem_client/models/gem_gem_repository.rb +32 -22
- data/lib/pulp_gem_client/models/gem_gem_repository_response.rb +45 -25
- data/lib/pulp_gem_client/models/my_permissions_response.rb +32 -22
- data/lib/pulp_gem_client/models/nested_role.rb +32 -22
- data/lib/pulp_gem_client/models/nested_role_response.rb +32 -22
- data/lib/pulp_gem_client/models/object_roles_response.rb +32 -22
- data/lib/pulp_gem_client/models/paginated_repository_version_response_list.rb +34 -22
- data/lib/pulp_gem_client/models/paginatedgem_gem_content_response_list.rb +34 -22
- data/lib/pulp_gem_client/models/paginatedgem_gem_distribution_response_list.rb +34 -22
- data/lib/pulp_gem_client/models/paginatedgem_gem_publication_response_list.rb +34 -22
- data/lib/pulp_gem_client/models/paginatedgem_gem_remote_response_list.rb +34 -22
- data/lib/pulp_gem_client/models/paginatedgem_gem_repository_response_list.rb +34 -22
- data/lib/pulp_gem_client/models/patchedgem_gem_distribution.rb +40 -24
- data/lib/pulp_gem_client/models/patchedgem_gem_remote.rb +62 -24
- data/lib/pulp_gem_client/models/patchedgem_gem_repository.rb +35 -23
- data/lib/pulp_gem_client/models/policy_enum.rb +8 -4
- data/lib/pulp_gem_client/models/repair.rb +30 -22
- data/lib/pulp_gem_client/models/repository_add_remove_content.rb +31 -23
- data/lib/pulp_gem_client/models/repository_sync_url.rb +30 -22
- data/lib/pulp_gem_client/models/repository_version_response.rb +44 -26
- data/lib/pulp_gem_client/models/set_label.rb +34 -22
- data/lib/pulp_gem_client/models/set_label_response.rb +34 -22
- data/lib/pulp_gem_client/models/unset_label.rb +32 -22
- data/lib/pulp_gem_client/models/unset_label_response.rb +32 -22
- data/lib/pulp_gem_client/version.rb +2 -2
- data/lib/pulp_gem_client.rb +2 -3
- data/pulp_gem_client.gemspec +9 -6
- data/spec/api/content_gem_api_spec.rb +9 -8
- data/spec/api/distributions_gem_api_spec.rb +15 -14
- data/spec/api/publications_gem_api_spec.rb +22 -20
- data/spec/api/remotes_gem_api_spec.rb +22 -20
- data/spec/api/repositories_gem_api_spec.rb +19 -18
- data/spec/api/repositories_gem_versions_api_spec.rb +16 -14
- data/spec/models/async_operation_response_spec.rb +7 -12
- data/spec/models/content_summary_response_spec.rb +9 -14
- data/spec/models/gem_gem_content_response_spec.rb +24 -23
- data/spec/models/gem_gem_distribution_response_spec.rb +30 -23
- data/spec/models/gem_gem_distribution_spec.rb +14 -19
- data/spec/models/gem_gem_publication_response_spec.rb +17 -16
- data/spec/models/gem_gem_publication_spec.rb +8 -13
- data/spec/models/{gem_gem_remote_response_hidden_fields_spec.rb → gem_gem_remote_response_hidden_fields_inner_spec.rb} +11 -16
- data/spec/models/gem_gem_remote_response_spec.rb +35 -34
- data/spec/models/gem_gem_remote_spec.rb +30 -35
- data/spec/models/gem_gem_repository_response_spec.rb +22 -21
- data/spec/models/gem_gem_repository_spec.rb +11 -16
- 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/paginated_repository_version_response_list_spec.rb +10 -15
- data/spec/models/paginatedgem_gem_content_response_list_spec.rb +10 -15
- data/spec/models/paginatedgem_gem_distribution_response_list_spec.rb +10 -15
- data/spec/models/paginatedgem_gem_publication_response_list_spec.rb +10 -15
- data/spec/models/paginatedgem_gem_remote_response_list_spec.rb +10 -15
- data/spec/models/paginatedgem_gem_repository_response_list_spec.rb +10 -15
- data/spec/models/patchedgem_gem_distribution_spec.rb +14 -19
- data/spec/models/patchedgem_gem_remote_spec.rb +30 -35
- data/spec/models/patchedgem_gem_repository_spec.rb +11 -16
- 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 +19 -18
- 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 +80 -60
- data/docs/GemGemContent.md +0 -21
- data/docs/GemGemRemoteResponseHiddenFields.md +0 -19
- data/lib/pulp_gem_client/models/gem_gem_content.rb +0 -228
- data/spec/api_client_spec.rb +0 -188
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/gem_gem_content_spec.rb +0 -53
@@ -6,17 +6,21 @@
|
|
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 PulpGemClient
|
16
17
|
# A Serializer for GemContent.
|
17
18
|
class GemGemContentResponse
|
18
19
|
attr_accessor :pulp_href
|
19
20
|
|
21
|
+
# The Pulp Resource Name (PRN).
|
22
|
+
attr_accessor :prn
|
23
|
+
|
20
24
|
# Timestamp of creation.
|
21
25
|
attr_accessor :pulp_created
|
22
26
|
|
@@ -53,6 +57,7 @@ module PulpGemClient
|
|
53
57
|
def self.attribute_map
|
54
58
|
{
|
55
59
|
:'pulp_href' => :'pulp_href',
|
60
|
+
:'prn' => :'prn',
|
56
61
|
:'pulp_created' => :'pulp_created',
|
57
62
|
:'pulp_last_updated' => :'pulp_last_updated',
|
58
63
|
:'artifacts' => :'artifacts',
|
@@ -67,12 +72,18 @@ module PulpGemClient
|
|
67
72
|
}
|
68
73
|
end
|
69
74
|
|
75
|
+
# Returns all the JSON keys this model knows about
|
76
|
+
def self.acceptable_attributes
|
77
|
+
attribute_map.values
|
78
|
+
end
|
79
|
+
|
70
80
|
# Attribute type mapping.
|
71
81
|
def self.openapi_types
|
72
82
|
{
|
73
83
|
:'pulp_href' => :'String',
|
74
|
-
:'
|
75
|
-
:'
|
84
|
+
:'prn' => :'String',
|
85
|
+
:'pulp_created' => :'Time',
|
86
|
+
:'pulp_last_updated' => :'Time',
|
76
87
|
:'artifacts' => :'Object',
|
77
88
|
:'checksum' => :'String',
|
78
89
|
:'name' => :'String',
|
@@ -110,6 +121,10 @@ module PulpGemClient
|
|
110
121
|
self.pulp_href = attributes[:'pulp_href']
|
111
122
|
end
|
112
123
|
|
124
|
+
if attributes.key?(:'prn')
|
125
|
+
self.prn = attributes[:'prn']
|
126
|
+
end
|
127
|
+
|
113
128
|
if attributes.key?(:'pulp_created')
|
114
129
|
self.pulp_created = attributes[:'pulp_created']
|
115
130
|
end
|
@@ -120,6 +135,8 @@ module PulpGemClient
|
|
120
135
|
|
121
136
|
if attributes.key?(:'artifacts')
|
122
137
|
self.artifacts = attributes[:'artifacts']
|
138
|
+
else
|
139
|
+
self.artifacts = nil
|
123
140
|
end
|
124
141
|
|
125
142
|
if attributes.key?(:'checksum')
|
@@ -160,6 +177,7 @@ module PulpGemClient
|
|
160
177
|
# Show invalid properties with the reasons. Usually used together with valid?
|
161
178
|
# @return Array for valid properties with the reasons
|
162
179
|
def list_invalid_properties
|
180
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
163
181
|
invalid_properties = Array.new
|
164
182
|
if @artifacts.nil?
|
165
183
|
invalid_properties.push('invalid value for "artifacts", artifacts cannot be nil.')
|
@@ -171,6 +189,7 @@ module PulpGemClient
|
|
171
189
|
# Check to see if the all the properties in the model are valid
|
172
190
|
# @return true if the model is valid
|
173
191
|
def valid?
|
192
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
174
193
|
return false if @artifacts.nil?
|
175
194
|
true
|
176
195
|
end
|
@@ -181,6 +200,7 @@ module PulpGemClient
|
|
181
200
|
return true if self.equal?(o)
|
182
201
|
self.class == o.class &&
|
183
202
|
pulp_href == o.pulp_href &&
|
203
|
+
prn == o.prn &&
|
184
204
|
pulp_created == o.pulp_created &&
|
185
205
|
pulp_last_updated == o.pulp_last_updated &&
|
186
206
|
artifacts == o.artifacts &&
|
@@ -203,44 +223,40 @@ module PulpGemClient
|
|
203
223
|
# Calculates hash code according to all attributes.
|
204
224
|
# @return [Integer] Hash code
|
205
225
|
def hash
|
206
|
-
[pulp_href, pulp_created, pulp_last_updated, artifacts, checksum, name, version, platform, prerelease, dependencies, required_ruby_version, required_rubygems_version].hash
|
226
|
+
[pulp_href, prn, pulp_created, pulp_last_updated, artifacts, checksum, name, version, platform, prerelease, dependencies, required_ruby_version, required_rubygems_version].hash
|
207
227
|
end
|
208
228
|
|
209
229
|
# Builds the object from hash
|
210
230
|
# @param [Hash] attributes Model attributes in the form of hash
|
211
231
|
# @return [Object] Returns the model itself
|
212
232
|
def self.build_from_hash(attributes)
|
213
|
-
new.build_from_hash(attributes)
|
214
|
-
end
|
215
|
-
|
216
|
-
# Builds the object from hash
|
217
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
218
|
-
# @return [Object] Returns the model itself
|
219
|
-
def build_from_hash(attributes)
|
220
233
|
return nil unless attributes.is_a?(Hash)
|
221
|
-
|
222
|
-
|
234
|
+
attributes = attributes.transform_keys(&:to_sym)
|
235
|
+
transformed_hash = {}
|
236
|
+
openapi_types.each_pair do |key, type|
|
237
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
238
|
+
transformed_hash["#{key}"] = nil
|
239
|
+
elsif type =~ /\AArray<(.*)>/i
|
223
240
|
# check to ensure the input is an array given that the attribute
|
224
241
|
# is documented as an array but the input is not
|
225
|
-
if attributes[
|
226
|
-
|
242
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
243
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
227
244
|
end
|
228
|
-
elsif !attributes[
|
229
|
-
|
230
|
-
end
|
245
|
+
elsif !attributes[attribute_map[key]].nil?
|
246
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
247
|
+
end
|
231
248
|
end
|
232
|
-
|
233
|
-
self
|
249
|
+
new(transformed_hash)
|
234
250
|
end
|
235
251
|
|
236
252
|
# Deserializes the data based on type
|
237
253
|
# @param string type Data type
|
238
254
|
# @param string value Value to be deserialized
|
239
255
|
# @return [Object] Deserialized data
|
240
|
-
def _deserialize(type, value)
|
256
|
+
def self._deserialize(type, value)
|
241
257
|
case type.to_sym
|
242
|
-
when :
|
243
|
-
|
258
|
+
when :Time
|
259
|
+
Time.parse(value)
|
244
260
|
when :Date
|
245
261
|
Date.parse(value)
|
246
262
|
when :String
|
@@ -270,7 +286,9 @@ module PulpGemClient
|
|
270
286
|
end
|
271
287
|
end
|
272
288
|
else # model
|
273
|
-
|
289
|
+
# models (e.g. Pet) or oneOf
|
290
|
+
klass = PulpGemClient.const_get(type)
|
291
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
274
292
|
end
|
275
293
|
end
|
276
294
|
|
@@ -296,7 +314,7 @@ module PulpGemClient
|
|
296
314
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
297
315
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
298
316
|
end
|
299
|
-
|
317
|
+
|
300
318
|
hash[param] = _to_hash(value)
|
301
319
|
end
|
302
320
|
hash
|
@@ -319,5 +337,7 @@ module PulpGemClient
|
|
319
337
|
value
|
320
338
|
end
|
321
339
|
end
|
340
|
+
|
322
341
|
end
|
342
|
+
|
323
343
|
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 PulpGemClient
|
16
17
|
# A Serializer for GemDistribution.
|
@@ -52,6 +53,11 @@ module PulpGemClient
|
|
52
53
|
}
|
53
54
|
end
|
54
55
|
|
56
|
+
# Returns all the JSON keys this model knows about
|
57
|
+
def self.acceptable_attributes
|
58
|
+
attribute_map.values
|
59
|
+
end
|
60
|
+
|
55
61
|
# Attribute type mapping.
|
56
62
|
def self.openapi_types
|
57
63
|
{
|
@@ -93,6 +99,8 @@ module PulpGemClient
|
|
93
99
|
|
94
100
|
if attributes.key?(:'base_path')
|
95
101
|
self.base_path = attributes[:'base_path']
|
102
|
+
else
|
103
|
+
self.base_path = nil
|
96
104
|
end
|
97
105
|
|
98
106
|
if attributes.key?(:'content_guard')
|
@@ -113,6 +121,8 @@ module PulpGemClient
|
|
113
121
|
|
114
122
|
if attributes.key?(:'name')
|
115
123
|
self.name = attributes[:'name']
|
124
|
+
else
|
125
|
+
self.name = nil
|
116
126
|
end
|
117
127
|
|
118
128
|
if attributes.key?(:'repository')
|
@@ -131,6 +141,7 @@ module PulpGemClient
|
|
131
141
|
# Show invalid properties with the reasons. Usually used together with valid?
|
132
142
|
# @return Array for valid properties with the reasons
|
133
143
|
def list_invalid_properties
|
144
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
134
145
|
invalid_properties = Array.new
|
135
146
|
if @base_path.nil?
|
136
147
|
invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
|
@@ -154,6 +165,7 @@ module PulpGemClient
|
|
154
165
|
# Check to see if the all the properties in the model are valid
|
155
166
|
# @return true if the model is valid
|
156
167
|
def valid?
|
168
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
157
169
|
return false if @base_path.nil?
|
158
170
|
return false if @base_path.to_s.length < 1
|
159
171
|
return false if @name.nil?
|
@@ -220,37 +232,33 @@ module PulpGemClient
|
|
220
232
|
# @param [Hash] attributes Model attributes in the form of hash
|
221
233
|
# @return [Object] Returns the model itself
|
222
234
|
def self.build_from_hash(attributes)
|
223
|
-
new.build_from_hash(attributes)
|
224
|
-
end
|
225
|
-
|
226
|
-
# Builds the object from hash
|
227
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
228
|
-
# @return [Object] Returns the model itself
|
229
|
-
def build_from_hash(attributes)
|
230
235
|
return nil unless attributes.is_a?(Hash)
|
231
|
-
|
232
|
-
|
236
|
+
attributes = attributes.transform_keys(&:to_sym)
|
237
|
+
transformed_hash = {}
|
238
|
+
openapi_types.each_pair do |key, type|
|
239
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
240
|
+
transformed_hash["#{key}"] = nil
|
241
|
+
elsif type =~ /\AArray<(.*)>/i
|
233
242
|
# check to ensure the input is an array given that the attribute
|
234
243
|
# is documented as an array but the input is not
|
235
|
-
if attributes[
|
236
|
-
|
244
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
245
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
237
246
|
end
|
238
|
-
elsif !attributes[
|
239
|
-
|
240
|
-
end
|
247
|
+
elsif !attributes[attribute_map[key]].nil?
|
248
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
249
|
+
end
|
241
250
|
end
|
242
|
-
|
243
|
-
self
|
251
|
+
new(transformed_hash)
|
244
252
|
end
|
245
253
|
|
246
254
|
# Deserializes the data based on type
|
247
255
|
# @param string type Data type
|
248
256
|
# @param string value Value to be deserialized
|
249
257
|
# @return [Object] Deserialized data
|
250
|
-
def _deserialize(type, value)
|
258
|
+
def self._deserialize(type, value)
|
251
259
|
case type.to_sym
|
252
|
-
when :
|
253
|
-
|
260
|
+
when :Time
|
261
|
+
Time.parse(value)
|
254
262
|
when :Date
|
255
263
|
Date.parse(value)
|
256
264
|
when :String
|
@@ -280,7 +288,9 @@ module PulpGemClient
|
|
280
288
|
end
|
281
289
|
end
|
282
290
|
else # model
|
283
|
-
|
291
|
+
# models (e.g. Pet) or oneOf
|
292
|
+
klass = PulpGemClient.const_get(type)
|
293
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
284
294
|
end
|
285
295
|
end
|
286
296
|
|
@@ -306,7 +316,7 @@ module PulpGemClient
|
|
306
316
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
307
317
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
308
318
|
end
|
309
|
-
|
319
|
+
|
310
320
|
hash[param] = _to_hash(value)
|
311
321
|
end
|
312
322
|
hash
|
@@ -329,5 +339,7 @@ module PulpGemClient
|
|
329
339
|
value
|
330
340
|
end
|
331
341
|
end
|
342
|
+
|
332
343
|
end
|
344
|
+
|
333
345
|
end
|
@@ -6,17 +6,21 @@
|
|
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 PulpGemClient
|
16
17
|
# A Serializer for GemDistribution.
|
17
18
|
class GemGemDistributionResponse
|
18
19
|
attr_accessor :pulp_href
|
19
20
|
|
21
|
+
# The Pulp Resource Name (PRN).
|
22
|
+
attr_accessor :prn
|
23
|
+
|
20
24
|
# Timestamp of creation.
|
21
25
|
attr_accessor :pulp_created
|
22
26
|
|
@@ -32,6 +36,9 @@ module PulpGemClient
|
|
32
36
|
# An optional content-guard.
|
33
37
|
attr_accessor :content_guard
|
34
38
|
|
39
|
+
# Timestamp since when the distributed content served by this distribution has not changed. If equals to `null`, no guarantee is provided about content changes.
|
40
|
+
attr_accessor :no_content_change_since
|
41
|
+
|
35
42
|
# Whether this distribution should be shown in the content app.
|
36
43
|
attr_accessor :hidden
|
37
44
|
|
@@ -53,11 +60,13 @@ module PulpGemClient
|
|
53
60
|
def self.attribute_map
|
54
61
|
{
|
55
62
|
:'pulp_href' => :'pulp_href',
|
63
|
+
:'prn' => :'prn',
|
56
64
|
:'pulp_created' => :'pulp_created',
|
57
65
|
:'pulp_last_updated' => :'pulp_last_updated',
|
58
66
|
:'base_path' => :'base_path',
|
59
67
|
:'base_url' => :'base_url',
|
60
68
|
:'content_guard' => :'content_guard',
|
69
|
+
:'no_content_change_since' => :'no_content_change_since',
|
61
70
|
:'hidden' => :'hidden',
|
62
71
|
:'pulp_labels' => :'pulp_labels',
|
63
72
|
:'name' => :'name',
|
@@ -67,15 +76,22 @@ module PulpGemClient
|
|
67
76
|
}
|
68
77
|
end
|
69
78
|
|
79
|
+
# Returns all the JSON keys this model knows about
|
80
|
+
def self.acceptable_attributes
|
81
|
+
attribute_map.values
|
82
|
+
end
|
83
|
+
|
70
84
|
# Attribute type mapping.
|
71
85
|
def self.openapi_types
|
72
86
|
{
|
73
87
|
:'pulp_href' => :'String',
|
74
|
-
:'
|
75
|
-
:'
|
88
|
+
:'prn' => :'String',
|
89
|
+
:'pulp_created' => :'Time',
|
90
|
+
:'pulp_last_updated' => :'Time',
|
76
91
|
:'base_path' => :'String',
|
77
92
|
:'base_url' => :'String',
|
78
93
|
:'content_guard' => :'String',
|
94
|
+
:'no_content_change_since' => :'String',
|
79
95
|
:'hidden' => :'Boolean',
|
80
96
|
:'pulp_labels' => :'Hash<String, String>',
|
81
97
|
:'name' => :'String',
|
@@ -114,6 +130,10 @@ module PulpGemClient
|
|
114
130
|
self.pulp_href = attributes[:'pulp_href']
|
115
131
|
end
|
116
132
|
|
133
|
+
if attributes.key?(:'prn')
|
134
|
+
self.prn = attributes[:'prn']
|
135
|
+
end
|
136
|
+
|
117
137
|
if attributes.key?(:'pulp_created')
|
118
138
|
self.pulp_created = attributes[:'pulp_created']
|
119
139
|
end
|
@@ -124,6 +144,8 @@ module PulpGemClient
|
|
124
144
|
|
125
145
|
if attributes.key?(:'base_path')
|
126
146
|
self.base_path = attributes[:'base_path']
|
147
|
+
else
|
148
|
+
self.base_path = nil
|
127
149
|
end
|
128
150
|
|
129
151
|
if attributes.key?(:'base_url')
|
@@ -134,6 +156,10 @@ module PulpGemClient
|
|
134
156
|
self.content_guard = attributes[:'content_guard']
|
135
157
|
end
|
136
158
|
|
159
|
+
if attributes.key?(:'no_content_change_since')
|
160
|
+
self.no_content_change_since = attributes[:'no_content_change_since']
|
161
|
+
end
|
162
|
+
|
137
163
|
if attributes.key?(:'hidden')
|
138
164
|
self.hidden = attributes[:'hidden']
|
139
165
|
else
|
@@ -148,6 +174,8 @@ module PulpGemClient
|
|
148
174
|
|
149
175
|
if attributes.key?(:'name')
|
150
176
|
self.name = attributes[:'name']
|
177
|
+
else
|
178
|
+
self.name = nil
|
151
179
|
end
|
152
180
|
|
153
181
|
if attributes.key?(:'repository')
|
@@ -166,6 +194,7 @@ module PulpGemClient
|
|
166
194
|
# Show invalid properties with the reasons. Usually used together with valid?
|
167
195
|
# @return Array for valid properties with the reasons
|
168
196
|
def list_invalid_properties
|
197
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
169
198
|
invalid_properties = Array.new
|
170
199
|
if @base_path.nil?
|
171
200
|
invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
|
@@ -181,6 +210,7 @@ module PulpGemClient
|
|
181
210
|
# Check to see if the all the properties in the model are valid
|
182
211
|
# @return true if the model is valid
|
183
212
|
def valid?
|
213
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
184
214
|
return false if @base_path.nil?
|
185
215
|
return false if @name.nil?
|
186
216
|
true
|
@@ -192,11 +222,13 @@ module PulpGemClient
|
|
192
222
|
return true if self.equal?(o)
|
193
223
|
self.class == o.class &&
|
194
224
|
pulp_href == o.pulp_href &&
|
225
|
+
prn == o.prn &&
|
195
226
|
pulp_created == o.pulp_created &&
|
196
227
|
pulp_last_updated == o.pulp_last_updated &&
|
197
228
|
base_path == o.base_path &&
|
198
229
|
base_url == o.base_url &&
|
199
230
|
content_guard == o.content_guard &&
|
231
|
+
no_content_change_since == o.no_content_change_since &&
|
200
232
|
hidden == o.hidden &&
|
201
233
|
pulp_labels == o.pulp_labels &&
|
202
234
|
name == o.name &&
|
@@ -214,44 +246,40 @@ module PulpGemClient
|
|
214
246
|
# Calculates hash code according to all attributes.
|
215
247
|
# @return [Integer] Hash code
|
216
248
|
def hash
|
217
|
-
[pulp_href, pulp_created, pulp_last_updated, base_path, base_url, content_guard, hidden, pulp_labels, name, repository, publication, remote].hash
|
249
|
+
[pulp_href, prn, pulp_created, pulp_last_updated, base_path, base_url, content_guard, no_content_change_since, hidden, pulp_labels, name, repository, publication, remote].hash
|
218
250
|
end
|
219
251
|
|
220
252
|
# Builds the object from hash
|
221
253
|
# @param [Hash] attributes Model attributes in the form of hash
|
222
254
|
# @return [Object] Returns the model itself
|
223
255
|
def self.build_from_hash(attributes)
|
224
|
-
new.build_from_hash(attributes)
|
225
|
-
end
|
226
|
-
|
227
|
-
# Builds the object from hash
|
228
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
229
|
-
# @return [Object] Returns the model itself
|
230
|
-
def build_from_hash(attributes)
|
231
256
|
return nil unless attributes.is_a?(Hash)
|
232
|
-
|
233
|
-
|
257
|
+
attributes = attributes.transform_keys(&:to_sym)
|
258
|
+
transformed_hash = {}
|
259
|
+
openapi_types.each_pair do |key, type|
|
260
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
261
|
+
transformed_hash["#{key}"] = nil
|
262
|
+
elsif type =~ /\AArray<(.*)>/i
|
234
263
|
# check to ensure the input is an array given that the attribute
|
235
264
|
# is documented as an array but the input is not
|
236
|
-
if attributes[
|
237
|
-
|
265
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
266
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
238
267
|
end
|
239
|
-
elsif !attributes[
|
240
|
-
|
241
|
-
end
|
268
|
+
elsif !attributes[attribute_map[key]].nil?
|
269
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
270
|
+
end
|
242
271
|
end
|
243
|
-
|
244
|
-
self
|
272
|
+
new(transformed_hash)
|
245
273
|
end
|
246
274
|
|
247
275
|
# Deserializes the data based on type
|
248
276
|
# @param string type Data type
|
249
277
|
# @param string value Value to be deserialized
|
250
278
|
# @return [Object] Deserialized data
|
251
|
-
def _deserialize(type, value)
|
279
|
+
def self._deserialize(type, value)
|
252
280
|
case type.to_sym
|
253
|
-
when :
|
254
|
-
|
281
|
+
when :Time
|
282
|
+
Time.parse(value)
|
255
283
|
when :Date
|
256
284
|
Date.parse(value)
|
257
285
|
when :String
|
@@ -281,7 +309,9 @@ module PulpGemClient
|
|
281
309
|
end
|
282
310
|
end
|
283
311
|
else # model
|
284
|
-
|
312
|
+
# models (e.g. Pet) or oneOf
|
313
|
+
klass = PulpGemClient.const_get(type)
|
314
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
285
315
|
end
|
286
316
|
end
|
287
317
|
|
@@ -307,7 +337,7 @@ module PulpGemClient
|
|
307
337
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
308
338
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
309
339
|
end
|
310
|
-
|
340
|
+
|
311
341
|
hash[param] = _to_hash(value)
|
312
342
|
end
|
313
343
|
hash
|
@@ -330,5 +360,7 @@ module PulpGemClient
|
|
330
360
|
value
|
331
361
|
end
|
332
362
|
end
|
363
|
+
|
333
364
|
end
|
365
|
+
|
334
366
|
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 PulpGemClient
|
16
17
|
# A Serializer for GemPublication.
|
@@ -28,6 +29,11 @@ module PulpGemClient
|
|
28
29
|
}
|
29
30
|
end
|
30
31
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
33
|
+
def self.acceptable_attributes
|
34
|
+
attribute_map.values
|
35
|
+
end
|
36
|
+
|
31
37
|
# Attribute type mapping.
|
32
38
|
def self.openapi_types
|
33
39
|
{
|
@@ -69,6 +75,7 @@ module PulpGemClient
|
|
69
75
|
# Show invalid properties with the reasons. Usually used together with valid?
|
70
76
|
# @return Array for valid properties with the reasons
|
71
77
|
def list_invalid_properties
|
78
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
72
79
|
invalid_properties = Array.new
|
73
80
|
invalid_properties
|
74
81
|
end
|
@@ -76,6 +83,7 @@ module PulpGemClient
|
|
76
83
|
# Check to see if the all the properties in the model are valid
|
77
84
|
# @return true if the model is valid
|
78
85
|
def valid?
|
86
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
79
87
|
true
|
80
88
|
end
|
81
89
|
|
@@ -104,37 +112,33 @@ module PulpGemClient
|
|
104
112
|
# @param [Hash] attributes Model attributes in the form of hash
|
105
113
|
# @return [Object] Returns the model itself
|
106
114
|
def self.build_from_hash(attributes)
|
107
|
-
new.build_from_hash(attributes)
|
108
|
-
end
|
109
|
-
|
110
|
-
# Builds the object from hash
|
111
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
-
# @return [Object] Returns the model itself
|
113
|
-
def build_from_hash(attributes)
|
114
115
|
return nil unless attributes.is_a?(Hash)
|
115
|
-
|
116
|
-
|
116
|
+
attributes = attributes.transform_keys(&:to_sym)
|
117
|
+
transformed_hash = {}
|
118
|
+
openapi_types.each_pair do |key, type|
|
119
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
120
|
+
transformed_hash["#{key}"] = nil
|
121
|
+
elsif type =~ /\AArray<(.*)>/i
|
117
122
|
# check to ensure the input is an array given that the attribute
|
118
123
|
# is documented as an array but the input is not
|
119
|
-
if attributes[
|
120
|
-
|
124
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
125
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
121
126
|
end
|
122
|
-
elsif !attributes[
|
123
|
-
|
124
|
-
end
|
127
|
+
elsif !attributes[attribute_map[key]].nil?
|
128
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
129
|
+
end
|
125
130
|
end
|
126
|
-
|
127
|
-
self
|
131
|
+
new(transformed_hash)
|
128
132
|
end
|
129
133
|
|
130
134
|
# Deserializes the data based on type
|
131
135
|
# @param string type Data type
|
132
136
|
# @param string value Value to be deserialized
|
133
137
|
# @return [Object] Deserialized data
|
134
|
-
def _deserialize(type, value)
|
138
|
+
def self._deserialize(type, value)
|
135
139
|
case type.to_sym
|
136
|
-
when :
|
137
|
-
|
140
|
+
when :Time
|
141
|
+
Time.parse(value)
|
138
142
|
when :Date
|
139
143
|
Date.parse(value)
|
140
144
|
when :String
|
@@ -164,7 +168,9 @@ module PulpGemClient
|
|
164
168
|
end
|
165
169
|
end
|
166
170
|
else # model
|
167
|
-
|
171
|
+
# models (e.g. Pet) or oneOf
|
172
|
+
klass = PulpGemClient.const_get(type)
|
173
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
168
174
|
end
|
169
175
|
end
|
170
176
|
|
@@ -190,7 +196,7 @@ module PulpGemClient
|
|
190
196
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
191
197
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
192
198
|
end
|
193
|
-
|
199
|
+
|
194
200
|
hash[param] = _to_hash(value)
|
195
201
|
end
|
196
202
|
hash
|
@@ -213,5 +219,7 @@ module PulpGemClient
|
|
213
219
|
value
|
214
220
|
end
|
215
221
|
end
|
222
|
+
|
216
223
|
end
|
224
|
+
|
217
225
|
end
|