class PiisConsentModelMapper {

    public ConsentsConfirmationOfFundsResponse mapToConsentsConfirmationOfFundsResponse(Xs2aConfirmationOfFundsResponse xs2aConfirmationOfFundsResponse) {
        return Optional.ofNullable(xs2aConfirmationOfFundsResponse).map(
            response -> {
                ConsentsConfirmationOfFundsResponse consentsConfirmationOfFundsResponse = new ConsentsConfirmationOfFundsResponse();
                consentsConfirmationOfFundsResponse.setConsentId(response.getConsentId());
                consentsConfirmationOfFundsResponse.setConsentStatus(ConsentStatus.fromValue(response.getConsentStatus()));
                consentsConfirmationOfFundsResponse.setLinks(hrefLinkMapper.mapToLinksMap(response.getLinks()));
                consentsConfirmationOfFundsResponse.setPsuMessage(response.getPsuMessage());
                return consentsConfirmationOfFundsResponse;
            }
        ).orElse(null);
    }

}