pulp_maven_client 0.8.2 → 0.8.3
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 +10 -6
- data/docs/AsyncOperationResponse.md +8 -7
- data/docs/ContentArtifactApi.md +111 -61
- data/docs/ContentSummaryResponse.md +12 -11
- data/docs/DistributionsMavenApi.md +265 -130
- data/docs/MavenMavenArtifact.md +12 -11
- data/docs/MavenMavenArtifactResponse.md +24 -23
- data/docs/MavenMavenDistribution.md +20 -19
- data/docs/MavenMavenDistributionResponse.md +32 -31
- data/docs/MavenMavenRemote.md +48 -47
- data/docs/MavenMavenRemoteResponse.md +48 -47
- data/docs/MavenMavenRemoteResponseHiddenFieldsInner.md +20 -0
- data/docs/MavenMavenRepository.md +16 -15
- data/docs/MavenMavenRepositoryResponse.md +28 -27
- data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
- data/docs/PaginatedmavenMavenArtifactResponseList.md +14 -13
- data/docs/PaginatedmavenMavenDistributionResponseList.md +14 -13
- data/docs/PaginatedmavenMavenRemoteResponseList.md +14 -13
- data/docs/PaginatedmavenMavenRepositoryResponseList.md +14 -13
- data/docs/PatchedmavenMavenDistribution.md +20 -19
- data/docs/PatchedmavenMavenRemote.md +48 -47
- data/docs/PatchedmavenMavenRepository.md +16 -15
- data/docs/PolicyEnum.md +4 -5
- data/docs/PulpMavenApi.md +60 -25
- data/docs/RemotesMavenApi.md +269 -132
- data/docs/Repair.md +8 -7
- data/docs/RepositoriesMavenApi.md +296 -144
- data/docs/RepositoriesMavenVersionsApi.md +152 -82
- data/docs/RepositoryAddCachedContent.md +8 -7
- 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_maven_client/api/content_artifact_api.rb +20 -14
- data/lib/pulp_maven_client/api/distributions_maven_api.rb +61 -38
- data/lib/pulp_maven_client/api/pulp_maven_api.rb +9 -7
- data/lib/pulp_maven_client/api/remotes_maven_api.rb +76 -50
- data/lib/pulp_maven_client/api/repositories_maven_api.rb +70 -43
- data/lib/pulp_maven_client/api/repositories_maven_versions_api.rb +40 -30
- data/lib/pulp_maven_client/api_client.rb +137 -102
- data/lib/pulp_maven_client/api_error.rb +2 -1
- data/lib/pulp_maven_client/configuration.rb +162 -21
- data/lib/pulp_maven_client/models/async_operation_response.rb +32 -22
- data/lib/pulp_maven_client/models/content_summary_response.rb +36 -22
- data/lib/pulp_maven_client/models/maven_maven_artifact.rb +34 -22
- data/lib/pulp_maven_client/models/maven_maven_artifact_response.rb +34 -24
- data/lib/pulp_maven_client/models/maven_maven_distribution.rb +34 -22
- data/lib/pulp_maven_client/models/maven_maven_distribution_response.rb +36 -24
- data/lib/pulp_maven_client/models/maven_maven_remote.rb +57 -38
- data/lib/pulp_maven_client/models/maven_maven_remote_response.rb +60 -41
- data/lib/pulp_maven_client/models/{maven_maven_remote_response_hidden_fields.rb → maven_maven_remote_response_hidden_fields_inner.rb} +37 -25
- data/lib/pulp_maven_client/models/maven_maven_repository.rb +32 -37
- data/lib/pulp_maven_client/models/maven_maven_repository_response.rb +34 -39
- data/lib/pulp_maven_client/models/paginated_repository_version_response_list.rb +34 -24
- data/lib/pulp_maven_client/models/paginatedmaven_maven_artifact_response_list.rb +34 -24
- data/lib/pulp_maven_client/models/paginatedmaven_maven_distribution_response_list.rb +34 -24
- data/lib/pulp_maven_client/models/paginatedmaven_maven_remote_response_list.rb +34 -24
- data/lib/pulp_maven_client/models/paginatedmaven_maven_repository_response_list.rb +34 -24
- data/lib/pulp_maven_client/models/patchedmaven_maven_distribution.rb +40 -24
- data/lib/pulp_maven_client/models/patchedmaven_maven_remote.rb +63 -40
- data/lib/pulp_maven_client/models/patchedmaven_maven_repository.rb +35 -38
- data/lib/pulp_maven_client/models/policy_enum.rb +8 -5
- data/lib/pulp_maven_client/models/repair.rb +30 -22
- data/lib/pulp_maven_client/models/repository_add_cached_content.rb +30 -22
- data/lib/pulp_maven_client/models/repository_version_response.rb +32 -24
- data/lib/pulp_maven_client/models/set_label.rb +34 -22
- data/lib/pulp_maven_client/models/set_label_response.rb +34 -22
- data/lib/pulp_maven_client/models/unset_label.rb +32 -22
- data/lib/pulp_maven_client/models/unset_label_response.rb +32 -22
- data/lib/pulp_maven_client/version.rb +2 -2
- data/lib/pulp_maven_client.rb +2 -2
- data/pulp_maven_client.gemspec +9 -6
- data/spec/api/content_artifact_api_spec.rb +4 -4
- data/spec/api/distributions_maven_api_spec.rb +9 -9
- data/spec/api/pulp_maven_api_spec.rb +3 -3
- data/spec/api/remotes_maven_api_spec.rb +16 -15
- data/spec/api/repositories_maven_api_spec.rb +10 -10
- data/spec/api/repositories_maven_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/maven_maven_artifact_response_spec.rb +15 -20
- data/spec/models/maven_maven_artifact_spec.rb +9 -14
- data/spec/models/maven_maven_distribution_response_spec.rb +19 -24
- data/spec/models/maven_maven_distribution_spec.rb +13 -18
- data/spec/models/{maven_maven_remote_response_hidden_fields_spec.rb → maven_maven_remote_response_hidden_fields_inner_spec.rb} +11 -16
- data/spec/models/maven_maven_remote_response_spec.rb +27 -32
- data/spec/models/maven_maven_remote_spec.rb +27 -32
- data/spec/models/maven_maven_repository_response_spec.rb +17 -22
- data/spec/models/maven_maven_repository_spec.rb +11 -16
- data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
- data/spec/models/paginatedmaven_maven_artifact_response_list_spec.rb +10 -15
- data/spec/models/paginatedmaven_maven_distribution_response_list_spec.rb +10 -15
- data/spec/models/paginatedmaven_maven_remote_response_list_spec.rb +10 -15
- data/spec/models/paginatedmaven_maven_repository_response_list_spec.rb +10 -15
- data/spec/models/patchedmaven_maven_distribution_spec.rb +13 -18
- data/spec/models/patchedmaven_maven_remote_spec.rb +27 -32
- data/spec/models/patchedmaven_maven_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_cached_content_spec.rb +7 -12
- 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 +67 -43
- data/docs/MavenMavenRemoteResponseHiddenFields.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 PulpMavenClient
|
16
17
|
# A Serializer for MavenArtifact.
|
@@ -33,6 +34,11 @@ module PulpMavenClient
|
|
33
34
|
}
|
34
35
|
end
|
35
36
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
36
42
|
# Attribute type mapping.
|
37
43
|
def self.openapi_types
|
38
44
|
{
|
@@ -69,16 +75,21 @@ module PulpMavenClient
|
|
69
75
|
|
70
76
|
if attributes.key?(:'artifact')
|
71
77
|
self.artifact = attributes[:'artifact']
|
78
|
+
else
|
79
|
+
self.artifact = nil
|
72
80
|
end
|
73
81
|
|
74
82
|
if attributes.key?(:'relative_path')
|
75
83
|
self.relative_path = attributes[:'relative_path']
|
84
|
+
else
|
85
|
+
self.relative_path = nil
|
76
86
|
end
|
77
87
|
end
|
78
88
|
|
79
89
|
# Show invalid properties with the reasons. Usually used together with valid?
|
80
90
|
# @return Array for valid properties with the reasons
|
81
91
|
def list_invalid_properties
|
92
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
82
93
|
invalid_properties = Array.new
|
83
94
|
if @artifact.nil?
|
84
95
|
invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
|
@@ -98,6 +109,7 @@ module PulpMavenClient
|
|
98
109
|
# Check to see if the all the properties in the model are valid
|
99
110
|
# @return true if the model is valid
|
100
111
|
def valid?
|
112
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
101
113
|
return false if @artifact.nil?
|
102
114
|
return false if @relative_path.nil?
|
103
115
|
return false if @relative_path.to_s.length < 1
|
@@ -144,37 +156,33 @@ module PulpMavenClient
|
|
144
156
|
# @param [Hash] attributes Model attributes in the form of hash
|
145
157
|
# @return [Object] Returns the model itself
|
146
158
|
def self.build_from_hash(attributes)
|
147
|
-
new.build_from_hash(attributes)
|
148
|
-
end
|
149
|
-
|
150
|
-
# Builds the object from hash
|
151
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
152
|
-
# @return [Object] Returns the model itself
|
153
|
-
def build_from_hash(attributes)
|
154
159
|
return nil unless attributes.is_a?(Hash)
|
155
|
-
|
156
|
-
|
160
|
+
attributes = attributes.transform_keys(&:to_sym)
|
161
|
+
transformed_hash = {}
|
162
|
+
openapi_types.each_pair do |key, type|
|
163
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
164
|
+
transformed_hash["#{key}"] = nil
|
165
|
+
elsif type =~ /\AArray<(.*)>/i
|
157
166
|
# check to ensure the input is an array given that the attribute
|
158
167
|
# is documented as an array but the input is not
|
159
|
-
if attributes[
|
160
|
-
|
168
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
169
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
161
170
|
end
|
162
|
-
elsif !attributes[
|
163
|
-
|
164
|
-
end
|
171
|
+
elsif !attributes[attribute_map[key]].nil?
|
172
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
173
|
+
end
|
165
174
|
end
|
166
|
-
|
167
|
-
self
|
175
|
+
new(transformed_hash)
|
168
176
|
end
|
169
177
|
|
170
178
|
# Deserializes the data based on type
|
171
179
|
# @param string type Data type
|
172
180
|
# @param string value Value to be deserialized
|
173
181
|
# @return [Object] Deserialized data
|
174
|
-
def _deserialize(type, value)
|
182
|
+
def self._deserialize(type, value)
|
175
183
|
case type.to_sym
|
176
|
-
when :
|
177
|
-
|
184
|
+
when :Time
|
185
|
+
Time.parse(value)
|
178
186
|
when :Date
|
179
187
|
Date.parse(value)
|
180
188
|
when :String
|
@@ -204,7 +212,9 @@ module PulpMavenClient
|
|
204
212
|
end
|
205
213
|
end
|
206
214
|
else # model
|
207
|
-
|
215
|
+
# models (e.g. Pet) or oneOf
|
216
|
+
klass = PulpMavenClient.const_get(type)
|
217
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
208
218
|
end
|
209
219
|
end
|
210
220
|
|
@@ -230,7 +240,7 @@ module PulpMavenClient
|
|
230
240
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
231
241
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
232
242
|
end
|
233
|
-
|
243
|
+
|
234
244
|
hash[param] = _to_hash(value)
|
235
245
|
end
|
236
246
|
hash
|
@@ -253,5 +263,7 @@ module PulpMavenClient
|
|
253
263
|
value
|
254
264
|
end
|
255
265
|
end
|
266
|
+
|
256
267
|
end
|
268
|
+
|
257
269
|
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 PulpMavenClient
|
16
17
|
# A Serializer for MavenArtifact.
|
@@ -56,13 +57,18 @@ module PulpMavenClient
|
|
56
57
|
}
|
57
58
|
end
|
58
59
|
|
60
|
+
# Returns all the JSON keys this model knows about
|
61
|
+
def self.acceptable_attributes
|
62
|
+
attribute_map.values
|
63
|
+
end
|
64
|
+
|
59
65
|
# Attribute type mapping.
|
60
66
|
def self.openapi_types
|
61
67
|
{
|
62
68
|
:'pulp_href' => :'String',
|
63
69
|
:'prn' => :'String',
|
64
|
-
:'pulp_created' => :'
|
65
|
-
:'pulp_last_updated' => :'
|
70
|
+
:'pulp_created' => :'Time',
|
71
|
+
:'pulp_last_updated' => :'Time',
|
66
72
|
:'artifact' => :'String',
|
67
73
|
:'group_id' => :'String',
|
68
74
|
:'artifact_id' => :'String',
|
@@ -110,6 +116,8 @@ module PulpMavenClient
|
|
110
116
|
|
111
117
|
if attributes.key?(:'artifact')
|
112
118
|
self.artifact = attributes[:'artifact']
|
119
|
+
else
|
120
|
+
self.artifact = nil
|
113
121
|
end
|
114
122
|
|
115
123
|
if attributes.key?(:'group_id')
|
@@ -132,6 +140,7 @@ module PulpMavenClient
|
|
132
140
|
# Show invalid properties with the reasons. Usually used together with valid?
|
133
141
|
# @return Array for valid properties with the reasons
|
134
142
|
def list_invalid_properties
|
143
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
135
144
|
invalid_properties = Array.new
|
136
145
|
if @artifact.nil?
|
137
146
|
invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
|
@@ -143,6 +152,7 @@ module PulpMavenClient
|
|
143
152
|
# Check to see if the all the properties in the model are valid
|
144
153
|
# @return true if the model is valid
|
145
154
|
def valid?
|
155
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
146
156
|
return false if @artifact.nil?
|
147
157
|
true
|
148
158
|
end
|
@@ -179,37 +189,33 @@ module PulpMavenClient
|
|
179
189
|
# @param [Hash] attributes Model attributes in the form of hash
|
180
190
|
# @return [Object] Returns the model itself
|
181
191
|
def self.build_from_hash(attributes)
|
182
|
-
new.build_from_hash(attributes)
|
183
|
-
end
|
184
|
-
|
185
|
-
# Builds the object from hash
|
186
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
187
|
-
# @return [Object] Returns the model itself
|
188
|
-
def build_from_hash(attributes)
|
189
192
|
return nil unless attributes.is_a?(Hash)
|
190
|
-
|
191
|
-
|
193
|
+
attributes = attributes.transform_keys(&:to_sym)
|
194
|
+
transformed_hash = {}
|
195
|
+
openapi_types.each_pair do |key, type|
|
196
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
197
|
+
transformed_hash["#{key}"] = nil
|
198
|
+
elsif type =~ /\AArray<(.*)>/i
|
192
199
|
# check to ensure the input is an array given that the attribute
|
193
200
|
# is documented as an array but the input is not
|
194
|
-
if attributes[
|
195
|
-
|
201
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
202
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
196
203
|
end
|
197
|
-
elsif !attributes[
|
198
|
-
|
199
|
-
end
|
204
|
+
elsif !attributes[attribute_map[key]].nil?
|
205
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
206
|
+
end
|
200
207
|
end
|
201
|
-
|
202
|
-
self
|
208
|
+
new(transformed_hash)
|
203
209
|
end
|
204
210
|
|
205
211
|
# Deserializes the data based on type
|
206
212
|
# @param string type Data type
|
207
213
|
# @param string value Value to be deserialized
|
208
214
|
# @return [Object] Deserialized data
|
209
|
-
def _deserialize(type, value)
|
215
|
+
def self._deserialize(type, value)
|
210
216
|
case type.to_sym
|
211
|
-
when :
|
212
|
-
|
217
|
+
when :Time
|
218
|
+
Time.parse(value)
|
213
219
|
when :Date
|
214
220
|
Date.parse(value)
|
215
221
|
when :String
|
@@ -239,7 +245,9 @@ module PulpMavenClient
|
|
239
245
|
end
|
240
246
|
end
|
241
247
|
else # model
|
242
|
-
|
248
|
+
# models (e.g. Pet) or oneOf
|
249
|
+
klass = PulpMavenClient.const_get(type)
|
250
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
243
251
|
end
|
244
252
|
end
|
245
253
|
|
@@ -265,7 +273,7 @@ module PulpMavenClient
|
|
265
273
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
266
274
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
267
275
|
end
|
268
|
-
|
276
|
+
|
269
277
|
hash[param] = _to_hash(value)
|
270
278
|
end
|
271
279
|
hash
|
@@ -288,5 +296,7 @@ module PulpMavenClient
|
|
288
296
|
value
|
289
297
|
end
|
290
298
|
end
|
299
|
+
|
291
300
|
end
|
301
|
+
|
292
302
|
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 PulpMavenClient
|
16
17
|
# Serializer for Maven Distributions.
|
@@ -48,6 +49,11 @@ module PulpMavenClient
|
|
48
49
|
}
|
49
50
|
end
|
50
51
|
|
52
|
+
# Returns all the JSON keys this model knows about
|
53
|
+
def self.acceptable_attributes
|
54
|
+
attribute_map.values
|
55
|
+
end
|
56
|
+
|
51
57
|
# Attribute type mapping.
|
52
58
|
def self.openapi_types
|
53
59
|
{
|
@@ -87,6 +93,8 @@ module PulpMavenClient
|
|
87
93
|
|
88
94
|
if attributes.key?(:'base_path')
|
89
95
|
self.base_path = attributes[:'base_path']
|
96
|
+
else
|
97
|
+
self.base_path = nil
|
90
98
|
end
|
91
99
|
|
92
100
|
if attributes.key?(:'content_guard')
|
@@ -107,6 +115,8 @@ module PulpMavenClient
|
|
107
115
|
|
108
116
|
if attributes.key?(:'name')
|
109
117
|
self.name = attributes[:'name']
|
118
|
+
else
|
119
|
+
self.name = nil
|
110
120
|
end
|
111
121
|
|
112
122
|
if attributes.key?(:'repository')
|
@@ -121,6 +131,7 @@ module PulpMavenClient
|
|
121
131
|
# Show invalid properties with the reasons. Usually used together with valid?
|
122
132
|
# @return Array for valid properties with the reasons
|
123
133
|
def list_invalid_properties
|
134
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
124
135
|
invalid_properties = Array.new
|
125
136
|
if @base_path.nil?
|
126
137
|
invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
|
@@ -144,6 +155,7 @@ module PulpMavenClient
|
|
144
155
|
# Check to see if the all the properties in the model are valid
|
145
156
|
# @return true if the model is valid
|
146
157
|
def valid?
|
158
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
147
159
|
return false if @base_path.nil?
|
148
160
|
return false if @base_path.to_s.length < 1
|
149
161
|
return false if @name.nil?
|
@@ -209,37 +221,33 @@ module PulpMavenClient
|
|
209
221
|
# @param [Hash] attributes Model attributes in the form of hash
|
210
222
|
# @return [Object] Returns the model itself
|
211
223
|
def self.build_from_hash(attributes)
|
212
|
-
new.build_from_hash(attributes)
|
213
|
-
end
|
214
|
-
|
215
|
-
# Builds the object from hash
|
216
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
217
|
-
# @return [Object] Returns the model itself
|
218
|
-
def build_from_hash(attributes)
|
219
224
|
return nil unless attributes.is_a?(Hash)
|
220
|
-
|
221
|
-
|
225
|
+
attributes = attributes.transform_keys(&:to_sym)
|
226
|
+
transformed_hash = {}
|
227
|
+
openapi_types.each_pair do |key, type|
|
228
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
229
|
+
transformed_hash["#{key}"] = nil
|
230
|
+
elsif type =~ /\AArray<(.*)>/i
|
222
231
|
# check to ensure the input is an array given that the attribute
|
223
232
|
# is documented as an array but the input is not
|
224
|
-
if attributes[
|
225
|
-
|
233
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
234
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
226
235
|
end
|
227
|
-
elsif !attributes[
|
228
|
-
|
229
|
-
end
|
236
|
+
elsif !attributes[attribute_map[key]].nil?
|
237
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
238
|
+
end
|
230
239
|
end
|
231
|
-
|
232
|
-
self
|
240
|
+
new(transformed_hash)
|
233
241
|
end
|
234
242
|
|
235
243
|
# Deserializes the data based on type
|
236
244
|
# @param string type Data type
|
237
245
|
# @param string value Value to be deserialized
|
238
246
|
# @return [Object] Deserialized data
|
239
|
-
def _deserialize(type, value)
|
247
|
+
def self._deserialize(type, value)
|
240
248
|
case type.to_sym
|
241
|
-
when :
|
242
|
-
|
249
|
+
when :Time
|
250
|
+
Time.parse(value)
|
243
251
|
when :Date
|
244
252
|
Date.parse(value)
|
245
253
|
when :String
|
@@ -269,7 +277,9 @@ module PulpMavenClient
|
|
269
277
|
end
|
270
278
|
end
|
271
279
|
else # model
|
272
|
-
|
280
|
+
# models (e.g. Pet) or oneOf
|
281
|
+
klass = PulpMavenClient.const_get(type)
|
282
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
273
283
|
end
|
274
284
|
end
|
275
285
|
|
@@ -295,7 +305,7 @@ module PulpMavenClient
|
|
295
305
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
296
306
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
297
307
|
end
|
298
|
-
|
308
|
+
|
299
309
|
hash[param] = _to_hash(value)
|
300
310
|
end
|
301
311
|
hash
|
@@ -318,5 +328,7 @@ module PulpMavenClient
|
|
318
328
|
value
|
319
329
|
end
|
320
330
|
end
|
331
|
+
|
321
332
|
end
|
333
|
+
|
322
334
|
end
|
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
Contact: pulp-list@redhat.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.10.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module PulpMavenClient
|
16
17
|
# Serializer for Maven Distributions.
|
@@ -71,13 +72,18 @@ module PulpMavenClient
|
|
71
72
|
}
|
72
73
|
end
|
73
74
|
|
75
|
+
# Returns all the JSON keys this model knows about
|
76
|
+
def self.acceptable_attributes
|
77
|
+
attribute_map.values
|
78
|
+
end
|
79
|
+
|
74
80
|
# Attribute type mapping.
|
75
81
|
def self.openapi_types
|
76
82
|
{
|
77
83
|
:'pulp_href' => :'String',
|
78
84
|
:'prn' => :'String',
|
79
|
-
:'pulp_created' => :'
|
80
|
-
:'pulp_last_updated' => :'
|
85
|
+
:'pulp_created' => :'Time',
|
86
|
+
:'pulp_last_updated' => :'Time',
|
81
87
|
:'base_path' => :'String',
|
82
88
|
:'base_url' => :'String',
|
83
89
|
:'content_guard' => :'String',
|
@@ -132,6 +138,8 @@ module PulpMavenClient
|
|
132
138
|
|
133
139
|
if attributes.key?(:'base_path')
|
134
140
|
self.base_path = attributes[:'base_path']
|
141
|
+
else
|
142
|
+
self.base_path = nil
|
135
143
|
end
|
136
144
|
|
137
145
|
if attributes.key?(:'base_url')
|
@@ -160,6 +168,8 @@ module PulpMavenClient
|
|
160
168
|
|
161
169
|
if attributes.key?(:'name')
|
162
170
|
self.name = attributes[:'name']
|
171
|
+
else
|
172
|
+
self.name = nil
|
163
173
|
end
|
164
174
|
|
165
175
|
if attributes.key?(:'repository')
|
@@ -174,6 +184,7 @@ module PulpMavenClient
|
|
174
184
|
# Show invalid properties with the reasons. Usually used together with valid?
|
175
185
|
# @return Array for valid properties with the reasons
|
176
186
|
def list_invalid_properties
|
187
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
177
188
|
invalid_properties = Array.new
|
178
189
|
if @base_path.nil?
|
179
190
|
invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
|
@@ -189,6 +200,7 @@ module PulpMavenClient
|
|
189
200
|
# Check to see if the all the properties in the model are valid
|
190
201
|
# @return true if the model is valid
|
191
202
|
def valid?
|
203
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
192
204
|
return false if @base_path.nil?
|
193
205
|
return false if @name.nil?
|
194
206
|
true
|
@@ -230,37 +242,33 @@ module PulpMavenClient
|
|
230
242
|
# @param [Hash] attributes Model attributes in the form of hash
|
231
243
|
# @return [Object] Returns the model itself
|
232
244
|
def self.build_from_hash(attributes)
|
233
|
-
new.build_from_hash(attributes)
|
234
|
-
end
|
235
|
-
|
236
|
-
# Builds the object from hash
|
237
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
238
|
-
# @return [Object] Returns the model itself
|
239
|
-
def build_from_hash(attributes)
|
240
245
|
return nil unless attributes.is_a?(Hash)
|
241
|
-
|
242
|
-
|
246
|
+
attributes = attributes.transform_keys(&:to_sym)
|
247
|
+
transformed_hash = {}
|
248
|
+
openapi_types.each_pair do |key, type|
|
249
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
250
|
+
transformed_hash["#{key}"] = nil
|
251
|
+
elsif type =~ /\AArray<(.*)>/i
|
243
252
|
# check to ensure the input is an array given that the attribute
|
244
253
|
# is documented as an array but the input is not
|
245
|
-
if attributes[
|
246
|
-
|
254
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
255
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
247
256
|
end
|
248
|
-
elsif !attributes[
|
249
|
-
|
250
|
-
end
|
257
|
+
elsif !attributes[attribute_map[key]].nil?
|
258
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
259
|
+
end
|
251
260
|
end
|
252
|
-
|
253
|
-
self
|
261
|
+
new(transformed_hash)
|
254
262
|
end
|
255
263
|
|
256
264
|
# Deserializes the data based on type
|
257
265
|
# @param string type Data type
|
258
266
|
# @param string value Value to be deserialized
|
259
267
|
# @return [Object] Deserialized data
|
260
|
-
def _deserialize(type, value)
|
268
|
+
def self._deserialize(type, value)
|
261
269
|
case type.to_sym
|
262
|
-
when :
|
263
|
-
|
270
|
+
when :Time
|
271
|
+
Time.parse(value)
|
264
272
|
when :Date
|
265
273
|
Date.parse(value)
|
266
274
|
when :String
|
@@ -290,7 +298,9 @@ module PulpMavenClient
|
|
290
298
|
end
|
291
299
|
end
|
292
300
|
else # model
|
293
|
-
|
301
|
+
# models (e.g. Pet) or oneOf
|
302
|
+
klass = PulpMavenClient.const_get(type)
|
303
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
294
304
|
end
|
295
305
|
end
|
296
306
|
|
@@ -316,7 +326,7 @@ module PulpMavenClient
|
|
316
326
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
317
327
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
318
328
|
end
|
319
|
-
|
329
|
+
|
320
330
|
hash[param] = _to_hash(value)
|
321
331
|
end
|
322
332
|
hash
|
@@ -339,5 +349,7 @@ module PulpMavenClient
|
|
339
349
|
value
|
340
350
|
end
|
341
351
|
end
|
352
|
+
|
342
353
|
end
|
354
|
+
|
343
355
|
end
|