pulp_npm_client 0.1.0a4 → 0.1.0
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 +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
|
class PaginatedRepositoryVersionResponseList
|
|
@@ -32,6 +33,11 @@ module PulpNpmClient
|
|
|
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 PulpNpmClient
|
|
|
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,19 +89,33 @@ module PulpNpmClient
|
|
|
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
|
|
102
|
+
if @count.nil?
|
|
103
|
+
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if @results.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "results", results cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
91
110
|
invalid_properties
|
|
92
111
|
end
|
|
93
112
|
|
|
94
113
|
# Check to see if the all the properties in the model are valid
|
|
95
114
|
# @return true if the model is valid
|
|
96
115
|
def valid?
|
|
116
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
117
|
+
return false if @count.nil?
|
|
118
|
+
return false if @results.nil?
|
|
97
119
|
true
|
|
98
120
|
end
|
|
99
121
|
|
|
@@ -124,37 +146,33 @@ module PulpNpmClient
|
|
|
124
146
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
125
147
|
# @return [Object] Returns the model itself
|
|
126
148
|
def self.build_from_hash(attributes)
|
|
127
|
-
new.build_from_hash(attributes)
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
# Builds the object from hash
|
|
131
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
132
|
-
# @return [Object] Returns the model itself
|
|
133
|
-
def build_from_hash(attributes)
|
|
134
149
|
return nil unless attributes.is_a?(Hash)
|
|
135
|
-
|
|
136
|
-
|
|
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
|
|
137
156
|
# check to ensure the input is an array given that the attribute
|
|
138
157
|
# is documented as an array but the input is not
|
|
139
|
-
if attributes[
|
|
140
|
-
|
|
158
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
159
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
141
160
|
end
|
|
142
|
-
elsif !attributes[
|
|
143
|
-
|
|
144
|
-
end
|
|
161
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
162
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
163
|
+
end
|
|
145
164
|
end
|
|
146
|
-
|
|
147
|
-
self
|
|
165
|
+
new(transformed_hash)
|
|
148
166
|
end
|
|
149
167
|
|
|
150
168
|
# Deserializes the data based on type
|
|
151
169
|
# @param string type Data type
|
|
152
170
|
# @param string value Value to be deserialized
|
|
153
171
|
# @return [Object] Deserialized data
|
|
154
|
-
def _deserialize(type, value)
|
|
172
|
+
def self._deserialize(type, value)
|
|
155
173
|
case type.to_sym
|
|
156
|
-
when :
|
|
157
|
-
|
|
174
|
+
when :Time
|
|
175
|
+
Time.parse(value)
|
|
158
176
|
when :Date
|
|
159
177
|
Date.parse(value)
|
|
160
178
|
when :String
|
|
@@ -184,7 +202,9 @@ module PulpNpmClient
|
|
|
184
202
|
end
|
|
185
203
|
end
|
|
186
204
|
else # model
|
|
187
|
-
|
|
205
|
+
# models (e.g. Pet) or oneOf
|
|
206
|
+
klass = PulpNpmClient.const_get(type)
|
|
207
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
188
208
|
end
|
|
189
209
|
end
|
|
190
210
|
|
|
@@ -210,7 +230,7 @@ module PulpNpmClient
|
|
|
210
230
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
211
231
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
212
232
|
end
|
|
213
|
-
|
|
233
|
+
|
|
214
234
|
hash[param] = _to_hash(value)
|
|
215
235
|
end
|
|
216
236
|
hash
|
|
@@ -233,5 +253,7 @@ module PulpNpmClient
|
|
|
233
253
|
value
|
|
234
254
|
end
|
|
235
255
|
end
|
|
256
|
+
|
|
236
257
|
end
|
|
258
|
+
|
|
237
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 PulpNpmClient
|
|
16
17
|
class PaginatednpmNpmDistributionResponseList
|
|
@@ -32,6 +33,11 @@ module PulpNpmClient
|
|
|
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 PulpNpmClient
|
|
|
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,19 +89,33 @@ module PulpNpmClient
|
|
|
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
|
|
102
|
+
if @count.nil?
|
|
103
|
+
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if @results.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "results", results cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
91
110
|
invalid_properties
|
|
92
111
|
end
|
|
93
112
|
|
|
94
113
|
# Check to see if the all the properties in the model are valid
|
|
95
114
|
# @return true if the model is valid
|
|
96
115
|
def valid?
|
|
116
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
117
|
+
return false if @count.nil?
|
|
118
|
+
return false if @results.nil?
|
|
97
119
|
true
|
|
98
120
|
end
|
|
99
121
|
|
|
@@ -124,37 +146,33 @@ module PulpNpmClient
|
|
|
124
146
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
125
147
|
# @return [Object] Returns the model itself
|
|
126
148
|
def self.build_from_hash(attributes)
|
|
127
|
-
new.build_from_hash(attributes)
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
# Builds the object from hash
|
|
131
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
132
|
-
# @return [Object] Returns the model itself
|
|
133
|
-
def build_from_hash(attributes)
|
|
134
149
|
return nil unless attributes.is_a?(Hash)
|
|
135
|
-
|
|
136
|
-
|
|
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
|
|
137
156
|
# check to ensure the input is an array given that the attribute
|
|
138
157
|
# is documented as an array but the input is not
|
|
139
|
-
if attributes[
|
|
140
|
-
|
|
158
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
159
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
141
160
|
end
|
|
142
|
-
elsif !attributes[
|
|
143
|
-
|
|
144
|
-
end
|
|
161
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
162
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
163
|
+
end
|
|
145
164
|
end
|
|
146
|
-
|
|
147
|
-
self
|
|
165
|
+
new(transformed_hash)
|
|
148
166
|
end
|
|
149
167
|
|
|
150
168
|
# Deserializes the data based on type
|
|
151
169
|
# @param string type Data type
|
|
152
170
|
# @param string value Value to be deserialized
|
|
153
171
|
# @return [Object] Deserialized data
|
|
154
|
-
def _deserialize(type, value)
|
|
172
|
+
def self._deserialize(type, value)
|
|
155
173
|
case type.to_sym
|
|
156
|
-
when :
|
|
157
|
-
|
|
174
|
+
when :Time
|
|
175
|
+
Time.parse(value)
|
|
158
176
|
when :Date
|
|
159
177
|
Date.parse(value)
|
|
160
178
|
when :String
|
|
@@ -184,7 +202,9 @@ module PulpNpmClient
|
|
|
184
202
|
end
|
|
185
203
|
end
|
|
186
204
|
else # model
|
|
187
|
-
|
|
205
|
+
# models (e.g. Pet) or oneOf
|
|
206
|
+
klass = PulpNpmClient.const_get(type)
|
|
207
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
188
208
|
end
|
|
189
209
|
end
|
|
190
210
|
|
|
@@ -210,7 +230,7 @@ module PulpNpmClient
|
|
|
210
230
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
211
231
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
212
232
|
end
|
|
213
|
-
|
|
233
|
+
|
|
214
234
|
hash[param] = _to_hash(value)
|
|
215
235
|
end
|
|
216
236
|
hash
|
|
@@ -233,5 +253,7 @@ module PulpNpmClient
|
|
|
233
253
|
value
|
|
234
254
|
end
|
|
235
255
|
end
|
|
256
|
+
|
|
236
257
|
end
|
|
258
|
+
|
|
237
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 PulpNpmClient
|
|
16
17
|
class PaginatednpmNpmRemoteResponseList
|
|
@@ -32,6 +33,11 @@ module PulpNpmClient
|
|
|
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 PulpNpmClient
|
|
|
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,19 +89,33 @@ module PulpNpmClient
|
|
|
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
|
|
102
|
+
if @count.nil?
|
|
103
|
+
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if @results.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "results", results cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
91
110
|
invalid_properties
|
|
92
111
|
end
|
|
93
112
|
|
|
94
113
|
# Check to see if the all the properties in the model are valid
|
|
95
114
|
# @return true if the model is valid
|
|
96
115
|
def valid?
|
|
116
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
117
|
+
return false if @count.nil?
|
|
118
|
+
return false if @results.nil?
|
|
97
119
|
true
|
|
98
120
|
end
|
|
99
121
|
|
|
@@ -124,37 +146,33 @@ module PulpNpmClient
|
|
|
124
146
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
125
147
|
# @return [Object] Returns the model itself
|
|
126
148
|
def self.build_from_hash(attributes)
|
|
127
|
-
new.build_from_hash(attributes)
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
# Builds the object from hash
|
|
131
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
132
|
-
# @return [Object] Returns the model itself
|
|
133
|
-
def build_from_hash(attributes)
|
|
134
149
|
return nil unless attributes.is_a?(Hash)
|
|
135
|
-
|
|
136
|
-
|
|
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
|
|
137
156
|
# check to ensure the input is an array given that the attribute
|
|
138
157
|
# is documented as an array but the input is not
|
|
139
|
-
if attributes[
|
|
140
|
-
|
|
158
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
159
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
141
160
|
end
|
|
142
|
-
elsif !attributes[
|
|
143
|
-
|
|
144
|
-
end
|
|
161
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
162
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
163
|
+
end
|
|
145
164
|
end
|
|
146
|
-
|
|
147
|
-
self
|
|
165
|
+
new(transformed_hash)
|
|
148
166
|
end
|
|
149
167
|
|
|
150
168
|
# Deserializes the data based on type
|
|
151
169
|
# @param string type Data type
|
|
152
170
|
# @param string value Value to be deserialized
|
|
153
171
|
# @return [Object] Deserialized data
|
|
154
|
-
def _deserialize(type, value)
|
|
172
|
+
def self._deserialize(type, value)
|
|
155
173
|
case type.to_sym
|
|
156
|
-
when :
|
|
157
|
-
|
|
174
|
+
when :Time
|
|
175
|
+
Time.parse(value)
|
|
158
176
|
when :Date
|
|
159
177
|
Date.parse(value)
|
|
160
178
|
when :String
|
|
@@ -184,7 +202,9 @@ module PulpNpmClient
|
|
|
184
202
|
end
|
|
185
203
|
end
|
|
186
204
|
else # model
|
|
187
|
-
|
|
205
|
+
# models (e.g. Pet) or oneOf
|
|
206
|
+
klass = PulpNpmClient.const_get(type)
|
|
207
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
188
208
|
end
|
|
189
209
|
end
|
|
190
210
|
|
|
@@ -210,7 +230,7 @@ module PulpNpmClient
|
|
|
210
230
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
211
231
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
212
232
|
end
|
|
213
|
-
|
|
233
|
+
|
|
214
234
|
hash[param] = _to_hash(value)
|
|
215
235
|
end
|
|
216
236
|
hash
|
|
@@ -233,5 +253,7 @@ module PulpNpmClient
|
|
|
233
253
|
value
|
|
234
254
|
end
|
|
235
255
|
end
|
|
256
|
+
|
|
236
257
|
end
|
|
258
|
+
|
|
237
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 PulpNpmClient
|
|
16
17
|
class PaginatednpmNpmRepositoryResponseList
|
|
@@ -32,6 +33,11 @@ module PulpNpmClient
|
|
|
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 PulpNpmClient
|
|
|
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,19 +89,33 @@ module PulpNpmClient
|
|
|
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
|
|
102
|
+
if @count.nil?
|
|
103
|
+
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if @results.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "results", results cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
91
110
|
invalid_properties
|
|
92
111
|
end
|
|
93
112
|
|
|
94
113
|
# Check to see if the all the properties in the model are valid
|
|
95
114
|
# @return true if the model is valid
|
|
96
115
|
def valid?
|
|
116
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
117
|
+
return false if @count.nil?
|
|
118
|
+
return false if @results.nil?
|
|
97
119
|
true
|
|
98
120
|
end
|
|
99
121
|
|
|
@@ -124,37 +146,33 @@ module PulpNpmClient
|
|
|
124
146
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
125
147
|
# @return [Object] Returns the model itself
|
|
126
148
|
def self.build_from_hash(attributes)
|
|
127
|
-
new.build_from_hash(attributes)
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
# Builds the object from hash
|
|
131
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
132
|
-
# @return [Object] Returns the model itself
|
|
133
|
-
def build_from_hash(attributes)
|
|
134
149
|
return nil unless attributes.is_a?(Hash)
|
|
135
|
-
|
|
136
|
-
|
|
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
|
|
137
156
|
# check to ensure the input is an array given that the attribute
|
|
138
157
|
# is documented as an array but the input is not
|
|
139
|
-
if attributes[
|
|
140
|
-
|
|
158
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
159
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
141
160
|
end
|
|
142
|
-
elsif !attributes[
|
|
143
|
-
|
|
144
|
-
end
|
|
161
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
162
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
163
|
+
end
|
|
145
164
|
end
|
|
146
|
-
|
|
147
|
-
self
|
|
165
|
+
new(transformed_hash)
|
|
148
166
|
end
|
|
149
167
|
|
|
150
168
|
# Deserializes the data based on type
|
|
151
169
|
# @param string type Data type
|
|
152
170
|
# @param string value Value to be deserialized
|
|
153
171
|
# @return [Object] Deserialized data
|
|
154
|
-
def _deserialize(type, value)
|
|
172
|
+
def self._deserialize(type, value)
|
|
155
173
|
case type.to_sym
|
|
156
|
-
when :
|
|
157
|
-
|
|
174
|
+
when :Time
|
|
175
|
+
Time.parse(value)
|
|
158
176
|
when :Date
|
|
159
177
|
Date.parse(value)
|
|
160
178
|
when :String
|
|
@@ -184,7 +202,9 @@ module PulpNpmClient
|
|
|
184
202
|
end
|
|
185
203
|
end
|
|
186
204
|
else # model
|
|
187
|
-
|
|
205
|
+
# models (e.g. Pet) or oneOf
|
|
206
|
+
klass = PulpNpmClient.const_get(type)
|
|
207
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
188
208
|
end
|
|
189
209
|
end
|
|
190
210
|
|
|
@@ -210,7 +230,7 @@ module PulpNpmClient
|
|
|
210
230
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
211
231
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
212
232
|
end
|
|
213
|
-
|
|
233
|
+
|
|
214
234
|
hash[param] = _to_hash(value)
|
|
215
235
|
end
|
|
216
236
|
hash
|
|
@@ -233,5 +253,7 @@ module PulpNpmClient
|
|
|
233
253
|
value
|
|
234
254
|
end
|
|
235
255
|
end
|
|
256
|
+
|
|
236
257
|
end
|
|
258
|
+
|
|
237
259
|
end
|