pulp_npm_client 0.1.0a1.dev01595813316 → 0.1.0a1.dev01596158992

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pulp_npm_client might be problematic. Click here for more details.

Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -11
  3. data/docs/ContentPackagesApi.md +27 -27
  4. data/docs/ContentSummary.md +3 -3
  5. data/docs/ContentSummaryResponse.md +21 -0
  6. data/docs/DistributionsNpmApi.md +104 -56
  7. data/docs/InlineResponse200.md +3 -3
  8. data/docs/InlineResponse2001.md +3 -3
  9. data/docs/InlineResponse2002.md +3 -3
  10. data/docs/InlineResponse2003.md +3 -3
  11. data/docs/InlineResponse2004.md +3 -3
  12. data/docs/NpmNpmDistribution.md +1 -7
  13. data/docs/NpmNpmDistributionResponse.md +31 -0
  14. data/docs/NpmNpmRemote.md +4 -10
  15. data/docs/NpmNpmRemoteResponse.md +43 -0
  16. data/docs/NpmNpmRepository.md +4 -10
  17. data/docs/NpmNpmRepositoryResponse.md +29 -0
  18. data/docs/NpmPackage.md +5 -5
  19. data/docs/NpmPackageResponse.md +27 -0
  20. data/docs/PatchednpmNpmDistribution.md +25 -0
  21. data/docs/PatchednpmNpmRemote.md +37 -0
  22. data/docs/PatchednpmNpmRepository.md +21 -0
  23. data/docs/PolicyEnum.md +16 -0
  24. data/docs/RemotesNpmApi.md +124 -64
  25. data/docs/RepositoriesNpmApi.md +94 -70
  26. data/docs/RepositoriesNpmVersionsApi.md +90 -58
  27. data/docs/RepositoryAddRemoveContent.md +2 -2
  28. data/docs/RepositorySyncURL.md +1 -1
  29. data/docs/RepositoryVersion.md +1 -9
  30. data/docs/RepositoryVersionResponse.md +25 -0
  31. data/lib/pulp_npm_client.rb +12 -2
  32. data/lib/pulp_npm_client/api/content_packages_api.rb +34 -46
  33. data/lib/pulp_npm_client/api/distributions_npm_api.rb +131 -68
  34. data/lib/pulp_npm_client/api/remotes_npm_api.rb +165 -84
  35. data/lib/pulp_npm_client/api/repositories_npm_api.rb +121 -94
  36. data/lib/pulp_npm_client/api/repositories_npm_versions_api.rb +119 -74
  37. data/lib/pulp_npm_client/api_client.rb +2 -2
  38. data/lib/pulp_npm_client/api_error.rb +2 -2
  39. data/lib/pulp_npm_client/configuration.rb +3 -3
  40. data/lib/pulp_npm_client/models/async_operation_response.rb +3 -2
  41. data/lib/pulp_npm_client/models/content_summary.rb +9 -15
  42. data/lib/pulp_npm_client/models/content_summary_response.rb +240 -0
  43. data/lib/pulp_npm_client/models/inline_response200.rb +3 -13
  44. data/lib/pulp_npm_client/models/inline_response2001.rb +3 -13
  45. data/lib/pulp_npm_client/models/inline_response2002.rb +3 -13
  46. data/lib/pulp_npm_client/models/inline_response2003.rb +3 -13
  47. data/lib/pulp_npm_client/models/inline_response2004.rb +3 -13
  48. data/lib/pulp_npm_client/models/npm_npm_distribution.rb +4 -85
  49. data/lib/pulp_npm_client/models/npm_npm_distribution_response.rb +290 -0
  50. data/lib/pulp_npm_client/models/npm_npm_remote.rb +7 -199
  51. data/lib/pulp_npm_client/models/npm_npm_remote_response.rb +368 -0
  52. data/lib/pulp_npm_client/models/npm_npm_repository.rb +18 -78
  53. data/lib/pulp_npm_client/models/npm_npm_repository_response.rb +271 -0
  54. data/lib/pulp_npm_client/models/npm_package.rb +24 -79
  55. data/lib/pulp_npm_client/models/npm_package_response.rb +269 -0
  56. data/lib/pulp_npm_client/models/patchednpm_npm_distribution.rb +251 -0
  57. data/lib/pulp_npm_client/models/patchednpm_npm_remote.rb +329 -0
  58. data/lib/pulp_npm_client/models/patchednpm_npm_repository.rb +229 -0
  59. data/lib/pulp_npm_client/models/policy_enum.rb +37 -0
  60. data/lib/pulp_npm_client/models/repository_add_remove_content.rb +5 -4
  61. data/lib/pulp_npm_client/models/repository_sync_url.rb +3 -8
  62. data/lib/pulp_npm_client/models/repository_version.rb +7 -43
  63. data/lib/pulp_npm_client/models/repository_version_response.rb +246 -0
  64. data/lib/pulp_npm_client/version.rb +3 -3
  65. data/pulp_npm_client.gemspec +4 -4
  66. data/spec/api/content_packages_api_spec.rb +14 -14
  67. data/spec/api/distributions_npm_api_spec.rb +39 -18
  68. data/spec/api/remotes_npm_api_spec.rb +51 -24
  69. data/spec/api/repositories_npm_api_spec.rb +31 -22
  70. data/spec/api/repositories_npm_versions_api_spec.rb +38 -23
  71. data/spec/api_client_spec.rb +2 -2
  72. data/spec/configuration_spec.rb +2 -2
  73. data/spec/models/async_operation_response_spec.rb +2 -2
  74. data/spec/models/content_summary_response_spec.rb +53 -0
  75. data/spec/models/content_summary_spec.rb +2 -2
  76. data/spec/models/inline_response2001_spec.rb +2 -2
  77. data/spec/models/inline_response2002_spec.rb +2 -2
  78. data/spec/models/inline_response2003_spec.rb +2 -2
  79. data/spec/models/inline_response2004_spec.rb +2 -2
  80. data/spec/models/inline_response200_spec.rb +2 -2
  81. data/spec/models/npm_npm_distribution_response_spec.rb +83 -0
  82. data/spec/models/npm_npm_distribution_spec.rb +2 -20
  83. data/spec/models/npm_npm_remote_response_spec.rb +119 -0
  84. data/spec/models/npm_npm_remote_spec.rb +2 -24
  85. data/spec/models/npm_npm_repository_response_spec.rb +77 -0
  86. data/spec/models/npm_npm_repository_spec.rb +5 -23
  87. data/spec/models/npm_package_response_spec.rb +71 -0
  88. data/spec/models/npm_package_spec.rb +6 -6
  89. data/spec/models/patchednpm_npm_distribution_spec.rb +65 -0
  90. data/spec/models/patchednpm_npm_remote_spec.rb +101 -0
  91. data/spec/models/patchednpm_npm_repository_spec.rb +53 -0
  92. data/spec/models/policy_enum_spec.rb +35 -0
  93. data/spec/models/repository_add_remove_content_spec.rb +2 -2
  94. data/spec/models/repository_sync_url_spec.rb +2 -2
  95. data/spec/models/repository_version_response_spec.rb +65 -0
  96. data/spec/models/repository_version_spec.rb +2 -26
  97. data/spec/spec_helper.rb +2 -2
  98. metadata +54 -14
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Pulp 3 API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
5
 
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
  OpenAPI Generator version: 4.2.3
