class AccountController implements AccountApi {

    @Override
    public ResponseEntity listOfTrustedBeneficiaries(UUID xRequestID, String consentID, String accountId, String psUIPAddress, String authorization) {
        ResponseObject<Xs2aTrustedBeneficiariesList> trustedBeneficiaries =
            trustedBeneficiariesService.getTrustedBeneficiaries(consentID, accountId, trimEndingSlash(request.getRequestURI()));
        return trustedBeneficiaries.hasError()
                   ? responseErrorMapper.generateErrorResponse(trustedBeneficiaries.getError())
                   : responseMapper.ok(trustedBeneficiaries, trustedBeneficiariesModelMapper::mapToTrustedBeneficiariesList);
    }

}