示例#1
0
 /// <summary>
 /// Creates a Support Ticket
 /// </summary>
 /// <param name="createTicketRequest"></param>
 /// <returns></returns>
 public GetTicketResponse CreateTicket(CreateTicketRequest createTicketRequest)
 {
     if (createTicketRequest == null)
     {
         throw new ArgumentNullException("createTicketRequest");
     }
     return(DoRequest <GetTicketResponse>(UriForPath("/helpdesk/tickets.json"), "POST", JsonConvert.SerializeObject(createTicketRequest)));
 }
示例#2
0
        /// <summary>
        /// Creates a Support Ticket with an attachment
        /// </summary>
        /// <param name="createTicketRequest"></param>
        /// <param name="attachments"></param>
        /// <returns></returns>
        public GetTicketResponse CreateTicketWithAttachment(CreateTicketRequest createTicketRequest, IEnumerable <Attachment> attachments)
        {
            if (createTicketRequest == null)
            {
                throw new ArgumentNullException("createTicketRequest");
            }
            if (attachments == null)
            {
                throw new ArgumentNullException("attachments");
            }

            return(DoMultipartFormRequest <GetTicketResponse>(UriForPath("/helpdesk/tickets.json"), createTicketRequest, attachments, "helpdesk_ticket", "helpdesk_ticket[attachments][][resource]"));
        }