[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / ReplyShortChannelIdsEnd.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 [`reply_short_channel_ids_end`] message is sent as a reply to a
11  * message. The query recipient makes a best
12  * effort to respond based on their local network view which may not be
13  * a perfect view of the network.
14  * 
15  * [`reply_short_channel_ids_end`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages
16  */
17 public class ReplyShortChannelIdsEnd : CommonBase {
18         internal ReplyShortChannelIdsEnd(object _dummy, long ptr) : base(ptr) { }
19         ~ReplyShortChannelIdsEnd() {
20                 if (ptr != 0) { bindings.ReplyShortChannelIdsEnd_free(ptr); }
21         }
22
23         /**
24          * The genesis hash of the blockchain that was queried
25          */
26         public byte[] get_chain_hash() {
27                 long ret = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this.ptr);
28                 GC.KeepAlive(this);
29                 if (ret >= 0 && ret <= 4096) { return null; }
30                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
31                 return ret_conv;
32         }
33
34         /**
35          * The genesis hash of the blockchain that was queried
36          */
37         public void set_chain_hash(byte[] val) {
38                 bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
39                 GC.KeepAlive(this);
40                 GC.KeepAlive(val);
41         }
42
43         /**
44          * Indicates if the query recipient maintains up-to-date channel
45          * information for the `chain_hash`
46          */
47         public bool get_full_information() {
48                 bool ret = bindings.ReplyShortChannelIdsEnd_get_full_information(this.ptr);
49                 GC.KeepAlive(this);
50                 return ret;
51         }
52
53         /**
54          * Indicates if the query recipient maintains up-to-date channel
55          * information for the `chain_hash`
56          */
57         public void set_full_information(bool val) {
58                 bindings.ReplyShortChannelIdsEnd_set_full_information(this.ptr, val);
59                 GC.KeepAlive(this);
60                 GC.KeepAlive(val);
61         }
62
63         /**
64          * Constructs a new ReplyShortChannelIdsEnd given each field
65          */
66         public static ReplyShortChannelIdsEnd of(byte[] chain_hash_arg, bool full_information_arg) {
67                 long ret = bindings.ReplyShortChannelIdsEnd_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), full_information_arg);
68                 GC.KeepAlive(chain_hash_arg);
69                 GC.KeepAlive(full_information_arg);
70                 if (ret >= 0 && ret <= 4096) { return null; }
71                 org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); }
72                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
73                 return ret_hu_conv;
74         }
75
76         internal long clone_ptr() {
77                 long ret = bindings.ReplyShortChannelIdsEnd_clone_ptr(this.ptr);
78                 GC.KeepAlive(this);
79                 return ret;
80         }
81
82         /**
83          * Creates a copy of the ReplyShortChannelIdsEnd
84          */
85         public ReplyShortChannelIdsEnd clone() {
86                 long ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr);
87                 GC.KeepAlive(this);
88                 if (ret >= 0 && ret <= 4096) { return null; }
89                 org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); }
90                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
91                 return ret_hu_conv;
92         }
93
94         /**
95          * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
96          */
97         public long hash() {
98                 long ret = bindings.ReplyShortChannelIdsEnd_hash(this.ptr);
99                 GC.KeepAlive(this);
100                 return ret;
101         }
102
103         public override int GetHashCode() {
104                 return (int)this.hash();
105         }
106         /**
107          * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
108          * This ignores pointers and is_owned flags and looks at the values in fields.
109          * Two objects with NULL inner values will be considered "equal" here.
110          */
111         public bool eq(org.ldk.structs.ReplyShortChannelIdsEnd b) {
112                 bool ret = bindings.ReplyShortChannelIdsEnd_eq(this.ptr, b == null ? 0 : b.ptr);
113                 GC.KeepAlive(this);
114                 GC.KeepAlive(b);
115                 if (this != null) { this.ptrs_to.AddLast(b); };
116                 return ret;
117         }
118
119         public override bool Equals(object o) {
120                 if (!(o is ReplyShortChannelIdsEnd)) return false;
121                 return this.eq((ReplyShortChannelIdsEnd)o);
122         }
123         /**
124          * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
125          */
126         public byte[] write() {
127                 long ret = bindings.ReplyShortChannelIdsEnd_write(this.ptr);
128                 GC.KeepAlive(this);
129                 if (ret >= 0 && ret <= 4096) { return null; }
130                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
131                 return ret_conv;
132         }
133
134         /**
135          * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
136          */
137         public static Result_ReplyShortChannelIdsEndDecodeErrorZ read(byte[] ser) {
138                 long ret = bindings.ReplyShortChannelIdsEnd_read(InternalUtils.encodeUint8Array(ser));
139                 GC.KeepAlive(ser);
140                 if (ret >= 0 && ret <= 4096) { return null; }
141                 Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
142                 return ret_hu_conv;
143         }
144
145 }
146 } } }