10
10
 
@@ -13,18 +13,11 @@ OpenAPI Generator version: 4.2.3
13
13
  require 'date'
14
14
 
15
15
  module PulpNpmClient
16
+ # Serializer for NPM Distributions.
16
17
  class NpmNpmDistribution
17
- attr_accessor :pulp_href
18
-
19
- # Timestamp of creation.
20
- attr_accessor :pulp_created
21
-
22
18
  # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
23
19
  attr_accessor :base_path
24
20
 
25
- # The URL for accessing the universe API as defined by this distribution.
26
- attr_accessor :base_url
27
-
28
21
  # An optional content-guard.
29
22
  attr_accessor :content_guard
30
23
 
@@ -40,10 +33,7 @@ module PulpNpmClient
40
33
  # Attribute mapping from ruby-style variable name to JSON key.
41
34
  def self.attribute_map
42
35
  {
43
- :'pulp_href' => :'pulp_href',
44
- :'pulp_created' => :'pulp_created',
45
36
  :'base_path' => :'base_path',
46
- :'base_url' => :'base_url',
47
37
  :'content_guard' => :'content_guard',
48
38
  :'name' => :'name',
49
39
  :'repository' => :'repository',
@@ -54,10 +44,7 @@ module PulpNpmClient
54
44
  # Attribute type mapping.
55
45
  def self.openapi_types
56
46
  {
57
- :'pulp_href' => :'String',
58
- :'pulp_created' => :'DateTime',
59
47
  :'base_path' => :'String',
60
- :'base_url' => :'String',
61
48
  :'content_guard' => :'String',
62
49
  :'name' => :'String',
63
50
  :'repository' => :'String',
@@ -89,22 +76,10 @@ module PulpNpmClient
89
76
  h[k.to_sym] = v
90
77
  }
91
78
 
92
- if attributes.key?(:'pulp_href')
93
- self.pulp_href = attributes[:'pulp_href']
94
- end
95
-
96
- if attributes.key?(:'pulp_created')
97
- self.pulp_created = attributes[:'pulp_created']
98
- end
99
-
100
79
  if attributes.key?(:'base_path')
101
80
  self.base_path = attributes[:'base_path']
102
81
  end
103
82
 
104
- if attributes.key?(:'base_url')
105
- self.base_url = attributes[:'base_url']
106
- end
107
-
108
83
  if attributes.key?(:'content_guard')
109
84
  self.content_guard = attributes[:'content_guard']
110
85
  end
@@ -130,22 +105,10 @@ module PulpNpmClient
130
105
  invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
131
106
  end
132
107
 
133
- if @base_path.to_s.length < 1
134
- invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
135
- end
136
-
137
- if !@base_url.nil? && @base_url.to_s.length < 1
138
- invalid_properties.push('invalid value for "base_url", the character length must be great than or equal to 1.')
139
- end
140
-
141
108
  if @name.nil?
142
109
  invalid_properties.push('invalid value for "name", name cannot be nil.')
143
110
  end
144
111
 
145
- if @name.to_s.length < 1
146
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
147
- end
148
-
149
112
  invalid_properties
150
113
  end
151
114
 
@@ -153,60 +116,16 @@ module PulpNpmClient
153
116
  # @return true if the model is valid
154
117
  def valid?
155
118
  return false if @base_path.nil?
156
- return false if @base_path.to_s.length < 1
157
- return false if !@base_url.nil? && @base_url.to_s.length < 1
158
119
  return false if @name.nil?
159
- return false if @name.to_s.length < 1
160
120
  true
161
121
  end
162
122
 
163
- # Custom attribute writer method with validation
164
- # @param [Object] base_path Value to be assigned
165
- def base_path=(base_path)
166
- if base_path.nil?
167
- fail ArgumentError, 'base_path cannot be nil'
168
- end
169
-
170
- if base_path.to_s.length < 1
171
- fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
172
- end
173
-
174
- @base_path = base_path
175
- end
176
-
177
- # Custom attribute writer method with validation
178
- # @param [Object] base_url Value to be assigned
179
- def base_url=(base_url)
180
- if !base_url.nil? && base_url.to_s.length < 1
181
- fail ArgumentError, 'invalid value for "base_url", the character length must be great than or equal to 1.'
182
- end
183
-
184
- @base_url = base_url
185
- end
186
-
187
- # Custom attribute writer method with validation
188
- # @param [Object] name Value to be assigned
189
- def name=(name)
190
- if name.nil?
191
- fail ArgumentError, 'name cannot be nil'
192
- end
193
-
194
- if name.to_s.length < 1
195
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
196
- end
197
-
198
- @name = name
199
- end
200
-
201
123
  # Checks equality by comparing each attribute.
202
124
  # @param [Object] Object to be compared
203
125
  def ==(o)
204
126
  return true if self.equal?(o)
205
127
  self.class == o.class &&
206
- pulp_href == o.pulp_href &&
207
- pulp_created == o.pulp_created &&
208
128
  base_path == o.base_path &&
209
- base_url == o.base_url &&
210
129
  content_guard == o.content_guard &&
211
130
  name == o.name &&
212
131
  repository == o.repository &&
@@ -222,7 +141,7 @@ module PulpNpmClient
222
141
  # Calculates hash code according to all attributes.
223
142
  # @return [Integer] Hash code
224
143
  def hash
225
- [pulp_href, pulp_created, base_path, base_url, content_guard, name, repository, repository_version].hash
144
+ [base_path, content_guard, name, repository, repository_version].hash
226
145
  end
227
146
 
228
147
  # Builds the object from hash
@@ -0,0 +1,290 @@
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
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpNpmClient
16
+ # Serializer for NPM Distributions.
17
+ class NpmNpmDistributionResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
24
+ attr_accessor :base_path
25
+
26
+ # The URL for accessing the universe API as defined by this distribution.
27
+ attr_accessor :base_url
28
+
29
+ # An optional content-guard.
30
+ attr_accessor :content_guard
31
+
32
+ # A unique name. Ex, `rawhide` and `stable`.
33
+ attr_accessor :name
34
+
35
+ # The latest RepositoryVersion for this Repository will be served.
36
+ attr_accessor :repository
37
+
38
+ # RepositoryVersion to be served
39
+ attr_accessor :repository_version
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'pulp_href' => :'pulp_href',
45
+ :'pulp_created' => :'pulp_created',
46
+ :'base_path' => :'base_path',
47
+ :'base_url' => :'base_url',
48
+ :'content_guard' => :'content_guard',
49
+ :'name' => :'name',
50
+ :'repository' => :'repository',
51
+ :'repository_version' => :'repository_version'
52
+ }
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'pulp_href' => :'String',
59
+ :'pulp_created' => :'DateTime',
60
+ :'base_path' => :'String',
61
+ :'base_url' => :'String',
62
+ :'content_guard' => :'String',
63
+ :'name' => :'String',
64
+ :'repository' => :'String',
65
+ :'repository_version' => :'String'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ :'content_guard',
73
+ :'repository',
74
+ :'repository_version'
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpNpmClient::NpmNpmDistributionResponse` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!self.class.attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpNpmClient::NpmNpmDistributionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'pulp_href')
94
+ self.pulp_href = attributes[:'pulp_href']
95
+ end
96
+
97
+ if attributes.key?(:'pulp_created')
98
+ self.pulp_created = attributes[:'pulp_created']
99
+ end
100
+
101
+ if attributes.key?(:'base_path')
102
+ self.base_path = attributes[:'base_path']
103
+ end
104
+
105
+ if attributes.key?(:'base_url')
106
+ self.base_url = attributes[:'base_url']
107
+ end
108
+
109
+ if attributes.key?(:'content_guard')
110
+ self.content_guard = attributes[:'content_guard']
111
+ end
112
+
113
+ if attributes.key?(:'name')
114
+ self.name = attributes[:'name']
115
+ end
116
+
117
+ if attributes.key?(:'repository')
118
+ self.repository = attributes[:'repository']
119
+ end
120
+
121
+ if attributes.key?(:'repository_version')
122
+ self.repository_version = attributes[:'repository_version']
123
+ end
124
+ end
125
+
126
+ # Show invalid properties with the reasons. Usually used together with valid?
127
+ # @return Array for valid properties with the reasons
128
+ def list_invalid_properties
129
+ invalid_properties = Array.new
130
+ if @base_path.nil?
131
+ invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
132
+ end
133
+
134
+ if @name.nil?
135
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
136
+ end
137
+
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ return false if @base_path.nil?
145
+ return false if @name.nil?
146
+ true
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ pulp_href == o.pulp_href &&
155
+ pulp_created == o.pulp_created &&
156
+ base_path == o.base_path &&
157
+ base_url == o.base_url &&
158
+ content_guard == o.content_guard &&
159
+ name == o.name &&
160
+ repository == o.repository &&
161
+ repository_version == o.repository_version
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Integer] Hash code
172
+ def hash
173
+ [pulp_href, pulp_created, base_path, base_url, content_guard, name, repository, repository_version].hash
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def self.build_from_hash(attributes)
180
+ new.build_from_hash(attributes)
181
+ end
182
+
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def build_from_hash(attributes)
187
+ return nil unless attributes.is_a?(Hash)
188
+ self.class.openapi_types.each_pair do |key, type|
189
+ if type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
193
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
194
+ end
195
+ elsif !attributes[self.class.attribute_map[key]].nil?
196
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
197
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
198
+ end
199
+
200
+ self
201
+ end
202
+
203
+ # Deserializes the data based on type
204
+ # @param string type Data type
205
+ # @param string value Value to be deserialized
206
+ # @return [Object] Deserialized data
207
+ def _deserialize(type, value)
208
+ case type.to_sym
209
+ when :DateTime
210
+ DateTime.parse(value)
211
+ when :Date
212
+ Date.parse(value)
213
+ when :String
214
+ value.to_s
215
+ when :Integer
216
+ value.to_i
217
+ when :Float
218
+ value.to_f
219
+ when :Boolean
220
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
221
+ true
222
+ else
223
+ false
224
+ end
225
+ when :Object
226
+ # generic object (usually a Hash), return directly
227
+ value
228
+ when /\AArray<(?<inner_type>.+)>\z/
229
+ inner_type = Regexp.last_match[:inner_type]
230
+ value.map { |v| _deserialize(inner_type, v) }
231
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
232
+ k_type = Regexp.last_match[:k_type]
233
+ v_type = Regexp.last_match[:v_type]
234
+ {}.tap do |hash|
235
+ value.each do |k, v|
236
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
237
+ end
238
+ end
239
+ else # model
240
+ PulpNpmClient.const_get(type).build_from_hash(value)
241
+ end
242
+ end
243
+
244
+ # Returns the string representation of the object
245
+ # @return [String] String presentation of the object
246
+ def to_s
247
+ to_hash.to_s
248
+ end
249
+
250
+ # to_body is an alias to to_hash (backward compatibility)
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_body
253
+ to_hash
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ if value.nil?
263
+ is_nullable = self.class.openapi_nullable.include?(attr)
264
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
+ end
266
+
267
+ hash[param] = _to_hash(value)
268
+ end
269
+ hash
270
+ end
271
+
272
+ # Outputs non-array value in the form of hash
273
+ # For object, use to_hash. Otherwise, just return the value
274
+ # @param [Object] value Any valid value
275
+ # @return [Hash] Returns the value in the form of hash
276
+ def _to_hash(value)
277
+ if value.is_a?(Array)
278
+ value.compact.map { |v| _to_hash(v) }
279
+ elsif value.is_a?(Hash)
280
+ {}.tap do |hash|
281
+ value.each { |k, v| hash[k] = _to_hash(v) }
282
+ end
283
+ elsif value.respond_to? :to_hash
284
+ value.to_hash
285
+ else
286
+ value
287
+ end
288
+ end
289
+ end
290
+ end