/
JobStatusResponse.java
75 lines (53 loc) · 1.5 KB
/
JobStatusResponse.java
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
66
67
68
69
70
71
72
73
74
75
package smile.identity.core.models;
import com.squareup.moshi.Json;
import java.time.Instant;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.NonNull;
import lombok.Value;
import javax.annotation.Nullable;
@Value
@AllArgsConstructor
public class JobStatusResponse {
String code;
@Json(name = "job_complete")
boolean jobComplete;
@Json(name = "job_success")
boolean jobSuccess;
Result result;
String signature;
Instant timestamp;
@Json(name = "image_links")
Map<String, String> imageLinks;
List<JobResponse> history;
@Json(name = "kyc_receipt")
String kycReceipt;
@Json(name = "kyb_receipt")
String kybReceipt;
public JobStatusResponse(JobResponse result) {
this("", false, true, new Result(result), result.getSignature(),
result.getTimestamp(), new HashMap<>(), new ArrayList<>(), "", "");
}
@Value
public static class Result {
@Nullable
String message;
@Nullable
JobResponse jobResponse;
public Result(@NonNull String message) {
this.message = message;
this.jobResponse = null;
}
public Result(@NonNull JobResponse jobResponse) {
this.jobResponse = jobResponse;
this.message = null;
}
public Result() {
this.message = null;
this.jobResponse = null;
}
}
}