예제 #1
0
        /// <summary>
        /// Checks if the given <paramref name="listName"/> has the recipient <paramref name="recipientIdentity"/>
        /// </summary>
        /// <param name="listName"></param>
        /// <param name="recipientIdentity"></param>
        /// <param name="cancellationToken"></param>
        /// <returns>Boolean indicating if the recipient is or not on the list</returns>
        public async Task <bool> HasRecipientAsync(string listName, Identity recipientIdentity, CancellationToken cancellationToken = default(CancellationToken))
        {
            var broadcastExtension = new BroadcastExtension(_sender);
            var hasRecipient       = await broadcastExtension.HasRecipientAsync(listName, recipientIdentity, cancellationToken);

            return(hasRecipient);
        }
예제 #2
0
        /// <summary>
        /// Returns a given number <paramref name="take"/> (with a <paramref name="skip"/> offset) of recipients
        /// </summary>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task <DocumentCollection> GetRecipientsAsynGetAllDistributionListsAsync(int skip = 0, int take = 100, CancellationToken cancellationToken = default(CancellationToken))
        {
            var broadcastExtension             = new BroadcastExtension(_sender);
            var allDistributionListsRecipients = await broadcastExtension.GetRecipientsAsynGetAllDistributionListsAsync(skip, take, cancellationToken);

            return(allDistributionListsRecipients);
        }
예제 #3
0
        /// <summary>
        /// Returns a list of recipients for the list with the name <paramref name="listName"/>
        /// </summary>
        /// <param name="listName"></param>
        /// <param name="skip">Recipients to skip from the start</param>
        /// <param name="take">Amount of recipients to get</param>
        /// <param name="cancellationToken"></param>
        /// <returns>DocumentCollection with the items being the recovered recipients</returns>
        public async Task <DocumentCollection> GetRecipientsAsync(string listName, int skip = 0, int take = 100, CancellationToken cancellationToken = default(CancellationToken))
        {
            var broadcastExtension = new BroadcastExtension(_sender);
            var recipients         = await broadcastExtension.GetRecipientsAsync(listName, skip, take, cancellationToken);

            return(recipients);
        }
예제 #4
0
        /// <summary>
        /// Gets the list's identity based on the <paramref name="listName"/>
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        public Identity GetListIdentity(string listName)
        {
            var broadcastExtension = new BroadcastExtension(_sender);
            var listIdentity       = broadcastExtension.GetListIdentity(listName);

            return(listIdentity);
        }
예제 #5
0
        public static IChatbotFlowService GetFlowService()
        {
            var sender            = GetSender();
            var owlFilter         = new OWLFilter(GetClient());
            var carouselBuilder   = new CarouselBuilder(owlFilter);
            var quickReplyBuilder = new QuickReplyBuilder();
            var broadcast         = new BroadcastExtension(sender);
            var bucket            = new BucketExtension(sender);
            var contextManager    = new ContextManager(bucket);

            return(new ChatbotFlowService
                   (
                       carouselBuilder,
                       quickReplyBuilder,
                       broadcast,
                       contextManager,
                       owlFilter,
                       sender
                   ));
        }
예제 #6
0
 /// <summary>
 /// Adds a recipient to a broadcast list based on the recipient's identity and the list's name
 /// </summary>
 /// <param name="listName"></param>
 /// <param name="recipientIdentity"></param>
 /// <param name="cancellationToken"></param>
 /// <returns></returns>
 public async Task AddRecipientAsync(string listName, Identity recipientIdentity, CancellationToken cancellationToken = default(CancellationToken))
 {
     var broadcastExtension = new BroadcastExtension(_sender);
     await broadcastExtension.AddRecipientAsync(listName, recipientIdentity, cancellationToken);
 }
예제 #7
0
 /// <summary>
 /// Sends a message to the given broadcast list
 /// </summary>
 /// <param name="listName"></param>
 /// <param name="content">Message to be sent</param>
 /// <param name="id"></param>
 /// <param name="cancellationToken"></param>
 /// <returns></returns>
 public async Task SendMessageAsync(string listName, Document content, string id = null, CancellationToken cancellationToken = default(CancellationToken))
 {
     var broadcastExtension = new BroadcastExtension(_sender);
     await broadcastExtension.SendMessageAsync(listName, content, id, cancellationToken);
 }
예제 #8
0
 /// <summary>
 /// Deletes a given distribution list
 /// </summary>
 /// <param name="listName"></param>
 /// <param name="cancellationToken"></param>
 /// <returns></returns>
 public async Task DeleteDistributionListAsync(string listName, CancellationToken cancellationToken = default(CancellationToken))
 {
     var broadcastExtension = new BroadcastExtension(_sender);
     await broadcastExtension.DeleteDistributionListAsync(listName, cancellationToken);
 }