Repository navigation
Expand file tree
/
Copy pathSession.java
More file actions
80 lines (61 loc) · 1.97 KB
/
Copy pathSession.java
File metadata and controls
80 lines (61 loc) · 1.97 KB
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
76
77
78
79
80
package com.qoder.cloudagents.forward;
import com.qoder.cloudagents.core.*;
import java.util.*;
/** Immutable API response; unknown fields are preserved. */
public final class Session extends JsonModel {
public Session(JsonValue value, String requestId) {
super(value, requestId);
}
public String id() {
return optional("id", JsonValue::asString);
}
public String type() {
return optional("type", JsonValue::asString);
}
public String identityId() {
return optional("identity_id", JsonValue::asString);
}
public SessionTemplate template() {
return optional("template", SessionTemplate::fromJson);
}
public String sourceType() {
return optional("source_type", JsonValue::asString);
}
public String status() {
return optional("status", JsonValue::asString);
}
public String title() {
return optional("title", JsonValue::asString);
}
/** Null means no limit; field("budget") distinguishes omission from explicit null. */
public SessionBudget budget() {
return optional("budget", SessionBudget::fromJson);
}
public Map<String, JsonValue> metadata() {
return optionalMap("metadata", item -> item);
}
public SessionConfig config() {
return optional("config", SessionConfig::fromJson);
}
public List<SessionResource> resources() {
return optionalList("resources", item -> new SessionResource(item, requestId()));
}
public SessionStats stats() {
return optional("stats", SessionStats::fromJson);
}
public SessionUsage usage() {
return optional("usage", SessionUsage::fromJson);
}
public List<OutcomeEvaluation> outcomeEvaluations() {
return optionalList("outcome_evaluations", OutcomeEvaluation::fromJson);
}
public String archivedAt() {
return optional("archived_at", JsonValue::asString);
}
public String createdAt() {
return optional("created_at", JsonValue::asString);
}
public String updatedAt() {
return optional("updated_at", JsonValue::asString);
}
}