Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / UserConfig.swift
1 import LDKCHeaders
2
3 public class UserConfig {
4
5     public internal(set) var cOpaqueStruct: LDKUserConfig?;
6
7         /* DEFAULT_CONSTRUCTOR_START */
8     public init() {
9         
10         self.cOpaqueStruct = UserConfig_default()
11     }
12     /* DEFAULT_CONSTRUCTOR_END */
13
14     public init(pointer: LDKUserConfig){
15                 self.cOpaqueStruct = pointer
16         }
17
18     /* STRUCT_METHODS_START */
19
20     public func get_own_channel_config() -> ChannelHandshakeConfig {
21         
22         return ChannelHandshakeConfig(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUserConfig>) in
23 UserConfig_get_own_channel_config(this_ptrPointer)
24 });
25     }
26
27     public func set_own_channel_config(val: ChannelHandshakeConfig) -> Void {
28         
29                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUserConfig>.allocate(capacity: 1)
30                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
31                                                 
32         return UserConfig_set_own_channel_config(this_ptrPointer, val.cOpaqueStruct!);
33     }
34
35     public func get_peer_channel_config_limits() -> ChannelHandshakeLimits {
36         
37         return ChannelHandshakeLimits(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUserConfig>) in
38 UserConfig_get_peer_channel_config_limits(this_ptrPointer)
39 });
40     }
41
42     public func set_peer_channel_config_limits(val: ChannelHandshakeLimits) -> Void {
43         
44                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUserConfig>.allocate(capacity: 1)
45                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
46                                                 
47         return UserConfig_set_peer_channel_config_limits(this_ptrPointer, val.cOpaqueStruct!);
48     }
49
50     public func get_channel_options() -> ChannelConfig {
51         
52         return ChannelConfig(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUserConfig>) in
53 UserConfig_get_channel_options(this_ptrPointer)
54 });
55     }
56
57     public func set_channel_options(val: ChannelConfig) -> Void {
58         
59                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUserConfig>.allocate(capacity: 1)
60                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
61                                                 
62         return UserConfig_set_channel_options(this_ptrPointer, val.cOpaqueStruct!);
63     }
64
65     public func get_accept_forwards_to_priv_channels() -> Bool {
66         
67         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUserConfig>) in
68 UserConfig_get_accept_forwards_to_priv_channels(this_ptrPointer)
69 };
70     }
71
72     public func set_accept_forwards_to_priv_channels(val: Bool) -> Void {
73         
74                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUserConfig>.allocate(capacity: 1)
75                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
76                                                 
77         return UserConfig_set_accept_forwards_to_priv_channels(this_ptrPointer, val);
78     }
79
80     public func clone(orig: UserConfig) -> UserConfig {
81         
82         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKUserConfig>) in
83 UserConfig(pointer: UserConfig_clone(origPointer))
84 };
85     }
86
87                                 
88         deinit {
89                                         if self.cOpaqueStruct?.is_owned == false {
90
91                                         
92                                         
93                 UserConfig_free(self.cOpaqueStruct!)
94                                         
95 }
96                                 
97         }
98                         
99     /* STRUCT_METHODS_END */
100
101 }