pulp_npm_client 0.1.0a4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -10
- data/docs/AsyncOperationResponse.md +8 -7
- data/docs/ContentPackagesApi.md +126 -64
- data/docs/ContentSummaryResponse.md +12 -11
- data/docs/DistributionsNpmApi.md +362 -93
- data/docs/NpmNpmDistribution.md +18 -15
- data/docs/NpmNpmDistributionResponse.md +30 -21
- data/docs/NpmNpmRemote.md +48 -47
- data/docs/NpmNpmRemoteResponse.md +48 -43
- data/docs/NpmNpmRemoteResponseHiddenFieldsInner.md +20 -0
- data/docs/NpmNpmRepository.md +16 -15
- data/docs/NpmNpmRepositoryResponse.md +28 -23
- data/docs/NpmPackageResponse.md +22 -17
- data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
- data/docs/PaginatednpmNpmDistributionResponseList.md +14 -13
- data/docs/PaginatednpmNpmRemoteResponseList.md +14 -13
- data/docs/PaginatednpmNpmRepositoryResponseList.md +14 -13
- data/docs/PaginatednpmPackageResponseList.md +14 -13
- data/docs/PatchednpmNpmDistribution.md +18 -15
- data/docs/PatchednpmNpmRemote.md +48 -47
- data/docs/PatchednpmNpmRepository.md +16 -15
- data/docs/PolicyEnum.md +4 -5
- data/docs/RemotesNpmApi.md +364 -99
- data/docs/Repair.md +8 -7
- data/docs/RepositoriesNpmApi.md +429 -110
- data/docs/RepositoriesNpmVersionsApi.md +156 -80
- data/docs/RepositoryAddRemoveContent.md +12 -11
- data/docs/RepositorySyncURL.md +10 -9
- data/docs/RepositoryVersionResponse.md +22 -17
- data/docs/SetLabel.md +20 -0
- data/docs/SetLabelResponse.md +20 -0
- data/docs/UnsetLabel.md +18 -0
- data/docs/UnsetLabelResponse.md +20 -0
- data/lib/pulp_npm_client/api/content_packages_api.rb +72 -44
- data/lib/pulp_npm_client/api/distributions_npm_api.rb +243 -47
- data/lib/pulp_npm_client/api/remotes_npm_api.rb +247 -57
- data/lib/pulp_npm_client/api/repositories_npm_api.rb +283 -55
- data/lib/pulp_npm_client/api/repositories_npm_versions_api.rb +71 -52
- data/lib/pulp_npm_client/api_client.rb +137 -102
- data/lib/pulp_npm_client/api_error.rb +2 -1
- data/lib/pulp_npm_client/configuration.rb +163 -22
- data/lib/pulp_npm_client/models/async_operation_response.rb +32 -22
- data/lib/pulp_npm_client/models/content_summary_response.rb +36 -22
- data/lib/pulp_npm_client/models/npm_npm_distribution.rb +51 -25
- data/lib/pulp_npm_client/models/npm_npm_distribution_response.rb +83 -27
- data/lib/pulp_npm_client/models/npm_npm_remote.rb +61 -25
- data/lib/pulp_npm_client/models/npm_npm_remote_response.rb +99 -41
- data/lib/pulp_npm_client/models/npm_npm_remote_response_hidden_fields_inner.rb +237 -0
- data/lib/pulp_npm_client/models/npm_npm_repository.rb +37 -25
- data/lib/pulp_npm_client/models/npm_npm_repository_response.rb +59 -27
- data/lib/pulp_npm_client/models/npm_package_response.rb +58 -24
- data/lib/pulp_npm_client/models/paginated_repository_version_response_list.rb +44 -22
- data/lib/pulp_npm_client/models/paginatednpm_npm_distribution_response_list.rb +44 -22
- data/lib/pulp_npm_client/models/paginatednpm_npm_remote_response_list.rb +44 -22
- data/lib/pulp_npm_client/models/paginatednpm_npm_repository_response_list.rb +44 -22
- data/lib/pulp_npm_client/models/paginatednpm_package_response_list.rb +44 -22
- data/lib/pulp_npm_client/models/patchednpm_npm_distribution.rb +57 -27
- data/lib/pulp_npm_client/models/patchednpm_npm_remote.rb +67 -27
- data/lib/pulp_npm_client/models/patchednpm_npm_repository.rb +40 -26
- data/lib/pulp_npm_client/models/policy_enum.rb +8 -4
- data/lib/pulp_npm_client/models/repair.rb +30 -22
- data/lib/pulp_npm_client/models/repository_add_remove_content.rb +33 -25
- data/lib/pulp_npm_client/models/repository_sync_url.rb +30 -22
- data/lib/pulp_npm_client/models/repository_version_response.rb +53 -25
- data/lib/pulp_npm_client/models/set_label.rb +264 -0
- data/lib/pulp_npm_client/models/set_label_response.rb +255 -0
- data/lib/pulp_npm_client/models/unset_label.rb +252 -0
- data/lib/pulp_npm_client/models/unset_label_response.rb +252 -0
- data/lib/pulp_npm_client/version.rb +2 -2
- data/lib/pulp_npm_client.rb +6 -3
- data/pulp_npm_client.gemspec +10 -7
- data/spec/api/content_packages_api_spec.rb +22 -16
- data/spec/api/distributions_npm_api_spec.rb +51 -14
- data/spec/api/remotes_npm_api_spec.rb +54 -19
- data/spec/api/repositories_npm_api_spec.rb +60 -15
- data/spec/api/repositories_npm_versions_api_spec.rb +23 -19
- data/spec/models/async_operation_response_spec.rb +7 -12
- data/spec/models/content_summary_response_spec.rb +9 -14
- data/spec/models/npm_npm_distribution_response_spec.rb +38 -19
- data/spec/models/npm_npm_distribution_spec.rb +17 -16
- data/spec/models/npm_npm_remote_response_hidden_fields_inner_spec.rb +42 -0
- data/spec/models/npm_npm_remote_response_spec.rb +42 -35
- data/spec/models/npm_npm_remote_spec.rb +27 -32
- data/spec/models/npm_npm_repository_response_spec.rb +27 -20
- data/spec/models/npm_npm_repository_spec.rb +11 -16
- data/spec/models/npm_package_response_spec.rb +24 -17
- data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
- data/spec/models/paginatednpm_npm_distribution_response_list_spec.rb +10 -15
- data/spec/models/paginatednpm_npm_remote_response_list_spec.rb +10 -15
- data/spec/models/paginatednpm_npm_repository_response_list_spec.rb +10 -15
- data/spec/models/paginatednpm_package_response_list_spec.rb +10 -15
- data/spec/models/patchednpm_npm_distribution_spec.rb +17 -16
- data/spec/models/patchednpm_npm_remote_spec.rb +27 -32
- data/spec/models/patchednpm_npm_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 +24 -17
- data/spec/models/set_label_response_spec.rb +42 -0
- data/spec/models/set_label_spec.rb +42 -0
- data/spec/models/unset_label_response_spec.rb +42 -0
- data/spec/models/unset_label_spec.rb +36 -0
- data/spec/spec_helper.rb +1 -1
- metadata +94 -59
- data/docs/NpmPackage.md +0 -29
- data/docs/PulpNpmPackagesApi.md +0 -60
- data/git_push.sh +0 -58
- data/lib/pulp_npm_client/api/pulp_npm_packages_api.rb +0 -86
- data/lib/pulp_npm_client/models/npm_package.rb +0 -337
- data/spec/api/pulp_npm_packages_api_spec.rb +0 -48
- data/spec/api_client_spec.rb +0 -188
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/npm_package_spec.rb +0 -77
@@ -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 PulpNpmClient
|
16
17
|
# A Serializer for NpmRepository. Add any new fields if defined on NpmRepository. Similar to the example above, in PackageSerializer. Additional validators can be added to the parent validators list For example:: class Meta: validators = platform.RepositorySerializer.Meta.validators + [myValidator1, myValidator2]
|
@@ -23,7 +24,7 @@ module PulpNpmClient
|
|
23
24
|
# An optional description.
|
24
25
|
attr_accessor :description
|
25
26
|
|
26
|
-
# Retain X versions of the repository. Default is null which retains all versions.
|
27
|
+
# Retain X versions of the repository. Default is null which retains all versions.
|
27
28
|
attr_accessor :retain_repo_versions
|
28
29
|
|
29
30
|
# An optional remote to use by default when syncing.
|
@@ -40,10 +41,15 @@ module PulpNpmClient
|
|
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
|
{
|
46
|
-
:'pulp_labels' => :'
|
52
|
+
:'pulp_labels' => :'Hash<String, String>',
|
47
53
|
:'name' => :'String',
|
48
54
|
:'description' => :'String',
|
49
55
|
:'retain_repo_versions' => :'Integer',
|
@@ -76,11 +82,15 @@ module PulpNpmClient
|
|
76
82
|
}
|
77
83
|
|
78
84
|
if attributes.key?(:'pulp_labels')
|
79
|
-
|
85
|
+
if (value = attributes[:'pulp_labels']).is_a?(Hash)
|
86
|
+
self.pulp_labels = value
|
87
|
+
end
|
80
88
|
end
|
81
89
|
|
82
90
|
if attributes.key?(:'name')
|
83
91
|
self.name = attributes[:'name']
|
92
|
+
else
|
93
|
+
self.name = nil
|
84
94
|
end
|
85
95
|
|
86
96
|
if attributes.key?(:'description')
|
@@ -99,6 +109,7 @@ module PulpNpmClient
|
|
99
109
|
# Show invalid properties with the reasons. Usually used together with valid?
|
100
110
|
# @return Array for valid properties with the reasons
|
101
111
|
def list_invalid_properties
|
112
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
102
113
|
invalid_properties = Array.new
|
103
114
|
if @name.nil?
|
104
115
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
@@ -122,6 +133,7 @@ module PulpNpmClient
|
|
122
133
|
# Check to see if the all the properties in the model are valid
|
123
134
|
# @return true if the model is valid
|
124
135
|
def valid?
|
136
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
125
137
|
return false if @name.nil?
|
126
138
|
return false if @name.to_s.length < 1
|
127
139
|
return false if !@description.nil? && @description.to_s.length < 1
|
@@ -191,37 +203,33 @@ module PulpNpmClient
|
|
191
203
|
# @param [Hash] attributes Model attributes in the form of hash
|
192
204
|
# @return [Object] Returns the model itself
|
193
205
|
def self.build_from_hash(attributes)
|
194
|
-
new.build_from_hash(attributes)
|
195
|
-
end
|
196
|
-
|
197
|
-
# Builds the object from hash
|
198
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
199
|
-
# @return [Object] Returns the model itself
|
200
|
-
def build_from_hash(attributes)
|
201
206
|
return nil unless attributes.is_a?(Hash)
|
202
|
-
|
203
|
-
|
207
|
+
attributes = attributes.transform_keys(&:to_sym)
|
208
|
+
transformed_hash = {}
|
209
|
+
openapi_types.each_pair do |key, type|
|
210
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
211
|
+
transformed_hash["#{key}"] = nil
|
212
|
+
elsif type =~ /\AArray<(.*)>/i
|
204
213
|
# check to ensure the input is an array given that the attribute
|
205
214
|
# is documented as an array but the input is not
|
206
|
-
if attributes[
|
207
|
-
|
215
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
216
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
208
217
|
end
|
209
|
-
elsif !attributes[
|
210
|
-
|
211
|
-
end
|
218
|
+
elsif !attributes[attribute_map[key]].nil?
|
219
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
220
|
+
end
|
212
221
|
end
|
213
|
-
|
214
|
-
self
|
222
|
+
new(transformed_hash)
|
215
223
|
end
|
216
224
|
|
217
225
|
# Deserializes the data based on type
|
218
226
|
# @param string type Data type
|
219
227
|
# @param string value Value to be deserialized
|
220
228
|
# @return [Object] Deserialized data
|
221
|
-
def _deserialize(type, value)
|
229
|
+
def self._deserialize(type, value)
|
222
230
|
case type.to_sym
|
223
|
-
when :
|
224
|
-
|
231
|
+
when :Time
|
232
|
+
Time.parse(value)
|
225
233
|
when :Date
|
226
234
|
Date.parse(value)
|
227
235
|
when :String
|
@@ -251,7 +259,9 @@ module PulpNpmClient
|
|
251
259
|
end
|
252
260
|
end
|
253
261
|
else # model
|
254
|
-
|
262
|
+
# models (e.g. Pet) or oneOf
|
263
|
+
klass = PulpNpmClient.const_get(type)
|
264
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
255
265
|
end
|
256
266
|
end
|
257
267
|
|
@@ -277,7 +287,7 @@ module PulpNpmClient
|
|
277
287
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
278
288
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
279
289
|
end
|
280
|
-
|
290
|
+
|
281
291
|
hash[param] = _to_hash(value)
|
282
292
|
end
|
283
293
|
hash
|
@@ -300,5 +310,7 @@ module PulpNpmClient
|
|
300
310
|
value
|
301
311
|
end
|
302
312
|
end
|
313
|
+
|
303
314
|
end
|
315
|
+
|
304
316
|
end
|
@@ -6,20 +6,27 @@
|
|
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 PulpNpmClient
|
16
17
|
# A Serializer for NpmRepository. Add any new fields if defined on NpmRepository. Similar to the example above, in PackageSerializer. Additional validators can be added to the parent validators list For example:: class Meta: validators = platform.RepositorySerializer.Meta.validators + [myValidator1, myValidator2]
|
17
18
|
class NpmNpmRepositoryResponse
|
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
|
|
27
|
+
# Timestamp of the last time this resource was updated. Note: for immutable resources - like content, repository versions, and publication - pulp_created and pulp_last_updated dates will be the same.
|
28
|
+
attr_accessor :pulp_last_updated
|
29
|
+
|
23
30
|
attr_accessor :versions_href
|
24
31
|
|
25
32
|
attr_accessor :pulp_labels
|
@@ -32,7 +39,7 @@ module PulpNpmClient
|
|
32
39
|
# An optional description.
|
33
40
|
attr_accessor :description
|
34
41
|
|
35
|
-
# Retain X versions of the repository. Default is null which retains all versions.
|
42
|
+
# Retain X versions of the repository. Default is null which retains all versions.
|
36
43
|
attr_accessor :retain_repo_versions
|
37
44
|
|
38
45
|
# An optional remote to use by default when syncing.
|
@@ -42,7 +49,9 @@ module PulpNpmClient
|
|
42
49
|
def self.attribute_map
|
43
50
|
{
|
44
51
|
:'pulp_href' => :'pulp_href',
|
52
|
+
:'prn' => :'prn',
|
45
53
|
:'pulp_created' => :'pulp_created',
|
54
|
+
:'pulp_last_updated' => :'pulp_last_updated',
|
46
55
|
:'versions_href' => :'versions_href',
|
47
56
|
:'pulp_labels' => :'pulp_labels',
|
48
57
|
:'latest_version_href' => :'latest_version_href',
|
@@ -53,13 +62,20 @@ module PulpNpmClient
|
|
53
62
|
}
|
54
63
|
end
|
55
64
|
|
65
|
+
# Returns all the JSON keys this model knows about
|
66
|
+
def self.acceptable_attributes
|
67
|
+
attribute_map.values
|
68
|
+
end
|
69
|
+
|
56
70
|
# Attribute type mapping.
|
57
71
|
def self.openapi_types
|
58
72
|
{
|
59
73
|
:'pulp_href' => :'String',
|
60
|
-
:'
|
74
|
+
:'prn' => :'String',
|
75
|
+
:'pulp_created' => :'Time',
|
76
|
+
:'pulp_last_updated' => :'Time',
|
61
77
|
:'versions_href' => :'String',
|
62
|
-
:'pulp_labels' => :'
|
78
|
+
:'pulp_labels' => :'Hash<String, String>',
|
63
79
|
:'latest_version_href' => :'String',
|
64
80
|
:'name' => :'String',
|
65
81
|
:'description' => :'String',
|
@@ -96,16 +112,26 @@ module PulpNpmClient
|
|
96
112
|
self.pulp_href = attributes[:'pulp_href']
|
97
113
|
end
|
98
114
|
|
115
|
+
if attributes.key?(:'prn')
|
116
|
+
self.prn = attributes[:'prn']
|
117
|
+
end
|
118
|
+
|
99
119
|
if attributes.key?(:'pulp_created')
|
100
120
|
self.pulp_created = attributes[:'pulp_created']
|
101
121
|
end
|
102
122
|
|
123
|
+
if attributes.key?(:'pulp_last_updated')
|
124
|
+
self.pulp_last_updated = attributes[:'pulp_last_updated']
|
125
|
+
end
|
126
|
+
|
103
127
|
if attributes.key?(:'versions_href')
|
104
128
|
self.versions_href = attributes[:'versions_href']
|
105
129
|
end
|
106
130
|
|
107
131
|
if attributes.key?(:'pulp_labels')
|
108
|
-
|
132
|
+
if (value = attributes[:'pulp_labels']).is_a?(Hash)
|
133
|
+
self.pulp_labels = value
|
134
|
+
end
|
109
135
|
end
|
110
136
|
|
111
137
|
if attributes.key?(:'latest_version_href')
|
@@ -114,6 +140,8 @@ module PulpNpmClient
|
|
114
140
|
|
115
141
|
if attributes.key?(:'name')
|
116
142
|
self.name = attributes[:'name']
|
143
|
+
else
|
144
|
+
self.name = nil
|
117
145
|
end
|
118
146
|
|
119
147
|
if attributes.key?(:'description')
|
@@ -132,6 +160,7 @@ module PulpNpmClient
|
|
132
160
|
# Show invalid properties with the reasons. Usually used together with valid?
|
133
161
|
# @return Array for valid properties with the reasons
|
134
162
|
def list_invalid_properties
|
163
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
135
164
|
invalid_properties = Array.new
|
136
165
|
if @name.nil?
|
137
166
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
@@ -147,6 +176,7 @@ module PulpNpmClient
|
|
147
176
|
# Check to see if the all the properties in the model are valid
|
148
177
|
# @return true if the model is valid
|
149
178
|
def valid?
|
179
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
150
180
|
return false if @name.nil?
|
151
181
|
return false if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
152
182
|
true
|
@@ -168,7 +198,9 @@ module PulpNpmClient
|
|
168
198
|
return true if self.equal?(o)
|
169
199
|
self.class == o.class &&
|
170
200
|
pulp_href == o.pulp_href &&
|
201
|
+
prn == o.prn &&
|
171
202
|
pulp_created == o.pulp_created &&
|
203
|
+
pulp_last_updated == o.pulp_last_updated &&
|
172
204
|
versions_href == o.versions_href &&
|
173
205
|
pulp_labels == o.pulp_labels &&
|
174
206
|
latest_version_href == o.latest_version_href &&
|
@@ -187,44 +219,40 @@ module PulpNpmClient
|
|
187
219
|
# Calculates hash code according to all attributes.
|
188
220
|
# @return [Integer] Hash code
|
189
221
|
def hash
|
190
|
-
[pulp_href, pulp_created, versions_href, pulp_labels, latest_version_href, name, description, retain_repo_versions, remote].hash
|
222
|
+
[pulp_href, prn, pulp_created, pulp_last_updated, versions_href, pulp_labels, latest_version_href, name, description, retain_repo_versions, remote].hash
|
191
223
|
end
|
192
224
|
|
193
225
|
# Builds the object from hash
|
194
226
|
# @param [Hash] attributes Model attributes in the form of hash
|
195
227
|
# @return [Object] Returns the model itself
|
196
228
|
def self.build_from_hash(attributes)
|
197
|
-
new.build_from_hash(attributes)
|
198
|
-
end
|
199
|
-
|
200
|
-
# Builds the object from hash
|
201
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
202
|
-
# @return [Object] Returns the model itself
|
203
|
-
def build_from_hash(attributes)
|
204
229
|
return nil unless attributes.is_a?(Hash)
|
205
|
-
|
206
|
-
|
230
|
+
attributes = attributes.transform_keys(&:to_sym)
|
231
|
+
transformed_hash = {}
|
232
|
+
openapi_types.each_pair do |key, type|
|
233
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
234
|
+
transformed_hash["#{key}"] = nil
|
235
|
+
elsif type =~ /\AArray<(.*)>/i
|
207
236
|
# check to ensure the input is an array given that the attribute
|
208
237
|
# is documented as an array but the input is not
|
209
|
-
if attributes[
|
210
|
-
|
238
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
239
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
211
240
|
end
|
212
|
-
elsif !attributes[
|
213
|
-
|
214
|
-
end
|
241
|
+
elsif !attributes[attribute_map[key]].nil?
|
242
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
243
|
+
end
|
215
244
|
end
|
216
|
-
|
217
|
-
self
|
245
|
+
new(transformed_hash)
|
218
246
|
end
|
219
247
|
|
220
248
|
# Deserializes the data based on type
|
221
249
|
# @param string type Data type
|
222
250
|
# @param string value Value to be deserialized
|
223
251
|
# @return [Object] Deserialized data
|
224
|
-
def _deserialize(type, value)
|
252
|
+
def self._deserialize(type, value)
|
225
253
|
case type.to_sym
|
226
|
-
when :
|
227
|
-
|
254
|
+
when :Time
|
255
|
+
Time.parse(value)
|
228
256
|
when :Date
|
229
257
|
Date.parse(value)
|
230
258
|
when :String
|
@@ -254,7 +282,9 @@ module PulpNpmClient
|
|
254
282
|
end
|
255
283
|
end
|
256
284
|
else # model
|
257
|
-
|
285
|
+
# models (e.g. Pet) or oneOf
|
286
|
+
klass = PulpNpmClient.const_get(type)
|
287
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
258
288
|
end
|
259
289
|
end
|
260
290
|
|
@@ -280,7 +310,7 @@ module PulpNpmClient
|
|
280
310
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
281
311
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
282
312
|
end
|
283
|
-
|
313
|
+
|
284
314
|
hash[param] = _to_hash(value)
|
285
315
|
end
|
286
316
|
hash
|
@@ -303,5 +333,7 @@ module PulpNpmClient
|
|
303
333
|
value
|
304
334
|
end
|
305
335
|
end
|
336
|
+
|
306
337
|
end
|
338
|
+
|
307
339
|
end
|
@@ -6,20 +6,27 @@
|
|
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 PulpNpmClient
|
16
17
|
# A Serializer for Package. Add serializers for the new fields defined in Package and add those fields to the Meta class keeping fields from the parent class as well. For example:: field1 = serializers.TextField() field2 = serializers.IntegerField() field3 = serializers.CharField() class Meta: fields = platform.SingleArtifactContentSerializer.Meta.fields + ( 'field1', 'field2', 'field3' ) model = models.Package
|
17
18
|
class NpmPackageResponse
|
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
|
|
27
|
+
# Timestamp of the last time this resource was updated. Note: for immutable resources - like content, repository versions, and publication - pulp_created and pulp_last_updated dates will be the same.
|
28
|
+
attr_accessor :pulp_last_updated
|
29
|
+
|
23
30
|
# Artifact file representing the physical content
|
24
31
|
attr_accessor :artifact
|
25
32
|
|
@@ -33,7 +40,9 @@ module PulpNpmClient
|
|
33
40
|
def self.attribute_map
|
34
41
|
{
|
35
42
|
:'pulp_href' => :'pulp_href',
|
43
|
+
:'prn' => :'prn',
|
36
44
|
:'pulp_created' => :'pulp_created',
|
45
|
+
:'pulp_last_updated' => :'pulp_last_updated',
|
37
46
|
:'artifact' => :'artifact',
|
38
47
|
:'relative_path' => :'relative_path',
|
39
48
|
:'name' => :'name',
|
@@ -41,11 +50,18 @@ module PulpNpmClient
|
|
41
50
|
}
|
42
51
|
end
|
43
52
|
|
53
|
+
# Returns all the JSON keys this model knows about
|
54
|
+
def self.acceptable_attributes
|
55
|
+
attribute_map.values
|
56
|
+
end
|
57
|
+
|
44
58
|
# Attribute type mapping.
|
45
59
|
def self.openapi_types
|
46
60
|
{
|
47
61
|
:'pulp_href' => :'String',
|
48
|
-
:'
|
62
|
+
:'prn' => :'String',
|
63
|
+
:'pulp_created' => :'Time',
|
64
|
+
:'pulp_last_updated' => :'Time',
|
49
65
|
:'artifact' => :'String',
|
50
66
|
:'relative_path' => :'String',
|
51
67
|
:'name' => :'String',
|
@@ -78,30 +94,45 @@ module PulpNpmClient
|
|
78
94
|
self.pulp_href = attributes[:'pulp_href']
|
79
95
|
end
|
80
96
|
|
97
|
+
if attributes.key?(:'prn')
|
98
|
+
self.prn = attributes[:'prn']
|
99
|
+
end
|
100
|
+
|
81
101
|
if attributes.key?(:'pulp_created')
|
82
102
|
self.pulp_created = attributes[:'pulp_created']
|
83
103
|
end
|
84
104
|
|
105
|
+
if attributes.key?(:'pulp_last_updated')
|
106
|
+
self.pulp_last_updated = attributes[:'pulp_last_updated']
|
107
|
+
end
|
108
|
+
|
85
109
|
if attributes.key?(:'artifact')
|
86
110
|
self.artifact = attributes[:'artifact']
|
87
111
|
end
|
88
112
|
|
89
113
|
if attributes.key?(:'relative_path')
|
90
114
|
self.relative_path = attributes[:'relative_path']
|
115
|
+
else
|
116
|
+
self.relative_path = nil
|
91
117
|
end
|
92
118
|
|
93
119
|
if attributes.key?(:'name')
|
94
120
|
self.name = attributes[:'name']
|
121
|
+
else
|
122
|
+
self.name = nil
|
95
123
|
end
|
96
124
|
|
97
125
|
if attributes.key?(:'version')
|
98
126
|
self.version = attributes[:'version']
|
127
|
+
else
|
128
|
+
self.version = nil
|
99
129
|
end
|
100
130
|
end
|
101
131
|
|
102
132
|
# Show invalid properties with the reasons. Usually used together with valid?
|
103
133
|
# @return Array for valid properties with the reasons
|
104
134
|
def list_invalid_properties
|
135
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
105
136
|
invalid_properties = Array.new
|
106
137
|
if @relative_path.nil?
|
107
138
|
invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
|
@@ -121,6 +152,7 @@ module PulpNpmClient
|
|
121
152
|
# Check to see if the all the properties in the model are valid
|
122
153
|
# @return true if the model is valid
|
123
154
|
def valid?
|
155
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
124
156
|
return false if @relative_path.nil?
|
125
157
|
return false if @name.nil?
|
126
158
|
return false if @version.nil?
|
@@ -133,7 +165,9 @@ module PulpNpmClient
|
|
133
165
|
return true if self.equal?(o)
|
134
166
|
self.class == o.class &&
|
135
167
|
pulp_href == o.pulp_href &&
|
168
|
+
prn == o.prn &&
|
136
169
|
pulp_created == o.pulp_created &&
|
170
|
+
pulp_last_updated == o.pulp_last_updated &&
|
137
171
|
artifact == o.artifact &&
|
138
172
|
relative_path == o.relative_path &&
|
139
173
|
name == o.name &&
|
@@ -149,44 +183,40 @@ module PulpNpmClient
|
|
149
183
|
# Calculates hash code according to all attributes.
|
150
184
|
# @return [Integer] Hash code
|
151
185
|
def hash
|
152
|
-
[pulp_href, pulp_created, artifact, relative_path, name, version].hash
|
186
|
+
[pulp_href, prn, pulp_created, pulp_last_updated, artifact, relative_path, name, version].hash
|
153
187
|
end
|
154
188
|
|
155
189
|
# Builds the object from hash
|
156
190
|
# @param [Hash] attributes Model attributes in the form of hash
|
157
191
|
# @return [Object] Returns the model itself
|
158
192
|
def self.build_from_hash(attributes)
|
159
|
-
new.build_from_hash(attributes)
|
160
|
-
end
|
161
|
-
|
162
|
-
# Builds the object from hash
|
163
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
164
|
-
# @return [Object] Returns the model itself
|
165
|
-
def build_from_hash(attributes)
|
166
193
|
return nil unless attributes.is_a?(Hash)
|
167
|
-
|
168
|
-
|
194
|
+
attributes = attributes.transform_keys(&:to_sym)
|
195
|
+
transformed_hash = {}
|
196
|
+
openapi_types.each_pair do |key, type|
|
197
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
198
|
+
transformed_hash["#{key}"] = nil
|
199
|
+
elsif type =~ /\AArray<(.*)>/i
|
169
200
|
# check to ensure the input is an array given that the attribute
|
170
201
|
# is documented as an array but the input is not
|
171
|
-
if attributes[
|
172
|
-
|
202
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
203
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
173
204
|
end
|
174
|
-
elsif !attributes[
|
175
|
-
|
176
|
-
end
|
205
|
+
elsif !attributes[attribute_map[key]].nil?
|
206
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
207
|
+
end
|
177
208
|
end
|
178
|
-
|
179
|
-
self
|
209
|
+
new(transformed_hash)
|
180
210
|
end
|
181
211
|
|
182
212
|
# Deserializes the data based on type
|
183
213
|
# @param string type Data type
|
184
214
|
# @param string value Value to be deserialized
|
185
215
|
# @return [Object] Deserialized data
|
186
|
-
def _deserialize(type, value)
|
216
|
+
def self._deserialize(type, value)
|
187
217
|
case type.to_sym
|
188
|
-
when :
|
189
|
-
|
218
|
+
when :Time
|
219
|
+
Time.parse(value)
|
190
220
|
when :Date
|
191
221
|
Date.parse(value)
|
192
222
|
when :String
|
@@ -216,7 +246,9 @@ module PulpNpmClient
|
|
216
246
|
end
|
217
247
|
end
|
218
248
|
else # model
|
219
|
-
|
249
|
+
# models (e.g. Pet) or oneOf
|
250
|
+
klass = PulpNpmClient.const_get(type)
|
251
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
220
252
|
end
|
221
253
|
end
|
222
254
|
|
@@ -242,7 +274,7 @@ module PulpNpmClient
|
|
242
274
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
243
275
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
244
276
|
end
|
245
|
-
|
277
|
+
|
246
278
|
hash[param] = _to_hash(value)
|
247
279
|
end
|
248
280
|
hash
|
@@ -265,5 +297,7 @@ module PulpNpmClient
|
|
265
297
|
value
|
266
298
|
end
|
267
299
|
end
|
300
|
+
|
268
301
|
end
|
302
|
+
|
269
303
|
end
|