public async Task <IEnumerable <PrintNodePrintJobState> > GetStates(PrintNodeRequestOptions options = null)
        {
            var response = await PrintNodeApiHelper.Get($"/printjobs/{Id}/states", options);

            var list = JsonConvert.DeserializeObject <IEnumerable <IEnumerable <PrintNodePrintJobState> > >(response);

            return(list.FirstOrDefault());
        }
        public static async Task <PrintNodeComputer> GetAsync(long id, PrintNodeRequestOptions options = null)
        {
            var response = await PrintNodeApiHelper.Get($"/computers/{id}", options);

            var list = JsonConvert.DeserializeObject <List <PrintNodeComputer> >(response);

            return(list.FirstOrDefault());
        }
        public static async Task <PrintNodePrintJob> GetAsync(long id, PrintNodeRequestOptions options = null)
        {
            var response = await PrintNodeApiHelper.Get($"/printjobs/{id}", options);

            var list = JsonConvert.DeserializeObject <IEnumerable <PrintNodePrintJob> >(response);

            return(list.FirstOrDefault());
        }
        public static async Task <bool> Exists(PrintNodeRequestOptions options = null)
        {
            try
            {
                var response = await PrintNodeApiHelper.Get("/whoami", options);

                return(!string.IsNullOrEmpty(response));
            }
            catch
            {
                return(false);
            }
        }
        public async Task <IEnumerable <PrintNodePrinter> > ListPrinters(PrintNodeRequestOptions options = null)
        {
            var response = await PrintNodeApiHelper.Get($"/computers/{Id}/printers", options);

            return(JsonConvert.DeserializeObject <List <PrintNodePrinter> >(response));
        }
        public static async Task <IEnumerable <PrintNodePrintJob> > ListForPrinterAsync(long printerId, PrintNodeRequestOptions options = null)
        {
            var response = await PrintNodeApiHelper.Get($"/printers/{printerId}/printjobs", options);

            return(JsonConvert.DeserializeObject <IEnumerable <PrintNodePrintJob> >(response));
        }
        public static async Task <string> GetKeyAsync(string clientId, PrintNodeRequestOptions options = null)
        {
            var response = await PrintNodeApiHelper.Get($"/client/key/{clientId}?version=4.7.1&edition=printnode", options);

            return(JsonConvert.DeserializeObject <string>(response));
        }
Beispiel #8
0
        public static async Task <PrintNodeScale> GetAsync(long computerId, string deviceName, PrintNodeRequestOptions options = null)
        {
            var response = await PrintNodeApiHelper.Get($"/computer/{computerId}/scales/{deviceName}", options);

            return(JsonConvert.DeserializeObject <PrintNodeScale>(response));
        }
Beispiel #9
0
        public static async Task <IEnumerable <PrintNodeScale> > ListForComputerAsync(long computerId, PrintNodeRequestOptions options = null)
        {
            var response = await PrintNodeApiHelper.Get($"/computer/{computerId}/scales", options);

            return(JsonConvert.DeserializeObject <List <PrintNodeScale> >(response));
        }
        public static async Task <IEnumerable <IEnumerable <PrintNodePrintJobState> > > ListAsync(PrintNodeRequestOptions options = null)
        {
            var response = await PrintNodeApiHelper.Get("/printjobs/states", options);

            return(JsonConvert.DeserializeObject <IEnumerable <IEnumerable <PrintNodePrintJobState> > >(response));
        }