[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / Result_NoneBolt12SemanticErrorZ.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_NoneBolt12SemanticErrorZ : CommonBase {
9         Result_NoneBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { }
10         ~Result_NoneBolt12SemanticErrorZ() {
11                 if (ptr != 0) { bindings.CResult_NoneBolt12SemanticErrorZ_free(ptr); }
12         }
13
14         internal static Result_NoneBolt12SemanticErrorZ constr_from_ptr(long ptr) {
15                 if (bindings.CResult_NoneBolt12SemanticErrorZ_is_ok(ptr)) {
16                         return new Result_NoneBolt12SemanticErrorZ_OK(null, ptr);
17                 } else {
18                         return new Result_NoneBolt12SemanticErrorZ_Err(null, ptr);
19                 }
20         }
21         public class Result_NoneBolt12SemanticErrorZ_OK : Result_NoneBolt12SemanticErrorZ {
22                 internal Result_NoneBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
23                 }
24         }
25
26         public class Result_NoneBolt12SemanticErrorZ_Err : Result_NoneBolt12SemanticErrorZ {
27                 public readonly Bolt12SemanticError err;
28                 internal Result_NoneBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
29                         this.err = bindings.CResult_NoneBolt12SemanticErrorZ_get_err(ptr);
30                 }
31         }
32
33         /**
34          * Creates a new CResult_NoneBolt12SemanticErrorZ in the success state.
35          */
36         public static Result_NoneBolt12SemanticErrorZ ok() {
37                 long ret = bindings.CResult_NoneBolt12SemanticErrorZ_ok();
38                 if (ret >= 0 && ret <= 4096) { return null; }
39                 Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret);
40                 return ret_hu_conv;
41         }
42
43         /**
44          * Creates a new CResult_NoneBolt12SemanticErrorZ in the error state.
45          */
46         public static Result_NoneBolt12SemanticErrorZ err(Bolt12SemanticError e) {
47                 long ret = bindings.CResult_NoneBolt12SemanticErrorZ_err(e);
48                 GC.KeepAlive(e);
49                 if (ret >= 0 && ret <= 4096) { return null; }
50                 Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret);
51                 return ret_hu_conv;
52         }
53
54         /**
55          * Checks if the given object is currently in the success state
56          */
57         public bool is_ok() {
58                 bool ret = bindings.CResult_NoneBolt12SemanticErrorZ_is_ok(this.ptr);
59                 GC.KeepAlive(this);
60                 return ret;
61         }
62
63         internal long clone_ptr() {
64                 long ret = bindings.CResult_NoneBolt12SemanticErrorZ_clone_ptr(this.ptr);
65                 GC.KeepAlive(this);
66                 return ret;
67         }
68
69         /**
70          * Creates a new CResult_NoneBolt12SemanticErrorZ which has the same data as `orig`
71          * but with all dynamically-allocated buffers duplicated in new buffers.
72          */
73         public Result_NoneBolt12SemanticErrorZ clone() {
74                 long ret = bindings.CResult_NoneBolt12SemanticErrorZ_clone(this.ptr);
75                 GC.KeepAlive(this);
76                 if (ret >= 0 && ret <= 4096) { return null; }
77                 Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret);
78                 return ret_hu_conv;
79         }
80
81 }
82 } } }