"""visaacceptancemergedspec.

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 visaacceptancemergedspec.apis.base_api import (
    BaseApi,
)
from visaacceptancemergedspec.apis.billing_agreements_api import (
    BillingAgreementsApi,
)
from visaacceptancemergedspec.apis.capture_api import (
    CaptureApi,
)
from visaacceptancemergedspec.apis.credit_api import (
    CreditApi,
)
from visaacceptancemergedspec.apis.customer_api import (
    CustomerApi,
)
from visaacceptancemergedspec.apis.customer_payment_instrument_api import (
    CustomerPaymentInstrumentApi,
)
from visaacceptancemergedspec.apis.customer_shipping_address_api import (
    CustomerShippingAddressApi,
)
from visaacceptancemergedspec.apis.instrument_identifier_api import (
    InstrumentIdentifierApi,
)
from visaacceptancemergedspec.apis.orders_api import (
    OrdersApi,
)
from visaacceptancemergedspec.apis.payment_instrument_api import (
    PaymentInstrumentApi,
)
from visaacceptancemergedspec.apis.payment_tokens_api import (
    PaymentTokensApi,
)
from visaacceptancemergedspec.apis.payments_api import (
    PaymentsApi,
)
from visaacceptancemergedspec.apis.refund_api import (
    RefundApi,
)
from visaacceptancemergedspec.apis.reversal_api import (
    ReversalApi,
)
from visaacceptancemergedspec.apis.token_api import (
    TokenApi,
)
from visaacceptancemergedspec.apis.tokenized_card_api import (
    TokenizedCardApi,
)
from visaacceptancemergedspec.apis.transaction_batches_api import (
    TransactionBatchesApi,
)
from visaacceptancemergedspec.apis.transaction_details_api import (
    TransactionDetailsApi,
)
from visaacceptancemergedspec.apis.transient_token_data_api import (
    TransientTokenDataApi,
)
from visaacceptancemergedspec.apis.unified_checkout_capture_context_api import (
    UnifiedCheckoutCaptureContextApi,
)
from visaacceptancemergedspec.apis.void_api import (
    VoidApi,
)
from visaacceptancemergedspec.configuration import (
    Configuration,
    Environment,
)
from visaacceptancemergedspec.http.auth.accept import (
    Accept,
)
from visaacceptancemergedspec.http.auth.bearer_auth import (
    BearerAuth,
)


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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=None, retry_methods=None, proxy_settings=None,
                 logging_configuration=None, environment=Environment.PRODUCTION,
                 bearer_auth_credentials=None, accept_credentials=None,
                 config=None):
        """Initialize a new instance of VisaacceptancemergedspecClient."""
        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,
            accept_credentials=accept_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": BearerAuth(self.config.bearer_auth_credentials),
            "Accept": Accept(self.config.accept_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:
            VisaacceptancemergedspecClient instance.

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