pulp_npm_client 0.1.0a1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +157 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +17 -0
  6. data/docs/ContentPackagesApi.md +208 -0
  7. data/docs/ContentSummary.md +21 -0
  8. data/docs/ContentSummaryResponse.md +21 -0
  9. data/docs/DistributionsNpmApi.md +364 -0
  10. data/docs/NpmNpmDistribution.md +25 -0
  11. data/docs/NpmNpmDistributionResponse.md +31 -0
  12. data/docs/NpmNpmRemote.md +37 -0
  13. data/docs/NpmNpmRemoteResponse.md +43 -0
  14. data/docs/NpmNpmRepository.md +21 -0
  15. data/docs/NpmNpmRepositoryResponse.md +29 -0
  16. data/docs/NpmPackage.md +27 -0
  17. data/docs/NpmPackageResponse.md +27 -0
  18. data/docs/PaginatedRepositoryVersionResponseList.md +23 -0
  19. data/docs/PaginatednpmNpmDistributionResponseList.md +23 -0
  20. data/docs/PaginatednpmNpmRemoteResponseList.md +23 -0
  21. data/docs/PaginatednpmNpmRepositoryResponseList.md +23 -0
  22. data/docs/PaginatednpmPackageResponseList.md +23 -0
  23. data/docs/PatchednpmNpmDistribution.md +25 -0
  24. data/docs/PatchednpmNpmRemote.md +37 -0
  25. data/docs/PatchednpmNpmRepository.md +21 -0
  26. data/docs/PolicyEnum.md +16 -0
  27. data/docs/PulpNpmPackagesApi.md +60 -0
  28. data/docs/RemotesNpmApi.md +368 -0
  29. data/docs/RepositoriesNpmApi.md +468 -0
  30. data/docs/RepositoriesNpmVersionsApi.md +271 -0
  31. data/docs/RepositoryAddRemoveContent.md +21 -0
  32. data/docs/RepositorySyncURL.md +19 -0
  33. data/docs/RepositoryVersion.md +17 -0
  34. data/docs/RepositoryVersionResponse.md +25 -0
  35. data/git_push.sh +58 -0
  36. data/lib/pulp_npm_client.rb +69 -0
  37. data/lib/pulp_npm_client/api/content_packages_api.rb +264 -0
  38. data/lib/pulp_npm_client/api/distributions_npm_api.rb +445 -0
  39. data/lib/pulp_npm_client/api/pulp_npm_packages_api.rb +86 -0
  40. data/lib/pulp_npm_client/api/remotes_npm_api.rb +451 -0
  41. data/lib/pulp_npm_client/api/repositories_npm_api.rb +573 -0
  42. data/lib/pulp_npm_client/api/repositories_npm_versions_api.rb +339 -0
  43. data/lib/pulp_npm_client/api_client.rb +402 -0
  44. data/lib/pulp_npm_client/api_error.rb +57 -0
  45. data/lib/pulp_npm_client/configuration.rb +243 -0
  46. data/lib/pulp_npm_client/models/async_operation_response.rb +213 -0
  47. data/lib/pulp_npm_client/models/content_summary.rb +240 -0
  48. data/lib/pulp_npm_client/models/content_summary_response.rb +240 -0
  49. data/lib/pulp_npm_client/models/npm_npm_distribution.rb +261 -0
  50. data/lib/pulp_npm_client/models/npm_npm_distribution_response.rb +290 -0
  51. data/lib/pulp_npm_client/models/npm_npm_remote.rb +339 -0
  52. data/lib/pulp_npm_client/models/npm_npm_remote_response.rb +368 -0
  53. data/lib/pulp_npm_client/models/npm_npm_repository.rb +234 -0
  54. data/lib/pulp_npm_client/models/npm_npm_repository_response.rb +271 -0
  55. data/lib/pulp_npm_client/models/npm_package.rb +270 -0
  56. data/lib/pulp_npm_client/models/npm_package_response.rb +269 -0
  57. data/lib/pulp_npm_client/models/paginated_repository_version_response_list.rb +237 -0
  58. data/lib/pulp_npm_client/models/paginatednpm_npm_distribution_response_list.rb +237 -0
  59. data/lib/pulp_npm_client/models/paginatednpm_npm_remote_response_list.rb +237 -0
  60. data/lib/pulp_npm_client/models/paginatednpm_npm_repository_response_list.rb +237 -0
  61. data/lib/pulp_npm_client/models/paginatednpm_package_response_list.rb +237 -0
  62. data/lib/pulp_npm_client/models/patchednpm_npm_distribution.rb +251 -0
  63. data/lib/pulp_npm_client/models/patchednpm_npm_remote.rb +329 -0
  64. data/lib/pulp_npm_client/models/patchednpm_npm_repository.rb +229 -0
  65. data/lib/pulp_npm_client/models/policy_enum.rb +37 -0
  66. data/lib/pulp_npm_client/models/repository_add_remove_content.rb +232 -0
  67. data/lib/pulp_npm_client/models/repository_sync_url.rb +220 -0
  68. data/lib/pulp_npm_client/models/repository_version.rb +208 -0
  69. data/lib/pulp_npm_client/models/repository_version_response.rb +246 -0
  70. data/lib/pulp_npm_client/version.rb +15 -0
  71. data/pulp_npm_client.gemspec +39 -0
  72. data/spec/api/content_packages_api_spec.rb +87 -0
  73. data/spec/api/distributions_npm_api_spec.rb +121 -0
  74. data/spec/api/pulp_npm_packages_api_spec.rb +48 -0
  75. data/spec/api/remotes_npm_api_spec.rb +123 -0
  76. data/spec/api/repositories_npm_api_spec.rb +143 -0
  77. data/spec/api/repositories_npm_versions_api_spec.rb +104 -0
  78. data/spec/api_client_spec.rb +188 -0
  79. data/spec/configuration_spec.rb +42 -0
  80. data/spec/models/async_operation_response_spec.rb +41 -0
  81. data/spec/models/content_summary_response_spec.rb +53 -0
  82. data/spec/models/content_summary_spec.rb +53 -0
  83. data/spec/models/npm_npm_distribution_response_spec.rb +83 -0
  84. data/spec/models/npm_npm_distribution_spec.rb +65 -0
  85. data/spec/models/npm_npm_remote_response_spec.rb +119 -0
  86. data/spec/models/npm_npm_remote_spec.rb +101 -0
  87. data/spec/models/npm_npm_repository_response_spec.rb +77 -0
  88. data/spec/models/npm_npm_repository_spec.rb +53 -0
  89. data/spec/models/npm_package_response_spec.rb +71 -0
  90. data/spec/models/npm_package_spec.rb +71 -0
  91. data/spec/models/paginated_repository_version_response_list_spec.rb +59 -0
  92. data/spec/models/paginatednpm_npm_distribution_response_list_spec.rb +59 -0
  93. data/spec/models/paginatednpm_npm_remote_response_list_spec.rb +59 -0
  94. data/spec/models/paginatednpm_npm_repository_response_list_spec.rb +59 -0
  95. data/spec/models/paginatednpm_package_response_list_spec.rb +59 -0
  96. data/spec/models/patchednpm_npm_distribution_spec.rb +65 -0
  97. data/spec/models/patchednpm_npm_remote_spec.rb +101 -0
  98. data/spec/models/patchednpm_npm_repository_spec.rb +53 -0
  99. data/spec/models/policy_enum_spec.rb +35 -0
  100. data/spec/models/repository_add_remove_content_spec.rb +53 -0
  101. data/spec/models/repository_sync_url_spec.rb +47 -0
  102. data/spec/models/repository_version_response_spec.rb +65 -0
  103. data/spec/models/repository_version_spec.rb +41 -0
  104. data/spec/spec_helper.rb +111 -0
  105. metadata +233 -0
