1212import java .lang .Long ;
1313import java .lang .Override ;
1414import java .lang .String ;
15+ import java .lang .SuppressWarnings ;
1516import java .util .Optional ;
1617
1718
@@ -30,6 +31,13 @@ public class PerAgentInsight {
3031 @ JsonProperty ("agentName" )
3132 private Optional <String > agentName ;
3233
34+ /**
35+ * Defines how to render an icon
36+ */
37+ @ JsonInclude (Include .NON_ABSENT )
38+ @ JsonProperty ("icon" )
39+ private Optional <? extends IconConfig > icon ;
40+
3341 /**
3442 * Total number of users for this agent over the specified time period.
3543 */
@@ -48,21 +56,24 @@ public class PerAgentInsight {
4856 public PerAgentInsight (
4957 @ JsonProperty ("agentId" ) Optional <String > agentId ,
5058 @ JsonProperty ("agentName" ) Optional <String > agentName ,
59+ @ JsonProperty ("icon" ) Optional <? extends IconConfig > icon ,
5160 @ JsonProperty ("userCount" ) Optional <Long > userCount ,
5261 @ JsonProperty ("runCount" ) Optional <Long > runCount ) {
5362 Utils .checkNotNull (agentId , "agentId" );
5463 Utils .checkNotNull (agentName , "agentName" );
64+ Utils .checkNotNull (icon , "icon" );
5565 Utils .checkNotNull (userCount , "userCount" );
5666 Utils .checkNotNull (runCount , "runCount" );
5767 this .agentId = agentId ;
5868 this .agentName = agentName ;
69+ this .icon = icon ;
5970 this .userCount = userCount ;
6071 this .runCount = runCount ;
6172 }
6273
6374 public PerAgentInsight () {
6475 this (Optional .empty (), Optional .empty (), Optional .empty (),
65- Optional .empty ());
76+ Optional .empty (), Optional . empty () );
6677 }
6778
6879 /**
@@ -81,6 +92,15 @@ public Optional<String> agentName() {
8192 return agentName ;
8293 }
8394
95+ /**
96+ * Defines how to render an icon
97+ */
98+ @ SuppressWarnings ("unchecked" )
99+ @ JsonIgnore
100+ public Optional <IconConfig > icon () {
101+ return (Optional <IconConfig >) icon ;
102+ }
103+
84104 /**
85105 * Total number of users for this agent over the specified time period.
86106 */
@@ -140,6 +160,25 @@ public PerAgentInsight withAgentName(Optional<String> agentName) {
140160 return this ;
141161 }
142162
163+ /**
164+ * Defines how to render an icon
165+ */
166+ public PerAgentInsight withIcon (IconConfig icon ) {
167+ Utils .checkNotNull (icon , "icon" );
168+ this .icon = Optional .ofNullable (icon );
169+ return this ;
170+ }
171+
172+
173+ /**
174+ * Defines how to render an icon
175+ */
176+ public PerAgentInsight withIcon (Optional <? extends IconConfig > icon ) {
177+ Utils .checkNotNull (icon , "icon" );
178+ this .icon = icon ;
179+ return this ;
180+ }
181+
143182 /**
144183 * Total number of users for this agent over the specified time period.
145184 */
@@ -190,22 +229,24 @@ public boolean equals(java.lang.Object o) {
190229 return
191230 Utils .enhancedDeepEquals (this .agentId , other .agentId ) &&
192231 Utils .enhancedDeepEquals (this .agentName , other .agentName ) &&
232+ Utils .enhancedDeepEquals (this .icon , other .icon ) &&
193233 Utils .enhancedDeepEquals (this .userCount , other .userCount ) &&
194234 Utils .enhancedDeepEquals (this .runCount , other .runCount );
195235 }
196236
197237 @ Override
198238 public int hashCode () {
199239 return Utils .enhancedHash (
200- agentId , agentName , userCount ,
201- runCount );
240+ agentId , agentName , icon ,
241+ userCount , runCount );
202242 }
203243
204244 @ Override
205245 public String toString () {
206246 return Utils .toString (PerAgentInsight .class ,
207247 "agentId" , agentId ,
208248 "agentName" , agentName ,
249+ "icon" , icon ,
209250 "userCount" , userCount ,
210251 "runCount" , runCount );
211252 }
@@ -217,6 +258,8 @@ public final static class Builder {
217258
218259 private Optional <String > agentName = Optional .empty ();
219260
261+ private Optional <? extends IconConfig > icon = Optional .empty ();
262+
220263 private Optional <Long > userCount = Optional .empty ();
221264
222265 private Optional <Long > runCount = Optional .empty ();
@@ -264,6 +307,25 @@ public Builder agentName(Optional<String> agentName) {
264307 }
265308
266309
310+ /**
311+ * Defines how to render an icon
312+ */
313+ public Builder icon (IconConfig icon ) {
314+ Utils .checkNotNull (icon , "icon" );
315+ this .icon = Optional .ofNullable (icon );
316+ return this ;
317+ }
318+
319+ /**
320+ * Defines how to render an icon
321+ */
322+ public Builder icon (Optional <? extends IconConfig > icon ) {
323+ Utils .checkNotNull (icon , "icon" );
324+ this .icon = icon ;
325+ return this ;
326+ }
327+
328+
267329 /**
268330 * Total number of users for this agent over the specified time period.
269331 */
@@ -304,8 +366,8 @@ public Builder runCount(Optional<Long> runCount) {
304366 public PerAgentInsight build () {
305367
306368 return new PerAgentInsight (
307- agentId , agentName , userCount ,
308- runCount );
369+ agentId , agentName , icon ,
370+ userCount , runCount );
309371 }
310372
311373 }
0 commit comments