Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / RouteHintHop.swift
1 import LDKCHeaders
2
3 public class RouteHintHop {
4
5     public internal(set) var cOpaqueStruct: LDKRouteHintHop?;
6
7         /* DEFAULT_CONSTRUCTOR_START */
8     public init(src_node_id_arg: [UInt8], short_channel_id_arg: UInt64, fees_arg: RoutingFees, cltv_expiry_delta_arg: UInt16, htlc_minimum_msat_arg: Option_u64Z, htlc_maximum_msat_arg: Option_u64Z) {
9         
10         self.cOpaqueStruct = RouteHintHop_new(Bindings.new_LDKPublicKey(array: src_node_id_arg), short_channel_id_arg, fees_arg.cOpaqueStruct!, cltv_expiry_delta_arg, htlc_minimum_msat_arg.cOpaqueStruct!, htlc_maximum_msat_arg.cOpaqueStruct!)
11     }
12     /* DEFAULT_CONSTRUCTOR_END */
13
14     public init(pointer: LDKRouteHintHop){
15                 self.cOpaqueStruct = pointer
16         }
17
18     /* STRUCT_METHODS_START */
19
20     public func get_src_node_id() -> [UInt8] {
21         
22         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHintHop>) in
23 RouteHintHop_get_src_node_id(this_ptrPointer)
24 });
25     }
26
27     public func set_src_node_id(val: [UInt8]) -> Void {
28         
29                                                         let this_ptrPointer = UnsafeMutablePointer<LDKRouteHintHop>.allocate(capacity: 1)
30                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
31                                                 
32         return RouteHintHop_set_src_node_id(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
33     }
34
35     public func get_short_channel_id() -> UInt64 {
36         
37         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHintHop>) in
38 RouteHintHop_get_short_channel_id(this_ptrPointer)
39 };
40     }
41
42     public func set_short_channel_id(val: UInt64) -> Void {
43         
44                                                         let this_ptrPointer = UnsafeMutablePointer<LDKRouteHintHop>.allocate(capacity: 1)
45                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
46                                                 
47         return RouteHintHop_set_short_channel_id(this_ptrPointer, val);
48     }
49
50     public func get_fees() -> RoutingFees {
51         
52         return RoutingFees(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHintHop>) in
53 RouteHintHop_get_fees(this_ptrPointer)
54 });
55     }
56
57     public func set_fees(val: RoutingFees) -> Void {
58         
59                                                         let this_ptrPointer = UnsafeMutablePointer<LDKRouteHintHop>.allocate(capacity: 1)
60                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
61                                                 
62         return RouteHintHop_set_fees(this_ptrPointer, val.cOpaqueStruct!);
63     }
64
65     public func get_cltv_expiry_delta() -> UInt16 {
66         
67         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHintHop>) in
68 RouteHintHop_get_cltv_expiry_delta(this_ptrPointer)
69 };
70     }
71
72     public func set_cltv_expiry_delta(val: UInt16) -> Void {
73         
74                                                         let this_ptrPointer = UnsafeMutablePointer<LDKRouteHintHop>.allocate(capacity: 1)
75                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
76                                                 
77         return RouteHintHop_set_cltv_expiry_delta(this_ptrPointer, val);
78     }
79
80     public func get_htlc_minimum_msat() -> Option_u64Z {
81         
82         return Option_u64Z(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHintHop>) in
83 RouteHintHop_get_htlc_minimum_msat(this_ptrPointer)
84 });
85     }
86
87     public func set_htlc_minimum_msat(val: Option_u64Z) -> Void {
88         
89                                                         let this_ptrPointer = UnsafeMutablePointer<LDKRouteHintHop>.allocate(capacity: 1)
90                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
91                                                 
92         return RouteHintHop_set_htlc_minimum_msat(this_ptrPointer, val.cOpaqueStruct!);
93     }
94
95     public func get_htlc_maximum_msat() -> Option_u64Z {
96         
97         return Option_u64Z(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHintHop>) in
98 RouteHintHop_get_htlc_maximum_msat(this_ptrPointer)
99 });
100     }
101
102     public func set_htlc_maximum_msat(val: Option_u64Z) -> Void {
103         
104                                                         let this_ptrPointer = UnsafeMutablePointer<LDKRouteHintHop>.allocate(capacity: 1)
105                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
106                                                 
107         return RouteHintHop_set_htlc_maximum_msat(this_ptrPointer, val.cOpaqueStruct!);
108     }
109
110     public func eq(a: RouteHintHop, b: RouteHintHop) -> Bool {
111         
112         return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKRouteHintHop>) in
113 withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKRouteHintHop>) in
114 RouteHintHop_eq(aPointer, bPointer)
115 }
116 };
117     }
118
119     public func clone(orig: RouteHintHop) -> RouteHintHop {
120         
121         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKRouteHintHop>) in
122 RouteHintHop(pointer: RouteHintHop_clone(origPointer))
123 };
124     }
125
126                                 
127         deinit {
128                                         if self.cOpaqueStruct?.is_owned == false {
129
130                                         
131                                         
132                 RouteHintHop_free(self.cOpaqueStruct!)
133                                         
134 }
135                                 
136         }
137                         
138     /* STRUCT_METHODS_END */
139
140 }