[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / TxRemoveInput.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_remove_input message for removing an input during interactive transaction construction.
11  */
12 public class TxRemoveInput : CommonBase {
13         internal TxRemoveInput(object _dummy, long ptr) : base(ptr) { }
14         ~TxRemoveInput() {
15                 if (ptr != 0) { bindings.TxRemoveInput_free(ptr); }
16         }
17
18         /**
19          * The channel ID
20          */
21         public byte[] get_channel_id() {
22                 byte[] ret = bindings.TxRemoveInput_get_channel_id(this.ptr);
23                 GC.KeepAlive(this);
24                 return ret;
25         }
26
27         /**
28          * The channel ID
29          */
30         public void set_channel_id(byte[] val) {
31                 bindings.TxRemoveInput_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
32                 GC.KeepAlive(this);
33                 GC.KeepAlive(val);
34         }
35
36         /**
37          * The serial ID of the input to be removed
38          */
39         public long get_serial_id() {
40                 long ret = bindings.TxRemoveInput_get_serial_id(this.ptr);
41                 GC.KeepAlive(this);
42                 return ret;
43         }
44
45         /**
46          * The serial ID of the input to be removed
47          */
48         public void set_serial_id(long val) {
49                 bindings.TxRemoveInput_set_serial_id(this.ptr, val);
50                 GC.KeepAlive(this);
51                 GC.KeepAlive(val);
52         }
53
54         /**
55          * Constructs a new TxRemoveInput given each field
56          */
57         public static TxRemoveInput of(byte[] channel_id_arg, long serial_id_arg) {
58                 long ret = bindings.TxRemoveInput_new(InternalUtils.check_arr_len(channel_id_arg, 32), serial_id_arg);
59                 GC.KeepAlive(channel_id_arg);
60                 GC.KeepAlive(serial_id_arg);
61                 if (ret >= 0 && ret <= 4096) { return null; }
62                 org.ldk.structs.TxRemoveInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveInput(null, ret); }
63                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
64                 return ret_hu_conv;
65         }
66
67         internal long clone_ptr() {
68                 long ret = bindings.TxRemoveInput_clone_ptr(this.ptr);
69                 GC.KeepAlive(this);
70                 return ret;
71         }
72
73         /**
74          * Creates a copy of the TxRemoveInput
75          */
76         public TxRemoveInput clone() {
77                 long ret = bindings.TxRemoveInput_clone(this.ptr);
78                 GC.KeepAlive(this);
79                 if (ret >= 0 && ret <= 4096) { return null; }
80                 org.ldk.structs.TxRemoveInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveInput(null, ret); }
81                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
82                 return ret_hu_conv;
83         }
84
85         /**
86          * Checks if two TxRemoveInputs contain equal inner contents.
87          * This ignores pointers and is_owned flags and looks at the values in fields.
88          * Two objects with NULL inner values will be considered "equal" here.
89          */
90         public bool eq(org.ldk.structs.TxRemoveInput b) {
91                 bool ret = bindings.TxRemoveInput_eq(this.ptr, b == null ? 0 : b.ptr);
92                 GC.KeepAlive(this);
93                 GC.KeepAlive(b);
94                 if (this != null) { this.ptrs_to.AddLast(b); };
95                 return ret;
96         }
97
98         public override bool Equals(object o) {
99                 if (!(o is TxRemoveInput)) return false;
100                 return this.eq((TxRemoveInput)o);
101         }
102         /**
103          * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
104          */
105         public byte[] write() {
106                 byte[] ret = bindings.TxRemoveInput_write(this.ptr);
107                 GC.KeepAlive(this);
108                 return ret;
109         }
110
111         /**
112          * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
113          */
114         public static Result_TxRemoveInputDecodeErrorZ read(byte[] ser) {
115                 long ret = bindings.TxRemoveInput_read(ser);
116                 GC.KeepAlive(ser);
117                 if (ret >= 0 && ret <= 4096) { return null; }
118                 Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret);
119                 return ret_hu_conv;
120         }
121
122 }
123 } } }