pulp_python_client 3.32.1 → 3.34.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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -4
  3. data/docs/ContentPackagesApi.md +2 -0
  4. data/docs/ContentYanksApi.md +341 -0
  5. data/docs/PaginatedpythonPackageYankResponseList.md +24 -0
  6. data/docs/PatchedpythonPythonRepository.md +3 -1
  7. data/docs/PypiLegacyApi.md +2 -2
  8. data/docs/PypiSimpleApi.md +2 -2
  9. data/docs/PypiUnyankApi.md +84 -0
  10. data/docs/PypiYankApi.md +84 -0
  11. data/docs/PythonPackageYankResponse.md +34 -0
  12. data/docs/PythonPythonRepository.md +3 -1
  13. data/docs/PythonPythonRepositoryResponse.md +2 -0
  14. data/docs/Yank.md +22 -0
  15. data/lib/pulp_python_client/api/content_packages_api.rb +3 -0
  16. data/lib/pulp_python_client/api/content_yanks_api.rb +354 -0
  17. data/lib/pulp_python_client/api/pypi_legacy_api.rb +2 -2
  18. data/lib/pulp_python_client/api/pypi_simple_api.rb +2 -2
  19. data/lib/pulp_python_client/api/pypi_unyank_api.rb +99 -0
  20. data/lib/pulp_python_client/api/pypi_yank_api.rb +99 -0
  21. data/lib/pulp_python_client/models/metadata_version_enum.rb +2 -1
  22. data/lib/pulp_python_client/models/paginatedpython_package_yank_response_list.rb +257 -0
  23. data/lib/pulp_python_client/models/patchedpython_python_repository.rb +16 -4
  24. data/lib/pulp_python_client/models/python_package_yank_response.rb +293 -0
  25. data/lib/pulp_python_client/models/python_python_repository.rb +16 -4
  26. data/lib/pulp_python_client/models/python_python_repository_response.rb +13 -1
  27. data/lib/pulp_python_client/models/yank.rb +290 -0
  28. data/lib/pulp_python_client/version.rb +1 -1
  29. data/lib/pulp_python_client.rb +6 -0
  30. data/spec/api/content_packages_api_spec.rb +1 -0
  31. data/spec/api/content_yanks_api_spec.rb +104 -0
  32. data/spec/api/pypi_legacy_api_spec.rb +1 -1
  33. data/spec/api/pypi_simple_api_spec.rb +1 -1
  34. data/spec/api/pypi_unyank_api_spec.rb +49 -0
  35. data/spec/api/pypi_yank_api_spec.rb +49 -0
  36. data/spec/models/paginatedpython_package_yank_response_list_spec.rb +54 -0
  37. data/spec/models/patchedpython_python_repository_spec.rb +6 -0
  38. data/spec/models/python_package_yank_response_spec.rb +84 -0
  39. data/spec/models/python_python_repository_response_spec.rb +6 -0
  40. data/spec/models/python_python_repository_spec.rb +6 -0
  41. data/spec/models/yank_spec.rb +48 -0
  42. metadata +71 -47
