2525public final class TransactionStatusDetails {
2626 private final String transactionId ;
2727
28+ private final Optional <String > type ;
29+
2830 private final List <String > reasons ;
2931
3032 private final RuleAction status ;
@@ -35,11 +37,13 @@ public final class TransactionStatusDetails {
3537
3638 private TransactionStatusDetails (
3739 String transactionId ,
40+ Optional <String > type ,
3841 List <String > reasons ,
3942 RuleAction status ,
4043 Optional <String > comment ,
4144 Map <String , Object > additionalProperties ) {
4245 this .transactionId = transactionId ;
46+ this .type = type ;
4347 this .reasons = reasons ;
4448 this .status = status ;
4549 this .comment = comment ;
@@ -51,6 +55,14 @@ public String getTransactionId() {
5155 return transactionId ;
5256 }
5357
58+ /**
59+ * @return Type of transaction (ex: DEPOSIT, WITHDRAWAL, TRANSFER, EXTERNAL_PAYMENT, REFUND, OTHER)
60+ */
61+ @ JsonProperty ("type" )
62+ public Optional <String > getType () {
63+ return type ;
64+ }
65+
5466 @ JsonProperty ("reasons" )
5567 public List <String > getReasons () {
5668 return reasons ;
@@ -79,14 +91,15 @@ public Map<String, Object> getAdditionalProperties() {
7991
8092 private boolean equalTo (TransactionStatusDetails other ) {
8193 return transactionId .equals (other .transactionId )
94+ && type .equals (other .type )
8295 && reasons .equals (other .reasons )
8396 && status .equals (other .status )
8497 && comment .equals (other .comment );
8598 }
8699
87100 @ java .lang .Override
88101 public int hashCode () {
89- return Objects .hash (this .transactionId , this .reasons , this .status , this .comment );
102+ return Objects .hash (this .transactionId , this .type , this . reasons , this .status , this .comment );
90103 }
91104
92105 @ java .lang .Override
@@ -111,6 +124,10 @@ public interface StatusStage {
111124 public interface _FinalStage {
112125 TransactionStatusDetails build ();
113126
127+ _FinalStage type (Optional <String > type );
128+
129+ _FinalStage type (String type );
130+
114131 _FinalStage reasons (List <String > reasons );
115132
116133 _FinalStage addReasons (String reasons );
@@ -132,6 +149,8 @@ public static final class Builder implements TransactionIdStage, StatusStage, _F
132149
133150 private List <String > reasons = new ArrayList <>();
134151
152+ private Optional <String > type = Optional .empty ();
153+
135154 @ JsonAnySetter
136155 private Map <String , Object > additionalProperties = new HashMap <>();
137156
@@ -140,6 +159,7 @@ private Builder() {}
140159 @ java .lang .Override
141160 public Builder from (TransactionStatusDetails other ) {
142161 transactionId (other .getTransactionId ());
162+ type (other .getType ());
143163 reasons (other .getReasons ());
144164 status (other .getStatus ());
145165 comment (other .getComment ());
@@ -193,9 +213,26 @@ public _FinalStage reasons(List<String> reasons) {
193213 return this ;
194214 }
195215
216+ /**
217+ * <p>Type of transaction (ex: DEPOSIT, WITHDRAWAL, TRANSFER, EXTERNAL_PAYMENT, REFUND, OTHER)</p>
218+ * @return Reference to {@code this} so that method calls can be chained together.
219+ */
220+ @ java .lang .Override
221+ public _FinalStage type (String type ) {
222+ this .type = Optional .ofNullable (type );
223+ return this ;
224+ }
225+
226+ @ java .lang .Override
227+ @ JsonSetter (value = "type" , nulls = Nulls .SKIP )
228+ public _FinalStage type (Optional <String > type ) {
229+ this .type = type ;
230+ return this ;
231+ }
232+
196233 @ java .lang .Override
197234 public TransactionStatusDetails build () {
198- return new TransactionStatusDetails (transactionId , reasons , status , comment , additionalProperties );
235+ return new TransactionStatusDetails (transactionId , type , reasons , status , comment , additionalProperties );
199236 }
200237 }
201238}
0 commit comments