class SubscriberProviderInfo {

        private String id;

        private String name;

        private String provider;

        private Map<String, Object> configuration;

        private AuthenticationSpec grant;

        private NotifyChannelState state;

        private List<NotifySubscriberChannelEntity> channels = new ArrayList<>();

        public SubscriberProviderInfo copyToProvidedUser(Authentication auth, NotifySubscriberProperties properties) {<FILL_FUNCTION_BODY>}

        public static SubscriberProviderInfo of(SubscriberProvider info) {
            return new SubscriberProviderInfo(
                IDGenerator.RANDOM.generate(),
                info.getName(),
                info.getId(),
                null,
                null,
                NotifyChannelState.disabled,
                new ArrayList<>());
        }

        public SubscriberProviderInfo with(List<NotifyChannelProvider> provider) {

            for (NotifyChannelProvider notifyChannelProvider : provider) {
                NotifySubscriberChannelEntity entity = new NotifySubscriberChannelEntity();
                entity.setChannelProvider(notifyChannelProvider.getId());
                entity.setName(notifyChannelProvider.getName());
                channels.add(entity);
            }
            return this;
        }

        public SubscriberProviderInfo with(NotifySubscriberChannelEntity channel) {
            boolean matched = false;
            for (NotifySubscriberChannelEntity entity : channels) {
                if (Objects.equals(entity.getChannelProvider(), channel.getChannelProvider())
                    && entity.getId() == null) {
                    matched = true;
                    channel.copyTo(entity);
                }
            }
            if (!matched) {
                channels.add(channel);
            }
            return this;
        }

        public SubscriberProviderInfo with(NotifySubscriberProviderEntity provider) {
            this.id = provider.getId();
            this.name = provider.getName();
            this.provider = provider.getProvider();
            this.grant = provider.getGrant();
            this.configuration = provider.getConfiguration();
            this.state = provider.getState();
            return this;
        }

        public NotifySubscriberProviderEntity toProviderEntity() {

            return new NotifySubscriberProviderEntity().copyFrom(this);
        }

        public List<NotifySubscriberChannelEntity> toChannelEntities() {
            if (CollectionUtils.isEmpty(channels)) {
                return Collections.emptyList();
            }
            for (NotifySubscriberChannelEntity channel : channels) {
                channel.setProviderId(this.id);
            }
            return channels;
        }
    }


            SubscriberProviderInfo info = new SubscriberProviderInfo();
            info.setId(id);
            info.setName(name);
            info.setProvider(provider);
            info.setChannels(
                channels
                    .stream()
                    .filter(e -> e.getId() != null &&
                        (properties.isAllowAllNotify(auth) || e.getGrant() == null || e.getGrant().isGranted(auth)))
                    .collect(Collectors.toList())
            );
            return info;
        
<no_super_class>