[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / Option_CVec_u8ZZ.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 /**
9  * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
10  */
11 public class Option_CVec_u8ZZ : CommonBase {
12         protected Option_CVec_u8ZZ(object _dummy, long ptr) : base(ptr) { }
13         ~Option_CVec_u8ZZ() {
14                 if (ptr != 0) { bindings.COption_CVec_u8ZZ_free(ptr); }
15         }
16
17         internal static Option_CVec_u8ZZ constr_from_ptr(long ptr) {
18                 long raw_ty = bindings.LDKCOption_CVec_u8ZZ_ty_from_ptr(ptr);
19                 switch (raw_ty) {
20                         case 0: return new Option_CVec_u8ZZ_Some(ptr);
21                         case 1: return new Option_CVec_u8ZZ_None(ptr);
22                         default:
23                                 throw new ArgumentException("Impossible enum variant");
24                 }
25         }
26
27         /** A Option_CVec_u8ZZ of type Some */
28         public class Option_CVec_u8ZZ_Some : Option_CVec_u8ZZ {
29                 public byte[] some;
30                 internal Option_CVec_u8ZZ_Some(long ptr) : base(null, ptr) {
31                         long some = bindings.LDKCOption_CVec_u8ZZ_Some_get_some(ptr);
32                         byte[] some_conv = InternalUtils.decodeUint8Array(some);
33                         this.some = some_conv;
34                 }
35         }
36         /** A Option_CVec_u8ZZ of type None */
37         public class Option_CVec_u8ZZ_None : Option_CVec_u8ZZ {
38                 internal Option_CVec_u8ZZ_None(long ptr) : base(null, ptr) {
39                 }
40         }
41         /**
42          * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
43          */
44         public static Option_CVec_u8ZZ some(byte[] o) {
45                 long ret = bindings.COption_CVec_u8ZZ_some(InternalUtils.encodeUint8Array(o));
46                 GC.KeepAlive(o);
47                 if (ret >= 0 && ret <= 4096) { return null; }
48                 org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret);
49                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
50                 return ret_hu_conv;
51         }
52
53         /**
54          * Constructs a new COption_CVec_u8ZZ containing nothing
55          */
56         public static Option_CVec_u8ZZ none() {
57                 long ret = bindings.COption_CVec_u8ZZ_none();
58                 if (ret >= 0 && ret <= 4096) { return null; }
59                 org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret);
60                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
61                 return ret_hu_conv;
62         }
63
64         internal long clone_ptr() {
65                 long ret = bindings.COption_CVec_u8ZZ_clone_ptr(this.ptr);
66                 GC.KeepAlive(this);
67                 return ret;
68         }
69
70         /**
71          * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
72          * but with all dynamically-allocated buffers duplicated in new buffers.
73          */
74         public Option_CVec_u8ZZ clone() {
75                 long ret = bindings.COption_CVec_u8ZZ_clone(this.ptr);
76                 GC.KeepAlive(this);
77                 if (ret >= 0 && ret <= 4096) { return null; }
78                 org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret);
79                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
80                 return ret_hu_conv;
81         }
82
83 }
84 } } }