Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / UpdateFailHTLC.swift
1 import LDKCHeaders
2
3 public class UpdateFailHTLC {
4
5     public internal(set) var cOpaqueStruct: LDKUpdateFailHTLC?;
6
7         
8
9     public init(pointer: LDKUpdateFailHTLC){
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<LDKUpdateFailHTLC>) in
18 UpdateFailHTLC_get_channel_id(this_ptrPointer)
19 }.pointee);
20     }
21
22     public func set_channel_id(val: [UInt8]) -> Void {
23         
24                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUpdateFailHTLC>.allocate(capacity: 1)
25                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
26                                                 
27         return UpdateFailHTLC_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<LDKUpdateFailHTLC>) in
33 UpdateFailHTLC_get_htlc_id(this_ptrPointer)
34 };
35     }
36
37     public func set_htlc_id(val: UInt64) -> Void {
38         
39                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUpdateFailHTLC>.allocate(capacity: 1)
40                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
41                                                 
42         return UpdateFailHTLC_set_htlc_id(this_ptrPointer, val);
43     }
44
45     public func clone(orig: UpdateFailHTLC) -> UpdateFailHTLC {
46         
47         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKUpdateFailHTLC>) in
48 UpdateFailHTLC(pointer: UpdateFailHTLC_clone(origPointer))
49 };
50     }
51
52     public func write(obj: UpdateFailHTLC) -> [UInt8] {
53         
54         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKUpdateFailHTLC>) in
55 UpdateFailHTLC_write(objPointer)
56 });
57     }
58
59     public func read(ser: [UInt8]) -> Result_UpdateFailHTLCDecodeErrorZ {
60         
61         return Result_UpdateFailHTLCDecodeErrorZ(pointer: UpdateFailHTLC_read(Bindings.new_LDKu8slice(array: ser)));
62     }
63
64                                 
65         deinit {
66                                         if self.cOpaqueStruct?.is_owned == false {
67
68                                         
69                                         
70                 UpdateFailHTLC_free(self.cOpaqueStruct!)
71                                         
72 }
73                                 
74         }
75                         
76     /* STRUCT_METHODS_END */
77
78 }