from ..base import AdyenServiceBase


class SCAAssociationManagementApi(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_association(self, request, idempotency_key=None, **kwargs):
        """
        Approve a pending approval association
        """
        endpoint = self.baseUrl + "/scaAssociations"
        method = "PATCH"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def list_associations(self, idempotency_key=None, **kwargs):
        """
        Get a list of devices associated with an entity
        """
        endpoint = self.baseUrl + "/scaAssociations"
        method = "GET"
        return self.client.call_adyen_api(
            None, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def remove_association(self, request, idempotency_key=None, **kwargs):
        """
        Delete association to devices
        """
        endpoint = self.baseUrl + "/scaAssociations"
        method = "DELETE"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )
