Пример #1
0
        /// <summary>
        /// Delete a v1 notification
        /// </summary>
        /// <param name="notificationId">Unique ID of the v1 notification to delete</param>
        public void DeleteNotification(string notificationId)
        {
            const string FunctionAdmin = "deleteNotification";
            const string Function      = "notification";

            if (string.IsNullOrWhiteSpace(notificationId))
            {
                throw new EntityException("NotificationId", "NotificationId may not be empty");
            }
            if (notificationId.Length != 32)
            {
                throw new EntityException("NotificationId", "Length of NotificationId must be 32");
            }

            HttpWebRequest webRequest = GetTrailedWebRequest("DELETE", isAdminConnection ? FunctionAdmin : Function, notificationId);

            DeleteNotificationResponse response = GetJSONresponse <DeleteNotificationResponse>(webRequest);

            if (response == null)
            {
                throw new Exception("No response.");
            }

            // check the result codes:
            response.Check();
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DeleteNotificationResponse response = new DeleteNotificationResponse();


            return(response);
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>  
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DeleteNotificationResponse response = new DeleteNotificationResponse();


            return response;
        }
Пример #4
0
        public HttpResponseMessage NotificationDelete(DeleteNotificationViewModel viewModel)
        {
            DeleteNotificationResponse response =
                userService.DeleteNotification(new DeleteNotificationRequest()
            {
                NotificationIds          = viewModel.NotificationIds,
                IsBulkDelete             = viewModel.IsBulkDelete,
                ModuleId                 = viewModel.ModuleId,
                ArePreviousNotifications = viewModel.ArePreviousNotifications,
                RequestedBy              = this.UserId
            });

            return(Request.BuildResponse(response));
        }
Пример #5
0
        public HttpResponseMessage DeleteNotification(string deleteViewModel)
        {
            DeleteNotificationViewModel notificationsViewModel = new DeleteNotificationViewModel();

            if (deleteViewModel != null)
            {
                notificationsViewModel = JsonConvert.DeserializeObject <DeleteNotificationViewModel>(deleteViewModel);
            }
            DeleteNotificationResponse response =
                userService.DeleteNotification(new DeleteNotificationRequest()
            {
                NotificationIds          = notificationsViewModel.NotificationIds,
                IsBulkDelete             = notificationsViewModel.IsBulkDelete,
                ModuleId                 = notificationsViewModel.ModuleId,
                ArePreviousNotifications = notificationsViewModel.ArePreviousNotifications,
                RequestedBy              = this.UserId
            });

            return(Request.BuildResponse(response));
        }