# coding: utf-8 """ Paystack The OpenAPI specification of the Paystack API that merchants and developers can harness to build financial solutions in Africa. # noqa: E501 The version of the OpenAPI document: 1.0.0 Contact: techsupport@paystack.com """ from __future__ import absolute_import import atexit import datetime from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool import os import re import tempfile # python 2 and python 3 compatibility library import six from six.moves.urllib.parse import quote from paystack.configuration import Configuration import paystack.models from paystack import rest from paystack.exceptions import ApiValueError, ApiException class ApiClient(object): """Generic API client for Paystack client library. NOTE: This class is auto generated. Do not edit the class manually. :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to the API. :param cookie: a cookie to include in the header when making calls to the API :param pool_threads: The number of threads to use for async requests to the API. More threads means more concurrent API requests. """ PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types NATIVE_TYPES_MAPPING = { 'int': int, 'long': int if six.PY3 else long, # noqa: F821 'float': float, 'str': str, 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, 'object': object, } _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): if configuration is None: configuration = Configuration.get_default_copy() self.configuration = configuration self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. self.user_agent = 'paystack-python/1.0.1' self.client_side_validation = configuration.client_side_validation def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): self.close() def close(self): pass @property def pool(self): """Create thread pool on first request avoids instantiating unused threadpool for blocking clients. """ pass @property def user_agent(self): """User agent for this API client""" pass @user_agent.setter def user_agent(self, value): pass def set_default_header(self, header_name, header_value): pass def __call_api( self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None, post_params=None, response_types_map=None, _return_http_data_only=None, collection_formats=None,_preload_content=True, _request_timeout=None): pass def sanitize_for_serialization(self, obj): """Builds a JSON POST object. If obj is None, return None. If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. :param obj: The data to serialize. :return: The serialized form of data. """ pass def deserialize(self, response, response_type): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. :return: deserialized object. """ pass def __deserialize(self, data, klass): """Deserializes dict, list, str into an object. :param data: dict, list or str. :param klass: class literal, or string of class name. :return: object. """ pass def call_api(self, resource_path, method, path_params=None, query_params=None, body=None, post_params=None, response_types_map=None): pass def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, _request_timeout=None): """Makes the HTTP request using RESTClient.""" pass def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. :param params: Parameters as dict or list of two-tuples :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ pass def files_parameters(self, files=None): """Builds form parameters. :param files: File parameters. :return: Form parameters with files. """ pass def select_header_accept(self, accepts): """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ pass def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. :return: Content-Type (e.g. application/json). """ pass def update_params_for_auth(self, headers): pass def _apply_auth_params(self, headers, auth_setting): pass def __deserialize_file(self, response): """Deserializes body to file Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. :param response: RESTResponse. :return: file path. """ pass def __deserialize_primitive(self, data, klass): """Deserializes string to primitive type. :param data: str. :param klass: class literal. :return: int, long, float, str, bool. """ pass def __deserialize_object(self, value): """Return an original value. :return: object. """ pass def __deserialize_date(self, string): """Deserializes string to date. :param string: str. :return: date. """ pass def __deserialize_datetime(self, string): """Deserializes string to datetime. The string should be in iso8601 datetime format. :param string: str. :return: datetime. """ pass def __deserialize_model(self, data, klass): """Deserializes list or dict to model. :param data: dict, list. :param klass: class literal. :return: model object. """ pass