Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / UpdateAddHTLC.swift
1 import LDKCHeaders
2
3 public class UpdateAddHTLC {
4
5     public internal(set) var cOpaqueStruct: LDKUpdateAddHTLC?;
6
7         
8
9     public init(pointer: LDKUpdateAddHTLC){
10                 self.cOpaqueStruct = pointer
11         }
12
13     /* STRUCT_METHODS_START */
14
15     public func get_channel_id() -> [UInt8] {
16         
17         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateAddHTLC>) in
18 UpdateAddHTLC_get_channel_id(this_ptrPointer)
19 }.pointee);
20     }
21
22     public func set_channel_id(val: [UInt8]) -> Void {
23         
24                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUpdateAddHTLC>.allocate(capacity: 1)
25                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
26                                                 
27         return UpdateAddHTLC_set_channel_id(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
28     }
29
30     public func get_htlc_id() -> UInt64 {
31         
32         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateAddHTLC>) in
33 UpdateAddHTLC_get_htlc_id(this_ptrPointer)
34 };
35     }
36
37     public func set_htlc_id(val: UInt64) -> Void {
38         
39                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUpdateAddHTLC>.allocate(capacity: 1)
40                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
41                                                 
42         return UpdateAddHTLC_set_htlc_id(this_ptrPointer, val);
43     }
44
45     public func get_amount_msat() -> UInt64 {
46         
47         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateAddHTLC>) in
48 UpdateAddHTLC_get_amount_msat(this_ptrPointer)
49 };
50     }
51
52     public func set_amount_msat(val: UInt64) -> Void {
53         
54                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUpdateAddHTLC>.allocate(capacity: 1)
55                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
56                                                 
57         return UpdateAddHTLC_set_amount_msat(this_ptrPointer, val);
58     }
59
60     public func get_payment_hash() -> [UInt8] {
61         
62         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateAddHTLC>) in
63 UpdateAddHTLC_get_payment_hash(this_ptrPointer)
64 }.pointee);
65     }
66
67     public func set_payment_hash(val: [UInt8]) -> Void {
68         
69                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUpdateAddHTLC>.allocate(capacity: 1)
70                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
71                                                 
72         return UpdateAddHTLC_set_payment_hash(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
73     }
74
75     public func get_cltv_expiry() -> UInt32 {
76         
77         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateAddHTLC>) in
78 UpdateAddHTLC_get_cltv_expiry(this_ptrPointer)
79 };
80     }
81
82     public func set_cltv_expiry(val: UInt32) -> Void {
83         
84                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUpdateAddHTLC>.allocate(capacity: 1)
85                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
86                                                 
87         return UpdateAddHTLC_set_cltv_expiry(this_ptrPointer, val);
88     }
89
90     public func clone(orig: UpdateAddHTLC) -> UpdateAddHTLC {
91         
92         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKUpdateAddHTLC>) in
93 UpdateAddHTLC(pointer: UpdateAddHTLC_clone(origPointer))
94 };
95     }
96
97     public func write(obj: UpdateAddHTLC) -> [UInt8] {
98         
99         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKUpdateAddHTLC>) in
100 UpdateAddHTLC_write(objPointer)
101 });
102     }
103
104     public func read(ser: [UInt8]) -> Result_UpdateAddHTLCDecodeErrorZ {
105         
106         return Result_UpdateAddHTLCDecodeErrorZ(pointer: UpdateAddHTLC_read(Bindings.new_LDKu8slice(array: ser)));
107     }
108
109                                 
110         deinit {
111                                         if self.cOpaqueStruct?.is_owned == false {
112
113                                         
114                                         
115                 UpdateAddHTLC_free(self.cOpaqueStruct!)
116                                         
117 }
118                                 
119         }
120                         
121     /* STRUCT_METHODS_END */
122
123 }