예제 #1
0
        /// <summary>
        /// Sends a SubscriptionEnded message to a customer as a notification.
        /// </summary>
        /// <param name="requestUuid">The reqyest UUId.</param>
        /// <param name="reason">The human readable reason why the subscription ended.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <SubscriptionEnded> NotificationSubscriptionEnded(Guid requestUuid, string reason, IMessageHeaderExtension extension = null)
        {
            var body = new SubscriptionEnded
            {
                RequestUuid = requestUuid,
                Reason      = reason ?? string.Empty,
            };

            return(SendNotification(body, extension: extension));
        }
예제 #2
0
        /// <summary>
        /// Sends a SubscriptionEnded message to a customer in response to a UnsubscribeNotifications message.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
        /// <param name="requestUuid">The reqyest UUId.</param>
        /// <param name="reason">The human readable reason why the subscription ended.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <SubscriptionEnded> ResponseSubscriptionEnded(IMessageHeader correlatedHeader, Guid requestUuid, string reason, IMessageHeaderExtension extension = null)
        {
            var body = new SubscriptionEnded
            {
                RequestUuid = requestUuid,
                Reason      = reason ?? string.Empty,
            };

            return(SendResponse(body, correlatedHeader, extension: extension));
        }