[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / InboundHTLCErr.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * Invalid inbound onion payment.
11  */
12 public class InboundHTLCErr : CommonBase {
13         internal InboundHTLCErr(object _dummy, long ptr) : base(ptr) { }
14         ~InboundHTLCErr() {
15                 if (ptr != 0) { bindings.InboundHTLCErr_free(ptr); }
16         }
17
18         /**
19          * BOLT 4 error code.
20          */
21         public short get_err_code() {
22                 short ret = bindings.InboundHTLCErr_get_err_code(this.ptr);
23                 GC.KeepAlive(this);
24                 return ret;
25         }
26
27         /**
28          * BOLT 4 error code.
29          */
30         public void set_err_code(short val) {
31                 bindings.InboundHTLCErr_set_err_code(this.ptr, val);
32                 GC.KeepAlive(this);
33                 GC.KeepAlive(val);
34         }
35
36         /**
37          * Data attached to this error.
38          * 
39          * Returns a copy of the field.
40          */
41         public byte[] get_err_data() {
42                 long ret = bindings.InboundHTLCErr_get_err_data(this.ptr);
43                 GC.KeepAlive(this);
44                 if (ret >= 0 && ret <= 4096) { return null; }
45                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
46                 return ret_conv;
47         }
48
49         /**
50          * Data attached to this error.
51          */
52         public void set_err_data(byte[] val) {
53                 bindings.InboundHTLCErr_set_err_data(this.ptr, InternalUtils.encodeUint8Array(val));
54                 GC.KeepAlive(this);
55                 GC.KeepAlive(val);
56         }
57
58         /**
59          * Error message text.
60          */
61         public string get_msg() {
62                 long ret = bindings.InboundHTLCErr_get_msg(this.ptr);
63                 GC.KeepAlive(this);
64                 if (ret >= 0 && ret <= 4096) { return null; }
65                 string ret_conv = InternalUtils.decodeString(ret);
66                 return ret_conv;
67         }
68
69         /**
70          * Error message text.
71          */
72         public void set_msg(string val) {
73                 bindings.InboundHTLCErr_set_msg(this.ptr, InternalUtils.encodeString(val));
74                 GC.KeepAlive(this);
75                 GC.KeepAlive(val);
76         }
77
78         /**
79          * Constructs a new InboundHTLCErr given each field
80          */
81         public static InboundHTLCErr of(short err_code_arg, byte[] err_data_arg, string msg_arg) {
82                 long ret = bindings.InboundHTLCErr_new(err_code_arg, InternalUtils.encodeUint8Array(err_data_arg), InternalUtils.encodeString(msg_arg));
83                 GC.KeepAlive(err_code_arg);
84                 GC.KeepAlive(err_data_arg);
85                 GC.KeepAlive(msg_arg);
86                 if (ret >= 0 && ret <= 4096) { return null; }
87                 org.ldk.structs.InboundHTLCErr ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InboundHTLCErr(null, ret); }
88                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
89                 return ret_hu_conv;
90         }
91
92 }
93 } } }