[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / TxComplete.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  * A tx_complete message signalling the conclusion of a peer's transaction contributions during
11  * interactive transaction construction.
12  */
13 public class TxComplete : CommonBase {
14         internal TxComplete(object _dummy, long ptr) : base(ptr) { }
15         ~TxComplete() {
16                 if (ptr != 0) { bindings.TxComplete_free(ptr); }
17         }
18
19         /**
20          * The channel ID
21          */
22         public byte[] get_channel_id() {
23                 byte[] ret = bindings.TxComplete_get_channel_id(this.ptr);
24                 GC.KeepAlive(this);
25                 return ret;
26         }
27
28         /**
29          * The channel ID
30          */
31         public void set_channel_id(byte[] val) {
32                 bindings.TxComplete_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
33                 GC.KeepAlive(this);
34                 GC.KeepAlive(val);
35         }
36
37         /**
38          * Constructs a new TxComplete given each field
39          */
40         public static TxComplete of(byte[] channel_id_arg) {
41                 long ret = bindings.TxComplete_new(InternalUtils.check_arr_len(channel_id_arg, 32));
42                 GC.KeepAlive(channel_id_arg);
43                 if (ret >= 0 && ret <= 4096) { return null; }
44                 org.ldk.structs.TxComplete ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxComplete(null, ret); }
45                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
46                 return ret_hu_conv;
47         }
48
49         internal long clone_ptr() {
50                 long ret = bindings.TxComplete_clone_ptr(this.ptr);
51                 GC.KeepAlive(this);
52                 return ret;
53         }
54
55         /**
56          * Creates a copy of the TxComplete
57          */
58         public TxComplete clone() {
59                 long ret = bindings.TxComplete_clone(this.ptr);
60                 GC.KeepAlive(this);
61                 if (ret >= 0 && ret <= 4096) { return null; }
62                 org.ldk.structs.TxComplete ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxComplete(null, ret); }
63                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
64                 return ret_hu_conv;
65         }
66
67         /**
68          * Checks if two TxCompletes contain equal inner contents.
69          * This ignores pointers and is_owned flags and looks at the values in fields.
70          * Two objects with NULL inner values will be considered "equal" here.
71          */
72         public bool eq(org.ldk.structs.TxComplete b) {
73                 bool ret = bindings.TxComplete_eq(this.ptr, b == null ? 0 : b.ptr);
74                 GC.KeepAlive(this);
75                 GC.KeepAlive(b);
76                 if (this != null) { this.ptrs_to.AddLast(b); };
77                 return ret;
78         }
79
80         public override bool Equals(object o) {
81                 if (!(o is TxComplete)) return false;
82                 return this.eq((TxComplete)o);
83         }
84         /**
85          * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
86          */
87         public byte[] write() {
88                 byte[] ret = bindings.TxComplete_write(this.ptr);
89                 GC.KeepAlive(this);
90                 return ret;
91         }
92
93         /**
94          * Read a TxComplete from a byte array, created by TxComplete_write
95          */
96         public static Result_TxCompleteDecodeErrorZ read(byte[] ser) {
97                 long ret = bindings.TxComplete_read(ser);
98                 GC.KeepAlive(ser);
99                 if (ret >= 0 && ret <= 4096) { return null; }
100                 Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret);
101                 return ret_hu_conv;
102         }
103
104 }
105 } } }