from ..base import AdyenServiceBase


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

    def get_account_holder(self, id, idempotency_key=None, **kwargs):
        """
        Get an account holder
        """
        endpoint = self.baseUrl + f"/accountHolders/{id}"
        method = "GET"
        return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

    def get_all_balance_accounts_of_account_holder(self, id, idempotency_key=None, **kwargs):
        """
        Get all balance accounts of an account holder
        """
        endpoint = self.baseUrl + f"/accountHolders/{id}/balanceAccounts"
        method = "GET"
        return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

    def get_tax_form(self, id, idempotency_key=None, **kwargs):
        """
        Get a tax form
        """
        endpoint = self.baseUrl + f"/accountHolders/{id}/taxForms"
        method = "GET"
        return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

    def update_account_holder(self, request, id, idempotency_key=None, **kwargs):
        """
        Update an account holder
        """
        endpoint = self.baseUrl + f"/accountHolders/{id}"
        method = "PATCH"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

    def create_account_holder(self, request, idempotency_key=None, **kwargs):
        """
        Create an account holder
        """
        endpoint = self.baseUrl + f"/accountHolders"
        method = "POST"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

