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