pulp_maven_client 0.8.1 → 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 +11 -7
- data/docs/AsyncOperationResponse.md +8 -7
- data/docs/ContentArtifactApi.md +116 -64
- data/docs/ContentSummaryResponse.md +12 -11
- data/docs/DistributionsMavenApi.md +267 -130
- data/docs/MavenMavenArtifact.md +12 -11
- data/docs/MavenMavenArtifactResponse.md +24 -21
- data/docs/MavenMavenDistribution.md +20 -19
- data/docs/MavenMavenDistributionResponse.md +32 -27
- data/docs/MavenMavenRemote.md +48 -47
- data/docs/MavenMavenRemoteResponse.md +48 -45
- data/docs/MavenMavenRemoteResponseHiddenFieldsInner.md +20 -0
- data/docs/MavenMavenRepository.md +16 -15
- data/docs/MavenMavenRepositoryResponse.md +28 -25
- 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 +61 -26
- data/docs/RemotesMavenApi.md +271 -132
- data/docs/Repair.md +8 -7
- data/docs/RepositoriesMavenApi.md +300 -146
- data/docs/RepositoriesMavenVersionsApi.md +155 -83
- data/docs/RepositoryAddCachedContent.md +8 -7
- 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_maven_client/api/content_artifact_api.rb +31 -22
- data/lib/pulp_maven_client/api/distributions_maven_api.rb +66 -40
- data/lib/pulp_maven_client/api/pulp_maven_api.rb +9 -7
- data/lib/pulp_maven_client/api/remotes_maven_api.rb +81 -52
- data/lib/pulp_maven_client/api/repositories_maven_api.rb +79 -49
- data/lib/pulp_maven_client/api/repositories_maven_versions_api.rb +50 -37
- 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 +45 -25
- data/lib/pulp_maven_client/models/maven_maven_distribution.rb +34 -22
- data/lib/pulp_maven_client/models/maven_maven_distribution_response.rb +57 -25
- data/lib/pulp_maven_client/models/maven_maven_remote.rb +57 -38
- data/lib/pulp_maven_client/models/maven_maven_remote_response.rb +71 -42
- 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 +45 -40
- 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 +44 -26
- 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 +9 -8
- data/spec/api/distributions_maven_api_spec.rb +11 -10
- data/spec/api/pulp_maven_api_spec.rb +3 -3
- data/spec/api/remotes_maven_api_spec.rb +18 -16
- data/spec/api/repositories_maven_api_spec.rb +14 -13
- data/spec/api/repositories_maven_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/maven_maven_artifact_response_spec.rb +20 -19
- data/spec/models/maven_maven_artifact_spec.rb +9 -14
- data/spec/models/maven_maven_distribution_response_spec.rb +29 -22
- 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 +32 -31
- data/spec/models/maven_maven_remote_spec.rb +27 -32
- data/spec/models/maven_maven_repository_response_spec.rb +22 -21
- 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 +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 +78 -54
- 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
|
# Serializer for Maven Repositories.
|
@@ -40,6 +41,11 @@ module PulpMavenClient
|
|
40
41
|
}
|
41
42
|
end
|
42
43
|
|
44
|
+
# Returns all the JSON keys this model knows about
|
45
|
+
def self.acceptable_attributes
|
46
|
+
attribute_map.values
|
47
|
+
end
|
48
|
+
|
43
49
|
# Attribute type mapping.
|
44
50
|
def self.openapi_types
|
45
51
|
{
|
@@ -101,6 +107,7 @@ module PulpMavenClient
|
|
101
107
|
# Show invalid properties with the reasons. Usually used together with valid?
|
102
108
|
# @return Array for valid properties with the reasons
|
103
109
|
def list_invalid_properties
|
110
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
104
111
|
invalid_properties = Array.new
|
105
112
|
if !@name.nil? && @name.to_s.length < 1
|
106
113
|
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
@@ -110,26 +117,26 @@ module PulpMavenClient
|
|
110
117
|
invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
|
111
118
|
end
|
112
119
|
|
113
|
-
if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
114
|
-
invalid_properties.push('invalid value for "retain_repo_versions", must be greater than or equal to 1.')
|
115
|
-
end
|
116
|
-
|
117
120
|
invalid_properties
|
118
121
|
end
|
119
122
|
|
120
123
|
# Check to see if the all the properties in the model are valid
|
121
124
|
# @return true if the model is valid
|
122
125
|
def valid?
|
126
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
123
127
|
return false if !@name.nil? && @name.to_s.length < 1
|
124
128
|
return false if !@description.nil? && @description.to_s.length < 1
|
125
|
-
return false if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
126
129
|
true
|
127
130
|
end
|
128
131
|
|
129
132
|
# Custom attribute writer method with validation
|
130
133
|
# @param [Object] name Value to be assigned
|
131
134
|
def name=(name)
|
132
|
-
if
|
135
|
+
if name.nil?
|
136
|
+
fail ArgumentError, 'name cannot be nil'
|
137
|
+
end
|
138
|
+
|
139
|
+
if name.to_s.length < 1
|
133
140
|
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
134
141
|
end
|
135
142
|
|
@@ -146,16 +153,6 @@ module PulpMavenClient
|
|
146
153
|
@description = description
|
147
154
|
end
|
148
155
|
|
149
|
-
# Custom attribute writer method with validation
|
150
|
-
# @param [Object] retain_repo_versions Value to be assigned
|
151
|
-
def retain_repo_versions=(retain_repo_versions)
|
152
|
-
if !retain_repo_versions.nil? && retain_repo_versions < 1
|
153
|
-
fail ArgumentError, 'invalid value for "retain_repo_versions", must be greater than or equal to 1.'
|
154
|
-
end
|
155
|
-
|
156
|
-
@retain_repo_versions = retain_repo_versions
|
157
|
-
end
|
158
|
-
|
159
156
|
# Checks equality by comparing each attribute.
|
160
157
|
# @param [Object] Object to be compared
|
161
158
|
def ==(o)
|
@@ -184,37 +181,33 @@ module PulpMavenClient
|
|
184
181
|
# @param [Hash] attributes Model attributes in the form of hash
|
185
182
|
# @return [Object] Returns the model itself
|
186
183
|
def self.build_from_hash(attributes)
|
187
|
-
new.build_from_hash(attributes)
|
188
|
-
end
|
189
|
-
|
190
|
-
# Builds the object from hash
|
191
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
192
|
-
# @return [Object] Returns the model itself
|
193
|
-
def build_from_hash(attributes)
|
194
184
|
return nil unless attributes.is_a?(Hash)
|
195
|
-
|
196
|
-
|
185
|
+
attributes = attributes.transform_keys(&:to_sym)
|
186
|
+
transformed_hash = {}
|
187
|
+
openapi_types.each_pair do |key, type|
|
188
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
189
|
+
transformed_hash["#{key}"] = nil
|
190
|
+
elsif type =~ /\AArray<(.*)>/i
|
197
191
|
# check to ensure the input is an array given that the attribute
|
198
192
|
# is documented as an array but the input is not
|
199
|
-
if attributes[
|
200
|
-
|
193
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
194
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
201
195
|
end
|
202
|
-
elsif !attributes[
|
203
|
-
|
204
|
-
end
|
196
|
+
elsif !attributes[attribute_map[key]].nil?
|
197
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
198
|
+
end
|
205
199
|
end
|
206
|
-
|
207
|
-
self
|
200
|
+
new(transformed_hash)
|
208
201
|
end
|
209
202
|
|
210
203
|
# Deserializes the data based on type
|
211
204
|
# @param string type Data type
|
212
205
|
# @param string value Value to be deserialized
|
213
206
|
# @return [Object] Deserialized data
|
214
|
-
def _deserialize(type, value)
|
207
|
+
def self._deserialize(type, value)
|
215
208
|
case type.to_sym
|
216
|
-
when :
|
217
|
-
|
209
|
+
when :Time
|
210
|
+
Time.parse(value)
|
218
211
|
when :Date
|
219
212
|
Date.parse(value)
|
220
213
|
when :String
|
@@ -244,7 +237,9 @@ module PulpMavenClient
|
|
244
237
|
end
|
245
238
|
end
|
246
239
|
else # model
|
247
|
-
|
240
|
+
# models (e.g. Pet) or oneOf
|
241
|
+
klass = PulpMavenClient.const_get(type)
|
242
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
248
243
|
end
|
249
244
|
end
|
250
245
|
|
@@ -270,7 +265,7 @@ module PulpMavenClient
|
|
270
265
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
271
266
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
272
267
|
end
|
273
|
-
|
268
|
+
|
274
269
|
hash[param] = _to_hash(value)
|
275
270
|
end
|
276
271
|
hash
|
@@ -293,5 +288,7 @@ module PulpMavenClient
|
|
293
288
|
value
|
294
289
|
end
|
295
290
|
end
|
291
|
+
|
296
292
|
end
|
293
|
+
|
297
294
|
end
|
@@ -6,16 +6,20 @@
|
|
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
|
class PolicyEnum
|
17
18
|
IMMEDIATE = "immediate".freeze
|
18
|
-
|
19
|
+
|
20
|
+
def self.all_vars
|
21
|
+
@all_vars ||= [IMMEDIATE].freeze
|
22
|
+
end
|
19
23
|
|
20
24
|
# Builds the enum from string
|
21
25
|
# @param [String] The enum value in the form of the string
|
@@ -28,9 +32,8 @@ module PulpMavenClient
|
|
28
32
|
# @param [String] The enum value in the form of the string
|
29
33
|
# @return [String] The enum value
|
30
34
|
def build_from_hash(value)
|
31
|
-
|
32
|
-
raise "Invalid ENUM value #{value} for class #PolicyEnum"
|
33
|
-
value
|
35
|
+
return value if PolicyEnum.all_vars.include?(value)
|
36
|
+
raise "Invalid ENUM value #{value} for class #PolicyEnum"
|
34
37
|
end
|
35
38
|
end
|
36
39
|
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
|
class Repair
|
@@ -24,6 +25,11 @@ module PulpMavenClient
|
|
24
25
|
}
|
25
26
|
end
|
26
27
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
27
33
|
# Attribute type mapping.
|
28
34
|
def self.openapi_types
|
29
35
|
{
|
@@ -62,6 +68,7 @@ module PulpMavenClient
|
|
62
68
|
# Show invalid properties with the reasons. Usually used together with valid?
|
63
69
|
# @return Array for valid properties with the reasons
|
64
70
|
def list_invalid_properties
|
71
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
65
72
|
invalid_properties = Array.new
|
66
73
|
invalid_properties
|
67
74
|
end
|
@@ -69,6 +76,7 @@ module PulpMavenClient
|
|
69
76
|
# Check to see if the all the properties in the model are valid
|
70
77
|
# @return true if the model is valid
|
71
78
|
def valid?
|
79
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
72
80
|
true
|
73
81
|
end
|
74
82
|
|
@@ -96,37 +104,33 @@ module PulpMavenClient
|
|
96
104
|
# @param [Hash] attributes Model attributes in the form of hash
|
97
105
|
# @return [Object] Returns the model itself
|
98
106
|
def self.build_from_hash(attributes)
|
99
|
-
new.build_from_hash(attributes)
|
100
|
-
end
|
101
|
-
|
102
|
-
# Builds the object from hash
|
103
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
-
# @return [Object] Returns the model itself
|
105
|
-
def build_from_hash(attributes)
|
106
107
|
return nil unless attributes.is_a?(Hash)
|
107
|
-
|
108
|
-
|
108
|
+
attributes = attributes.transform_keys(&:to_sym)
|
109
|
+
transformed_hash = {}
|
110
|
+
openapi_types.each_pair do |key, type|
|
111
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
112
|
+
transformed_hash["#{key}"] = nil
|
113
|
+
elsif type =~ /\AArray<(.*)>/i
|
109
114
|
# check to ensure the input is an array given that the attribute
|
110
115
|
# is documented as an array but the input is not
|
111
|
-
if attributes[
|
112
|
-
|
116
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
117
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
113
118
|
end
|
114
|
-
elsif !attributes[
|
115
|
-
|
116
|
-
end
|
119
|
+
elsif !attributes[attribute_map[key]].nil?
|
120
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
121
|
+
end
|
117
122
|
end
|
118
|
-
|
119
|
-
self
|
123
|
+
new(transformed_hash)
|
120
124
|
end
|
121
125
|
|
122
126
|
# Deserializes the data based on type
|
123
127
|
# @param string type Data type
|
124
128
|
# @param string value Value to be deserialized
|
125
129
|
# @return [Object] Deserialized data
|
126
|
-
def _deserialize(type, value)
|
130
|
+
def self._deserialize(type, value)
|
127
131
|
case type.to_sym
|
128
|
-
when :
|
129
|
-
|
132
|
+
when :Time
|
133
|
+
Time.parse(value)
|
130
134
|
when :Date
|
131
135
|
Date.parse(value)
|
132
136
|
when :String
|
@@ -156,7 +160,9 @@ module PulpMavenClient
|
|
156
160
|
end
|
157
161
|
end
|
158
162
|
else # model
|
159
|
-
|
163
|
+
# models (e.g. Pet) or oneOf
|
164
|
+
klass = PulpMavenClient.const_get(type)
|
165
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
160
166
|
end
|
161
167
|
end
|
162
168
|
|
@@ -182,7 +188,7 @@ module PulpMavenClient
|
|
182
188
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
183
189
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
184
190
|
end
|
185
|
-
|
191
|
+
|
186
192
|
hash[param] = _to_hash(value)
|
187
193
|
end
|
188
194
|
hash
|
@@ -205,5 +211,7 @@ module PulpMavenClient
|
|
205
211
|
value
|
206
212
|
end
|
207
213
|
end
|
214
|
+
|
208
215
|
end
|
216
|
+
|
209
217
|
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 mixin for validating unknown serializers' fields.
|
@@ -25,6 +26,11 @@ module PulpMavenClient
|
|
25
26
|
}
|
26
27
|
end
|
27
28
|
|
29
|
+
# Returns all the JSON keys this model knows about
|
30
|
+
def self.acceptable_attributes
|
31
|
+
attribute_map.values
|
32
|
+
end
|
33
|
+
|
28
34
|
# Attribute type mapping.
|
29
35
|
def self.openapi_types
|
30
36
|
{
|
@@ -61,6 +67,7 @@ module PulpMavenClient
|
|
61
67
|
# Show invalid properties with the reasons. Usually used together with valid?
|
62
68
|
# @return Array for valid properties with the reasons
|
63
69
|
def list_invalid_properties
|
70
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
64
71
|
invalid_properties = Array.new
|
65
72
|
invalid_properties
|
66
73
|
end
|
@@ -68,6 +75,7 @@ module PulpMavenClient
|
|
68
75
|
# Check to see if the all the properties in the model are valid
|
69
76
|
# @return true if the model is valid
|
70
77
|
def valid?
|
78
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
71
79
|
true
|
72
80
|
end
|
73
81
|
|
@@ -95,37 +103,33 @@ module PulpMavenClient
|
|
95
103
|
# @param [Hash] attributes Model attributes in the form of hash
|
96
104
|
# @return [Object] Returns the model itself
|
97
105
|
def self.build_from_hash(attributes)
|
98
|
-
new.build_from_hash(attributes)
|
99
|
-
end
|
100
|
-
|
101
|
-
# Builds the object from hash
|
102
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
-
# @return [Object] Returns the model itself
|
104
|
-
def build_from_hash(attributes)
|
105
106
|
return nil unless attributes.is_a?(Hash)
|
106
|
-
|
107
|
-
|
107
|
+
attributes = attributes.transform_keys(&:to_sym)
|
108
|
+
transformed_hash = {}
|
109
|
+
openapi_types.each_pair do |key, type|
|
110
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
111
|
+
transformed_hash["#{key}"] = nil
|
112
|
+
elsif type =~ /\AArray<(.*)>/i
|
108
113
|
# check to ensure the input is an array given that the attribute
|
109
114
|
# is documented as an array but the input is not
|
110
|
-
if attributes[
|
111
|
-
|
115
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
116
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
112
117
|
end
|
113
|
-
elsif !attributes[
|
114
|
-
|
115
|
-
end
|
118
|
+
elsif !attributes[attribute_map[key]].nil?
|
119
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
120
|
+
end
|
116
121
|
end
|
117
|
-
|
118
|
-
self
|
122
|
+
new(transformed_hash)
|
119
123
|
end
|
120
124
|
|
121
125
|
# Deserializes the data based on type
|
122
126
|
# @param string type Data type
|
123
127
|
# @param string value Value to be deserialized
|
124
128
|
# @return [Object] Deserialized data
|
125
|
-
def _deserialize(type, value)
|
129
|
+
def self._deserialize(type, value)
|
126
130
|
case type.to_sym
|
127
|
-
when :
|
128
|
-
|
131
|
+
when :Time
|
132
|
+
Time.parse(value)
|
129
133
|
when :Date
|
130
134
|
Date.parse(value)
|
131
135
|
when :String
|
@@ -155,7 +159,9 @@ module PulpMavenClient
|
|
155
159
|
end
|
156
160
|
end
|
157
161
|
else # model
|
158
|
-
|
162
|
+
# models (e.g. Pet) or oneOf
|
163
|
+
klass = PulpMavenClient.const_get(type)
|
164
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
159
165
|
end
|
160
166
|
end
|
161
167
|
|
@@ -181,7 +187,7 @@ module PulpMavenClient
|
|
181
187
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
182
188
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
183
189
|
end
|
184
|
-
|
190
|
+
|
185
191
|
hash[param] = _to_hash(value)
|
186
192
|
end
|
187
193
|
hash
|
@@ -204,5 +210,7 @@ module PulpMavenClient
|
|
204
210
|
value
|
205
211
|
end
|
206
212
|
end
|
213
|
+
|
207
214
|
end
|
215
|
+
|
208
216
|
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 PulpMavenClient
|
16
|
-
# Base serializer for use with
|
17
|
+
# Base serializer for use with [pulpcore.app.models.Model][] This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
|
17
18
|
class RepositoryVersionResponse
|
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
|
|
@@ -37,6 +41,7 @@ module PulpMavenClient
|
|
37
41
|
def self.attribute_map
|
38
42
|
{
|
39
43
|
:'pulp_href' => :'pulp_href',
|
44
|
+
:'prn' => :'prn',
|
40
45
|
:'pulp_created' => :'pulp_created',
|
41
46
|
:'pulp_last_updated' => :'pulp_last_updated',
|
42
47
|
:'number' => :'number',
|
@@ -46,12 +51,18 @@ module PulpMavenClient
|
|
46
51
|
}
|
47
52
|
end
|
48
53
|
|
54
|
+
# Returns all the JSON keys this model knows about
|
55
|
+
def self.acceptable_attributes
|
56
|
+
attribute_map.values
|
57
|
+
end
|
58
|
+
|
49
59
|
# Attribute type mapping.
|
50
60
|
def self.openapi_types
|
51
61
|
{
|
52
62
|
:'pulp_href' => :'String',
|
53
|
-
:'
|
54
|
-
:'
|
63
|
+
:'prn' => :'String',
|
64
|
+
:'pulp_created' => :'Time',
|
65
|
+
:'pulp_last_updated' => :'Time',
|
55
66
|
:'number' => :'Integer',
|
56
67
|
:'repository' => :'String',
|
57
68
|
:'base_version' => :'String',
|
@@ -84,6 +95,10 @@ module PulpMavenClient
|
|
84
95
|
self.pulp_href = attributes[:'pulp_href']
|
85
96
|
end
|
86
97
|
|
98
|
+
if attributes.key?(:'prn')
|
99
|
+
self.prn = attributes[:'prn']
|
100
|
+
end
|
101
|
+
|
87
102
|
if attributes.key?(:'pulp_created')
|
88
103
|
self.pulp_created = attributes[:'pulp_created']
|
89
104
|
end
|
@@ -112,6 +127,7 @@ module PulpMavenClient
|
|
112
127
|
# Show invalid properties with the reasons. Usually used together with valid?
|
113
128
|
# @return Array for valid properties with the reasons
|
114
129
|
def list_invalid_properties
|
130
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
115
131
|
invalid_properties = Array.new
|
116
132
|
invalid_properties
|
117
133
|
end
|
@@ -119,6 +135,7 @@ module PulpMavenClient
|
|
119
135
|
# Check to see if the all the properties in the model are valid
|
120
136
|
# @return true if the model is valid
|
121
137
|
def valid?
|
138
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
122
139
|
true
|
123
140
|
end
|
124
141
|
|
@@ -128,6 +145,7 @@ module PulpMavenClient
|
|
128
145
|
return true if self.equal?(o)
|
129
146
|
self.class == o.class &&
|
130
147
|
pulp_href == o.pulp_href &&
|
148
|
+
prn == o.prn &&
|
131
149
|
pulp_created == o.pulp_created &&
|
132
150
|
pulp_last_updated == o.pulp_last_updated &&
|
133
151
|
number == o.number &&
|
@@ -145,44 +163,40 @@ module PulpMavenClient
|
|
145
163
|
# Calculates hash code according to all attributes.
|
146
164
|
# @return [Integer] Hash code
|
147
165
|
def hash
|
148
|
-
[pulp_href, pulp_created, pulp_last_updated, number, repository, base_version, content_summary].hash
|
166
|
+
[pulp_href, prn, pulp_created, pulp_last_updated, number, repository, base_version, content_summary].hash
|
149
167
|
end
|
150
168
|
|
151
169
|
# Builds the object from hash
|
152
170
|
# @param [Hash] attributes Model attributes in the form of hash
|
153
171
|
# @return [Object] Returns the model itself
|
154
172
|
def self.build_from_hash(attributes)
|
155
|
-
new.build_from_hash(attributes)
|
156
|
-
end
|
157
|
-
|
158
|
-
# Builds the object from hash
|
159
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
160
|
-
# @return [Object] Returns the model itself
|
161
|
-
def build_from_hash(attributes)
|
162
173
|
return nil unless attributes.is_a?(Hash)
|
163
|
-
|
164
|
-
|
174
|
+
attributes = attributes.transform_keys(&:to_sym)
|
175
|
+
transformed_hash = {}
|
176
|
+
openapi_types.each_pair do |key, type|
|
177
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
178
|
+
transformed_hash["#{key}"] = nil
|
179
|
+
elsif type =~ /\AArray<(.*)>/i
|
165
180
|
# check to ensure the input is an array given that the attribute
|
166
181
|
# is documented as an array but the input is not
|
167
|
-
if attributes[
|
168
|
-
|
182
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
183
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
169
184
|
end
|
170
|
-
elsif !attributes[
|
171
|
-
|
172
|
-
end
|
185
|
+
elsif !attributes[attribute_map[key]].nil?
|
186
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
187
|
+
end
|
173
188
|
end
|
174
|
-
|
175
|
-
self
|
189
|
+
new(transformed_hash)
|
176
190
|
end
|
177
191
|
|
178
192
|
# Deserializes the data based on type
|
179
193
|
# @param string type Data type
|
180
194
|
# @param string value Value to be deserialized
|
181
195
|
# @return [Object] Deserialized data
|
182
|
-
def _deserialize(type, value)
|
196
|
+
def self._deserialize(type, value)
|
183
197
|
case type.to_sym
|
184
|
-
when :
|
185
|
-
|
198
|
+
when :Time
|
199
|
+
Time.parse(value)
|
186
200
|
when :Date
|
187
201
|
Date.parse(value)
|
188
202
|
when :String
|
@@ -212,7 +226,9 @@ module PulpMavenClient
|
|
212
226
|
end
|
213
227
|
end
|
214
228
|
else # model
|
215
|
-
|
229
|
+
# models (e.g. Pet) or oneOf
|
230
|
+
klass = PulpMavenClient.const_get(type)
|
231
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
216
232
|
end
|
217
233
|
end
|
218
234
|
|
@@ -238,7 +254,7 @@ module PulpMavenClient
|
|
238
254
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
239
255
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
240
256
|
end
|
241
|
-
|
257
|
+
|
242
258
|
hash[param] = _to_hash(value)
|
243
259
|
end
|
244
260
|
hash
|
@@ -261,5 +277,7 @@ module PulpMavenClient
|
|
261
277
|
value
|
262
278
|
end
|
263
279
|
end
|
280
|
+
|
264
281
|
end
|
282
|
+
|
265
283
|
end
|