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,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
|
# Serializer to add/remove object roles to/from users/groups. This is used in conjunction with ``pulpcore.app.viewsets.base.RolesMixin`` and requires the underlying object to be passed as ``content_object`` in the context.
|
@@ -30,6 +31,11 @@ module PulpGemClient
|
|
30
31
|
}
|
31
32
|
end
|
32
33
|
|
34
|
+
# Returns all the JSON keys this model knows about
|
35
|
+
def self.acceptable_attributes
|
36
|
+
attribute_map.values
|
37
|
+
end
|
38
|
+
|
33
39
|
# Attribute type mapping.
|
34
40
|
def self.openapi_types
|
35
41
|
{
|
@@ -74,12 +80,15 @@ module PulpGemClient
|
|
74
80
|
|
75
81
|
if attributes.key?(:'role')
|
76
82
|
self.role = attributes[:'role']
|
83
|
+
else
|
84
|
+
self.role = nil
|
77
85
|
end
|
78
86
|
end
|
79
87
|
|
80
88
|
# Show invalid properties with the reasons. Usually used together with valid?
|
81
89
|
# @return Array for valid properties with the reasons
|
82
90
|
def list_invalid_properties
|
91
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
83
92
|
invalid_properties = Array.new
|
84
93
|
if @role.nil?
|
85
94
|
invalid_properties.push('invalid value for "role", role cannot be nil.')
|
@@ -95,6 +104,7 @@ module PulpGemClient
|
|
95
104
|
# Check to see if the all the properties in the model are valid
|
96
105
|
# @return true if the model is valid
|
97
106
|
def valid?
|
107
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
98
108
|
return false if @role.nil?
|
99
109
|
return false if @role.to_s.length < 1
|
100
110
|
true
|
@@ -140,37 +150,33 @@ module PulpGemClient
|
|
140
150
|
# @param [Hash] attributes Model attributes in the form of hash
|
141
151
|
# @return [Object] Returns the model itself
|
142
152
|
def self.build_from_hash(attributes)
|
143
|
-
new.build_from_hash(attributes)
|
144
|
-
end
|
145
|
-
|
146
|
-
# Builds the object from hash
|
147
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
148
|
-
# @return [Object] Returns the model itself
|
149
|
-
def build_from_hash(attributes)
|
150
153
|
return nil unless attributes.is_a?(Hash)
|
151
|
-
|
152
|
-
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
155
|
+
transformed_hash = {}
|
156
|
+
openapi_types.each_pair do |key, type|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
158
|
+
transformed_hash["#{key}"] = nil
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
153
160
|
# check to ensure the input is an array given that the attribute
|
154
161
|
# is documented as an array but the input is not
|
155
|
-
if attributes[
|
156
|
-
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
157
164
|
end
|
158
|
-
elsif !attributes[
|
159
|
-
|
160
|
-
end
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
167
|
+
end
|
161
168
|
end
|
162
|
-
|
163
|
-
self
|
169
|
+
new(transformed_hash)
|
164
170
|
end
|
165
171
|
|
166
172
|
# Deserializes the data based on type
|
167
173
|
# @param string type Data type
|
168
174
|
# @param string value Value to be deserialized
|
169
175
|
# @return [Object] Deserialized data
|
170
|
-
def _deserialize(type, value)
|
176
|
+
def self._deserialize(type, value)
|
171
177
|
case type.to_sym
|
172
|
-
when :
|
173
|
-
|
178
|
+
when :Time
|
179
|
+
Time.parse(value)
|
174
180
|
when :Date
|
175
181
|
Date.parse(value)
|
176
182
|
when :String
|
@@ -200,7 +206,9 @@ module PulpGemClient
|
|
200
206
|
end
|
201
207
|
end
|
202
208
|
else # model
|
203
|
-
|
209
|
+
# models (e.g. Pet) or oneOf
|
210
|
+
klass = PulpGemClient.const_get(type)
|
211
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
212
|
end
|
205
213
|
end
|
206
214
|
|
@@ -226,7 +234,7 @@ module PulpGemClient
|
|
226
234
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
227
235
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
228
236
|
end
|
229
|
-
|
237
|
+
|
230
238
|
hash[param] = _to_hash(value)
|
231
239
|
end
|
232
240
|
hash
|
@@ -249,5 +257,7 @@ module PulpGemClient
|
|
249
257
|
value
|
250
258
|
end
|
251
259
|
end
|
260
|
+
|
252
261
|
end
|
262
|
+
|
253
263
|
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
|
# Serializer to add/remove object roles to/from users/groups. This is used in conjunction with ``pulpcore.app.viewsets.base.RolesMixin`` and requires the underlying object to be passed as ``content_object`` in the context.
|
@@ -30,6 +31,11 @@ module PulpGemClient
|
|
30
31
|
}
|
31
32
|
end
|
32
33
|
|
34
|
+
# Returns all the JSON keys this model knows about
|
35
|
+
def self.acceptable_attributes
|
36
|
+
attribute_map.values
|
37
|
+
end
|
38
|
+
|
33
39
|
# Attribute type mapping.
|
34
40
|
def self.openapi_types
|
35
41
|
{
|
@@ -74,12 +80,15 @@ module PulpGemClient
|
|
74
80
|
|
75
81
|
if attributes.key?(:'role')
|
76
82
|
self.role = attributes[:'role']
|
83
|
+
else
|
84
|
+
self.role = nil
|
77
85
|
end
|
78
86
|
end
|
79
87
|
|
80
88
|
# Show invalid properties with the reasons. Usually used together with valid?
|
81
89
|
# @return Array for valid properties with the reasons
|
82
90
|
def list_invalid_properties
|
91
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
83
92
|
invalid_properties = Array.new
|
84
93
|
if @role.nil?
|
85
94
|
invalid_properties.push('invalid value for "role", role cannot be nil.')
|
@@ -91,6 +100,7 @@ module PulpGemClient
|
|
91
100
|
# Check to see if the all the properties in the model are valid
|
92
101
|
# @return true if the model is valid
|
93
102
|
def valid?
|
103
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
94
104
|
return false if @role.nil?
|
95
105
|
true
|
96
106
|
end
|
@@ -121,37 +131,33 @@ module PulpGemClient
|
|
121
131
|
# @param [Hash] attributes Model attributes in the form of hash
|
122
132
|
# @return [Object] Returns the model itself
|
123
133
|
def self.build_from_hash(attributes)
|
124
|
-
new.build_from_hash(attributes)
|
125
|
-
end
|
126
|
-
|
127
|
-
# Builds the object from hash
|
128
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
-
# @return [Object] Returns the model itself
|
130
|
-
def build_from_hash(attributes)
|
131
134
|
return nil unless attributes.is_a?(Hash)
|
132
|
-
|
133
|
-
|
135
|
+
attributes = attributes.transform_keys(&:to_sym)
|
136
|
+
transformed_hash = {}
|
137
|
+
openapi_types.each_pair do |key, type|
|
138
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
139
|
+
transformed_hash["#{key}"] = nil
|
140
|
+
elsif type =~ /\AArray<(.*)>/i
|
134
141
|
# check to ensure the input is an array given that the attribute
|
135
142
|
# is documented as an array but the input is not
|
136
|
-
if attributes[
|
137
|
-
|
143
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
144
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
138
145
|
end
|
139
|
-
elsif !attributes[
|
140
|
-
|
141
|
-
end
|
146
|
+
elsif !attributes[attribute_map[key]].nil?
|
147
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
148
|
+
end
|
142
149
|
end
|
143
|
-
|
144
|
-
self
|
150
|
+
new(transformed_hash)
|
145
151
|
end
|
146
152
|
|
147
153
|
# Deserializes the data based on type
|
148
154
|
# @param string type Data type
|
149
155
|
# @param string value Value to be deserialized
|
150
156
|
# @return [Object] Deserialized data
|
151
|
-
def _deserialize(type, value)
|
157
|
+
def self._deserialize(type, value)
|
152
158
|
case type.to_sym
|
153
|
-
when :
|
154
|
-
|
159
|
+
when :Time
|
160
|
+
Time.parse(value)
|
155
161
|
when :Date
|
156
162
|
Date.parse(value)
|
157
163
|
when :String
|
@@ -181,7 +187,9 @@ module PulpGemClient
|
|
181
187
|
end
|
182
188
|
end
|
183
189
|
else # model
|
184
|
-
|
190
|
+
# models (e.g. Pet) or oneOf
|
191
|
+
klass = PulpGemClient.const_get(type)
|
192
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
185
193
|
end
|
186
194
|
end
|
187
195
|
|
@@ -207,7 +215,7 @@ module PulpGemClient
|
|
207
215
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
208
216
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
209
217
|
end
|
210
|
-
|
218
|
+
|
211
219
|
hash[param] = _to_hash(value)
|
212
220
|
end
|
213
221
|
hash
|
@@ -230,5 +238,7 @@ module PulpGemClient
|
|
230
238
|
value
|
231
239
|
end
|
232
240
|
end
|
241
|
+
|
233
242
|
end
|
243
|
+
|
234
244
|
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
|
class ObjectRolesResponse
|
@@ -23,6 +24,11 @@ module PulpGemClient
|
|
23
24
|
}
|
24
25
|
end
|
25
26
|
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
26
32
|
# Attribute type mapping.
|
27
33
|
def self.openapi_types
|
28
34
|
{
|
@@ -55,12 +61,15 @@ module PulpGemClient
|
|
55
61
|
if (value = attributes[:'roles']).is_a?(Array)
|
56
62
|
self.roles = value
|
57
63
|
end
|
64
|
+
else
|
65
|
+
self.roles = nil
|
58
66
|
end
|
59
67
|
end
|
60
68
|
|
61
69
|
# Show invalid properties with the reasons. Usually used together with valid?
|
62
70
|
# @return Array for valid properties with the reasons
|
63
71
|
def list_invalid_properties
|
72
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
64
73
|
invalid_properties = Array.new
|
65
74
|
if @roles.nil?
|
66
75
|
invalid_properties.push('invalid value for "roles", roles cannot be nil.')
|
@@ -72,6 +81,7 @@ module PulpGemClient
|
|
72
81
|
# Check to see if the all the properties in the model are valid
|
73
82
|
# @return true if the model is valid
|
74
83
|
def valid?
|
84
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
75
85
|
return false if @roles.nil?
|
76
86
|
true
|
77
87
|
end
|
@@ -100,37 +110,33 @@ module PulpGemClient
|
|
100
110
|
# @param [Hash] attributes Model attributes in the form of hash
|
101
111
|
# @return [Object] Returns the model itself
|
102
112
|
def self.build_from_hash(attributes)
|
103
|
-
new.build_from_hash(attributes)
|
104
|
-
end
|
105
|
-
|
106
|
-
# Builds the object from hash
|
107
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
-
# @return [Object] Returns the model itself
|
109
|
-
def build_from_hash(attributes)
|
110
113
|
return nil unless attributes.is_a?(Hash)
|
111
|
-
|
112
|
-
|
114
|
+
attributes = attributes.transform_keys(&:to_sym)
|
115
|
+
transformed_hash = {}
|
116
|
+
openapi_types.each_pair do |key, type|
|
117
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = nil
|
119
|
+
elsif type =~ /\AArray<(.*)>/i
|
113
120
|
# check to ensure the input is an array given that the attribute
|
114
121
|
# is documented as an array but the input is not
|
115
|
-
if attributes[
|
116
|
-
|
122
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
123
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
117
124
|
end
|
118
|
-
elsif !attributes[
|
119
|
-
|
120
|
-
end
|
125
|
+
elsif !attributes[attribute_map[key]].nil?
|
126
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
127
|
+
end
|
121
128
|
end
|
122
|
-
|
123
|
-
self
|
129
|
+
new(transformed_hash)
|
124
130
|
end
|
125
131
|
|
126
132
|
# Deserializes the data based on type
|
127
133
|
# @param string type Data type
|
128
134
|
# @param string value Value to be deserialized
|
129
135
|
# @return [Object] Deserialized data
|
130
|
-
def _deserialize(type, value)
|
136
|
+
def self._deserialize(type, value)
|
131
137
|
case type.to_sym
|
132
|
-
when :
|
133
|
-
|
138
|
+
when :Time
|
139
|
+
Time.parse(value)
|
134
140
|
when :Date
|
135
141
|
Date.parse(value)
|
136
142
|
when :String
|
@@ -160,7 +166,9 @@ module PulpGemClient
|
|
160
166
|
end
|
161
167
|
end
|
162
168
|
else # model
|
163
|
-
|
169
|
+
# models (e.g. Pet) or oneOf
|
170
|
+
klass = PulpGemClient.const_get(type)
|
171
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
164
172
|
end
|
165
173
|
end
|
166
174
|
|
@@ -186,7 +194,7 @@ module PulpGemClient
|
|
186
194
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
187
195
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
188
196
|
end
|
189
|
-
|
197
|
+
|
190
198
|
hash[param] = _to_hash(value)
|
191
199
|
end
|
192
200
|
hash
|
@@ -209,5 +217,7 @@ module PulpGemClient
|
|
209
217
|
value
|
210
218
|
end
|
211
219
|
end
|
220
|
+
|
212
221
|
end
|
222
|
+
|
213
223
|
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
|
class PaginatedRepositoryVersionResponseList
|
@@ -32,6 +33,11 @@ module PulpGemClient
|
|
32
33
|
}
|
33
34
|
end
|
34
35
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
37
|
+
def self.acceptable_attributes
|
38
|
+
attribute_map.values
|
39
|
+
end
|
40
|
+
|
35
41
|
# Attribute type mapping.
|
36
42
|
def self.openapi_types
|
37
43
|
{
|
@@ -67,6 +73,8 @@ module PulpGemClient
|
|
67
73
|
|
68
74
|
if attributes.key?(:'count')
|
69
75
|
self.count = attributes[:'count']
|
76
|
+
else
|
77
|
+
self.count = nil
|
70
78
|
end
|
71
79
|
|
72
80
|
if attributes.key?(:'_next')
|
@@ -81,12 +89,15 @@ module PulpGemClient
|
|
81
89
|
if (value = attributes[:'results']).is_a?(Array)
|
82
90
|
self.results = value
|
83
91
|
end
|
92
|
+
else
|
93
|
+
self.results = nil
|
84
94
|
end
|
85
95
|
end
|
86
96
|
|
87
97
|
# Show invalid properties with the reasons. Usually used together with valid?
|
88
98
|
# @return Array for valid properties with the reasons
|
89
99
|
def list_invalid_properties
|
100
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
90
101
|
invalid_properties = Array.new
|
91
102
|
if @count.nil?
|
92
103
|
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
@@ -102,6 +113,7 @@ module PulpGemClient
|
|
102
113
|
# Check to see if the all the properties in the model are valid
|
103
114
|
# @return true if the model is valid
|
104
115
|
def valid?
|
116
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
105
117
|
return false if @count.nil?
|
106
118
|
return false if @results.nil?
|
107
119
|
true
|
@@ -134,37 +146,33 @@ module PulpGemClient
|
|
134
146
|
# @param [Hash] attributes Model attributes in the form of hash
|
135
147
|
# @return [Object] Returns the model itself
|
136
148
|
def self.build_from_hash(attributes)
|
137
|
-
new.build_from_hash(attributes)
|
138
|
-
end
|
139
|
-
|
140
|
-
# Builds the object from hash
|
141
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
-
# @return [Object] Returns the model itself
|
143
|
-
def build_from_hash(attributes)
|
144
149
|
return nil unless attributes.is_a?(Hash)
|
145
|
-
|
146
|
-
|
150
|
+
attributes = attributes.transform_keys(&:to_sym)
|
151
|
+
transformed_hash = {}
|
152
|
+
openapi_types.each_pair do |key, type|
|
153
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
154
|
+
transformed_hash["#{key}"] = nil
|
155
|
+
elsif type =~ /\AArray<(.*)>/i
|
147
156
|
# check to ensure the input is an array given that the attribute
|
148
157
|
# is documented as an array but the input is not
|
149
|
-
if attributes[
|
150
|
-
|
158
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
159
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
151
160
|
end
|
152
|
-
elsif !attributes[
|
153
|
-
|
154
|
-
end
|
161
|
+
elsif !attributes[attribute_map[key]].nil?
|
162
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
163
|
+
end
|
155
164
|
end
|
156
|
-
|
157
|
-
self
|
165
|
+
new(transformed_hash)
|
158
166
|
end
|
159
167
|
|
160
168
|
# Deserializes the data based on type
|
161
169
|
# @param string type Data type
|
162
170
|
# @param string value Value to be deserialized
|
163
171
|
# @return [Object] Deserialized data
|
164
|
-
def _deserialize(type, value)
|
172
|
+
def self._deserialize(type, value)
|
165
173
|
case type.to_sym
|
166
|
-
when :
|
167
|
-
|
174
|
+
when :Time
|
175
|
+
Time.parse(value)
|
168
176
|
when :Date
|
169
177
|
Date.parse(value)
|
170
178
|
when :String
|
@@ -194,7 +202,9 @@ module PulpGemClient
|
|
194
202
|
end
|
195
203
|
end
|
196
204
|
else # model
|
197
|
-
|
205
|
+
# models (e.g. Pet) or oneOf
|
206
|
+
klass = PulpGemClient.const_get(type)
|
207
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
198
208
|
end
|
199
209
|
end
|
200
210
|
|
@@ -220,7 +230,7 @@ module PulpGemClient
|
|
220
230
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
221
231
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
222
232
|
end
|
223
|
-
|
233
|
+
|
224
234
|
hash[param] = _to_hash(value)
|
225
235
|
end
|
226
236
|
hash
|
@@ -243,5 +253,7 @@ module PulpGemClient
|
|
243
253
|
value
|
244
254
|
end
|
245
255
|
end
|
256
|
+
|
246
257
|
end
|
258
|
+
|
247
259
|
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
|
class PaginatedgemGemContentResponseList
|
@@ -32,6 +33,11 @@ module PulpGemClient
|
|
32
33
|
}
|
33
34
|
end
|
34
35
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
37
|
+
def self.acceptable_attributes
|
38
|
+
attribute_map.values
|
39
|
+
end
|
40
|
+
|
35
41
|
# Attribute type mapping.
|
36
42
|
def self.openapi_types
|
37
43
|
{
|
@@ -67,6 +73,8 @@ module PulpGemClient
|
|
67
73
|
|
68
74
|
if attributes.key?(:'count')
|
69
75
|
self.count = attributes[:'count']
|
76
|
+
else
|
77
|
+
self.count = nil
|
70
78
|
end
|
71
79
|
|
72
80
|
if attributes.key?(:'_next')
|
@@ -81,12 +89,15 @@ module PulpGemClient
|
|
81
89
|
if (value = attributes[:'results']).is_a?(Array)
|
82
90
|
self.results = value
|
83
91
|
end
|
92
|
+
else
|
93
|
+
self.results = nil
|
84
94
|
end
|
85
95
|
end
|
86
96
|
|
87
97
|
# Show invalid properties with the reasons. Usually used together with valid?
|
88
98
|
# @return Array for valid properties with the reasons
|
89
99
|
def list_invalid_properties
|
100
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
90
101
|
invalid_properties = Array.new
|
91
102
|
if @count.nil?
|
92
103
|
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
@@ -102,6 +113,7 @@ module PulpGemClient
|
|
102
113
|
# Check to see if the all the properties in the model are valid
|
103
114
|
# @return true if the model is valid
|
104
115
|
def valid?
|
116
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
105
117
|
return false if @count.nil?
|
106
118
|
return false if @results.nil?
|
107
119
|
true
|
@@ -134,37 +146,33 @@ module PulpGemClient
|
|
134
146
|
# @param [Hash] attributes Model attributes in the form of hash
|
135
147
|
# @return [Object] Returns the model itself
|
136
148
|
def self.build_from_hash(attributes)
|
137
|
-
new.build_from_hash(attributes)
|
138
|
-
end
|
139
|
-
|
140
|
-
# Builds the object from hash
|
141
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
-
# @return [Object] Returns the model itself
|
143
|
-
def build_from_hash(attributes)
|
144
149
|
return nil unless attributes.is_a?(Hash)
|
145
|
-
|
146
|
-
|
150
|
+
attributes = attributes.transform_keys(&:to_sym)
|
151
|
+
transformed_hash = {}
|
152
|
+
openapi_types.each_pair do |key, type|
|
153
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
154
|
+
transformed_hash["#{key}"] = nil
|
155
|
+
elsif type =~ /\AArray<(.*)>/i
|
147
156
|
# check to ensure the input is an array given that the attribute
|
148
157
|
# is documented as an array but the input is not
|
149
|
-
if attributes[
|
150
|
-
|
158
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
159
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
151
160
|
end
|
152
|
-
elsif !attributes[
|
153
|
-
|
154
|
-
end
|
161
|
+
elsif !attributes[attribute_map[key]].nil?
|
162
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
163
|
+
end
|
155
164
|
end
|
156
|
-
|
157
|
-
self
|
165
|
+
new(transformed_hash)
|
158
166
|
end
|
159
167
|
|
160
168
|
# Deserializes the data based on type
|
161
169
|
# @param string type Data type
|
162
170
|
# @param string value Value to be deserialized
|
163
171
|
# @return [Object] Deserialized data
|
164
|
-
def _deserialize(type, value)
|
172
|
+
def self._deserialize(type, value)
|
165
173
|
case type.to_sym
|
166
|
-
when :
|
167
|
-
|
174
|
+
when :Time
|
175
|
+
Time.parse(value)
|
168
176
|
when :Date
|
169
177
|
Date.parse(value)
|
170
178
|
when :String
|
@@ -194,7 +202,9 @@ module PulpGemClient
|
|
194
202
|
end
|
195
203
|
end
|
196
204
|
else # model
|
197
|
-
|
205
|
+
# models (e.g. Pet) or oneOf
|
206
|
+
klass = PulpGemClient.const_get(type)
|
207
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
198
208
|
end
|
199
209
|
end
|
200
210
|
|
@@ -220,7 +230,7 @@ module PulpGemClient
|
|
220
230
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
221
231
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
222
232
|
end
|
223
|
-
|
233
|
+
|
224
234
|
hash[param] = _to_hash(value)
|
225
235
|
end
|
226
236
|
hash
|
@@ -243,5 +253,7 @@ module PulpGemClient
|
|
243
253
|
value
|
244
254
|
end
|
245
255
|
end
|
256
|
+
|
246
257
|
end
|
258
|
+
|
247
259
|
end
|