[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / Result_PendingHTLCInfoDecodeErrorZ.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 public class Result_PendingHTLCInfoDecodeErrorZ : CommonBase {
9         Result_PendingHTLCInfoDecodeErrorZ(object _dummy, long ptr) : base(ptr) { }
10         ~Result_PendingHTLCInfoDecodeErrorZ() {
11                 if (ptr != 0) { bindings.CResult_PendingHTLCInfoDecodeErrorZ_free(ptr); }
12         }
13
14         internal static Result_PendingHTLCInfoDecodeErrorZ constr_from_ptr(long ptr) {
15                 if (bindings.CResult_PendingHTLCInfoDecodeErrorZ_is_ok(ptr)) {
16                         return new Result_PendingHTLCInfoDecodeErrorZ_OK(null, ptr);
17                 } else {
18                         return new Result_PendingHTLCInfoDecodeErrorZ_Err(null, ptr);
19                 }
20         }
21         public class Result_PendingHTLCInfoDecodeErrorZ_OK : Result_PendingHTLCInfoDecodeErrorZ {
22                 public readonly PendingHTLCInfo res;
23                 internal Result_PendingHTLCInfoDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24                         long res = bindings.CResult_PendingHTLCInfoDecodeErrorZ_get_ok(ptr);
25                         org.ldk.structs.PendingHTLCInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.PendingHTLCInfo(null, res); }
26                         if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); };
27                         this.res = res_hu_conv;
28                 }
29         }
30
31         public class Result_PendingHTLCInfoDecodeErrorZ_Err : Result_PendingHTLCInfoDecodeErrorZ {
32                 public readonly DecodeError err;
33                 internal Result_PendingHTLCInfoDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
34                         long err = bindings.CResult_PendingHTLCInfoDecodeErrorZ_get_err(ptr);
35                         org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
36                         if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); };
37                         this.err = err_hu_conv;
38                 }
39         }
40
41         /**
42          * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the success state.
43          */
44         public static Result_PendingHTLCInfoDecodeErrorZ ok(org.ldk.structs.PendingHTLCInfo o) {
45                 long ret = bindings.CResult_PendingHTLCInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr);
46                 GC.KeepAlive(o);
47                 if (ret >= 0 && ret <= 4096) { return null; }
48                 Result_PendingHTLCInfoDecodeErrorZ ret_hu_conv = Result_PendingHTLCInfoDecodeErrorZ.constr_from_ptr(ret);
49                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); };
50                 return ret_hu_conv;
51         }
52
53         /**
54          * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the error state.
55          */
56         public static Result_PendingHTLCInfoDecodeErrorZ err(org.ldk.structs.DecodeError e) {
57                 long ret = bindings.CResult_PendingHTLCInfoDecodeErrorZ_err(e.ptr);
58                 GC.KeepAlive(e);
59                 if (ret >= 0 && ret <= 4096) { return null; }
60                 Result_PendingHTLCInfoDecodeErrorZ ret_hu_conv = Result_PendingHTLCInfoDecodeErrorZ.constr_from_ptr(ret);
61                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); };
62                 return ret_hu_conv;
63         }
64
65         /**
66          * Checks if the given object is currently in the success state
67          */
68         public bool is_ok() {
69                 bool ret = bindings.CResult_PendingHTLCInfoDecodeErrorZ_is_ok(this.ptr);
70                 GC.KeepAlive(this);
71                 return ret;
72         }
73
74         internal long clone_ptr() {
75                 long ret = bindings.CResult_PendingHTLCInfoDecodeErrorZ_clone_ptr(this.ptr);
76                 GC.KeepAlive(this);
77                 return ret;
78         }
79
80         /**
81          * Creates a new CResult_PendingHTLCInfoDecodeErrorZ which has the same data as `orig`
82          * but with all dynamically-allocated buffers duplicated in new buffers.
83          */
84         public Result_PendingHTLCInfoDecodeErrorZ clone() {
85                 long ret = bindings.CResult_PendingHTLCInfoDecodeErrorZ_clone(this.ptr);
86                 GC.KeepAlive(this);
87                 if (ret >= 0 && ret <= 4096) { return null; }
88                 Result_PendingHTLCInfoDecodeErrorZ ret_hu_conv = Result_PendingHTLCInfoDecodeErrorZ.constr_from_ptr(ret);
89                 return ret_hu_conv;
90         }
91
92 }
93 } } }