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