[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / UpdateFailMalformedHTLC.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  * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
11  * 
12  * [`update_fail_malformed_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
13  */
14 public class UpdateFailMalformedHTLC : CommonBase {
15         internal UpdateFailMalformedHTLC(object _dummy, long ptr) : base(ptr) { }
16         ~UpdateFailMalformedHTLC() {
17                 if (ptr != 0) { bindings.UpdateFailMalformedHTLC_free(ptr); }
18         }
19
20         /**
21          * The channel ID
22          */
23         public byte[] get_channel_id() {
24                 byte[] ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this.ptr);
25                 GC.KeepAlive(this);
26                 return ret;
27         }
28
29         /**
30          * The channel ID
31          */
32         public void set_channel_id(byte[] val) {
33                 bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
34                 GC.KeepAlive(this);
35                 GC.KeepAlive(val);
36         }
37
38         /**
39          * The HTLC ID
40          */
41         public long get_htlc_id() {
42                 long ret = bindings.UpdateFailMalformedHTLC_get_htlc_id(this.ptr);
43                 GC.KeepAlive(this);
44                 return ret;
45         }
46
47         /**
48          * The HTLC ID
49          */
50         public void set_htlc_id(long val) {
51                 bindings.UpdateFailMalformedHTLC_set_htlc_id(this.ptr, val);
52                 GC.KeepAlive(this);
53                 GC.KeepAlive(val);
54         }
55
56         /**
57          * The failure code
58          */
59         public short get_failure_code() {
60                 short ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this.ptr);
61                 GC.KeepAlive(this);
62                 return ret;
63         }
64
65         /**
66          * The failure code
67          */
68         public void set_failure_code(short val) {
69                 bindings.UpdateFailMalformedHTLC_set_failure_code(this.ptr, val);
70                 GC.KeepAlive(this);
71                 GC.KeepAlive(val);
72         }
73
74         internal long clone_ptr() {
75                 long ret = bindings.UpdateFailMalformedHTLC_clone_ptr(this.ptr);
76                 GC.KeepAlive(this);
77                 return ret;
78         }
79
80         /**
81          * Creates a copy of the UpdateFailMalformedHTLC
82          */
83         public UpdateFailMalformedHTLC clone() {
84                 long ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr);
85                 GC.KeepAlive(this);
86                 if (ret >= 0 && ret <= 4096) { return null; }
87                 org.ldk.structs.UpdateFailMalformedHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFailMalformedHTLC(null, ret); }
88                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
89                 return ret_hu_conv;
90         }
91
92         /**
93          * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
94          * This ignores pointers and is_owned flags and looks at the values in fields.
95          * Two objects with NULL inner values will be considered "equal" here.
96          */
97         public bool eq(org.ldk.structs.UpdateFailMalformedHTLC b) {
98                 bool ret = bindings.UpdateFailMalformedHTLC_eq(this.ptr, b == null ? 0 : b.ptr);
99                 GC.KeepAlive(this);
100                 GC.KeepAlive(b);
101                 if (this != null) { this.ptrs_to.AddLast(b); };
102                 return ret;
103         }
104
105         public override bool Equals(object o) {
106                 if (!(o is UpdateFailMalformedHTLC)) return false;
107                 return this.eq((UpdateFailMalformedHTLC)o);
108         }
109         /**
110          * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
111          */
112         public byte[] write() {
113                 byte[] ret = bindings.UpdateFailMalformedHTLC_write(this.ptr);
114                 GC.KeepAlive(this);
115                 return ret;
116         }
117
118         /**
119          * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
120          */
121         public static Result_UpdateFailMalformedHTLCDecodeErrorZ read(byte[] ser) {
122                 long ret = bindings.UpdateFailMalformedHTLC_read(ser);
123                 GC.KeepAlive(ser);
124                 if (ret >= 0 && ret <= 4096) { return null; }
125                 Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
126                 return ret_hu_conv;
127         }
128
129 }
130 } } }