class AisConsentServiceRemote implements AisConsentServiceEncrypted {

    @Override
    public CmsResponse<CmsConsent> updateAspspAccountAccess(String consentId, AccountAccess request) {
        try {
            UpdateAisConsentResponse response = consentRestTemplate.exchange(remoteAisConsentUrls.updateAisAccountAccess(), HttpMethod.PUT,
                                                                             new HttpEntity<>(request), UpdateAisConsentResponse.class, consentId).getBody();
            if (response != null) {
                return CmsResponse.<CmsConsent>builder()
                           .payload(response.getAisConsent())
                           .build();
            }
        } catch (CmsRestException cmsRestException) {
            log.info("Couldn't update ASPSP account access, HTTP response status: {}", cmsRestException.getHttpStatus());

            return CmsResponse.<CmsConsent>builder()
                       .error(cmsRestException.getCmsError())
                       .build();
        }

        return CmsResponse.<CmsConsent>builder()
                   .error(TECHNICAL_ERROR)
                   .build();
    }

}