[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / ChannelUsage.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  * Proposed use of a channel passed as a parameter to [`ScoreLookUp::channel_penalty_msat`].
11  */
12 public class ChannelUsage : CommonBase {
13         internal ChannelUsage(object _dummy, long ptr) : base(ptr) { }
14         ~ChannelUsage() {
15                 if (ptr != 0) { bindings.ChannelUsage_free(ptr); }
16         }
17
18         /**
19          * The amount to send through the channel, denominated in millisatoshis.
20          */
21         public long get_amount_msat() {
22                 long ret = bindings.ChannelUsage_get_amount_msat(this.ptr);
23                 GC.KeepAlive(this);
24                 return ret;
25         }
26
27         /**
28          * The amount to send through the channel, denominated in millisatoshis.
29          */
30         public void set_amount_msat(long val) {
31                 bindings.ChannelUsage_set_amount_msat(this.ptr, val);
32                 GC.KeepAlive(this);
33                 GC.KeepAlive(val);
34         }
35
36         /**
37          * Total amount, denominated in millisatoshis, already allocated to send through the channel
38          * as part of a multi-path payment.
39          */
40         public long get_inflight_htlc_msat() {
41                 long ret = bindings.ChannelUsage_get_inflight_htlc_msat(this.ptr);
42                 GC.KeepAlive(this);
43                 return ret;
44         }
45
46         /**
47          * Total amount, denominated in millisatoshis, already allocated to send through the channel
48          * as part of a multi-path payment.
49          */
50         public void set_inflight_htlc_msat(long val) {
51                 bindings.ChannelUsage_set_inflight_htlc_msat(this.ptr, val);
52                 GC.KeepAlive(this);
53                 GC.KeepAlive(val);
54         }
55
56         /**
57          * The effective capacity of the channel.
58          */
59         public EffectiveCapacity get_effective_capacity() {
60                 long ret = bindings.ChannelUsage_get_effective_capacity(this.ptr);
61                 GC.KeepAlive(this);
62                 if (ret >= 0 && ret <= 4096) { return null; }
63                 org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret);
64                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
65                 return ret_hu_conv;
66         }
67
68         /**
69          * The effective capacity of the channel.
70          */
71         public void set_effective_capacity(org.ldk.structs.EffectiveCapacity val) {
72                 bindings.ChannelUsage_set_effective_capacity(this.ptr, val.ptr);
73                 GC.KeepAlive(this);
74                 GC.KeepAlive(val);
75                 if (this != null) { this.ptrs_to.AddLast(val); };
76         }
77
78         /**
79          * Constructs a new ChannelUsage given each field
80          */
81         public static ChannelUsage of(long amount_msat_arg, long inflight_htlc_msat_arg, org.ldk.structs.EffectiveCapacity effective_capacity_arg) {
82                 long ret = bindings.ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg.ptr);
83                 GC.KeepAlive(amount_msat_arg);
84                 GC.KeepAlive(inflight_htlc_msat_arg);
85                 GC.KeepAlive(effective_capacity_arg);
86                 if (ret >= 0 && ret <= 4096) { return null; }
87                 org.ldk.structs.ChannelUsage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUsage(null, ret); }
88                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
89                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(effective_capacity_arg); };
90                 return ret_hu_conv;
91         }
92
93         internal long clone_ptr() {
94                 long ret = bindings.ChannelUsage_clone_ptr(this.ptr);
95                 GC.KeepAlive(this);
96                 return ret;
97         }
98
99         /**
100          * Creates a copy of the ChannelUsage
101          */
102         public ChannelUsage clone() {
103                 long ret = bindings.ChannelUsage_clone(this.ptr);
104                 GC.KeepAlive(this);
105                 if (ret >= 0 && ret <= 4096) { return null; }
106                 org.ldk.structs.ChannelUsage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUsage(null, ret); }
107                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
108                 return ret_hu_conv;
109         }
110
111 }
112 } } }