[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / UpdateFailHTLC.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_htlc`] message to be sent to or received from a peer.
11  * 
12  * [`update_fail_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 UpdateFailHTLC : CommonBase {
15         internal UpdateFailHTLC(object _dummy, long ptr) : base(ptr) { }
16         ~UpdateFailHTLC() {
17                 if (ptr != 0) { bindings.UpdateFailHTLC_free(ptr); }
18         }
19
20         /**
21          * The channel ID
22          */
23         public byte[] get_channel_id() {
24                 byte[] ret = bindings.UpdateFailHTLC_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.UpdateFailHTLC_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.UpdateFailHTLC_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.UpdateFailHTLC_set_htlc_id(this.ptr, val);
52                 GC.KeepAlive(this);
53                 GC.KeepAlive(val);
54         }
55
56         internal long clone_ptr() {
57                 long ret = bindings.UpdateFailHTLC_clone_ptr(this.ptr);
58                 GC.KeepAlive(this);
59                 return ret;
60         }
61
62         /**
63          * Creates a copy of the UpdateFailHTLC
64          */
65         public UpdateFailHTLC clone() {
66                 long ret = bindings.UpdateFailHTLC_clone(this.ptr);
67                 GC.KeepAlive(this);
68                 if (ret >= 0 && ret <= 4096) { return null; }
69                 org.ldk.structs.UpdateFailHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFailHTLC(null, ret); }
70                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
71                 return ret_hu_conv;
72         }
73
74         /**
75          * Checks if two UpdateFailHTLCs contain equal inner contents.
76          * This ignores pointers and is_owned flags and looks at the values in fields.
77          * Two objects with NULL inner values will be considered "equal" here.
78          */
79         public bool eq(org.ldk.structs.UpdateFailHTLC b) {
80                 bool ret = bindings.UpdateFailHTLC_eq(this.ptr, b == null ? 0 : b.ptr);
81                 GC.KeepAlive(this);
82                 GC.KeepAlive(b);
83                 if (this != null) { this.ptrs_to.AddLast(b); };
84                 return ret;
85         }
86
87         public override bool Equals(object o) {
88                 if (!(o is UpdateFailHTLC)) return false;
89                 return this.eq((UpdateFailHTLC)o);
90         }
91         /**
92          * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
93          */
94         public byte[] write() {
95                 byte[] ret = bindings.UpdateFailHTLC_write(this.ptr);
96                 GC.KeepAlive(this);
97                 return ret;
98         }
99
100         /**
101          * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
102          */
103         public static Result_UpdateFailHTLCDecodeErrorZ read(byte[] ser) {
104                 long ret = bindings.UpdateFailHTLC_read(ser);
105                 GC.KeepAlive(ser);
106                 if (ret >= 0 && ret <= 4096) { return null; }
107                 Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
108                 return ret_hu_conv;
109         }
110
111 }
112 } } }