# -*- coding: utf-8 -*-

"""
pqapiv2

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""

from pqapiv2.decorators import lazy_property
from pqapiv2.configuration import Configuration
from pqapiv2.configuration import Environment
from pqapiv2.controllers.payments_controller import PaymentsController
from pqapiv2.controllers.transfers_controller import TransfersController
from pqapiv2.controllers.spend_back_controller import SpendBackController
from pqapiv2.controllers.prepaid_cards_controller import PrepaidCardsController
from pqapiv2.controllers.paper_checks_controller import PaperChecksController
from pqapiv2.controllers.bank_accounts_controller import BankAccountsController
from pqapiv2.controllers.balances_controller import BalancesController
from pqapiv2.controllers.receipts_controller import ReceiptsController
from pqapiv2.controllers.users_controller import UsersController
from pqapiv2.controllers.documents_controller import DocumentsController
from pqapiv2.controllers.webhooks_controller import WebhooksController
from pqapiv2.controllers.program_controller import ProgramController


class Pqapiv2Client(object):

    auth = OAuth2

    @lazy_property
    def payments(self):
        return PaymentsController(self.config)

    @lazy_property
    def transfers(self):
        return TransfersController(self.config)

    @lazy_property
    def spend_back(self):
        return SpendBackController(self.config)

    @lazy_property
    def prepaid_cards(self):
        return PrepaidCardsController(self.config)

    @lazy_property
    def paper_checks(self):
        return PaperChecksController(self.config)

    @lazy_property
    def bank_accounts(self):
        return BankAccountsController(self.config)

    @lazy_property
    def balances(self):
        return BalancesController(self.config)

    @lazy_property
    def receipts(self):
        return ReceiptsController(self.config)

    @lazy_property
    def users(self):
        return UsersController(self.config)

    @lazy_property
    def documents(self):
        return DocumentsController(self.config)

    @lazy_property
    def webhooks(self):
        return WebhooksController(self.config)

    @lazy_property
    def program(self):
        return ProgramController(self.config)

    def __init__(self, http_client_instance=None,
                 override_http_client_configuration=False, http_call_back=None,
                 timeout=60, max_retries=0, backoff_factor=2,
                 retry_statuses=[408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
                 retry_methods=['GET', 'PUT', 'GET', 'PUT'],
                 environment=Environment.PRODUCTION, config=None):
        if config is None:
            self.config = Configuration(
                                         http_client_instance=http_client_instance,
                                         override_http_client_configuration=override_http_client_configuration,
                                         http_call_back=http_call_back,
                                         timeout=timeout,
                                         max_retries=max_retries,
                                         backoff_factor=backoff_factor,
                                         retry_statuses=retry_statuses,
                                         retry_methods=retry_methods,
                                         environment=environment)
        else:
            self.config = config


