Exemple #1
0
        /// <summary>
        /// Sends a SubscriptionsStopped message to a customer as a notification.
        /// </summary>
        /// <param name="channelIds">The IDs of the channels for which subscriptions were stopped.</param>
        /// <param name="reason">The human readable reason why the subscriptions were stopped.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <SubscriptionsStopped> NotificationSubscriptionsStopped(IDictionary <string, long> channelIds, string reason, IMessageHeaderExtension extension = null)
        {
            var body = new SubscriptionsStopped
            {
                ChannelIds = channelIds ?? new Dictionary <string, long>(),
                Reason     = reason ?? string.Empty,
            };

            return(SendNotification(body, extension: extension, isMultiPart: true, isFinalPart: true));
        }
Exemple #2
0
        /// <summary>
        /// Sends a SubscriptionsStopped message to a customer in response to a UnsubscribeChannels message.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
        /// <param name="channelIds">The channel IDs.</param>
        /// <param name="reason">The human readable reason why the subscriptions were stopped.</param>
        /// <param name="isFinalPart">Whether or not this is the final part of a multi-part message.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <SubscriptionsStopped> ResponseSubscriptionsStopped(IMessageHeader correlatedHeader, IDictionary <string, long> channelIds, string reason, bool isFinalPart = true, IMessageHeaderExtension extension = null)
        {
            var body = new SubscriptionsStopped
            {
                ChannelIds = channelIds ?? new Dictionary <string, long>(),
                Reason     = reason ?? string.Empty,
            };

            return(SendResponse(body, correlatedHeader, extension: extension, isMultiPart: true, isFinalPart: isFinalPart));
        }