Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / QueryShortChannelIds.swift
1 import LDKCHeaders
2
3 public class QueryShortChannelIds {
4
5     public internal(set) var cOpaqueStruct: LDKQueryShortChannelIds?;
6
7         /* DEFAULT_CONSTRUCTOR_START */
8     public init(chain_hash_arg: [UInt8], short_channel_ids_arg: [UInt64]) {
9         
10         self.cOpaqueStruct = QueryShortChannelIds_new(Bindings.new_LDKThirtyTwoBytes(array: chain_hash_arg), Bindings.new_LDKCVec_u64Z(array: short_channel_ids_arg))
11     }
12     /* DEFAULT_CONSTRUCTOR_END */
13
14     public init(pointer: LDKQueryShortChannelIds){
15                 self.cOpaqueStruct = pointer
16         }
17
18     /* STRUCT_METHODS_START */
19
20     public func get_chain_hash() -> [UInt8] {
21         
22         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKQueryShortChannelIds>) in
23 QueryShortChannelIds_get_chain_hash(this_ptrPointer)
24 }.pointee);
25     }
26
27     public func set_chain_hash(val: [UInt8]) -> Void {
28         
29                                                         let this_ptrPointer = UnsafeMutablePointer<LDKQueryShortChannelIds>.allocate(capacity: 1)
30                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
31                                                 
32         return QueryShortChannelIds_set_chain_hash(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
33     }
34
35     public func set_short_channel_ids(val: [UInt64]) -> Void {
36         
37                                                         let this_ptrPointer = UnsafeMutablePointer<LDKQueryShortChannelIds>.allocate(capacity: 1)
38                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
39                                                 
40         return QueryShortChannelIds_set_short_channel_ids(this_ptrPointer, Bindings.new_LDKCVec_u64Z(array: val));
41     }
42
43     public func clone(orig: QueryShortChannelIds) -> QueryShortChannelIds {
44         
45         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKQueryShortChannelIds>) in
46 QueryShortChannelIds(pointer: QueryShortChannelIds_clone(origPointer))
47 };
48     }
49
50     public func read(ser: [UInt8]) -> Result_QueryShortChannelIdsDecodeErrorZ {
51         
52         return Result_QueryShortChannelIdsDecodeErrorZ(pointer: QueryShortChannelIds_read(Bindings.new_LDKu8slice(array: ser)));
53     }
54
55     public func write(obj: QueryShortChannelIds) -> [UInt8] {
56         
57         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKQueryShortChannelIds>) in
58 QueryShortChannelIds_write(objPointer)
59 });
60     }
61
62                                 
63         deinit {
64                                         if self.cOpaqueStruct?.is_owned == false {
65
66                                         
67                                         
68                 QueryShortChannelIds_free(self.cOpaqueStruct!)
69                                         
70 }
71                                 
72         }
73                         
74     /* STRUCT_METHODS_END */
75
76 }