# Path: pagarme/resources/requests_retry.py
# def requests_retry_session(
#     retries=3,
#     backoff_factor=0.3,
#     status_forcelist=(500, 502, 504),
#     session=None,
# ):
#     session = session or requests.Session()
#     session.headers.update(headers())
# 
#     retry = Retry(
#         total=retries,
#         read=retries,
#         connect=retries,
#         backoff_factor=backoff_factor,
#         status_forcelist=status_forcelist,
#     )
#     adapter = HTTPAdapter(max_retries=retry)
#     session.mount('https://', adapter)
#     return session


from .requests_retry import requests_retry_session

TEMPORARY_COMPANY = 'https://api.pagar.me/1/companies/temporary'

KEYS = {}

def validate_response(pagarme_response):
    if pagarme_response.ok:
        return pagarme_response.json()
    else:
        return error(pagarme_response.json())


def create_temporary_company():

# Path: pagarme/resources/requests_retry.py
# def requests_retry_session(
#     retries=3,
#     backoff_factor=0.3,
#     status_forcelist=(500, 502, 504),
#     session=None,
# ):
#     session = session or requests.Session()
#     session.headers.update(headers())
# 
#     retry = Retry(
#         total=retries,
#         read=retries,
#         connect=retries,
#         backoff_factor=backoff_factor,
#         status_forcelist=status_forcelist,
#     )
#     adapter = HTTPAdapter(max_retries=retry)
#     session.mount('https://', adapter)
#     return session


# Path: pagarme/resources/handler_request.py
from .requests_retry import requests_retry_session


TEMPORARY_COMPANY = 'https://api.pagar.me/1/companies/temporary'

KEYS = {}

def validate_response(pagarme_response):
    if pagarme_response.ok:
        return pagarme_response.json()
    else:
        return error(pagarme_response.json())


def create_temporary_company():

    company = requests_retry_session().post(TEMPORARY_COMPANY)