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