-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathPrintNodePrintJobState.cs
65 lines (56 loc) · 2.38 KB
/
PrintNodePrintJobState.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;
using PrintNodeNet.Http;
namespace PrintNodeNet
{
public sealed class PrintNodePrintJobState
{
/// <summary>
/// The id of the PrintJob this state relates to.
/// </summary>
[JsonProperty("printJobId")]
public long PrintJobId { get; set; }
/// <summary>
/// The PrintJob string. The allowed states are pending_confirmation, new, sent_to_client, deleted,
/// done, error, in_progress, queued, disappeared, received, downloading, downloaded,
/// preparing_to_print, queued_to_print and expired.
/// </summary>
[JsonProperty("state")]
public string State { get; set; }
/// <summary>
/// Additional human readable information about the state. If a error has occoured this where to look
/// to diagnose the problem.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
/// <summary>
/// A machine readable representation of the information contained in the property 'message'. Implmented
/// shortly. Currently this is null.
/// </summary>
[JsonProperty("data")]
public object Data { get; set; }
/// <summary>
/// The version of the client which reported this state. This will be null null if the state did
/// not originate from the client.
/// </summary>
[JsonProperty("clientVersion")]
public string ClientVersion { get; set; }
/// <summary>
/// The UTC date this state was reported to the server.
/// </summary>
[JsonProperty("createTimestamp")]
public DateTime CreateTimeStamp { get; set; }
/// <summary>
/// The age of this state relative to the first state in milliseconds.
/// </summary>
[JsonProperty("age")]
public int Age { get; set; }
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);
}
}
}