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