[Java] Update auto-generated bindings to 0.0.105.0
[ldk-java] / src / main / java / org / ldk / structs / ErrorAction.java
index b7e592dd9d630c6628a6ab1e19f50b900f906e1c..bb9b7e445f782561fb5e27156fe9fd55beb04de9 100644 (file)
@@ -36,6 +36,9 @@ public class ErrorAction extends CommonBase {
                if (raw_val.getClass() == bindings.LDKErrorAction.SendErrorMessage.class) {
                        return new SendErrorMessage(ptr, (bindings.LDKErrorAction.SendErrorMessage)raw_val);
                }
+               if (raw_val.getClass() == bindings.LDKErrorAction.SendWarningMessage.class) {
+                       return new SendWarningMessage(ptr, (bindings.LDKErrorAction.SendWarningMessage)raw_val);
+               }
                assert false; return null; // Unreachable without extending the (internal) bindings interface
        }
 
@@ -102,6 +105,29 @@ public class ErrorAction extends CommonBase {
                        this.msg = msg_hu_conv;
                }
        }
+       /**
+        * The peer did something incorrect. Tell them without closing any channels.
+        */
+       public final static class SendWarningMessage extends ErrorAction {
+               /**
+                * The message to send.
+               */
+               public final WarningMessage msg;
+               /**
+                * The peer may have done something harmless that we weren't able to meaningfully process,
+                * though we should still tell them about it.
+                * If this event is logged, log it at the given level.
+               */
+               public final Level log_level;
+               private SendWarningMessage(long ptr, bindings.LDKErrorAction.SendWarningMessage obj) {
+                       super(null, ptr);
+                       long msg = obj.msg;
+                       WarningMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new WarningMessage(null, msg); }
+                       msg_hu_conv.ptrs_to.add(this);
+                       this.msg = msg_hu_conv;
+                       this.log_level = obj.log_level;
+               }
+       }
        long clone_ptr() {
                long ret = bindings.ErrorAction_clone_ptr(this.ptr);
                Reference.reachabilityFence(this);
@@ -178,4 +204,17 @@ public class ErrorAction extends CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Utility method to constructs a new SendWarningMessage-variant ErrorAction
+        */
+       public static ErrorAction send_warning_message(WarningMessage msg, org.ldk.enums.Level log_level) {
+               long ret = bindings.ErrorAction_send_warning_message(msg == null ? 0 : msg.ptr & ~1, log_level);
+               Reference.reachabilityFence(msg);
+               Reference.reachabilityFence(log_level);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
 }