예제 #1
0
        /// <summary>
        /// Remove the churn event associated with a subscription. This rewrites history for the subscription,
        /// making it appear as thought the subscription never churned to begin with. You may do this for a subscription
        /// that has already churned, or that is set to churn in the future.
        /// </summary>
        public async Task <bool> UnchurnSubscriptionAsync(UnchurnSubscriptionRequestModel model)
        {
            try
            {
                if (string.IsNullOrEmpty(model.SubscriptionId) && string.IsNullOrEmpty(model.SubscriptionAlias))
                {
                    throw new MissingMemberException("Either you need to set 'SubscriptionId' or 'SubscriptionAlias'");
                }
                var result = await client.PutAsync("v2/unchurn/" + (string.IsNullOrEmpty(model.SubscriptionAlias) ? model.SubscriptionId : model.SubscriptionAlias) + "/", null);


                return(result.IsSuccessStatusCode);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
예제 #2
0
 /// <summary>
 /// Remove the churn event associated with a subscription. This rewrites history for the subscription,
 /// making it appear as thought the subscription never churned to begin with. You may do this for a subscription
 /// that has already churned, or that is set to churn in the future.
 /// </summary>
 public bool UnchurnSubscription(UnchurnSubscriptionRequestModel model) => UnchurnSubscriptionAsync(model).ConfigureAwait(false).GetAwaiter().GetResult();