from ..base import AdyenServiceBase


class TransferLimitsBalanceAccountLevelApi(AdyenServiceBase):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, client=None):
        super().__init__(client=client)
        self.service = "balancePlatform"
        self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2"

    def approve_pending_transfer_limits(self, request, id, idempotency_key=None, **kwargs):
        """
        Approve pending transfer limits
        """
        endpoint = self.baseUrl + f"/balanceAccounts/{id}/transferLimits/approve"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def create_transfer_limit(self, request, id, idempotency_key=None, **kwargs):
        """
        Create a transfer limit
        """
        endpoint = self.baseUrl + f"/balanceAccounts/{id}/transferLimits"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def delete_pending_transfer_limit(self, id, transferLimitId, idempotency_key=None, **kwargs):
        """
        Delete a scheduled or pending transfer limit
        """
        endpoint = self.baseUrl + f"/balanceAccounts/{id}/transferLimits/{transferLimitId}"
        method = "DELETE"
        return self.client.call_adyen_api(
            None, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def get_current_transfer_limits(self, id, idempotency_key=None, **kwargs):
        """
        Get all current transfer limits
        """
        endpoint = self.baseUrl + f"/balanceAccounts/{id}/transferLimits/current"
        method = "GET"
        return self.client.call_adyen_api(
            None, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def get_specific_transfer_limit(self, id, transferLimitId, idempotency_key=None, **kwargs):
        """
        Get the details of a transfer limit
        """
        endpoint = self.baseUrl + f"/balanceAccounts/{id}/transferLimits/{transferLimitId}"
        method = "GET"
        return self.client.call_adyen_api(
            None, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def get_transfer_limits(self, id, idempotency_key=None, **kwargs):
        """
        Filter and view the transfer limits
        """
        endpoint = self.baseUrl + f"/balanceAccounts/{id}/transferLimits"
        method = "GET"
        return self.client.call_adyen_api(
            None, self.service, method, endpoint, idempotency_key, **kwargs
        )
