public object Delete(DeleteSubscription request)
        {
            try
            {
                var subscriberId = this.GetSession().UserAuthId.ToInt();
                DeletingSubscription.Delete(request, subscriberId);
            }
            catch (TopicNotExistsException)
            {
                return(new HttpError(HttpStatusCode.NotFound, $"Topic {request.TopicName} not exists"));
            }
            catch (BadRequestException)
            {
                return(new HttpError(HttpStatusCode.BadRequest, "BadRequest"));
            }

            return(new HttpResult(new CreateSubscriptionResponse(), HttpStatusCode.NoContent));
        }
Ejemplo n.º 2
0
        public void Delete(DeleteSubscription request, int subscriberId)
        {
            var requestToSend = new RestRequest($"topics/{request.TopicName}/subscriptions/{subscriberId}", Method.DELETE);

            processRequest(request.TopicName, requestToSend);
        }