class AuthorisationMapper {

    public Object mapToConsentCreateOrUpdateAuthorisationResponse(ResponseObject<AuthorisationResponse> responseObject) {
        AuthorisationResponse body = responseObject.getBody();
        if (Objects.isNull(body)) {
            return null;
        }

        if (body instanceof CreateConsentAuthorizationResponse) {
            return authorisationModelMapper.mapToStartScaProcessResponse((CreateConsentAuthorizationResponse) body);
        } else if (body instanceof UpdateConsentPsuDataResponse) {

            UpdatePsuAuthenticationResponse resp = mapToConsentUpdatePsuAuthenticationResponse((UpdateConsentPsuDataResponse) body);
            resp.setAuthorisationId(body.getAuthorisationId());
            return resp;

        } else {
            return null;
        }
    }

}