[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          * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
96          * This ignores pointers and is_owned flags and looks at the values in fields.
97          * Two objects with NULL inner values will be considered "equal" here.
98          */
99         public bool eq(org.ldk.structs.ReplyShortChannelIdsEnd b) {
100                 bool ret = bindings.ReplyShortChannelIdsEnd_eq(this.ptr, b == null ? 0 : b.ptr);
101                 GC.KeepAlive(this);
102                 GC.KeepAlive(b);
103                 if (this != null) { this.ptrs_to.AddLast(b); };
104                 return ret;
105         }
106
107         public override bool Equals(object o) {
108                 if (!(o is ReplyShortChannelIdsEnd)) return false;
109                 return this.eq((ReplyShortChannelIdsEnd)o);
110         }
111         /**
112          * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
113          */
114         public byte[] write() {
115                 long ret = bindings.ReplyShortChannelIdsEnd_write(this.ptr);
116                 GC.KeepAlive(this);
117                 if (ret >= 0 && ret <= 4096) { return null; }
118                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
119                 return ret_conv;
120         }
121
122         /**
123          * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
124          */
125         public static Result_ReplyShortChannelIdsEndDecodeErrorZ read(byte[] ser) {
126                 long ret = bindings.ReplyShortChannelIdsEnd_read(InternalUtils.encodeUint8Array(ser));
127                 GC.KeepAlive(ser);
128                 if (ret >= 0 && ret <= 4096) { return null; }
129                 Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
130                 return ret_hu_conv;
131         }
132
133 }
134 } } }