"""staxfattmerchantapi.

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

# ruff: noqa: E501
from apimatic_core.configurations.global_configuration import (
    GlobalConfiguration,
)
from apimatic_core.decorators.lazy_property import (
    LazyProperty,
)

from staxfattmerchantapi.apis.base_api import (
    BaseApi,
)
from staxfattmerchantapi.apis.cache_api import (
    CacheApi,
)
from staxfattmerchantapi.apis.charge_api import (
    ChargeApi,
)
from staxfattmerchantapi.apis.credit_api import (
    CreditApi,
)
from staxfattmerchantapi.apis.customer_api import (
    CustomerApi,
)
from staxfattmerchantapi.apis.dispute_file_api import (
    DisputeFileApi,
)
from staxfattmerchantapi.apis.file_api import (
    FileApi,
)
from staxfattmerchantapi.apis.hello_sign_api import (
    HelloSignApi,
)
from staxfattmerchantapi.apis.integration_api import (
    IntegrationApi,
)
from staxfattmerchantapi.apis.invoice_api import (
    InvoiceApi,
)
from staxfattmerchantapi.apis.invoice_schedule_api import (
    InvoiceScheduleApi,
)
from staxfattmerchantapi.apis.item_api import (
    ItemApi,
)
from staxfattmerchantapi.apis.merchant_admin_api import (
    MerchantAdminApi,
)
from staxfattmerchantapi.apis.payment_method_api import (
    PaymentMethodApi,
)
from staxfattmerchantapi.apis.reporting_api import (
    ReportingApi,
)
from staxfattmerchantapi.apis.sandbox_api import (
    SandboxApi,
)
from staxfattmerchantapi.apis.self_api import (
    SelfApi,
)
from staxfattmerchantapi.apis.team_api import (
    TeamApi,
)
from staxfattmerchantapi.apis.team_api_keys_api import (
    TeamApiKeysApi,
)
from staxfattmerchantapi.apis.team_funding_accounts_api import (
    TeamFundingAccountsApi,
)
from staxfattmerchantapi.apis.team_options_api import (
    TeamOptionsApi,
)
from staxfattmerchantapi.apis.team_registration_api import (
    TeamRegistrationApi,
)
from staxfattmerchantapi.apis.team_users_api import (
    TeamUsersApi,
)
from staxfattmerchantapi.apis.terminal_api import (
    TerminalApi,
)
from staxfattmerchantapi.apis.transaction_api import (
    TransactionApi,
)
from staxfattmerchantapi.apis.user_admin_api import (
    UserAdminApi,
)
from staxfattmerchantapi.apis.verify_api import (
    VerifyApi,
)
from staxfattmerchantapi.apis.web_payment_api import (
    WebPaymentApi,
)
from staxfattmerchantapi.apis.webhook_api import (
    WebhookApi,
)
from staxfattmerchantapi.configuration import (
    Configuration,
    Environment,
)
from staxfattmerchantapi.http.auth.oauth_2 import (
    Oauth2,
)


class StaxfattmerchantapiClient(object):
    """Client that provide access to the StaxfattmerchantapiClient APIs."""

    @LazyProperty
    def mself(self):
        """Provide access to the SelfApi endpoints."""
        return SelfApi(self.global_configuration)

    @LazyProperty
    def team(self):
        """Provide access to the TeamApi endpoints."""
        return TeamApi(self.global_configuration)

    @LazyProperty
    def team_users(self):
        """Provide access to the TeamUsersApi endpoints."""
        return TeamUsersApi(self.global_configuration)

    @LazyProperty
    def team_api_keys(self):
        """Provide access to the TeamApiKeysApi endpoints."""
        return TeamApiKeysApi(self.global_configuration)

    @LazyProperty
    def team_options(self):
        """Provide access to the TeamOptionsApi endpoints."""
        return TeamOptionsApi(self.global_configuration)

    @LazyProperty
    def team_registration(self):
        """Provide access to the TeamRegistrationApi endpoints."""
        return TeamRegistrationApi(self.global_configuration)

    @LazyProperty
    def team_funding_accounts(self):
        """Provide access to the TeamFundingAccountsApi endpoints."""
        return TeamFundingAccountsApi(self.global_configuration)

    @LazyProperty
    def webhook(self):
        """Provide access to the WebhookApi endpoints."""
        return WebhookApi(self.global_configuration)

    @LazyProperty
    def transaction(self):
        """Provide access to the TransactionApi endpoints."""
        return TransactionApi(self.global_configuration)

    @LazyProperty
    def invoice(self):
        """Provide access to the InvoiceApi endpoints."""
        return InvoiceApi(self.global_configuration)

    @LazyProperty
    def invoice_schedule(self):
        """Provide access to the InvoiceScheduleApi endpoints."""
        return InvoiceScheduleApi(self.global_configuration)

    @LazyProperty
    def customer(self):
        """Provide access to the CustomerApi endpoints."""
        return CustomerApi(self.global_configuration)

    @LazyProperty
    def item(self):
        """Provide access to the ItemApi endpoints."""
        return ItemApi(self.global_configuration)

    @LazyProperty
    def file(self):
        """Provide access to the FileApi endpoints."""
        return FileApi(self.global_configuration)

    @LazyProperty
    def dispute_file(self):
        """Provide access to the DisputeFileApi endpoints."""
        return DisputeFileApi(self.global_configuration)

    @LazyProperty
    def payment_method(self):
        """Provide access to the PaymentMethodApi endpoints."""
        return PaymentMethodApi(self.global_configuration)

    @LazyProperty
    def integration(self):
        """Provide access to the IntegrationApi endpoints."""
        return IntegrationApi(self.global_configuration)

    @LazyProperty
    def hello_sign(self):
        """Provide access to the HelloSignApi endpoints."""
        return HelloSignApi(self.global_configuration)

    @LazyProperty
    def reporting(self):
        """Provide access to the ReportingApi endpoints."""
        return ReportingApi(self.global_configuration)

    @LazyProperty
    def charge(self):
        """Provide access to the ChargeApi endpoints."""
        return ChargeApi(self.global_configuration)

    @LazyProperty
    def credit(self):
        """Provide access to the CreditApi endpoints."""
        return CreditApi(self.global_configuration)

    @LazyProperty
    def verify(self):
        """Provide access to the VerifyApi endpoints."""
        return VerifyApi(self.global_configuration)

    @LazyProperty
    def terminal(self):
        """Provide access to the TerminalApi endpoints."""
        return TerminalApi(self.global_configuration)

    @LazyProperty
    def merchant_admin(self):
        """Provide access to the MerchantAdminApi endpoints."""
        return MerchantAdminApi(self.global_configuration)

    @LazyProperty
    def user_admin(self):
        """Provide access to the UserAdminApi endpoints."""
        return UserAdminApi(self.global_configuration)

    @LazyProperty
    def sandbox(self):
        """Provide access to the SandboxApi endpoints."""
        return SandboxApi(self.global_configuration)

    @LazyProperty
    def cache(self):
        """Provide access to the CacheApi endpoints."""
        return CacheApi(self.global_configuration)

    @LazyProperty
    def web_payment(self):
        """Provide access to the WebPaymentApi endpoints."""
        return WebPaymentApi(self.global_configuration)

    def __init__(self, http_client_instance=None,
                 override_http_client_configuration=False, http_call_back=None,
                 timeout=30, max_retries=0, backoff_factor=2,
                 retry_statuses=None, retry_methods=None, proxy_settings=None,
                 logging_configuration=None, environment=Environment.PRODUCTION,
                 bearer_auth_credentials=None, config=None):
        """Initialize a new instance of StaxfattmerchantapiClient."""
        self.config = config or 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,
            proxy_settings=proxy_settings,
            logging_configuration=logging_configuration,
            environment=environment,
            bearer_auth_credentials=bearer_auth_credentials)

        self.global_configuration = GlobalConfiguration(self.config)\
            .global_errors(BaseApi.global_errors())\
            .base_uri_executor(self.config.get_base_uri)\
            .user_agent(BaseApi.user_agent(),
                BaseApi.user_agent_parameters())

        self.auth_managers = {
            "bearerAuth": Oauth2(self.config.bearer_auth_credentials),
        }
        self.global_configuration =\
            self.global_configuration.auth_managers(self.auth_managers)

    @classmethod
    def from_environment(cls, dotenv_path=None, **overrides):
        """Create a client instance using environment variables.

        Returns:
            StaxfattmerchantapiClient instance.

        """
        return cls(config=Configuration
            .from_environment(dotenv_path=dotenv_path, **overrides))
