[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.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_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ : CommonBase {
9         Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ(object _dummy, long ptr) : base(ptr) { }
10         ~Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ() {
11                 if (ptr != 0) { bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(ptr); }
12         }
13
14         internal static Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ constr_from_ptr(long ptr) {
15                 if (bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(ptr)) {
16                         return new Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_OK(null, ptr);
17                 } else {
18                         return new Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_Err(null, ptr);
19                 }
20         }
21         public class Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_OK : Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ {
22                 public readonly TwoTuple_BlindedPayInfoBlindedPathZ[] res;
23                 internal Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24                         long res = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(ptr);
25                         int res_conv_37_len = InternalUtils.getArrayLength(res);
26                         TwoTuple_BlindedPayInfoBlindedPathZ[] res_conv_37_arr = new TwoTuple_BlindedPayInfoBlindedPathZ[res_conv_37_len];
27                         for (int l = 0; l < res_conv_37_len; l++) {
28                                 long res_conv_37 = InternalUtils.getU64ArrayElem(res, l);
29                                 TwoTuple_BlindedPayInfoBlindedPathZ res_conv_37_hu_conv = new TwoTuple_BlindedPayInfoBlindedPathZ(null, res_conv_37);
30                                 if (res_conv_37_hu_conv != null) { res_conv_37_hu_conv.ptrs_to.AddLast(this); };
31                                 res_conv_37_arr[l] = res_conv_37_hu_conv;
32                         }
33                         bindings.free_buffer(res);
34                         this.res = res_conv_37_arr;
35                 }
36         }
37
38         public class Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_Err : Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ {
39                 internal Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
40                 }
41         }
42
43         /**
44          * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the success state.
45          */
46         public static Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ok(TwoTuple_BlindedPayInfoBlindedPathZ[] o) {
47                 long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_37 => o_conv_37 != null ? o_conv_37.ptr : 0)));
48                 GC.KeepAlive(o);
49                 if (ret >= 0 && ret <= 4096) { return null; }
50                 Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_hu_conv = Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.constr_from_ptr(ret);
51                 return ret_hu_conv;
52         }
53
54         /**
55          * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the error state.
56          */
57         public static Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ err() {
58                 long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err();
59                 if (ret >= 0 && ret <= 4096) { return null; }
60                 Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_hu_conv = Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.constr_from_ptr(ret);
61                 return ret_hu_conv;
62         }
63
64         /**
65          * Checks if the given object is currently in the success state
66          */
67         public bool is_ok() {
68                 bool ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(this.ptr);
69                 GC.KeepAlive(this);
70                 return ret;
71         }
72
73         internal long clone_ptr() {
74                 long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(this.ptr);
75                 GC.KeepAlive(this);
76                 return ret;
77         }
78
79         /**
80          * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ which has the same data as `orig`
81          * but with all dynamically-allocated buffers duplicated in new buffers.
82          */
83         public Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ clone() {
84                 long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(this.ptr);
85                 GC.KeepAlive(this);
86                 if (ret >= 0 && ret <= 4096) { return null; }
87                 Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_hu_conv = Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.constr_from_ptr(ret);
88                 return ret_hu_conv;
89         }
90
91 }
92 } } }