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