private void updateLimits(ProxyContext context, ResourceType resourceType, ShareResourceLimit limit, List<SharedResource> resources) {
        String ownerLocation = BucketBuilder.buildInitiatorBucket(context);
        String ownerBucket = encryptionService.encrypt(ownerLocation);
        ResourceDescriptor sharedByMe = getShareResource(ResourceTypes.SHARED_BY_ME, resourceType, ownerBucket, ownerLocation);
        resourceService.computeResource(sharedByMe, state -> {
            SharedByMeDto dto = ProxyUtil.convertToObject(state, SharedByMeDto.class);
            if (dto == null) {
                dto = new SharedByMeDto(new HashMap<>(), new HashMap<>(), new HashMap<>(), new HashMap<>());
            }
            for (SharedResource resource : resources) {
                dto.updateLimit(resource.getUrl(), limit);
            }
            return ProxyUtil.convertToString(dto);
        });
    }
Initialize share request by creating invitation object

@param request  - request body
@return invitation link
server/src/main/java/com/epam/aidial/core/server/service/ShareService.java