[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / OnionMessagePath.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  * A path for sending an [`msgs::OnionMessage`].
11  */
12 public class OnionMessagePath : CommonBase {
13         internal OnionMessagePath(object _dummy, long ptr) : base(ptr) { }
14         ~OnionMessagePath() {
15                 if (ptr != 0) { bindings.OnionMessagePath_free(ptr); }
16         }
17
18         /**
19          * Nodes on the path between the sender and the destination.
20          * 
21          * Returns a copy of the field.
22          */
23         public byte[][] get_intermediate_nodes() {
24                 byte[][] ret = bindings.OnionMessagePath_get_intermediate_nodes(this.ptr);
25                 GC.KeepAlive(this);
26                 return ret;
27         }
28
29         /**
30          * Nodes on the path between the sender and the destination.
31          */
32         public void set_intermediate_nodes(byte[][] val) {
33                 bindings.OnionMessagePath_set_intermediate_nodes(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_8 => InternalUtils.check_arr_len(val_conv_8, 33)) : null);
34                 GC.KeepAlive(this);
35                 GC.KeepAlive(val);
36         }
37
38         /**
39          * The recipient of the message.
40          */
41         public Destination get_destination() {
42                 long ret = bindings.OnionMessagePath_get_destination(this.ptr);
43                 GC.KeepAlive(this);
44                 if (ret >= 0 && ret <= 4096) { return null; }
45                 org.ldk.structs.Destination ret_hu_conv = org.ldk.structs.Destination.constr_from_ptr(ret);
46                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
47                 return ret_hu_conv;
48         }
49
50         /**
51          * The recipient of the message.
52          */
53         public void set_destination(org.ldk.structs.Destination val) {
54                 bindings.OnionMessagePath_set_destination(this.ptr, val.ptr);
55                 GC.KeepAlive(this);
56                 GC.KeepAlive(val);
57                 if (this != null) { this.ptrs_to.AddLast(val); };
58         }
59
60         /**
61          * Constructs a new OnionMessagePath given each field
62          */
63         public static OnionMessagePath of(byte[][] intermediate_nodes_arg, org.ldk.structs.Destination destination_arg) {
64                 long ret = bindings.OnionMessagePath_new(intermediate_nodes_arg != null ? InternalUtils.mapArray(intermediate_nodes_arg, intermediate_nodes_arg_conv_8 => InternalUtils.check_arr_len(intermediate_nodes_arg_conv_8, 33)) : null, destination_arg.ptr);
65                 GC.KeepAlive(intermediate_nodes_arg);
66                 GC.KeepAlive(destination_arg);
67                 if (ret >= 0 && ret <= 4096) { return null; }
68                 org.ldk.structs.OnionMessagePath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessagePath(null, ret); }
69                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
70                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(destination_arg); };
71                 return ret_hu_conv;
72         }
73
74         internal long clone_ptr() {
75                 long ret = bindings.OnionMessagePath_clone_ptr(this.ptr);
76                 GC.KeepAlive(this);
77                 return ret;
78         }
79
80         /**
81          * Creates a copy of the OnionMessagePath
82          */
83         public OnionMessagePath clone() {
84                 long ret = bindings.OnionMessagePath_clone(this.ptr);
85                 GC.KeepAlive(this);
86                 if (ret >= 0 && ret <= 4096) { return null; }
87                 org.ldk.structs.OnionMessagePath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessagePath(null, ret); }
88                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
89                 return ret_hu_conv;
90         }
91
92 }
93 } } }