Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / ReplyShortChannelIdsEnd.swift
1 import LDKCHeaders
2
3 public class ReplyShortChannelIdsEnd {
4
5     public internal(set) var cOpaqueStruct: LDKReplyShortChannelIdsEnd?;
6
7         /* DEFAULT_CONSTRUCTOR_START */
8     public init(chain_hash_arg: [UInt8], full_information_arg: Bool) {
9         
10         self.cOpaqueStruct = ReplyShortChannelIdsEnd_new(Bindings.new_LDKThirtyTwoBytes(array: chain_hash_arg), full_information_arg)
11     }
12     /* DEFAULT_CONSTRUCTOR_END */
13
14     public init(pointer: LDKReplyShortChannelIdsEnd){
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<LDKReplyShortChannelIdsEnd>) in
23 ReplyShortChannelIdsEnd_get_chain_hash(this_ptrPointer)
24 }.pointee);
25     }
26
27     public func set_chain_hash(val: [UInt8]) -> Void {
28         
29                                                         let this_ptrPointer = UnsafeMutablePointer<LDKReplyShortChannelIdsEnd>.allocate(capacity: 1)
30                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
31                                                 
32         return ReplyShortChannelIdsEnd_set_chain_hash(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
33     }
34
35     public func get_full_information() -> Bool {
36         
37         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKReplyShortChannelIdsEnd>) in
38 ReplyShortChannelIdsEnd_get_full_information(this_ptrPointer)
39 };
40     }
41
42     public func set_full_information(val: Bool) -> Void {
43         
44                                                         let this_ptrPointer = UnsafeMutablePointer<LDKReplyShortChannelIdsEnd>.allocate(capacity: 1)
45                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
46                                                 
47         return ReplyShortChannelIdsEnd_set_full_information(this_ptrPointer, val);
48     }
49
50     public func clone(orig: ReplyShortChannelIdsEnd) -> ReplyShortChannelIdsEnd {
51         
52         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKReplyShortChannelIdsEnd>) in
53 ReplyShortChannelIdsEnd(pointer: ReplyShortChannelIdsEnd_clone(origPointer))
54 };
55     }
56
57     public func read(ser: [UInt8]) -> Result_ReplyShortChannelIdsEndDecodeErrorZ {
58         
59         return Result_ReplyShortChannelIdsEndDecodeErrorZ(pointer: ReplyShortChannelIdsEnd_read(Bindings.new_LDKu8slice(array: ser)));
60     }
61
62     public func write(obj: ReplyShortChannelIdsEnd) -> [UInt8] {
63         
64         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKReplyShortChannelIdsEnd>) in
65 ReplyShortChannelIdsEnd_write(objPointer)
66 });
67     }
68
69                                 
70         deinit {
71                                         if self.cOpaqueStruct?.is_owned == false {
72
73                                         
74                                         
75                 ReplyShortChannelIdsEnd_free(self.cOpaqueStruct!)
76                                         
77 }
78                                 
79         }
80                         
81     /* STRUCT_METHODS_END */
82
83 }