from ..base import AdyenServiceBase


class SCADeviceManagementApi(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 begin_sca_device_registration(self, request, idempotency_key=None, **kwargs):
        """
        Begin SCA device registration
        """
        endpoint = self.baseUrl + "/scaDevices"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def finish_sca_device_registration(self, request, deviceId, idempotency_key=None, **kwargs):
        """
        Finish registration process for a SCA device
        """
        endpoint = self.baseUrl + f"/scaDevices/{deviceId}"
        method = "PATCH"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def submit_sca_association(self, request, deviceId, idempotency_key=None, **kwargs):
        """
        Create a new SCA association for a device
        """
        endpoint = self.baseUrl + f"/scaDevices/{deviceId}/scaAssociations"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )
