public async Task <TicketListItem[]> GetTickets(TicketStatusTypes statusType, string contactOrCompany = null, int?contactOrCompanyId = null, bool?deepSearch = null, int?projectId = null) { string status = TicketStatusTypesToString(statusType); var fields = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("type", status) }; // TODO: add optional params return(await DoCall <TicketListItem[]>("getTickets.php", fields)); }
private string TicketStatusTypesToString(TicketStatusTypes statusType) { switch (statusType) { case TicketStatusTypes.New: return("new"); case TicketStatusTypes.Open: return("open"); case TicketStatusTypes.WaitingForClient: return("waiting_for_client"); case TicketStatusTypes.EscalatedThirdParty: return("escalated_thirdparty"); case TicketStatusTypes.NotClosed: return("not_closed"); case TicketStatusTypes.Closed: return("closed"); default: throw new InvalidEnumArgumentException(nameof(statusType)); } }