[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / LightningError.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 Err type for failure to process messages.
11  */
12 public class LightningError : CommonBase {
13         internal LightningError(object _dummy, long ptr) : base(ptr) { }
14         ~LightningError() {
15                 if (ptr != 0) { bindings.LightningError_free(ptr); }
16         }
17
18         /**
19          * A human-readable message describing the error
20          */
21         public string get_err() {
22                 string ret = bindings.LightningError_get_err(this.ptr);
23                 GC.KeepAlive(this);
24                 return ret;
25         }
26
27         /**
28          * A human-readable message describing the error
29          */
30         public void set_err(string val) {
31                 bindings.LightningError_set_err(this.ptr, val);
32                 GC.KeepAlive(this);
33                 GC.KeepAlive(val);
34         }
35
36         /**
37          * The action which should be taken against the offending peer.
38          */
39         public ErrorAction get_action() {
40                 long ret = bindings.LightningError_get_action(this.ptr);
41                 GC.KeepAlive(this);
42                 if (ret >= 0 && ret <= 4096) { return null; }
43                 org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
44                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
45                 return ret_hu_conv;
46         }
47
48         /**
49          * The action which should be taken against the offending peer.
50          */
51         public void set_action(org.ldk.structs.ErrorAction val) {
52                 bindings.LightningError_set_action(this.ptr, val.ptr);
53                 GC.KeepAlive(this);
54                 GC.KeepAlive(val);
55                 if (this != null) { this.ptrs_to.AddLast(val); };
56         }
57
58         /**
59          * Constructs a new LightningError given each field
60          */
61         public static LightningError of(string err_arg, org.ldk.structs.ErrorAction action_arg) {
62                 long ret = bindings.LightningError_new(err_arg, action_arg.ptr);
63                 GC.KeepAlive(err_arg);
64                 GC.KeepAlive(action_arg);
65                 if (ret >= 0 && ret <= 4096) { return null; }
66                 org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
67                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
68                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(action_arg); };
69                 return ret_hu_conv;
70         }
71
72         internal long clone_ptr() {
73                 long ret = bindings.LightningError_clone_ptr(this.ptr);
74                 GC.KeepAlive(this);
75                 return ret;
76         }
77
78         /**
79          * Creates a copy of the LightningError
80          */
81         public LightningError clone() {
82                 long ret = bindings.LightningError_clone(this.ptr);
83                 GC.KeepAlive(this);
84                 if (ret >= 0 && ret <= 4096) { return null; }
85                 org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
86                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
87                 return ret_hu_conv;
88         }
89
90 }
91 } } }