[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / AnnouncementSignatures.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  * An [`announcement_signatures`] message to be sent to or received from a peer.
11  * 
12  * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
13  */
14 public class AnnouncementSignatures : CommonBase {
15         internal AnnouncementSignatures(object _dummy, long ptr) : base(ptr) { }
16         ~AnnouncementSignatures() {
17                 if (ptr != 0) { bindings.AnnouncementSignatures_free(ptr); }
18         }
19
20         /**
21          * The channel ID
22          */
23         public byte[] get_channel_id() {
24                 byte[] ret = bindings.AnnouncementSignatures_get_channel_id(this.ptr);
25                 GC.KeepAlive(this);
26                 return ret;
27         }
28
29         /**
30          * The channel ID
31          */
32         public void set_channel_id(byte[] val) {
33                 bindings.AnnouncementSignatures_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
34                 GC.KeepAlive(this);
35                 GC.KeepAlive(val);
36         }
37
38         /**
39          * The short channel ID
40          */
41         public long get_short_channel_id() {
42                 long ret = bindings.AnnouncementSignatures_get_short_channel_id(this.ptr);
43                 GC.KeepAlive(this);
44                 return ret;
45         }
46
47         /**
48          * The short channel ID
49          */
50         public void set_short_channel_id(long val) {
51                 bindings.AnnouncementSignatures_set_short_channel_id(this.ptr, val);
52                 GC.KeepAlive(this);
53                 GC.KeepAlive(val);
54         }
55
56         /**
57          * A signature by the node key
58          */
59         public byte[] get_node_signature() {
60                 byte[] ret = bindings.AnnouncementSignatures_get_node_signature(this.ptr);
61                 GC.KeepAlive(this);
62                 return ret;
63         }
64
65         /**
66          * A signature by the node key
67          */
68         public void set_node_signature(byte[] val) {
69                 bindings.AnnouncementSignatures_set_node_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
70                 GC.KeepAlive(this);
71                 GC.KeepAlive(val);
72         }
73
74         /**
75          * A signature by the funding key
76          */
77         public byte[] get_bitcoin_signature() {
78                 byte[] ret = bindings.AnnouncementSignatures_get_bitcoin_signature(this.ptr);
79                 GC.KeepAlive(this);
80                 return ret;
81         }
82
83         /**
84          * A signature by the funding key
85          */
86         public void set_bitcoin_signature(byte[] val) {
87                 bindings.AnnouncementSignatures_set_bitcoin_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
88                 GC.KeepAlive(this);
89                 GC.KeepAlive(val);
90         }
91
92         /**
93          * Constructs a new AnnouncementSignatures given each field
94          */
95         public static AnnouncementSignatures of(byte[] channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg) {
96                 long ret = bindings.AnnouncementSignatures_new(InternalUtils.check_arr_len(channel_id_arg, 32), short_channel_id_arg, InternalUtils.check_arr_len(node_signature_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_arg, 64));
97                 GC.KeepAlive(channel_id_arg);
98                 GC.KeepAlive(short_channel_id_arg);
99                 GC.KeepAlive(node_signature_arg);
100                 GC.KeepAlive(bitcoin_signature_arg);
101                 if (ret >= 0 && ret <= 4096) { return null; }
102                 org.ldk.structs.AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, ret); }
103                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
104                 return ret_hu_conv;
105         }
106
107         internal long clone_ptr() {
108                 long ret = bindings.AnnouncementSignatures_clone_ptr(this.ptr);
109                 GC.KeepAlive(this);
110                 return ret;
111         }
112
113         /**
114          * Creates a copy of the AnnouncementSignatures
115          */
116         public AnnouncementSignatures clone() {
117                 long ret = bindings.AnnouncementSignatures_clone(this.ptr);
118                 GC.KeepAlive(this);
119                 if (ret >= 0 && ret <= 4096) { return null; }
120                 org.ldk.structs.AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, ret); }
121                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
122                 return ret_hu_conv;
123         }
124
125         /**
126          * Checks if two AnnouncementSignaturess contain equal inner contents.
127          * This ignores pointers and is_owned flags and looks at the values in fields.
128          * Two objects with NULL inner values will be considered "equal" here.
129          */
130         public bool eq(org.ldk.structs.AnnouncementSignatures b) {
131                 bool ret = bindings.AnnouncementSignatures_eq(this.ptr, b == null ? 0 : b.ptr);
132                 GC.KeepAlive(this);
133                 GC.KeepAlive(b);
134                 if (this != null) { this.ptrs_to.AddLast(b); };
135                 return ret;
136         }
137
138         public override bool Equals(object o) {
139                 if (!(o is AnnouncementSignatures)) return false;
140                 return this.eq((AnnouncementSignatures)o);
141         }
142         /**
143          * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
144          */
145         public byte[] write() {
146                 byte[] ret = bindings.AnnouncementSignatures_write(this.ptr);
147                 GC.KeepAlive(this);
148                 return ret;
149         }
150
151         /**
152          * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
153          */
154         public static Result_AnnouncementSignaturesDecodeErrorZ read(byte[] ser) {
155                 long ret = bindings.AnnouncementSignatures_read(ser);
156                 GC.KeepAlive(ser);
157                 if (ret >= 0 && ret <= 4096) { return null; }
158                 Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
159                 return ret_hu_conv;
160         }
161
162 }
163 } } }