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
|
@@ -0,0 +1,252 @@
|
|
|
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
|
+
# Serializer for synchronously setting a label.
|
|
18
|
+
class UnsetLabel
|
|
19
|
+
attr_accessor :key
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'key' => :'key'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
|
29
|
+
def self.acceptable_attributes
|
|
30
|
+
attribute_map.values
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Attribute type mapping.
|
|
34
|
+
def self.openapi_types
|
|
35
|
+
{
|
|
36
|
+
:'key' => :'String'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# List of attributes with nullable: true
|
|
41
|
+
def self.openapi_nullable
|
|
42
|
+
Set.new([
|
|
43
|
+
])
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Initializes the object
|
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
48
|
+
def initialize(attributes = {})
|
|
49
|
+
if (!attributes.is_a?(Hash))
|
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpNpmClient::UnsetLabel` initialize method"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpNpmClient::UnsetLabel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
57
|
+
end
|
|
58
|
+
h[k.to_sym] = v
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if attributes.key?(:'key')
|
|
62
|
+
self.key = attributes[:'key']
|
|
63
|
+
else
|
|
64
|
+
self.key = nil
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
69
|
+
# @return Array for valid properties with the reasons
|
|
70
|
+
def list_invalid_properties
|
|
71
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
72
|
+
invalid_properties = Array.new
|
|
73
|
+
if @key.nil?
|
|
74
|
+
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if @key.to_s.length < 1
|
|
78
|
+
invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
82
|
+
if @key !~ pattern
|
|
83
|
+
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
invalid_properties
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Check to see if the all the properties in the model are valid
|
|
90
|
+
# @return true if the model is valid
|
|
91
|
+
def valid?
|
|
92
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
93
|
+
return false if @key.nil?
|
|
94
|
+
return false if @key.to_s.length < 1
|
|
95
|
+
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
96
|
+
true
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Custom attribute writer method with validation
|
|
100
|
+
# @param [Object] key Value to be assigned
|
|
101
|
+
def key=(key)
|
|
102
|
+
if key.nil?
|
|
103
|
+
fail ArgumentError, 'key cannot be nil'
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if key.to_s.length < 1
|
|
107
|
+
fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
111
|
+
if key !~ pattern
|
|
112
|
+
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
@key = key
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Checks equality by comparing each attribute.
|
|
119
|
+
# @param [Object] Object to be compared
|
|
120
|
+
def ==(o)
|
|
121
|
+
return true if self.equal?(o)
|
|
122
|
+
self.class == o.class &&
|
|
123
|
+
key == o.key
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# @see the `==` method
|
|
127
|
+
# @param [Object] Object to be compared
|
|
128
|
+
def eql?(o)
|
|
129
|
+
self == o
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Calculates hash code according to all attributes.
|
|
133
|
+
# @return [Integer] Hash code
|
|
134
|
+
def hash
|
|
135
|
+
[key].hash
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Builds the object from hash
|
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
140
|
+
# @return [Object] Returns the model itself
|
|
141
|
+
def self.build_from_hash(attributes)
|
|
142
|
+
return nil unless attributes.is_a?(Hash)
|
|
143
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
144
|
+
transformed_hash = {}
|
|
145
|
+
openapi_types.each_pair do |key, type|
|
|
146
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
147
|
+
transformed_hash["#{key}"] = nil
|
|
148
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
149
|
+
# check to ensure the input is an array given that the attribute
|
|
150
|
+
# is documented as an array but the input is not
|
|
151
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
152
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
153
|
+
end
|
|
154
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
155
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
new(transformed_hash)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Deserializes the data based on type
|
|
162
|
+
# @param string type Data type
|
|
163
|
+
# @param string value Value to be deserialized
|
|
164
|
+
# @return [Object] Deserialized data
|
|
165
|
+
def self._deserialize(type, value)
|
|
166
|
+
case type.to_sym
|
|
167
|
+
when :Time
|
|
168
|
+
Time.parse(value)
|
|
169
|
+
when :Date
|
|
170
|
+
Date.parse(value)
|
|
171
|
+
when :String
|
|
172
|
+
value.to_s
|
|
173
|
+
when :Integer
|
|
174
|
+
value.to_i
|
|
175
|
+
when :Float
|
|
176
|
+
value.to_f
|
|
177
|
+
when :Boolean
|
|
178
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
179
|
+
true
|
|
180
|
+
else
|
|
181
|
+
false
|
|
182
|
+
end
|
|
183
|
+
when :Object
|
|
184
|
+
# generic object (usually a Hash), return directly
|
|
185
|
+
value
|
|
186
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
187
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
188
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
189
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
190
|
+
k_type = Regexp.last_match[:k_type]
|
|
191
|
+
v_type = Regexp.last_match[:v_type]
|
|
192
|
+
{}.tap do |hash|
|
|
193
|
+
value.each do |k, v|
|
|
194
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
else # model
|
|
198
|
+
# models (e.g. Pet) or oneOf
|
|
199
|
+
klass = PulpNpmClient.const_get(type)
|
|
200
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Returns the string representation of the object
|
|
205
|
+
# @return [String] String presentation of the object
|
|
206
|
+
def to_s
|
|
207
|
+
to_hash.to_s
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
|
212
|
+
def to_body
|
|
213
|
+
to_hash
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Returns the object in the form of hash
|
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
|
218
|
+
def to_hash
|
|
219
|
+
hash = {}
|
|
220
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
221
|
+
value = self.send(attr)
|
|
222
|
+
if value.nil?
|
|
223
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
224
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
hash[param] = _to_hash(value)
|
|
228
|
+
end
|
|
229
|
+
hash
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Outputs non-array value in the form of hash
|
|
233
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
234
|
+
# @param [Object] value Any valid value
|
|
235
|
+
# @return [Hash] Returns the value in the form of hash
|
|
236
|
+
def _to_hash(value)
|
|
237
|
+
if value.is_a?(Array)
|
|
238
|
+
value.compact.map { |v| _to_hash(v) }
|
|
239
|
+
elsif value.is_a?(Hash)
|
|
240
|
+
{}.tap do |hash|
|
|
241
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
242
|
+
end
|
|
243
|
+
elsif value.respond_to? :to_hash
|
|
244
|
+
value.to_hash
|
|
245
|
+
else
|
|
246
|
+
value
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
end
|
|
@@ -0,0 +1,252 @@
|
|
|
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
|
+
# Serializer for synchronously setting a label.
|
|
18
|
+
class UnsetLabelResponse
|
|
19
|
+
attr_accessor :key
|
|
20
|
+
|
|
21
|
+
attr_accessor :value
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'key' => :'key',
|
|
27
|
+
:'value' => :'value'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns all the JSON keys this model knows about
|
|
32
|
+
def self.acceptable_attributes
|
|
33
|
+
attribute_map.values
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Attribute type mapping.
|
|
37
|
+
def self.openapi_types
|
|
38
|
+
{
|
|
39
|
+
:'key' => :'String',
|
|
40
|
+
:'value' => :'String'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpNpmClient::UnsetLabelResponse` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpNpmClient::UnsetLabelResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
61
|
+
end
|
|
62
|
+
h[k.to_sym] = v
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if attributes.key?(:'key')
|
|
66
|
+
self.key = attributes[:'key']
|
|
67
|
+
else
|
|
68
|
+
self.key = nil
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'value')
|
|
72
|
+
self.value = attributes[:'value']
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
77
|
+
# @return Array for valid properties with the reasons
|
|
78
|
+
def list_invalid_properties
|
|
79
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
80
|
+
invalid_properties = Array.new
|
|
81
|
+
if @key.nil?
|
|
82
|
+
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
86
|
+
if @key !~ pattern
|
|
87
|
+
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
|
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 @key.nil?
|
|
98
|
+
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
99
|
+
true
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Custom attribute writer method with validation
|
|
103
|
+
# @param [Object] key Value to be assigned
|
|
104
|
+
def key=(key)
|
|
105
|
+
if key.nil?
|
|
106
|
+
fail ArgumentError, 'key cannot be nil'
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
110
|
+
if key !~ pattern
|
|
111
|
+
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
@key = key
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Checks equality by comparing each attribute.
|
|
118
|
+
# @param [Object] Object to be compared
|
|
119
|
+
def ==(o)
|
|
120
|
+
return true if self.equal?(o)
|
|
121
|
+
self.class == o.class &&
|
|
122
|
+
key == o.key &&
|
|
123
|
+
value == o.value
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# @see the `==` method
|
|
127
|
+
# @param [Object] Object to be compared
|
|
128
|
+
def eql?(o)
|
|
129
|
+
self == o
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Calculates hash code according to all attributes.
|
|
133
|
+
# @return [Integer] Hash code
|
|
134
|
+
def hash
|
|
135
|
+
[key, value].hash
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Builds the object from hash
|
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
140
|
+
# @return [Object] Returns the model itself
|
|
141
|
+
def self.build_from_hash(attributes)
|
|
142
|
+
return nil unless attributes.is_a?(Hash)
|
|
143
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
144
|
+
transformed_hash = {}
|
|
145
|
+
openapi_types.each_pair do |key, type|
|
|
146
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
147
|
+
transformed_hash["#{key}"] = nil
|
|
148
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
149
|
+
# check to ensure the input is an array given that the attribute
|
|
150
|
+
# is documented as an array but the input is not
|
|
151
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
152
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
153
|
+
end
|
|
154
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
155
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
new(transformed_hash)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Deserializes the data based on type
|
|
162
|
+
# @param string type Data type
|
|
163
|
+
# @param string value Value to be deserialized
|
|
164
|
+
# @return [Object] Deserialized data
|
|
165
|
+
def self._deserialize(type, value)
|
|
166
|
+
case type.to_sym
|
|
167
|
+
when :Time
|
|
168
|
+
Time.parse(value)
|
|
169
|
+
when :Date
|
|
170
|
+
Date.parse(value)
|
|
171
|
+
when :String
|
|
172
|
+
value.to_s
|
|
173
|
+
when :Integer
|
|
174
|
+
value.to_i
|
|
175
|
+
when :Float
|
|
176
|
+
value.to_f
|
|
177
|
+
when :Boolean
|
|
178
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
179
|
+
true
|
|
180
|
+
else
|
|
181
|
+
false
|
|
182
|
+
end
|
|
183
|
+
when :Object
|
|
184
|
+
# generic object (usually a Hash), return directly
|
|
185
|
+
value
|
|
186
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
187
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
188
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
189
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
190
|
+
k_type = Regexp.last_match[:k_type]
|
|
191
|
+
v_type = Regexp.last_match[:v_type]
|
|
192
|
+
{}.tap do |hash|
|
|
193
|
+
value.each do |k, v|
|
|
194
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
else # model
|
|
198
|
+
# models (e.g. Pet) or oneOf
|
|
199
|
+
klass = PulpNpmClient.const_get(type)
|
|
200
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Returns the string representation of the object
|
|
205
|
+
# @return [String] String presentation of the object
|
|
206
|
+
def to_s
|
|
207
|
+
to_hash.to_s
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
|
212
|
+
def to_body
|
|
213
|
+
to_hash
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Returns the object in the form of hash
|
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
|
218
|
+
def to_hash
|
|
219
|
+
hash = {}
|
|
220
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
221
|
+
value = self.send(attr)
|
|
222
|
+
if value.nil?
|
|
223
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
224
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
hash[param] = _to_hash(value)
|
|
228
|
+
end
|
|
229
|
+
hash
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Outputs non-array value in the form of hash
|
|
233
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
234
|
+
# @param [Object] value Any valid value
|
|
235
|
+
# @return [Hash] Returns the value in the form of hash
|
|
236
|
+
def _to_hash(value)
|
|
237
|
+
if value.is_a?(Array)
|
|
238
|
+
value.compact.map { |v| _to_hash(v) }
|
|
239
|
+
elsif value.is_a?(Hash)
|
|
240
|
+
{}.tap do |hash|
|
|
241
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
242
|
+
end
|
|
243
|
+
elsif value.respond_to? :to_hash
|
|
244
|
+
value.to_hash
|
|
245
|
+
else
|
|
246
|
+
value
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
end
|
|
@@ -6,10 +6,10 @@
|
|
|
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
|
module PulpNpmClient
|
|
14
|
-
VERSION = '0.1.
|
|
14
|
+
VERSION = '0.1.0'
|
|
15
15
|
end
|
data/lib/pulp_npm_client.rb
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
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
|
|
|
@@ -23,9 +23,9 @@ require 'pulp_npm_client/models/npm_npm_distribution'
|
|
|
23
23
|
require 'pulp_npm_client/models/npm_npm_distribution_response'
|
|
24
24
|
require 'pulp_npm_client/models/npm_npm_remote'
|
|
25
25
|
require 'pulp_npm_client/models/npm_npm_remote_response'
|
|
26
|
+
require 'pulp_npm_client/models/npm_npm_remote_response_hidden_fields_inner'
|
|
26
27
|
require 'pulp_npm_client/models/npm_npm_repository'
|
|
27
28
|
require 'pulp_npm_client/models/npm_npm_repository_response'
|
|
28
|
-
require 'pulp_npm_client/models/npm_package'
|
|
29
29
|
require 'pulp_npm_client/models/npm_package_response'
|
|
30
30
|
require 'pulp_npm_client/models/paginated_repository_version_response_list'
|
|
31
31
|
require 'pulp_npm_client/models/paginatednpm_npm_distribution_response_list'
|
|
@@ -40,11 +40,14 @@ require 'pulp_npm_client/models/repair'
|
|
|
40
40
|
require 'pulp_npm_client/models/repository_add_remove_content'
|
|
41
41
|
require 'pulp_npm_client/models/repository_sync_url'
|
|
42
42
|
require 'pulp_npm_client/models/repository_version_response'
|
|
43
|
+
require 'pulp_npm_client/models/set_label'
|
|
44
|
+
require 'pulp_npm_client/models/set_label_response'
|
|
45
|
+
require 'pulp_npm_client/models/unset_label'
|
|
46
|
+
require 'pulp_npm_client/models/unset_label_response'
|
|
43
47
|
|
|
44
48
|
# APIs
|
|
45
49
|
require 'pulp_npm_client/api/content_packages_api'
|
|
46
50
|
require 'pulp_npm_client/api/distributions_npm_api'
|
|
47
|
-
require 'pulp_npm_client/api/pulp_npm_packages_api'
|
|
48
51
|
require 'pulp_npm_client/api/remotes_npm_api'
|
|
49
52
|
require 'pulp_npm_client/api/repositories_npm_api'
|
|
50
53
|
require 'pulp_npm_client/api/repositories_npm_versions_api'
|
data/pulp_npm_client.gemspec
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
The version of the OpenAPI document: v3
|
|
9
9
|
Contact: pulp-list@redhat.com
|
|
10
10
|
Generated by: https://openapi-generator.tech
|
|
11
|
-
|
|
11
|
+
Generator version: 7.10.0
|
|
12
12
|
|
|
13
13
|
=end
|
|
14
14
|
|
|
@@ -21,14 +21,17 @@ Gem::Specification.new do |s|
|
|
|
21
21
|
s.platform = Gem::Platform::RUBY
|
|
22
22
|
s.authors = ["OpenAPI-Generator"]
|
|
23
23
|
s.email = ["pulp-list@redhat.com"]
|
|
24
|
-
s.homepage = "https://
|
|
24
|
+
s.homepage = "https://github.com/pulp/pulp_npm"
|
|
25
25
|
s.summary = "Pulp 3 API Ruby Gem"
|
|
26
26
|
s.description = "Fetch, Upload, Organize, and Distribute Software Packages"
|
|
27
|
-
s.license =
|
|
28
|
-
s.required_ruby_version = ">=
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
s.add_runtime_dependency '
|
|
27
|
+
s.license = "GPLv2+"
|
|
28
|
+
s.required_ruby_version = ">= 2.7"
|
|
29
|
+
s.metadata = {}
|
|
30
|
+
|
|
31
|
+
s.add_runtime_dependency 'faraday-net_http', '>= 2.0', '< 3.1'
|
|
32
|
+
s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 2.9'
|
|
33
|
+
s.add_runtime_dependency 'faraday-multipart'
|
|
34
|
+
s.add_runtime_dependency 'marcel'
|
|
32
35
|
|
|
33
36
|
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
|
34
37
|
|
|
@@ -6,7 +6,7 @@
|
|
|
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
|
|
|
@@ -34,19 +34,20 @@ describe 'ContentPackagesApi' do
|
|
|
34
34
|
|
|
35
35
|
# unit tests for create
|
|
36
36
|
# Create a package
|
|
37
|
-
# Perform bookkeeping when saving Content. \"Artifacts\" need to be popped off and saved
|
|
37
|
+
# Perform bookkeeping when saving Content. \"Artifacts\" need to be popped off and saved independently, as they are not actually part of the Content model.
|
|
38
38
|
# @param relative_path
|
|
39
39
|
# @param name
|
|
40
40
|
# @param version
|
|
41
41
|
# @param [Hash] opts the optional parameters
|
|
42
|
-
# @option opts [String] :artifact Artifact file representing the physical content
|
|
43
|
-
# @option opts [File] :file An uploaded file that may be turned into the artifact of the content unit.
|
|
44
42
|
# @option opts [String] :repository A URI of a repository the new content unit should be associated with.
|
|
45
|
-
# @option opts [String] :
|
|
43
|
+
# @option opts [String] :artifact Artifact file representing the physical content
|
|
44
|
+
# @option opts [File] :file An uploaded file that may be turned into the content unit.
|
|
45
|
+
# @option opts [String] :upload An uncommitted upload that may be turned into the content unit.
|
|
46
|
+
# @option opts [String] :file_url A url that Pulp can download and turn into the content unit.
|
|
46
47
|
# @return [NpmPackageResponse]
|
|
47
48
|
describe 'create test' do
|
|
48
49
|
it 'should work' do
|
|
49
|
-
# assertion here. ref: https://
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
50
51
|
end
|
|
51
52
|
end
|
|
52
53
|
|
|
@@ -58,16 +59,21 @@ describe 'ContentPackagesApi' do
|
|
|
58
59
|
# @option opts [String] :name Filter results where name matches value
|
|
59
60
|
# @option opts [Array<String>] :name__in Filter results where name is in a comma-separated list of values
|
|
60
61
|
# @option opts [Integer] :offset The initial index from which to return the results.
|
|
61
|
-
# @option opts [Array<String>] :ordering Ordering
|
|
62
|
-
# @option opts [
|
|
63
|
-
# @option opts [String] :
|
|
64
|
-
# @option opts [String] :
|
|
65
|
-
# @option opts [String] :
|
|
66
|
-
# @option opts [String] :
|
|
62
|
+
# @option opts [Array<String>] :ordering Ordering * `pulp_id` - Pulp id * `-pulp_id` - Pulp id (descending) * `pulp_created` - Pulp created * `-pulp_created` - Pulp created (descending) * `pulp_last_updated` - Pulp last updated * `-pulp_last_updated` - Pulp last updated (descending) * `pulp_type` - Pulp type * `-pulp_type` - Pulp type (descending) * `upstream_id` - Upstream id * `-upstream_id` - Upstream id (descending) * `timestamp_of_interest` - Timestamp of interest * `-timestamp_of_interest` - Timestamp of interest (descending) * `name` - Name * `-name` - Name (descending) * `version` - Version * `-version` - Version (descending) * `pk` - Pk * `-pk` - Pk (descending)
|
|
63
|
+
# @option opts [Float] :orphaned_for Minutes Content has been orphaned for. -1 uses ORPHAN_PROTECTION_TIME.
|
|
64
|
+
# @option opts [Array<String>] :prn__in Multiple values may be separated by commas.
|
|
65
|
+
# @option opts [Array<String>] :pulp_href__in Multiple values may be separated by commas.
|
|
66
|
+
# @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas.
|
|
67
|
+
# @option opts [String] :q Filter results by using NOT, AND and OR operations on other filters
|
|
68
|
+
# @option opts [String] :repository_version Repository Version referenced by HREF/PRN
|
|
69
|
+
# @option opts [String] :repository_version_added Repository Version referenced by HREF/PRN
|
|
70
|
+
# @option opts [String] :repository_version_removed Repository Version referenced by HREF/PRN
|
|
71
|
+
# @option opts [Array<String>] :fields A list of fields to include in the response.
|
|
72
|
+
# @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
|
|
67
73
|
# @return [PaginatednpmPackageResponseList]
|
|
68
74
|
describe 'list test' do
|
|
69
75
|
it 'should work' do
|
|
70
|
-
# assertion here. ref: https://
|
|
76
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
71
77
|
end
|
|
72
78
|
end
|
|
73
79
|
|
|
@@ -76,12 +82,12 @@ describe 'ContentPackagesApi' do
|
|
|
76
82
|
# A ViewSet for Package. Define endpoint name which will appear in the API endpoint for this content type. For example:: http://pulp.example.com/pulp/api/v3/content/npm/units/ Also specify queryset and serializer for Package.
|
|
77
83
|
# @param npm_package_href
|
|
78
84
|
# @param [Hash] opts the optional parameters
|
|
79
|
-
# @option opts [String] :fields A list of fields to include in the response.
|
|
80
|
-
# @option opts [String] :exclude_fields A list of fields to exclude from the response.
|
|
85
|
+
# @option opts [Array<String>] :fields A list of fields to include in the response.
|
|
86
|
+
# @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
|
|
81
87
|
# @return [NpmPackageResponse]
|
|
82
88
|
describe 'read test' do
|
|
83
89
|
it 'should work' do
|
|
84
|
-
# assertion here. ref: https://
|
|
90
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
85
91
|
end
|
|
86
92
|
end
|
|
87
93
|
|