public static async Task <PrintNodePrintJob> GetAsync(int id) { var response = await ApiHelper.Get("/printjobs/" + id); var list = JsonConvert.DeserializeObject <IEnumerable <PrintNodePrintJob> >(response); return(list.FirstOrDefault()); }
public async Task <IEnumerable <PrintNodePrintJobState> > GetStates() { var response = await ApiHelper.Get("/printjobs/" + Id + "/states"); var list = JsonConvert.DeserializeObject <IEnumerable <IEnumerable <PrintNodePrintJobState> > >(response); return(list.FirstOrDefault()); }
public static async Task <PrintNodePrinter> GetAsync(long id) { var response = await ApiHelper.Get("/printers/" + id); var list = JsonConvert.DeserializeObject <List <PrintNodePrinter> >(response); return(list.FirstOrDefault()); }
public static async Task <PrintNodeComputer> GetAsync(long id, PrintNodeDelegatedClientContext clientContext = null) { var response = await ApiHelper.Get("/computers/" + id, clientContext); var list = JsonConvert.DeserializeObject <List <PrintNodeComputer> >(response); return(list.FirstOrDefault()); }
public static async Task <PrintNodePrinter> GetAsync(long id, PrintNodeDelegatedClientContext clientContext = null) { var response = await ApiHelper.Get("/printers/" + id, clientContext); var list = JsonConvert.DeserializeObject <List <PrintNodePrinter> >(response); // Set clientContext on each printer object; list.ForEach(p => p.ClientContext = clientContext); return(list.FirstOrDefault()); }
public static async Task <IEnumerable <PrintNodePrinter> > ListAsync(PrintNodeDelegatedClientContext clientContext = null) { var response = await ApiHelper.Get("/printers", clientContext); var list = JsonConvert.DeserializeObject <List <PrintNodePrinter> >(response); // Set clientContext on each printer object; list.ForEach(p => p.ClientContext = clientContext); return(list); }
public static async Task <IEnumerable <PrintNodePrintJob> > ListForPrinterAsync(int printerId, PrintNodeDelegatedClientContext clientContext = null) { var response = await ApiHelper.Get("/printers/" + printerId + "/printjobs"); var list = JsonConvert.DeserializeObject <List <PrintNodePrintJob> >(response); // Set clientContext on each job object; list.ForEach(j => j.ClientContext = clientContext); return(list); }
public static async Task <bool> Exists() { try { var response = await ApiHelper.Get("/whoami"); return(!string.IsNullOrEmpty(response)); } catch { return(false); } }
public static async Task <bool> Exists(PrintNodeDelegatedClientContext clientContext = null) { try { var response = await ApiHelper.Get("/whoami", clientContext); return(!string.IsNullOrEmpty(response)); } catch { return(false); } }
public static async Task <IEnumerable <PrintNodePrintJob> > ListForPrinterAsync(int printerId) { var response = await ApiHelper.Get("/printers/" + printerId + "/printjobs"); return(JsonConvert.DeserializeObject <IEnumerable <PrintNodePrintJob> >(response)); }
public static async Task <IEnumerable <IEnumerable <PrintNodePrintJobState> > > ListAsync() { var response = await ApiHelper.Get("/printjobs/states"); return(JsonConvert.DeserializeObject <IEnumerable <IEnumerable <PrintNodePrintJobState> > >(response)); }
public static async Task <IEnumerable <PrintNodeComputer> > ListAsync() { var response = await ApiHelper.Get("/computers"); return(JsonConvert.DeserializeObject <List <PrintNodeComputer> >(response)); }
public static async Task <PrintNodeScale> GetAsync(long computerId, string deviceName) { var response = await ApiHelper.Get("/computer/" + computerId + "/scales/" + deviceName); return(JsonConvert.DeserializeObject <PrintNodeScale>(response)); }
public static async Task <string> GetKeyAsync(string clientId) { var response = await ApiHelper.Get("/client/key/" + clientId + "?version=4.7.1&edition=printnode"); return(JsonConvert.DeserializeObject <string>(response)); }
public static async Task <IEnumerable <PrintNodeComputer> > ListAsync(PrintNodeDelegatedClientContext clientContext = null) { var response = await ApiHelper.Get("/computers", clientContext); return(JsonConvert.DeserializeObject <List <PrintNodeComputer> >(response)); }
public static async Task <IEnumerable <IEnumerable <PrintNodePrintJobState> > > ListAsync(PrintNodeDelegatedClientContext clientContext = null) { var response = await ApiHelper.Get("/printjobs/states", clientContext); return(JsonConvert.DeserializeObject <IEnumerable <IEnumerable <PrintNodePrintJobState> > >(response)); }
public static async Task <IEnumerable <PrintNodeScale> > ListForComputerAsync(long computerId) { var response = await ApiHelper.Get("/computer/" + computerId + "/scales"); return(JsonConvert.DeserializeObject <List <PrintNodeScale> >(response)); }