pulp_npm_client 0.1.0a4 → 0.2.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 +20 -15
- data/docs/NpmNpmDistributionResponse.md +32 -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 +20 -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 +66 -29
- data/lib/pulp_npm_client/models/npm_npm_distribution_response.rb +98 -31
- data/lib/pulp_npm_client/models/npm_npm_remote.rb +62 -26
- data/lib/pulp_npm_client/models/npm_npm_remote_response.rb +100 -42
- 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 +38 -26
- data/lib/pulp_npm_client/models/npm_npm_repository_response.rb +60 -28
- data/lib/pulp_npm_client/models/npm_package_response.rb +59 -25
- 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 +72 -31
- data/lib/pulp_npm_client/models/patchednpm_npm_remote.rb +68 -28
- data/lib/pulp_npm_client/models/patchednpm_npm_repository.rb +41 -27
- 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 +44 -19
- data/spec/models/npm_npm_distribution_spec.rb +23 -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 +23 -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
@@ -0,0 +1,237 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
Contact: pulp-list@redhat.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.10.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module PulpNpmClient
|
17
|
+
class NpmNpmRemoteResponseHiddenFieldsInner
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
attr_accessor :is_set
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'name' => :'name',
|
26
|
+
:'is_set' => :'is_set'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'name' => :'String',
|
39
|
+
:'is_set' => :'Boolean'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
])
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpNpmClient::NpmNpmRemoteResponseHiddenFieldsInner` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpNpmClient::NpmNpmRemoteResponseHiddenFieldsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'name')
|
65
|
+
self.name = attributes[:'name']
|
66
|
+
else
|
67
|
+
self.name = nil
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'is_set')
|
71
|
+
self.is_set = attributes[:'is_set']
|
72
|
+
else
|
73
|
+
self.is_set = nil
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
78
|
+
# @return Array for valid properties with the reasons
|
79
|
+
def list_invalid_properties
|
80
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
81
|
+
invalid_properties = Array.new
|
82
|
+
if @name.nil?
|
83
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
84
|
+
end
|
85
|
+
|
86
|
+
if @is_set.nil?
|
87
|
+
invalid_properties.push('invalid value for "is_set", is_set cannot be nil.')
|
88
|
+
end
|
89
|
+
|
90
|
+
invalid_properties
|
91
|
+
end
|
92
|
+
|
93
|
+
# Check to see if the all the properties in the model are valid
|
94
|
+
# @return true if the model is valid
|
95
|
+
def valid?
|
96
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
97
|
+
return false if @name.nil?
|
98
|
+
return false if @is_set.nil?
|
99
|
+
true
|
100
|
+
end
|
101
|
+
|
102
|
+
# Checks equality by comparing each attribute.
|
103
|
+
# @param [Object] Object to be compared
|
104
|
+
def ==(o)
|
105
|
+
return true if self.equal?(o)
|
106
|
+
self.class == o.class &&
|
107
|
+
name == o.name &&
|
108
|
+
is_set == o.is_set
|
109
|
+
end
|
110
|
+
|
111
|
+
# @see the `==` method
|
112
|
+
# @param [Object] Object to be compared
|
113
|
+
def eql?(o)
|
114
|
+
self == o
|
115
|
+
end
|
116
|
+
|
117
|
+
# Calculates hash code according to all attributes.
|
118
|
+
# @return [Integer] Hash code
|
119
|
+
def hash
|
120
|
+
[name, is_set].hash
|
121
|
+
end
|
122
|
+
|
123
|
+
# Builds the object from hash
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
+
# @return [Object] Returns the model itself
|
126
|
+
def self.build_from_hash(attributes)
|
127
|
+
return nil unless attributes.is_a?(Hash)
|
128
|
+
attributes = attributes.transform_keys(&:to_sym)
|
129
|
+
transformed_hash = {}
|
130
|
+
openapi_types.each_pair do |key, type|
|
131
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
132
|
+
transformed_hash["#{key}"] = nil
|
133
|
+
elsif type =~ /\AArray<(.*)>/i
|
134
|
+
# check to ensure the input is an array given that the attribute
|
135
|
+
# is documented as an array but the input is not
|
136
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
137
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
138
|
+
end
|
139
|
+
elsif !attributes[attribute_map[key]].nil?
|
140
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
141
|
+
end
|
142
|
+
end
|
143
|
+
new(transformed_hash)
|
144
|
+
end
|
145
|
+
|
146
|
+
# Deserializes the data based on type
|
147
|
+
# @param string type Data type
|
148
|
+
# @param string value Value to be deserialized
|
149
|
+
# @return [Object] Deserialized data
|
150
|
+
def self._deserialize(type, value)
|
151
|
+
case type.to_sym
|
152
|
+
when :Time
|
153
|
+
Time.parse(value)
|
154
|
+
when :Date
|
155
|
+
Date.parse(value)
|
156
|
+
when :String
|
157
|
+
value.to_s
|
158
|
+
when :Integer
|
159
|
+
value.to_i
|
160
|
+
when :Float
|
161
|
+
value.to_f
|
162
|
+
when :Boolean
|
163
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
164
|
+
true
|
165
|
+
else
|
166
|
+
false
|
167
|
+
end
|
168
|
+
when :Object
|
169
|
+
# generic object (usually a Hash), return directly
|
170
|
+
value
|
171
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
172
|
+
inner_type = Regexp.last_match[:inner_type]
|
173
|
+
value.map { |v| _deserialize(inner_type, v) }
|
174
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
175
|
+
k_type = Regexp.last_match[:k_type]
|
176
|
+
v_type = Regexp.last_match[:v_type]
|
177
|
+
{}.tap do |hash|
|
178
|
+
value.each do |k, v|
|
179
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
else # model
|
183
|
+
# models (e.g. Pet) or oneOf
|
184
|
+
klass = PulpNpmClient.const_get(type)
|
185
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
# Returns the string representation of the object
|
190
|
+
# @return [String] String presentation of the object
|
191
|
+
def to_s
|
192
|
+
to_hash.to_s
|
193
|
+
end
|
194
|
+
|
195
|
+
# to_body is an alias to to_hash (backward compatibility)
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_body
|
198
|
+
to_hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Returns the object in the form of hash
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
203
|
+
def to_hash
|
204
|
+
hash = {}
|
205
|
+
self.class.attribute_map.each_pair do |attr, param|
|
206
|
+
value = self.send(attr)
|
207
|
+
if value.nil?
|
208
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
209
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
210
|
+
end
|
211
|
+
|
212
|
+
hash[param] = _to_hash(value)
|
213
|
+
end
|
214
|
+
hash
|
215
|
+
end
|
216
|
+
|
217
|
+
# Outputs non-array value in the form of hash
|
218
|
+
# For object, use to_hash. Otherwise, just return the value
|
219
|
+
# @param [Object] value Any valid value
|
220
|
+
# @return [Hash] Returns the value in the form of hash
|
221
|
+
def _to_hash(value)
|
222
|
+
if value.is_a?(Array)
|
223
|
+
value.compact.map { |v| _to_hash(v) }
|
224
|
+
elsif value.is_a?(Hash)
|
225
|
+
{}.tap do |hash|
|
226
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
227
|
+
end
|
228
|
+
elsif value.respond_to? :to_hash
|
229
|
+
value.to_hash
|
230
|
+
else
|
231
|
+
value
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
end
|
236
|
+
|
237
|
+
end
|
@@ -6,14 +6,15 @@
|
|
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
|
-
# 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 =
|
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 = core_serializers.RepositorySerializer.Meta.validators + [myValidator1, ...]
|
17
18
|
class NpmNpmRepository
|
18
19
|
attr_accessor :pulp_labels
|
19
20
|
|
@@ -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
|
-
# 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 =
|
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 = core_serializers.RepositorySerializer.Meta.validators + [myValidator1, ...]
|
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
|