@@ -0,0 +1,208 @@
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
+ # Base serializer for use with :class:`pulpcore.app.models.Model` This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
17
+ class RepositoryVersion
18
+ # A repository version whose content was used as the initial set of content for this repository version
19
+ attr_accessor :base_version
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'base_version' => :'base_version'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'base_version' => :'String'
32
+ }
33
+ end
34
+
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new([
38
+ ])
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpNpmClient::RepositoryVersion` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h|
50
+ if (!self.class.attribute_map.key?(k.to_sym))
51
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpNpmClient::RepositoryVersion`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
+ end
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'base_version')
57
+ self.base_version = attributes[:'base_version']
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ true
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
76
+ def ==(o)
77
+ return true if self.equal?(o)
78
+ self.class == o.class &&
79
+ base_version == o.base_version
80
+ end
81
+
82
+ # @see the `==` method
83
+ # @param [Object] Object to be compared
84
+ def eql?(o)
85
+ self == o
86
+ end
87
+
88
+ # Calculates hash code according to all attributes.
89
+ # @return [Integer] Hash code
90
+ def hash
91
+ [base_version].hash
92
+ end
93
+
94
+ # Builds the object from hash
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ # @return [Object] Returns the model itself
97
+ def self.build_from_hash(attributes)
98
+ new.build_from_hash(attributes)
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.openapi_types.each_pair do |key, type|
107
+ if type =~ /\AArray<(.*)>/i
108
+ # check to ensure the input is an array given that the attribute
109
+ # is documented as an array but the input is not
110
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
111
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :Boolean
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ PulpNpmClient.const_get(type).build_from_hash(value)
159
+ end
160
+ end
161
+
162
+ # Returns the string representation of the object
163
+ # @return [String] String presentation of the object
164
+ def to_s
165
+ to_hash.to_s
166
+ end
167
+
168
+ # to_body is an alias to to_hash (backward compatibility)
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_body
171
+ to_hash
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map { |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+ end
208
+ end
@@ -0,0 +1,246 @@
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
+ # Base serializer for use with :class:`pulpcore.app.models.Model` This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
17
+ class RepositoryVersionResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ attr_accessor :number
24
+
25
+ # A repository version whose content was used as the initial set of content for this repository version
26
+ attr_accessor :base_version
27
+
28
+ # Various count summaries of the content in the version and the HREF to view them.
29
+ attr_accessor :content_summary
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'pulp_href' => :'pulp_href',
35
+ :'pulp_created' => :'pulp_created',
36
+ :'number' => :'number',
37
+ :'base_version' => :'base_version',
38
+ :'content_summary' => :'content_summary'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'pulp_href' => :'String',
46
+ :'pulp_created' => :'DateTime',
47
+ :'number' => :'Integer',
48
+ :'base_version' => :'String',
49
+ :'content_summary' => :'ContentSummaryResponse'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpNpmClient::RepositoryVersionResponse` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpNpmClient::RepositoryVersionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'pulp_href')
75
+ self.pulp_href = attributes[:'pulp_href']
76
+ end
77
+
78
+ if attributes.key?(:'pulp_created')
79
+ self.pulp_created = attributes[:'pulp_created']
80
+ end
81
+
82
+ if attributes.key?(:'number')
83
+ self.number = attributes[:'number']
84
+ end
85
+
86
+ if attributes.key?(:'base_version')
87
+ self.base_version = attributes[:'base_version']
88
+ end
89
+
90
+ if attributes.key?(:'content_summary')
91
+ self.content_summary = attributes[:'content_summary']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ pulp_href == o.pulp_href &&
114
+ pulp_created == o.pulp_created &&
115
+ number == o.number &&
116
+ base_version == o.base_version &&
117
+ content_summary == o.content_summary
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [pulp_href, pulp_created, number, base_version, content_summary].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ new.build_from_hash(attributes)
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ self.class.openapi_types.each_pair do |key, type|
145
+ if type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :DateTime
166
+ DateTime.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ PulpNpmClient.const_get(type).build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ if value.nil?
219
+ is_nullable = self.class.openapi_nullable.include?(attr)
220
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
221
+ end
222
+
223
+ hash[param] = _to_hash(value)
224
+ end
225
+ hash
226
+ end
227
+
228
+ # Outputs non-array value in the form of hash
229
+ # For object, use to_hash. Otherwise, just return the value
230
+ # @param [Object] value Any valid value
231
+ # @return [Hash] Returns the value in the form of hash
232
+ def _to_hash(value)
233
+ if value.is_a?(Array)
234
+ value.compact.map { |v| _to_hash(v) }
235
+ elsif value.is_a?(Hash)
236
+ {}.tap do |hash|
237
+ value.each { |k, v| hash[k] = _to_hash(v) }
238
+ end
239
+ elsif value.respond_to? :to_hash
240
+ value.to_hash
241
+ else
242
+ value
243
+ end
244
+ end
245
+ end
246
+ end