from ..base import AdyenServiceBase


class RecurringApi(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 = "recurring"
        self.baseUrl = (
            "https://paltokenization-test.adyen.com/paltokenization/servlet/Recurring/v68"
        )

    def create_permit(self, request, idempotency_key=None, **kwargs):
        """
        Create new permits linked to a recurring contract.

        Deprecated since Adyen Recurring API v68
        """
        endpoint = self.baseUrl + "/createPermit"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def disable(self, request, idempotency_key=None, **kwargs):
        """
        Disable stored payment details
        """
        endpoint = self.baseUrl + "/disable"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def disable_permit(self, request, idempotency_key=None, **kwargs):
        """
        Disable an existing permit.

        Deprecated since Adyen Recurring API v68
        """
        endpoint = self.baseUrl + "/disablePermit"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def list_recurring_details(self, request, idempotency_key=None, **kwargs):
        """
        Get stored payment details
        """
        endpoint = self.baseUrl + "/listRecurringDetails"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def notify_shopper(self, request, idempotency_key=None, **kwargs):
        """
        Ask issuer to notify the shopper
        """
        endpoint = self.baseUrl + "/notifyShopper"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def schedule_account_updater(self, request, idempotency_key=None, **kwargs):
        """
        Schedule running the Account Updater
        """
        endpoint = self.baseUrl + "/scheduleAccountUpdater"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )
