[C#] Check in initial auto-generated C# bindings
[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         }
56
57         /**
58          * Constructs a new LightningError given each field
59          */
60         public static LightningError of(string err_arg, org.ldk.structs.ErrorAction action_arg) {
61                 long ret = bindings.LightningError_new(err_arg, action_arg.ptr);
62                 GC.KeepAlive(err_arg);
63                 GC.KeepAlive(action_arg);
64                 if (ret >= 0 && ret <= 4096) { return null; }
65                 org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
66                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
67                 return ret_hu_conv;
68         }
69
70         internal long clone_ptr() {
71                 long ret = bindings.LightningError_clone_ptr(this.ptr);
72                 GC.KeepAlive(this);
73                 return ret;
74         }
75
76         /**
77          * Creates a copy of the LightningError
78          */
79         public LightningError clone() {
80                 long ret = bindings.LightningError_clone(this.ptr);
81                 GC.KeepAlive(this);
82                 if (ret >= 0 && ret <= 4096) { return null; }
83                 org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
84                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
85                 return ret_hu_conv;
86         }
87
88 }
89 } } }