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 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 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, …)
30 31 32 33 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 30 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, …)
43 44 45 46 47 48 49 50 51 52 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 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 43 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data', 'application/x-www-form-urlencoded']) # 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? # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PackageUploadTaskResponse' # auth_names auth_names = opts[:auth_names] || ['basicAuth'] = opts.merge( :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 page for a package.
123 124 125 126 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 123 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 page for a package.
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 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 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 136 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 # 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[:'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] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['basicAuth'] = opts.merge( :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.
194 195 196 197 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 194 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.
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/pulp_python_client/api/pypi_simple_api.rb', line 206 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 # 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[:'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] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['basicAuth'] = opts.merge( :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 |