from ..base import AdyenServiceBase


class ManageSCADevicesApi(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(ManageSCADevicesApi, self).__init__(client=client)
        self.service = "balancePlatform"
        self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2"

    def complete_association_between_sca_device_and_resource(self, request, deviceId, idempotency_key=None, **kwargs):
        """
        Complete an association between an SCA device and a resource
        """
        endpoint = self.baseUrl + f"/registeredDevices/{deviceId}/associations"
        method = "PATCH"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

    def complete_registration_of_sca_device(self, request, id, idempotency_key=None, **kwargs):
        """
        Complete the registration of an SCA device
        """
        endpoint = self.baseUrl + f"/registeredDevices/{id}"
        method = "PATCH"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

    def delete_registration_of_sca_device(self, id, idempotency_key=None, **kwargs):
        """
        Delete a registration of an SCA device
        """
        endpoint = self.baseUrl + f"/registeredDevices/{id}"
        method = "DELETE"
        return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

    def initiate_association_between_sca_device_and_resource(self, request, deviceId, idempotency_key=None, **kwargs):
        """
        Initiate an association between an SCA device and a resource
        """
        endpoint = self.baseUrl + f"/registeredDevices/{deviceId}/associations"
        method = "POST"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

    def initiate_registration_of_sca_device(self, request, idempotency_key=None, **kwargs):
        """
        Initiate the registration of an SCA device
        """
        endpoint = self.baseUrl + f"/registeredDevices"
        method = "POST"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

    def list_registered_sca_devices(self, idempotency_key=None, **kwargs):
        """
        Get a list of registered SCA devices
        """
        endpoint = self.baseUrl + f"/registeredDevices"
        method = "GET"
        return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

