[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / InvalidShutdownScript.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 /**
10  * An error occurring when converting from [`Script`] to [`ShutdownScript`].
11  */
12 public class InvalidShutdownScript : CommonBase {
13         internal InvalidShutdownScript(object _dummy, long ptr) : base(ptr) { }
14         ~InvalidShutdownScript() {
15                 if (ptr != 0) { bindings.InvalidShutdownScript_free(ptr); }
16         }
17
18         /**
19          * The script that did not meet the requirements from [BOLT #2].
20          * 
21          * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
22          */
23         public byte[] get_script() {
24                 long ret = bindings.InvalidShutdownScript_get_script(this.ptr);
25                 GC.KeepAlive(this);
26                 if (ret >= 0 && ret <= 4096) { return null; }
27                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
28                 return ret_conv;
29         }
30
31         /**
32          * The script that did not meet the requirements from [BOLT #2].
33          * 
34          * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
35          */
36         public void set_script(byte[] val) {
37                 bindings.InvalidShutdownScript_set_script(this.ptr, InternalUtils.encodeUint8Array(val));
38                 GC.KeepAlive(this);
39                 GC.KeepAlive(val);
40         }
41
42         /**
43          * Constructs a new InvalidShutdownScript given each field
44          */
45         public static InvalidShutdownScript of(byte[] script_arg) {
46                 long ret = bindings.InvalidShutdownScript_new(InternalUtils.encodeUint8Array(script_arg));
47                 GC.KeepAlive(script_arg);
48                 if (ret >= 0 && ret <= 4096) { return null; }
49                 org.ldk.structs.InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvalidShutdownScript(null, ret); }
50                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
51                 return ret_hu_conv;
52         }
53
54         internal long clone_ptr() {
55                 long ret = bindings.InvalidShutdownScript_clone_ptr(this.ptr);
56                 GC.KeepAlive(this);
57                 return ret;
58         }
59
60         /**
61          * Creates a copy of the InvalidShutdownScript
62          */
63         public InvalidShutdownScript clone() {
64                 long ret = bindings.InvalidShutdownScript_clone(this.ptr);
65                 GC.KeepAlive(this);
66                 if (ret >= 0 && ret <= 4096) { return null; }
67                 org.ldk.structs.InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvalidShutdownScript(null, ret); }
68                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
69                 return ret_hu_conv;
70         }
71
72 }
73 } } }