class AuthorisationModelMapper {

    public Object mapToStartOrUpdateCancellationResponse(CancellationAuthorisationResponse cancellationAuthorisationResponse) {
        if (Objects.isNull(cancellationAuthorisationResponse)) {
            return null;
        }

        AuthorisationResponseType authorisationResponseType = cancellationAuthorisationResponse.getAuthorisationResponseType();

        if (authorisationResponseType == AuthorisationResponseType.START) {
            return mapToStartScaProcessResponseCancellation((Xs2aCreatePisCancellationAuthorisationResponse) cancellationAuthorisationResponse);
        } else if (authorisationResponseType == AuthorisationResponseType.UPDATE) {
            return mapToUpdatePsuAuthenticationResponse((Xs2aUpdatePisCommonPaymentPsuDataResponse) cancellationAuthorisationResponse);
        } else {
            throw new IllegalArgumentException("Unknown authorisation response type: " + authorisationResponseType);
        }
    }

}