[TS] Update auto-generated bindings to LDK-C-Bindings 0.0.123.1
[ldk-java] / c_sharp / src / org / ldk / structs / Result_u64ShortChannelIdErrorZ.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_u64ShortChannelIdErrorZ : CommonBase {
9         Result_u64ShortChannelIdErrorZ(object _dummy, long ptr) : base(ptr) { }
10         ~Result_u64ShortChannelIdErrorZ() {
11                 if (ptr != 0) { bindings.CResult_u64ShortChannelIdErrorZ_free(ptr); }
12         }
13
14         internal static Result_u64ShortChannelIdErrorZ constr_from_ptr(long ptr) {
15                 if (bindings.CResult_u64ShortChannelIdErrorZ_is_ok(ptr)) {
16                         return new Result_u64ShortChannelIdErrorZ_OK(null, ptr);
17                 } else {
18                         return new Result_u64ShortChannelIdErrorZ_Err(null, ptr);
19                 }
20         }
21         public class Result_u64ShortChannelIdErrorZ_OK : Result_u64ShortChannelIdErrorZ {
22                 public readonly long res;
23                 internal Result_u64ShortChannelIdErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24                         this.res = bindings.CResult_u64ShortChannelIdErrorZ_get_ok(ptr);
25                 }
26         }
27
28         public class Result_u64ShortChannelIdErrorZ_Err : Result_u64ShortChannelIdErrorZ {
29                 public readonly ShortChannelIdError err;
30                 internal Result_u64ShortChannelIdErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
31                         this.err = bindings.CResult_u64ShortChannelIdErrorZ_get_err(ptr);
32                 }
33         }
34
35         /**
36          * Creates a new CResult_u64ShortChannelIdErrorZ in the success state.
37          */
38         public static Result_u64ShortChannelIdErrorZ ok(long o) {
39                 long ret = bindings.CResult_u64ShortChannelIdErrorZ_ok(o);
40                 GC.KeepAlive(o);
41                 if (ret >= 0 && ret <= 4096) { return null; }
42                 Result_u64ShortChannelIdErrorZ ret_hu_conv = Result_u64ShortChannelIdErrorZ.constr_from_ptr(ret);
43                 return ret_hu_conv;
44         }
45
46         /**
47          * Creates a new CResult_u64ShortChannelIdErrorZ in the error state.
48          */
49         public static Result_u64ShortChannelIdErrorZ err(ShortChannelIdError e) {
50                 long ret = bindings.CResult_u64ShortChannelIdErrorZ_err(e);
51                 GC.KeepAlive(e);
52                 if (ret >= 0 && ret <= 4096) { return null; }
53                 Result_u64ShortChannelIdErrorZ ret_hu_conv = Result_u64ShortChannelIdErrorZ.constr_from_ptr(ret);
54                 return ret_hu_conv;
55         }
56
57         /**
58          * Checks if the given object is currently in the success state
59          */
60         public bool is_ok() {
61                 bool ret = bindings.CResult_u64ShortChannelIdErrorZ_is_ok(this.ptr);
62                 GC.KeepAlive(this);
63                 return ret;
64         }
65
66 }
67 } } }