Class: PulpPythonClient::PypiSimpleApi
- Inherits:
-
Object
- Object
- PulpPythonClient::PypiSimpleApi
- Defined in:
- lib/pulp_python_client/api/pypi_simple_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create(path, content, sha256_digest, opts = {}) ⇒ PackageUploadTaskResponse
Upload a package Upload package to the index.
-
#create_with_http_info(path, content, sha256_digest, opts = {}) ⇒ Array<(PackageUploadTaskResponse, Integer, Hash)>
Upload a package Upload package to the index.
-
#initialize(api_client = ApiClient.default) ⇒ PypiSimpleApi
constructor
A new instance of PypiSimpleApi.
-
#pypi_simple_package_read(package, path, opts = {}) ⇒ nil
Get package simple page Retrieves the simple api html/json page for a package.
-
#pypi_simple_package_read_with_http_info(package, path, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Get package simple page Retrieves the simple api html/json page for a package.
-
#read(path, opts = {}) ⇒ nil
Get index simple page Gets the simple api html page for the index.
-
#read_with_http_info(path, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Get index simple page Gets the simple api html page for the index.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ PypiSimpleApi
Returns a new instance of PypiSimpleApi.
19 20 21 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create(path, content, sha256_digest, opts = {}) ⇒ PackageUploadTaskResponse
Upload a package Upload package to the index. This endpoint has the same functionality as the upload endpoint at the ‘/legacy` url of the index. This is provided for convenience for users who want a single index url for all their Python tools. (pip, twine, poetry, pipenv, …)
35 36 37 38 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 35 def create(path, content, sha256_digest, opts = {}) data, _status_code, _headers = create_with_http_info(path, content, sha256_digest, opts) data end |
#create_with_http_info(path, content, sha256_digest, opts = {}) ⇒ Array<(PackageUploadTaskResponse, Integer, Hash)>
Upload a package Upload package to the index. This endpoint has the same functionality as the upload endpoint at the `/legacy` url of the index. This is provided for convenience for users who want a single index url for all their Python tools. (pip, twine, poetry, pipenv, …)
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 53 def create_with_http_info(path, content, sha256_digest, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PypiSimpleApi.create ...' end # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? fail ArgumentError, "Missing the required parameter 'path' when calling PypiSimpleApi.create" end # verify the required parameter 'content' is set if @api_client.config.client_side_validation && content.nil? fail ArgumentError, "Missing the required parameter 'content' when calling PypiSimpleApi.create" end # verify the required parameter 'sha256_digest' is set if @api_client.config.client_side_validation && sha256_digest.nil? fail ArgumentError, "Missing the required parameter 'sha256_digest' when calling PypiSimpleApi.create" end if @api_client.config.client_side_validation && sha256_digest.to_s.length > 64 fail ArgumentError, 'invalid value for "sha256_digest" when calling PypiSimpleApi.create, the character length must be smaller than or equal to 64.' end if @api_client.config.client_side_validation && sha256_digest.to_s.length < 64 fail ArgumentError, 'invalid value for "sha256_digest" when calling PypiSimpleApi.create, the character length must be great than or equal to 64.' end if @api_client.config.client_side_validation && !opts[:'action'].nil? && opts[:'action'].to_s.length < 1 fail ArgumentError, 'invalid value for "opts[:"action"]" when calling PypiSimpleApi.create, the character length must be great than or equal to 1.' end # resource path local_var_path = '/pypi/{path}/simple/'.sub('{' + 'path' + '}', CGI.escape(path.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data', 'application/x-www-form-urlencoded']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil? # form parameters form_params = opts[:form_params] || {} form_params['content'] = content form_params['sha256_digest'] = sha256_digest form_params['action'] = opts[:'action'] if !opts[:'action'].nil? form_params['protocol_version'] = opts[:'protocol_version'] if !opts[:'protocol_version'].nil? form_params['filetype'] = opts[:'filetype'] if !opts[:'filetype'].nil? form_params['metadata_version'] = opts[:'metadata_version'] if !opts[:'metadata_version'].nil? form_params['attestations'] = opts[:'attestations'] if !opts[:'attestations'].nil? # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'PackageUploadTaskResponse' # auth_names auth_names = opts[:debug_auth_names] || ['basicAuth'] = opts.merge( :operation => :"PypiSimpleApi.create", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PypiSimpleApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#pypi_simple_package_read(package, path, opts = {}) ⇒ nil
Get package simple page Retrieves the simple api html/json page for a package.
144 145 146 147 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 144 def pypi_simple_package_read(package, path, opts = {}) pypi_simple_package_read_with_http_info(package, path, opts) nil end |
#pypi_simple_package_read_with_http_info(package, path, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Get package simple page Retrieves the simple api html/json page for a package.
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 159 def pypi_simple_package_read_with_http_info(package, path, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PypiSimpleApi.pypi_simple_package_read ...' end # verify the required parameter 'package' is set if @api_client.config.client_side_validation && package.nil? fail ArgumentError, "Missing the required parameter 'package' when calling PypiSimpleApi.pypi_simple_package_read" end # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? fail ArgumentError, "Missing the required parameter 'path' when calling PypiSimpleApi.pypi_simple_package_read" end allowable_values = ["html", "json"] if @api_client.config.client_side_validation && opts[:'format'] && !allowable_values.include?(opts[:'format']) fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}" end # resource path local_var_path = '/pypi/{path}/simple/{package}/'.sub('{' + 'package' + '}', CGI.escape(package.to_s).gsub('%2F', '/')).sub('{' + 'path' + '}', CGI.escape(path.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :multi) if !opts[:'exclude_fields'].nil? # header parameters header_params = opts[:header_params] || {} header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['basicAuth'] = opts.merge( :operation => :"PypiSimpleApi.pypi_simple_package_read", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PypiSimpleApi#pypi_simple_package_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#read(path, opts = {}) ⇒ nil
Get index simple page Gets the simple api html page for the index.
226 227 228 229 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 226 def read(path, opts = {}) read_with_http_info(path, opts) nil end |
#read_with_http_info(path, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Get index simple page Gets the simple api html page for the index.
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 240 def read_with_http_info(path, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PypiSimpleApi.read ...' end # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? fail ArgumentError, "Missing the required parameter 'path' when calling PypiSimpleApi.read" end allowable_values = ["html", "json"] if @api_client.config.client_side_validation && opts[:'format'] && !allowable_values.include?(opts[:'format']) fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}" end # resource path local_var_path = '/pypi/{path}/simple/'.sub('{' + 'path' + '}', CGI.escape(path.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :multi) if !opts[:'exclude_fields'].nil? # header parameters header_params = opts[:header_params] || {} header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['basicAuth'] = opts.merge( :operation => :"PypiSimpleApi.read", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PypiSimpleApi#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |