File tree Expand file tree Collapse file tree 9 files changed +42
-10
lines changed
slack-base/src/main/java/com/hubspot/slack/client/methods/params/chat/workobject Expand file tree Collapse file tree 9 files changed +42
-10
lines changed Original file line number Diff line number Diff line change 11package com .hubspot .slack .client .methods .params .chat .workobject ;
22
3+ import com .fasterxml .jackson .annotation .JsonInclude ;
34import com .hubspot .immutables .style .HubSpotStyle ;
45import java .util .Optional ;
56import org .immutables .value .Value ;
67
78@ Value .Immutable
89@ HubSpotStyle
10+ @ JsonInclude (JsonInclude .Include .NON_EMPTY )
911public interface ExternalRefIF {
1012 String getId ();
1113 Optional <String > getType ();
Original file line number Diff line number Diff line change 11package com .hubspot .slack .client .methods .params .chat .workobject ;
22
3+ import com .fasterxml .jackson .databind .PropertyNamingStrategies ;
4+ import com .fasterxml .jackson .databind .annotation .JsonNaming ;
35import com .fasterxml .jackson .databind .annotation .JsonSerialize ;
46import com .hubspot .immutables .style .HubSpotStyle ;
57import com .hubspot .slack .client .methods .params .chat .workobject .entity .EntityPayload ;
810
911@ Value .Immutable
1012@ HubSpotStyle
13+ @ JsonNaming (PropertyNamingStrategies .SnakeCaseStrategy .class )
1114public interface WorkObjectIF {
1215 String getAppUnfurlUrl ();
1316 String getUrl ();
Original file line number Diff line number Diff line change 1+ package com .hubspot .slack .client .methods .params .chat .workobject .entity ;
2+
3+ import com .hubspot .immutables .style .HubSpotStyle ;
4+ import org .immutables .value .Value ;
5+
6+ @ Value .Immutable
7+ @ HubSpotStyle
8+ public interface EntityPayloadAttributeTitleIF {
9+ String getText ();
10+ }
Original file line number Diff line number Diff line change 11package com .hubspot .slack .client .methods .params .chat .workobject .entity ;
22
3+ import com .fasterxml .jackson .annotation .JsonInclude ;
4+ import com .fasterxml .jackson .databind .PropertyNamingStrategies ;
5+ import com .fasterxml .jackson .databind .annotation .JsonNaming ;
36import com .fasterxml .jackson .databind .annotation .JsonSerialize ;
47import com .hubspot .immutables .style .HubSpotStyle ;
58import com .hubspot .slack .client .methods .params .chat .workobject .serializers .DisplayTypeSerializer ;
811
912@ Value .Immutable
1013@ HubSpotStyle
14+ @ JsonNaming (PropertyNamingStrategies .SnakeCaseStrategy .class )
15+ @ JsonInclude (JsonInclude .Include .NON_EMPTY )
1116public interface EntityPayloadAttributesIF {
12- String getTitle ();
17+ EntityPayloadAttributeTitle getTitle ();
1318 Optional <String > getDisplayId ();
1419
20+ @ JsonInclude (JsonInclude .Include .NON_ABSENT )
1521 @ JsonSerialize (using = DisplayTypeSerializer .class )
1622 Optional <DisplayType > getDisplayType ();
1723
Original file line number Diff line number Diff line change 11package com .hubspot .slack .client .methods .params .chat .workobject .entity ;
22
3+ import com .fasterxml .jackson .annotation .JsonInclude ;
4+ import com .fasterxml .jackson .databind .PropertyNamingStrategies ;
5+ import com .fasterxml .jackson .databind .annotation .JsonNaming ;
36import com .hubspot .immutables .style .HubSpotStyle ;
47import com .hubspot .slack .client .methods .params .chat .workobject .entity .fields .EntityPayloadFields ;
58import java .util .List ;
9+ import java .util .Optional ;
610import org .immutables .value .Value ;
711
812@ Value .Immutable
913@ HubSpotStyle
14+ @ JsonNaming (PropertyNamingStrategies .SnakeCaseStrategy .class )
15+ @ JsonInclude (JsonInclude .Include .NON_EMPTY )
1016public interface EntityPayloadIF {
1117 EntityPayloadAttributes getAttributes ();
12- EntityPayloadFields getFields ();
18+ Optional < EntityPayloadFields > getFields ();
1319 List <EntityPayloadAttributesCustomField > getCustomFields ();
1420 List <String > getDisplayOrder ();
1521}
Original file line number Diff line number Diff line change 11package com .hubspot .slack .client .methods .params .chat .workobject .entity ;
22
3+ import com .fasterxml .jackson .databind .PropertyNamingStrategies ;
4+ import com .fasterxml .jackson .databind .annotation .JsonNaming ;
35import com .hubspot .immutables .style .HubSpotStyle ;
46import org .immutables .value .Value ;
57
68@ Value .Immutable
79@ HubSpotStyle
10+ @ JsonNaming (PropertyNamingStrategies .SnakeCaseStrategy .class )
811public interface ProductIconIF {
912 String getUrl ();
1013 String getAltText ();
Original file line number Diff line number Diff line change 11package com .hubspot .slack .client .methods .params .chat .workobject .entity .fields ;
22
3+ import com .fasterxml .jackson .annotation .JsonInclude ;
34import com .hubspot .immutables .style .HubSpotStyle ;
45import org .immutables .value .Value ;
56
67@ Value .Immutable
78@ HubSpotStyle
9+ @ JsonInclude (JsonInclude .Include .NON_EMPTY )
810public interface ItemFieldsIF extends EntityPayloadFields {}
Original file line number Diff line number Diff line change @@ -21,4 +21,9 @@ public void serialize(
2121 gen .writeNull ();
2222 }
2323 }
24+
25+ @ Override
26+ public boolean isEmpty (SerializerProvider provider , Optional <DisplayType > value ) {
27+ return value .isEmpty ();
28+ }
2429}
Original file line number Diff line number Diff line change 55import com .fasterxml .jackson .databind .SerializerProvider ;
66import com .hubspot .slack .client .methods .params .chat .workobject .EntityType ;
77import java .io .IOException ;
8- import java .util .Optional ;
98
10- public class EntityTypeSerializer extends JsonSerializer <Optional < EntityType > > {
9+ public class EntityTypeSerializer extends JsonSerializer <EntityType > {
1110
1211 @ Override
1312 public void serialize (
14- Optional < EntityType > entityType ,
13+ EntityType entityType ,
1514 JsonGenerator gen ,
1615 SerializerProvider serializers
1716 ) throws IOException {
18- if (entityType .isPresent ()) {
19- gen .writeString (entityType .get ().getValue ());
20- } else {
21- gen .writeNull ();
22- }
17+ gen .writeString (entityType .getValue ());
2318 }
2419}
You can’t perform that action at this time.
0 commit comments