[C#] Update auto-generated files
[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                 byte[] ret = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this.ptr);
28                 GC.KeepAlive(this);
29                 return ret;
30         }
31
32         /**
33          * The genesis hash of the blockchain that was queried
34          */
35         public void set_chain_hash(byte[] val) {
36                 bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
37                 GC.KeepAlive(this);
38                 GC.KeepAlive(val);
39         }
40
41         /**
42          * Indicates if the query recipient maintains up-to-date channel
43          * information for the `chain_hash`
44          */
45         public bool get_full_information() {
46                 bool ret = bindings.ReplyShortChannelIdsEnd_get_full_information(this.ptr);
47                 GC.KeepAlive(this);
48                 return ret;
49         }
50
51         /**
52          * Indicates if the query recipient maintains up-to-date channel
53          * information for the `chain_hash`
54          */
55         public void set_full_information(bool val) {
56                 bindings.ReplyShortChannelIdsEnd_set_full_information(this.ptr, val);
57                 GC.KeepAlive(this);
58                 GC.KeepAlive(val);
59         }
60
61         /**
62          * Constructs a new ReplyShortChannelIdsEnd given each field
63          */
64         public static ReplyShortChannelIdsEnd of(byte[] chain_hash_arg, bool full_information_arg) {
65                 long ret = bindings.ReplyShortChannelIdsEnd_new(InternalUtils.check_arr_len(chain_hash_arg, 32), full_information_arg);
66                 GC.KeepAlive(chain_hash_arg);
67                 GC.KeepAlive(full_information_arg);
68                 if (ret >= 0 && ret <= 4096) { return null; }
69                 org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); }
70                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
71                 return ret_hu_conv;
72         }
73
74         internal long clone_ptr() {
75                 long ret = bindings.ReplyShortChannelIdsEnd_clone_ptr(this.ptr);
76                 GC.KeepAlive(this);
77                 return ret;
78         }
79
80         /**
81          * Creates a copy of the ReplyShortChannelIdsEnd
82          */
83         public ReplyShortChannelIdsEnd clone() {
84                 long ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr);
85                 GC.KeepAlive(this);
86                 if (ret >= 0 && ret <= 4096) { return null; }
87                 org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); }
88                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
89                 return ret_hu_conv;
90         }
91
92         /**
93          * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
94          * This ignores pointers and is_owned flags and looks at the values in fields.
95          * Two objects with NULL inner values will be considered "equal" here.
96          */
97         public bool eq(org.ldk.structs.ReplyShortChannelIdsEnd b) {
98                 bool ret = bindings.ReplyShortChannelIdsEnd_eq(this.ptr, b == null ? 0 : b.ptr);
99                 GC.KeepAlive(this);
100                 GC.KeepAlive(b);
101                 if (this != null) { this.ptrs_to.AddLast(b); };
102                 return ret;
103         }
104
105         public override bool Equals(object o) {
106                 if (!(o is ReplyShortChannelIdsEnd)) return false;
107                 return this.eq((ReplyShortChannelIdsEnd)o);
108         }
109         /**
110          * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
111          */
112         public byte[] write() {
113                 byte[] ret = bindings.ReplyShortChannelIdsEnd_write(this.ptr);
114                 GC.KeepAlive(this);
115                 return ret;
116         }
117
118         /**
119          * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
120          */
121         public static Result_ReplyShortChannelIdsEndDecodeErrorZ read(byte[] ser) {
122                 long ret = bindings.ReplyShortChannelIdsEnd_read(ser);
123                 GC.KeepAlive(ser);
124                 if (ret >= 0 && ret <= 4096) { return null; }
125                 Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
126                 return ret_hu_conv;
127         }
128
129 }
130 } } }