[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / DirectedChannelInfo.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 wrapper around [`ChannelInfo`] representing information about the channel as directed from a
11  * source node to a target node.
12  */
13 public class DirectedChannelInfo : CommonBase {
14         internal DirectedChannelInfo(object _dummy, long ptr) : base(ptr) { }
15         ~DirectedChannelInfo() {
16                 if (ptr != 0) { bindings.DirectedChannelInfo_free(ptr); }
17         }
18
19         internal long clone_ptr() {
20                 long ret = bindings.DirectedChannelInfo_clone_ptr(this.ptr);
21                 GC.KeepAlive(this);
22                 return ret;
23         }
24
25         /**
26          * Creates a copy of the DirectedChannelInfo
27          */
28         public DirectedChannelInfo clone() {
29                 long ret = bindings.DirectedChannelInfo_clone(this.ptr);
30                 GC.KeepAlive(this);
31                 if (ret >= 0 && ret <= 4096) { return null; }
32                 org.ldk.structs.DirectedChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DirectedChannelInfo(null, ret); }
33                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
34                 return ret_hu_conv;
35         }
36
37         /**
38          * Returns information for the channel.
39          */
40         public ChannelInfo channel() {
41                 long ret = bindings.DirectedChannelInfo_channel(this.ptr);
42                 GC.KeepAlive(this);
43                 if (ret >= 0 && ret <= 4096) { return null; }
44                 org.ldk.structs.ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelInfo(null, ret); }
45                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
46                 return ret_hu_conv;
47         }
48
49         /**
50          * Returns the [`EffectiveCapacity`] of the channel in the direction.
51          * 
52          * This is either the total capacity from the funding transaction, if known, or the
53          * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
54          * otherwise.
55          */
56         public EffectiveCapacity effective_capacity() {
57                 long ret = bindings.DirectedChannelInfo_effective_capacity(this.ptr);
58                 GC.KeepAlive(this);
59                 if (ret >= 0 && ret <= 4096) { return null; }
60                 org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret);
61                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
62                 return ret_hu_conv;
63         }
64
65 }
66 } } }