@@ -0,0 +1,99 @@
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 'cgi'
14
+
15
+ module PulpPythonClient
16
+ class PypiUnyankApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Unyank a package version
23
+ # Unyank a package version, unmarking all its files with data-yanked.
24
+ # @param path [String]
25
+ # @param yank [Yank]
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
28
+ # @return [AsyncOperationResponse]
29
+ def unyank(path, yank, opts = {})
30
+ data, _status_code, _headers = unyank_with_http_info(path, yank, opts)
31
+ data
32
+ end
33
+
34
+ # Unyank a package version
35
+ # Unyank a package version, unmarking all its files with data-yanked.
36
+ # @param path [String]
37
+ # @param yank [Yank]
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
40
+ # @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers
41
+ def unyank_with_http_info(path, yank, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: PypiUnyankApi.unyank ...'
44
+ end
45
+ # verify the required parameter 'path' is set
46
+ if @api_client.config.client_side_validation && path.nil?
47
+ fail ArgumentError, "Missing the required parameter 'path' when calling PypiUnyankApi.unyank"
48
+ end
49
+ # verify the required parameter 'yank' is set
50
+ if @api_client.config.client_side_validation && yank.nil?
51
+ fail ArgumentError, "Missing the required parameter 'yank' when calling PypiUnyankApi.unyank"
52
+ end
53
+ # resource path
54
+ local_var_path = '/pypi/{path}/unyank/'.sub('{' + 'path' + '}', CGI.escape(path.to_s).gsub('%2F', '/'))
55
+
56
+ # query parameters
57
+ query_params = opts[:query_params] || {}
58
+
59
+ # header parameters
60
+ header_params = opts[:header_params] || {}
61
+ # HTTP header 'Accept' (if needed)
62
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
63
+ # HTTP header 'Content-Type'
64
+ content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
65
+ if !content_type.nil?
66
+ header_params['Content-Type'] = content_type
67
+ end
68
+ header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?
69
+
70
+ # form parameters
71
+ form_params = opts[:form_params] || {}
72
+
73
+ # http body (model)
74
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(yank)
75
+
76
+ # return_type
77
+ return_type = opts[:debug_return_type] || 'AsyncOperationResponse'
78
+
79
+ # auth_names
80
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
81
+
82
+ new_options = opts.merge(
83
+ :operation => :"PypiUnyankApi.unyank",
84
+ :header_params => header_params,
85
+ :query_params => query_params,
86
+ :form_params => form_params,
87
+ :body => post_body,
88
+ :auth_names => auth_names,
89
+ :return_type => return_type
90
+ )
91
+
92
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
93
+ if @api_client.config.debugging
94
+ @api_client.config.logger.debug "API called: PypiUnyankApi#unyank\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
95
+ end
96
+ return data, status_code, headers
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,99 @@
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 'cgi'
14
+
15
+ module PulpPythonClient
16
+ class PypiYankApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Yank a package version
23
+ # Yank a package version, marking all its files with data-yanked.
24
+ # @param path [String]
25
+ # @param yank [Yank]
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
28
+ # @return [AsyncOperationResponse]
29
+ def yank(path, yank, opts = {})
30
+ data, _status_code, _headers = yank_with_http_info(path, yank, opts)
31
+ data
32
+ end
33
+
34
+ # Yank a package version
35
+ # Yank a package version, marking all its files with data-yanked.
36
+ # @param path [String]
37
+ # @param yank [Yank]
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
40
+ # @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers
41
+ def yank_with_http_info(path, yank, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: PypiYankApi.yank ...'
44
+ end
45
+ # verify the required parameter 'path' is set
46
+ if @api_client.config.client_side_validation && path.nil?
47
+ fail ArgumentError, "Missing the required parameter 'path' when calling PypiYankApi.yank"
48
+ end
49
+ # verify the required parameter 'yank' is set
50
+ if @api_client.config.client_side_validation && yank.nil?
51
+ fail ArgumentError, "Missing the required parameter 'yank' when calling PypiYankApi.yank"
52
+ end
53
+ # resource path
54
+ local_var_path = '/pypi/{path}/yank/'.sub('{' + 'path' + '}', CGI.escape(path.to_s).gsub('%2F', '/'))
55
+
56
+ # query parameters
57
+ query_params = opts[:query_params] || {}
58
+
59
+ # header parameters
60
+ header_params = opts[:header_params] || {}
61
+ # HTTP header 'Accept' (if needed)
62
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
63
+ # HTTP header 'Content-Type'
64
+ content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
65
+ if !content_type.nil?
66
+ header_params['Content-Type'] = content_type
67
+ end
68
+ header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?
69
+
70
+ # form parameters
71
+ form_params = opts[:form_params] || {}
72
+
73
+ # http body (model)
74
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(yank)
75
+
76
+ # return_type
77
+ return_type = opts[:debug_return_type] || 'AsyncOperationResponse'
78
+
79
+ # auth_names
80
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
81
+
82
+ new_options = opts.merge(
83
+ :operation => :"PypiYankApi.yank",
84
+ :header_params => header_params,
85
+ :query_params => query_params,
86
+ :form_params => form_params,
87
+ :body => post_body,
88
+ :auth_names => auth_names,
89
+ :return_type => return_type
90
+ )
91
+
92
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
93
+ if @api_client.config.debugging
94
+ @api_client.config.logger.debug "API called: PypiYankApi#yank\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
95
+ end
96
+ return data, status_code, headers
97
+ end
98
+ end
99
+ end
@@ -23,9 +23,10 @@ module PulpPythonClient
23
23
  N2_2 = "2.2".freeze
24
24
  N2_3 = "2.3".freeze
25
25
  N2_4 = "2.4".freeze
26
+ N2_5 = "2.5".freeze
26
27
 
27
28
  def self.all_vars
28
- @all_vars ||= [N1_0, N1_1, N1_2, N2_0, N2_1, N2_2, N2_3, N2_4].freeze
29
+ @all_vars ||= [N1_0, N1_1, N1_2, N2_0, N2_1, N2_2, N2_3, N2_4, N2_5].freeze
29
30
  end
30
31
 
31
32
  # Builds the enum from string
@@ -0,0 +1,257 @@
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 PulpPythonClient
17
+ class PaginatedpythonPackageYankResponseList
18
+ attr_accessor :count
19
+
20
+ attr_accessor :_next
21
+
22
+ attr_accessor :previous
23
+
24
+ attr_accessor :results
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'count' => :'count',
30
+ :'_next' => :'next',
31
+ :'previous' => :'previous',
32
+ :'results' => :'results'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'count' => :'Integer',
45
+ :'_next' => :'String',
46
+ :'previous' => :'String',
47
+ :'results' => :'Array<PythonPackageYankResponse>'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpPythonClient::PaginatedpythonPackageYankResponseList` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpPythonClient::PaginatedpythonPackageYankResponseList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'count')
73
+ self.count = attributes[:'count']
74
+ else
75
+ self.count = nil
76
+ end
77
+
78
+ if attributes.key?(:'_next')
79
+ self._next = attributes[:'_next']
80
+ end
81
+
82
+ if attributes.key?(:'previous')
83
+ self.previous = attributes[:'previous']
84
+ end
85
+
86
+ if attributes.key?(:'results')
87
+ if (value = attributes[:'results']).is_a?(Array)
88
+ self.results = value
89
+ end
90
+ else
91
+ self.results = nil
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
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @count.nil?
101
+ invalid_properties.push('invalid value for "count", count cannot be nil.')
102
+ end
103
+
104
+ if @results.nil?
105
+ invalid_properties.push('invalid value for "results", results cannot be nil.')
106
+ end
107
+
108
+ invalid_properties
109
+ end
110
+
111
+ # Check to see if the all the properties in the model are valid
112
+ # @return true if the model is valid
113
+ def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
115
+ return false if @count.nil?
116
+ return false if @results.nil?
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ count == o.count &&
126
+ _next == o._next &&
127
+ previous == o.previous &&
128
+ results == o.results
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [count, _next, previous, results].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
158
+ end
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
162
+ end
163
+ new(transformed_hash)
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def self._deserialize(type, value)
171
+ case type.to_sym
172
+ when :Time
173
+ Time.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :Boolean
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ # models (e.g. Pet) or oneOf
204
+ klass = PulpPythonClient.const_get(type)
205
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+
255
+ end
256
+
257
+ end
@@ -39,6 +39,9 @@ module PulpPythonClient
39
39
  # Whether to allow package substitution (replacing existing packages with packages that have the same filename but a different checksum). When False, any new repository version that would cause such a substitution will be rejected. This applies to all repository version creation paths including uploads, modify, and sync. When True (the default), package substitution is allowed.
40
40
  attr_accessor :allow_package_substitution
41
41
 
42
+ # Whether to fail the entire repository version when packages are rejected by the package substitution or blocklist policies. When True (the default), a ValidationError is raised and no packages from the request are added. When False, rejected packages are skipped and remaining packages are added; skipped packages are recorded in a task progress report.
43
+ attr_accessor :error_on_reject
44
+
42
45
  # Attribute mapping from ruby-style variable name to JSON key.
43
46
  def self.attribute_map
44
47
  {
@@ -49,7 +52,8 @@ module PulpPythonClient
49
52
  :'retain_checkpoints' => :'retain_checkpoints',
50
53
  :'remote' => :'remote',
51
54
  :'autopublish' => :'autopublish',
52
- :'allow_package_substitution' => :'allow_package_substitution'
55
+ :'allow_package_substitution' => :'allow_package_substitution',
56
+ :'error_on_reject' => :'error_on_reject'
53
57
  }
54
58
  end
55
59
 
@@ -68,7 +72,8 @@ module PulpPythonClient
68
72
  :'retain_checkpoints' => :'Integer',
69
73
  :'remote' => :'String',
70
74
  :'autopublish' => :'Boolean',
71
- :'allow_package_substitution' => :'Boolean'
75
+ :'allow_package_substitution' => :'Boolean',
76
+ :'error_on_reject' => :'Boolean'
72
77
  }
73
78
  end
74
79
 
@@ -134,6 +139,12 @@ module PulpPythonClient
134
139
  else
135
140
  self.allow_package_substitution = true
136
141
  end
142
+
143
+ if attributes.key?(:'error_on_reject')
144
+ self.error_on_reject = attributes[:'error_on_reject']
145
+ else
146
+ self.error_on_reject = true
147
+ end
137
148
  end
138
149
 
139
150
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -227,7 +238,8 @@ module PulpPythonClient
227
238
  retain_checkpoints == o.retain_checkpoints &&
228
239
  remote == o.remote &&
229
240
  autopublish == o.autopublish &&
230
- allow_package_substitution == o.allow_package_substitution
241
+ allow_package_substitution == o.allow_package_substitution &&
242
+ error_on_reject == o.error_on_reject
231
243
  end
232
244
 
233
245
  # @see the `==` method
@@ -239,7 +251,7 @@ module PulpPythonClient
239
251
  # Calculates hash code according to all attributes.
240
252
  # @return [Integer] Hash code
241
253
  def hash
242
- [pulp_labels, name, description, retain_repo_versions, retain_checkpoints, remote, autopublish, allow_package_substitution].hash
254
+ [pulp_labels, name, description, retain_repo_versions, retain_checkpoints, remote, autopublish, allow_package_substitution, error_on_reject].hash
243
255
  end
244
256
 
245
257
  # Builds the object from hash