Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / UnsignedNodeAnnouncement.swift
1 import LDKCHeaders
2
3 public class UnsignedNodeAnnouncement {
4
5     public internal(set) var cOpaqueStruct: LDKUnsignedNodeAnnouncement?;
6
7         
8
9     public init(pointer: LDKUnsignedNodeAnnouncement){
10                 self.cOpaqueStruct = pointer
11         }
12
13     /* STRUCT_METHODS_START */
14
15     public func get_features() -> NodeFeatures {
16         
17         return NodeFeatures(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUnsignedNodeAnnouncement>) in
18 UnsignedNodeAnnouncement_get_features(this_ptrPointer)
19 });
20     }
21
22     public func set_features(val: NodeFeatures) -> Void {
23         
24                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedNodeAnnouncement>.allocate(capacity: 1)
25                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
26                                                 
27         return UnsignedNodeAnnouncement_set_features(this_ptrPointer, val.cOpaqueStruct!);
28     }
29
30     public func get_timestamp() -> UInt32 {
31         
32         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUnsignedNodeAnnouncement>) in
33 UnsignedNodeAnnouncement_get_timestamp(this_ptrPointer)
34 };
35     }
36
37     public func set_timestamp(val: UInt32) -> Void {
38         
39                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedNodeAnnouncement>.allocate(capacity: 1)
40                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
41                                                 
42         return UnsignedNodeAnnouncement_set_timestamp(this_ptrPointer, val);
43     }
44
45     public func get_node_id() -> [UInt8] {
46         
47         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUnsignedNodeAnnouncement>) in
48 UnsignedNodeAnnouncement_get_node_id(this_ptrPointer)
49 });
50     }
51
52     public func set_node_id(val: [UInt8]) -> Void {
53         
54                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedNodeAnnouncement>.allocate(capacity: 1)
55                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
56                                                 
57         return UnsignedNodeAnnouncement_set_node_id(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
58     }
59
60     public func get_rgb() -> [UInt8] {
61         
62         return Bindings.tuple3_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUnsignedNodeAnnouncement>) in
63 UnsignedNodeAnnouncement_get_rgb(this_ptrPointer)
64 }.pointee);
65     }
66
67     public func set_rgb(val: [UInt8]) -> Void {
68         
69                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedNodeAnnouncement>.allocate(capacity: 1)
70                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
71                                                 
72         return UnsignedNodeAnnouncement_set_rgb(this_ptrPointer, Bindings.new_LDKThreeBytes(array: val));
73     }
74
75     public func get_alias() -> [UInt8] {
76         
77         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUnsignedNodeAnnouncement>) in
78 UnsignedNodeAnnouncement_get_alias(this_ptrPointer)
79 }.pointee);
80     }
81
82     public func set_alias(val: [UInt8]) -> Void {
83         
84                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedNodeAnnouncement>.allocate(capacity: 1)
85                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
86                                                 
87         return UnsignedNodeAnnouncement_set_alias(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
88     }
89
90     public func set_addresses(val: [LDKNetAddress]) -> Void {
91         
92                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedNodeAnnouncement>.allocate(capacity: 1)
93                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
94                                                 
95         return UnsignedNodeAnnouncement_set_addresses(this_ptrPointer, Bindings.new_LDKCVec_NetAddressZ(array: val));
96     }
97
98     public func clone(orig: UnsignedNodeAnnouncement) -> UnsignedNodeAnnouncement {
99         
100         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKUnsignedNodeAnnouncement>) in
101 UnsignedNodeAnnouncement(pointer: UnsignedNodeAnnouncement_clone(origPointer))
102 };
103     }
104
105     public func write(obj: UnsignedNodeAnnouncement) -> [UInt8] {
106         
107         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKUnsignedNodeAnnouncement>) in
108 UnsignedNodeAnnouncement_write(objPointer)
109 });
110     }
111
112     public func read(ser: [UInt8]) -> Result_UnsignedNodeAnnouncementDecodeErrorZ {
113         
114         return Result_UnsignedNodeAnnouncementDecodeErrorZ(pointer: UnsignedNodeAnnouncement_read(Bindings.new_LDKu8slice(array: ser)));
115     }
116
117                                 
118         deinit {
119                                         if self.cOpaqueStruct?.is_owned == false {
120
121                                         
122                                         
123                 UnsignedNodeAnnouncement_free(self.cOpaqueStruct!)
124                                         
125 }
126                                 
127         }
128                         
129     /* STRUCT_METHODS_END */
130
131 }